]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20210109
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20210105.
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-string-hacks   work around bogus compiler/loader warnings
673   --with-pkg-config{=path} enable/disable use of pkg-config
674   --disable-echo          do not display "compiling" commands
675 Curses Version-dependent Options:
676   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
677   --disable-widec         disable checks for wide-character functions
678   --with-curses-dir=DIR   directory in which (n)curses is installed
679   --with-screen=XXX       use specified curses-libraries
680   --with-ncursesw         use wide ncurses-libraries
681   --with-ncurses          use ncurses-libraries
682   --with-pdcurses         compile/link with pdcurses X11 library
683   --with-curses-colr      compile/link with HPUX 10.x color-curses
684   --with-curses-5lib      compile/link with SunOS 5lib curses
685   --with-Xaw3d            link with Xaw 3d library
686   --with-Xaw3dxft         link with Xaw 3d xft library
687   --with-neXtaw           link with neXT Athena library
688   --with-XawPlus          link with Athena-Plus library
689   --with-x                use the X Window System
690   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
691   --with-form-libname=XXX override form basename of library
692   --with-menu-libname=XXX override menu basename of library
693   --with-panel-libname=XXX override panel basename of library
694   --disable-panel         disable checks for panel functions
695   --disable-menu          disable checks for menu functions
696   --disable-form          disable checks for form functions
697 Testing/development Options:
698   --enable-warnings       test: turn on gcc compiler warnings
699   --with-dmalloc          test: use Gray Watson's dmalloc library
700   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
701   --with-valgrind         test: use valgrind
702   --disable-leaks         test: free permanent memory, analyze leaks
703   --disable-rpath-hack    don't add rpath options for additional libraries
704
705 Some influential environment variables:
706   CC          C compiler command
707   CFLAGS      C compiler flags
708   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
709               nonstandard directory <lib dir>
710   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
711               headers in a nonstandard directory <include dir>
712   CPP         C preprocessor
713
714 Use these variables to override the choices made by `configure' or to help
715 it to find libraries and programs with nonstandard names/locations.
716
717 EOF
718 fi
719
720 if test "$ac_init_help" = "recursive"; then
721   # If there are subdirs, report their specific --help.
722   ac_popdir=`pwd`
723   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
724     cd "$ac_subdir"
725     # A "../" for each directory in /$ac_subdir.
726     ac_dots=`echo "$ac_subdir" |
727              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
728
729     case "$srcdir" in
730     .) # No --srcdir option.  We are building in place.
731       ac_sub_srcdir="$srcdir" ;;
732     [\\/]* | ?:[\\/]* ) # Absolute path.
733       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
734     *) # Relative path.
735       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
736     esac
737
738     # Check for guested configure; otherwise get Cygnus style configure.
739     if test -f "$ac_sub_srcdir/configure.gnu"; then
740       echo
741       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
742     elif test -f "$ac_sub_srcdir/configure"; then
743       echo
744       $SHELL "$ac_sub_srcdir/configure" --help=recursive
745     elif test -f "$ac_sub_srcdir/configure.ac" ||
746            test -f "$ac_sub_srcdir/configure.in"; then
747       echo
748       "$ac_configure" --help
749     else
750       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
751     fi
752     cd "$ac_popdir"
753   done
754 fi
755
756 test -n "$ac_init_help" && exit 0
757 if "$ac_init_version"; then
758   cat <<\EOF
759
760 Copyright 2003-2020,2021        Thomas E. Dickey
761 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
762 Free Software Foundation, Inc.
763 This configure script is free software; the Free Software Foundation
764 gives unlimited permission to copy, distribute and modify it.
765 EOF
766   exit 0
767 fi
768 exec 5>config.log
769 cat >&5 <<EOF
770 This file contains any messages produced by compilers while
771 running configure, to aid debugging if configure makes a mistake.
772
773 It was created by $as_me, which was
774 generated by GNU Autoconf 2.52.20210105.  Invocation command line was
775
776   $ $0 $@
777
778 EOF
779 {
780 cat <<_ASUNAME
781 ## ---------- ##
782 ## Platform.  ##
783 ## ---------- ##
784
785 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
786 uname -m = `(uname -m) 2>/dev/null || echo unknown`
787 uname -r = `(uname -r) 2>/dev/null || echo unknown`
788 uname -s = `(uname -s) 2>/dev/null || echo unknown`
789 uname -v = `(uname -v) 2>/dev/null || echo unknown`
790
791 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
792 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
793
794 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
795 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
796 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
797 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
798 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
799 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
800 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
801
802 PATH = $PATH
803
804 _ASUNAME
805 } >&5
806
807 cat >&5 <<EOF
808 ## ------------ ##
809 ## Core tests.  ##
810 ## ------------ ##
811
812 EOF
813
814 # Keep a trace of the command line.
815 # Strip out --no-create and --no-recursion so they do not pile up.
816 # Also quote any args containing shell meta-characters.
817 ac_configure_args=
818 ac_sep=
819 for ac_arg
820 do
821   case "$ac_arg" in
822   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
823   | --no-cr | --no-c) ;;
824   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
825   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
826   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
827     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
828     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
829     ac_sep=" " ;;
830   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
831      ac_sep=" " ;;
832   esac
833   # Get rid of the leading space.
834 done
835
836 # When interrupted or exit'd, cleanup temporary files, and complete
837 # config.log.  We remove comments because anyway the quotes in there
838 # would cause problems or look ugly.
839 trap 'exit_status=$?
840   # Save into config.log some information that might help in debugging.
841   echo >&5
842   echo "## ----------------- ##" >&5
843   echo "## Cache variables.  ##" >&5
844   echo "## ----------------- ##" >&5
845   echo >&5
846   # The following way of writing the cache mishandles newlines in values,
847 {
848   (set) 2>&1 |
849     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
850     *ac_space=\ *)
851       sed -n \
852         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
853           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
854       ;;
855     *)
856       sed -n \
857         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
858       ;;
859     esac;
860 } >&5
861   sed "/^$/d" confdefs.h >conftest.log
862   if test -s conftest.log; then
863     echo >&5
864     echo "## ------------ ##" >&5
865     echo "## confdefs.h.  ##" >&5
866     echo "## ------------ ##" >&5
867     echo >&5
868     cat conftest.log >&5
869   fi
870   (echo; echo) >&5
871   test "$ac_signal" != 0 &&
872     echo "$as_me: caught signal $ac_signal" >&5
873   echo "$as_me: exit $exit_status" >&5
874   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
875     exit $exit_status
876      ' 0
877 for ac_signal in 1 2 13 15; do
878   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
879 done
880 ac_signal=0
881
882 # confdefs.h avoids OS command line length limits that DEFS can exceed.
883 rm -rf conftest* confdefs.h
884 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
885 echo >confdefs.h
886
887 # Let the site file select an alternate cache file if it wants to.
888 # Prefer explicitly selected file to automatically selected ones.
889 if test -z "$CONFIG_SITE"; then
890   if test "x$prefix" != xNONE; then
891     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
892   else
893     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
894   fi
895 fi
896 for ac_site_file in $CONFIG_SITE; do
897   if test -r "$ac_site_file"; then
898     { echo "$as_me:898: loading site script $ac_site_file" >&5
899 echo "$as_me: loading site script $ac_site_file" >&6;}
900     cat "$ac_site_file" >&5
901     . "$ac_site_file"
902   fi
903 done
904
905 if test -r "$cache_file"; then
906   # Some versions of bash will fail to source /dev/null (special
907   # files actually), so we avoid doing that.
908   if test -f "$cache_file"; then
909     { echo "$as_me:909: loading cache $cache_file" >&5
910 echo "$as_me: loading cache $cache_file" >&6;}
911     case $cache_file in
912       [\\/]* | ?:[\\/]* ) . $cache_file;;
913       *)                      . ./$cache_file;;
914     esac
915   fi
916 else
917   { echo "$as_me:917: creating cache $cache_file" >&5
918 echo "$as_me: creating cache $cache_file" >&6;}
919   >$cache_file
920 fi
921
922 # Check that the precious variables saved in the cache have kept the same
923 # value.
924 ac_cache_corrupted=false
925 for ac_var in `(set) 2>&1 |
926                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
927   eval ac_old_set=\$ac_cv_env_${ac_var}_set
928   eval ac_new_set=\$ac_env_${ac_var}_set
929   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
930   eval ac_new_val="\$ac_env_${ac_var}_value"
931   case "$ac_old_set,$ac_new_set" in
932     set,)
933       { echo "$as_me:933: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
934 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
935       ac_cache_corrupted=: ;;
936     ,set)
937       { echo "$as_me:937: error: \`$ac_var' was not set in the previous run" >&5
938 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
939       ac_cache_corrupted=: ;;
940     ,);;
941     *)
942       if test "x$ac_old_val" != "x$ac_new_val"; then
943         { echo "$as_me:943: error: \`$ac_var' has changed since the previous run:" >&5
944 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
945         { echo "$as_me:945:   former value:  $ac_old_val" >&5
946 echo "$as_me:   former value:  $ac_old_val" >&2;}
947         { echo "$as_me:947:   current value: $ac_new_val" >&5
948 echo "$as_me:   current value: $ac_new_val" >&2;}
949         ac_cache_corrupted=:
950       fi;;
951   esac
952   # Pass precious variables to config.status.  It doesn't matter if
953   # we pass some twice (in addition to the command line arguments).
954   if test "$ac_new_set" = set; then
955     case "$ac_new_val" in
956     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
957       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
958       ac_configure_args="$ac_configure_args '$ac_arg'"
959       ;;
960     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
961        ;;
962     esac
963   fi
964 done
965 if "$ac_cache_corrupted"; then
966   { echo "$as_me:966: error: changes in the environment can compromise the build" >&5
967 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
968   { { echo "$as_me:968: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
969 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
970    { (exit 1); exit 1; }; }
971 fi
972
973 ac_ext=c
974 ac_cpp='$CPP $CPPFLAGS'
975 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
976 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
977 ac_compiler_gnu=$ac_cv_c_compiler_gnu
978 ac_main_return="return"
979
980 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
981   *c*,-n*) ECHO_N=
982            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
983            ECHO_T='     '
984            ;;
985   *c*,*  ) ECHO_N=-n
986            ECHO_C=
987            ECHO_T=
988            ;;
989   *)       ECHO_N=
990            ECHO_C='\c'
991            ECHO_T=
992            ;;
993 esac
994 echo "#! $SHELL" >conftest.sh
995 echo  "exit 0"   >>conftest.sh
996 chmod +x conftest.sh
997 if { (echo "$as_me:997: PATH=\".;.\"; conftest.sh") >&5
998   (PATH=".;."; conftest.sh) 2>&5
999   ac_status=$?
1000   echo "$as_me:1000: \$? = $ac_status" >&5
1001   (exit "$ac_status"); }; then
1002   ac_path_separator=';'
1003 else
1004   ac_path_separator=:
1005 fi
1006 PATH_SEPARATOR="$ac_path_separator"
1007 rm -f conftest.sh
1008
1009 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1010
1011 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1012
1013 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1014
1015 ac_aux_dir=
1016 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1017   if test -f "$ac_dir/install-sh"; then
1018     ac_aux_dir=$ac_dir
1019     ac_install_sh="$ac_aux_dir/install-sh -c"
1020     break
1021   elif test -f "$ac_dir/install.sh"; then
1022     ac_aux_dir=$ac_dir
1023     ac_install_sh="$ac_aux_dir/install.sh -c"
1024     break
1025   elif test -f "$ac_dir/shtool"; then
1026     ac_aux_dir=$ac_dir
1027     ac_install_sh="$ac_aux_dir/shtool install -c"
1028     break
1029   fi
1030 done
1031 if test -z "$ac_aux_dir"; then
1032   { { echo "$as_me:1032: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1033 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1034    { (exit 1); exit 1; }; }
1035 fi
1036 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1037 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1038 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1039
1040 # Make sure we can run config.sub.
1041 $ac_config_sub sun4 >/dev/null 2>&1 ||
1042   { { echo "$as_me:1042: error: cannot run $ac_config_sub" >&5
1043 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1044    { (exit 1); exit 1; }; }
1045
1046 echo "$as_me:1046: checking build system type" >&5
1047 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1048 if test "${ac_cv_build+set}" = set; then
1049   echo $ECHO_N "(cached) $ECHO_C" >&6
1050 else
1051   ac_cv_build_alias=$build_alias
1052 test -z "$ac_cv_build_alias" &&
1053   ac_cv_build_alias=`$ac_config_guess`
1054 test -z "$ac_cv_build_alias" &&
1055   { { echo "$as_me:1055: error: cannot guess build type; you must specify one" >&5
1056 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1057    { (exit 1); exit 1; }; }
1058 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1059   { { echo "$as_me:1059: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1060 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1061    { (exit 1); exit 1; }; }
1062
1063 fi
1064 echo "$as_me:1064: result: $ac_cv_build" >&5
1065 echo "${ECHO_T}$ac_cv_build" >&6
1066 build=$ac_cv_build
1067 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1068 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1069 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1070
1071 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1072         echo "$as_me:1072: checking host system type" >&5
1073 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1074 if test "${ac_cv_host+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   ac_cv_host_alias=$host_alias
1078 test -z "$ac_cv_host_alias" &&
1079   ac_cv_host_alias=$ac_cv_build_alias
1080 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1081   { { echo "$as_me:1081: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1082 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1083    { (exit 1); exit 1; }; }
1084
1085 fi
1086 echo "$as_me:1086: result: $ac_cv_host" >&5
1087 echo "${ECHO_T}$ac_cv_host" >&6
1088 host=$ac_cv_host
1089 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1090 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1091 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1092
1093         system_name="$host_os"
1094 else
1095         system_name="`(uname -s -r) 2>/dev/null`"
1096         if test -z "$system_name" ; then
1097                 system_name="`(hostname) 2>/dev/null`"
1098         fi
1099 fi
1100 test -n "$system_name" &&
1101 cat >>confdefs.h <<EOF
1102 #define SYSTEM_NAME "$system_name"
1103 EOF
1104
1105 if test "${cf_cv_system_name+set}" = set; then
1106   echo $ECHO_N "(cached) $ECHO_C" >&6
1107 else
1108   cf_cv_system_name="$system_name"
1109 fi
1110
1111 test -z "$system_name" && system_name="$cf_cv_system_name"
1112 test -n "$cf_cv_system_name" && echo "$as_me:1112: result: Configuring for $cf_cv_system_name" >&5
1113 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1114
1115 if test ".$system_name" != ".$cf_cv_system_name" ; then
1116         echo "$as_me:1116: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1117 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1118         { { echo "$as_me:1118: error: \"Please remove config.cache and try again.\"" >&5
1119 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1120    { (exit 1); exit 1; }; }
1121 fi
1122
1123 test "$program_prefix" != NONE &&
1124   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1125 # Use a double $ so make ignores it.
1126 test "$program_suffix" != NONE &&
1127   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1128 # Double any \ or $.  echo might interpret backslashes.
1129 # By default was `s,x,x', remove it if useless.
1130 cat <<\_ACEOF >conftest.sed
1131 s/[\\$]/&&/g;s/;s,x,x,$//
1132 _ACEOF
1133 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1134 rm conftest.sed
1135
1136 echo "$as_me:1136: checking whether ${MAKE-make} sets \${MAKE}" >&5
1137 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1138 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1139 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1140   echo $ECHO_N "(cached) $ECHO_C" >&6
1141 else
1142   cat >conftest.make <<\EOF
1143 all:
1144         @echo 'ac_maketemp="${MAKE}"'
1145 EOF
1146 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1147 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1148 if test -n "$ac_maketemp"; then
1149   eval ac_cv_prog_make_${ac_make}_set=yes
1150 else
1151   eval ac_cv_prog_make_${ac_make}_set=no
1152 fi
1153 rm -f conftest.make
1154 fi
1155 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1156   echo "$as_me:1156: result: yes" >&5
1157 echo "${ECHO_T}yes" >&6
1158   SET_MAKE=
1159 else
1160   echo "$as_me:1160: result: no" >&5
1161 echo "${ECHO_T}no" >&6
1162   SET_MAKE="MAKE=${MAKE-make}"
1163 fi
1164
1165 ac_ext=c
1166 ac_cpp='$CPP $CPPFLAGS'
1167 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1168 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1169 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1170 ac_main_return="return"
1171 if test -n "$ac_tool_prefix"; then
1172   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1173 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1174 echo "$as_me:1174: checking for $ac_word" >&5
1175 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1176 if test "${ac_cv_prog_CC+set}" = set; then
1177   echo $ECHO_N "(cached) $ECHO_C" >&6
1178 else
1179   if test -n "$CC"; then
1180   ac_cv_prog_CC="$CC" # Let the user override the test.
1181 else
1182   ac_save_IFS=$IFS; IFS=$ac_path_separator
1183 ac_dummy="$PATH"
1184 for ac_dir in $ac_dummy; do
1185   IFS=$ac_save_IFS
1186   test -z "$ac_dir" && ac_dir=.
1187   $as_executable_p "$ac_dir/$ac_word" || continue
1188 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1189 echo "$as_me:1189: found $ac_dir/$ac_word" >&5
1190 break
1191 done
1192
1193 fi
1194 fi
1195 CC=$ac_cv_prog_CC
1196 if test -n "$CC"; then
1197   echo "$as_me:1197: result: $CC" >&5
1198 echo "${ECHO_T}$CC" >&6
1199 else
1200   echo "$as_me:1200: result: no" >&5
1201 echo "${ECHO_T}no" >&6
1202 fi
1203
1204 fi
1205 if test -z "$ac_cv_prog_CC"; then
1206   ac_ct_CC=$CC
1207   # Extract the first word of "gcc", so it can be a program name with args.
1208 set dummy gcc; ac_word=$2
1209 echo "$as_me:1209: checking for $ac_word" >&5
1210 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1211 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1212   echo $ECHO_N "(cached) $ECHO_C" >&6
1213 else
1214   if test -n "$ac_ct_CC"; then
1215   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1216 else
1217   ac_save_IFS=$IFS; IFS=$ac_path_separator
1218 ac_dummy="$PATH"
1219 for ac_dir in $ac_dummy; do
1220   IFS=$ac_save_IFS
1221   test -z "$ac_dir" && ac_dir=.
1222   $as_executable_p "$ac_dir/$ac_word" || continue
1223 ac_cv_prog_ac_ct_CC="gcc"
1224 echo "$as_me:1224: found $ac_dir/$ac_word" >&5
1225 break
1226 done
1227
1228 fi
1229 fi
1230 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1231 if test -n "$ac_ct_CC"; then
1232   echo "$as_me:1232: result: $ac_ct_CC" >&5
1233 echo "${ECHO_T}$ac_ct_CC" >&6
1234 else
1235   echo "$as_me:1235: result: no" >&5
1236 echo "${ECHO_T}no" >&6
1237 fi
1238
1239   CC=$ac_ct_CC
1240 else
1241   CC="$ac_cv_prog_CC"
1242 fi
1243
1244 if test -z "$CC"; then
1245   if test -n "$ac_tool_prefix"; then
1246   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1247 set dummy ${ac_tool_prefix}cc; ac_word=$2
1248 echo "$as_me:1248: checking for $ac_word" >&5
1249 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1250 if test "${ac_cv_prog_CC+set}" = set; then
1251   echo $ECHO_N "(cached) $ECHO_C" >&6
1252 else
1253   if test -n "$CC"; then
1254   ac_cv_prog_CC="$CC" # Let the user override the test.
1255 else
1256   ac_save_IFS=$IFS; IFS=$ac_path_separator
1257 ac_dummy="$PATH"
1258 for ac_dir in $ac_dummy; do
1259   IFS=$ac_save_IFS
1260   test -z "$ac_dir" && ac_dir=.
1261   $as_executable_p "$ac_dir/$ac_word" || continue
1262 ac_cv_prog_CC="${ac_tool_prefix}cc"
1263 echo "$as_me:1263: found $ac_dir/$ac_word" >&5
1264 break
1265 done
1266
1267 fi
1268 fi
1269 CC=$ac_cv_prog_CC
1270 if test -n "$CC"; then
1271   echo "$as_me:1271: result: $CC" >&5
1272 echo "${ECHO_T}$CC" >&6
1273 else
1274   echo "$as_me:1274: result: no" >&5
1275 echo "${ECHO_T}no" >&6
1276 fi
1277
1278 fi
1279 if test -z "$ac_cv_prog_CC"; then
1280   ac_ct_CC=$CC
1281   # Extract the first word of "cc", so it can be a program name with args.
1282 set dummy cc; ac_word=$2
1283 echo "$as_me:1283: checking for $ac_word" >&5
1284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1285 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1286   echo $ECHO_N "(cached) $ECHO_C" >&6
1287 else
1288   if test -n "$ac_ct_CC"; then
1289   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1290 else
1291   ac_save_IFS=$IFS; IFS=$ac_path_separator
1292 ac_dummy="$PATH"
1293 for ac_dir in $ac_dummy; do
1294   IFS=$ac_save_IFS
1295   test -z "$ac_dir" && ac_dir=.
1296   $as_executable_p "$ac_dir/$ac_word" || continue
1297 ac_cv_prog_ac_ct_CC="cc"
1298 echo "$as_me:1298: found $ac_dir/$ac_word" >&5
1299 break
1300 done
1301
1302 fi
1303 fi
1304 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1305 if test -n "$ac_ct_CC"; then
1306   echo "$as_me:1306: result: $ac_ct_CC" >&5
1307 echo "${ECHO_T}$ac_ct_CC" >&6
1308 else
1309   echo "$as_me:1309: result: no" >&5
1310 echo "${ECHO_T}no" >&6
1311 fi
1312
1313   CC=$ac_ct_CC
1314 else
1315   CC="$ac_cv_prog_CC"
1316 fi
1317
1318 fi
1319 if test -z "$CC"; then
1320   # Extract the first word of "cc", so it can be a program name with args.
1321 set dummy cc; ac_word=$2
1322 echo "$as_me:1322: checking for $ac_word" >&5
1323 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1324 if test "${ac_cv_prog_CC+set}" = set; then
1325   echo $ECHO_N "(cached) $ECHO_C" >&6
1326 else
1327   if test -n "$CC"; then
1328   ac_cv_prog_CC="$CC" # Let the user override the test.
1329 else
1330   ac_prog_rejected=no
1331   ac_save_IFS=$IFS; IFS=$ac_path_separator
1332 ac_dummy="$PATH"
1333 for ac_dir in $ac_dummy; do
1334   IFS=$ac_save_IFS
1335   test -z "$ac_dir" && ac_dir=.
1336   $as_executable_p "$ac_dir/$ac_word" || continue
1337 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1338   ac_prog_rejected=yes
1339   continue
1340 fi
1341 ac_cv_prog_CC="cc"
1342 echo "$as_me:1342: found $ac_dir/$ac_word" >&5
1343 break
1344 done
1345
1346 if test "$ac_prog_rejected" = yes; then
1347   # We found a bogon in the path, so make sure we never use it.
1348   set dummy $ac_cv_prog_CC
1349   shift
1350   if test $# != 0; then
1351     # We chose a different compiler from the bogus one.
1352     # However, it has the same basename, so the bogon will be chosen
1353     # first if we set CC to just the basename; use the full file name.
1354     shift
1355     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1356     shift
1357     ac_cv_prog_CC="$@"
1358   fi
1359 fi
1360 fi
1361 fi
1362 CC=$ac_cv_prog_CC
1363 if test -n "$CC"; then
1364   echo "$as_me:1364: result: $CC" >&5
1365 echo "${ECHO_T}$CC" >&6
1366 else
1367   echo "$as_me:1367: result: no" >&5
1368 echo "${ECHO_T}no" >&6
1369 fi
1370
1371 fi
1372 if test -z "$CC"; then
1373   if test -n "$ac_tool_prefix"; then
1374   for ac_prog in cl
1375   do
1376     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1377 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1378 echo "$as_me:1378: checking for $ac_word" >&5
1379 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1380 if test "${ac_cv_prog_CC+set}" = set; then
1381   echo $ECHO_N "(cached) $ECHO_C" >&6
1382 else
1383   if test -n "$CC"; then
1384   ac_cv_prog_CC="$CC" # Let the user override the test.
1385 else
1386   ac_save_IFS=$IFS; IFS=$ac_path_separator
1387 ac_dummy="$PATH"
1388 for ac_dir in $ac_dummy; do
1389   IFS=$ac_save_IFS
1390   test -z "$ac_dir" && ac_dir=.
1391   $as_executable_p "$ac_dir/$ac_word" || continue
1392 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1393 echo "$as_me:1393: found $ac_dir/$ac_word" >&5
1394 break
1395 done
1396
1397 fi
1398 fi
1399 CC=$ac_cv_prog_CC
1400 if test -n "$CC"; then
1401   echo "$as_me:1401: result: $CC" >&5
1402 echo "${ECHO_T}$CC" >&6
1403 else
1404   echo "$as_me:1404: result: no" >&5
1405 echo "${ECHO_T}no" >&6
1406 fi
1407
1408     test -n "$CC" && break
1409   done
1410 fi
1411 if test -z "$CC"; then
1412   ac_ct_CC=$CC
1413   for ac_prog in cl
1414 do
1415   # Extract the first word of "$ac_prog", so it can be a program name with args.
1416 set dummy $ac_prog; ac_word=$2
1417 echo "$as_me:1417: checking for $ac_word" >&5
1418 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1419 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1420   echo $ECHO_N "(cached) $ECHO_C" >&6
1421 else
1422   if test -n "$ac_ct_CC"; then
1423   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1424 else
1425   ac_save_IFS=$IFS; IFS=$ac_path_separator
1426 ac_dummy="$PATH"
1427 for ac_dir in $ac_dummy; do
1428   IFS=$ac_save_IFS
1429   test -z "$ac_dir" && ac_dir=.
1430   $as_executable_p "$ac_dir/$ac_word" || continue
1431 ac_cv_prog_ac_ct_CC="$ac_prog"
1432 echo "$as_me:1432: found $ac_dir/$ac_word" >&5
1433 break
1434 done
1435
1436 fi
1437 fi
1438 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1439 if test -n "$ac_ct_CC"; then
1440   echo "$as_me:1440: result: $ac_ct_CC" >&5
1441 echo "${ECHO_T}$ac_ct_CC" >&6
1442 else
1443   echo "$as_me:1443: result: no" >&5
1444 echo "${ECHO_T}no" >&6
1445 fi
1446
1447   test -n "$ac_ct_CC" && break
1448 done
1449
1450   CC=$ac_ct_CC
1451 fi
1452
1453 fi
1454
1455 test -z "$CC" && { { echo "$as_me:1455: error: no acceptable cc found in \$PATH" >&5
1456 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1457    { (exit 1); exit 1; }; }
1458
1459 # Provide some information about the compiler.
1460 echo "$as_me:1460:" \
1461      "checking for C compiler version" >&5
1462 ac_compiler=`set X $ac_compile; echo "$2"`
1463 { (eval echo "$as_me:1463: \"$ac_compiler --version </dev/null >&5\"") >&5
1464   (eval $ac_compiler --version </dev/null >&5) 2>&5
1465   ac_status=$?
1466   echo "$as_me:1466: \$? = $ac_status" >&5
1467   (exit "$ac_status"); }
1468 { (eval echo "$as_me:1468: \"$ac_compiler -v </dev/null >&5\"") >&5
1469   (eval $ac_compiler -v </dev/null >&5) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit "$ac_status"); }
1473 { (eval echo "$as_me:1473: \"$ac_compiler -V </dev/null >&5\"") >&5
1474   (eval $ac_compiler -V </dev/null >&5) 2>&5
1475   ac_status=$?
1476   echo "$as_me:1476: \$? = $ac_status" >&5
1477   (exit "$ac_status"); }
1478
1479 cat >"conftest.$ac_ext" <<_ACEOF
1480 #line 1480 "configure"
1481 #include "confdefs.h"
1482
1483 int
1484 main (void)
1485 {
1486
1487   ;
1488   return 0;
1489 }
1490 _ACEOF
1491 ac_clean_files_save=$ac_clean_files
1492 ac_clean_files="$ac_clean_files a.out a.exe"
1493 # Try to create an executable without -o first, disregard a.out.
1494 # It will help us diagnose broken compilers, and finding out an intuition
1495 # of exeext.
1496 echo "$as_me:1496: checking for C compiler default output" >&5
1497 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1498 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1499 if { (eval echo "$as_me:1499: \"$ac_link_default\"") >&5
1500   (eval $ac_link_default) 2>&5
1501   ac_status=$?
1502   echo "$as_me:1502: \$? = $ac_status" >&5
1503   (exit "$ac_status"); }; then
1504   # Find the output, starting from the most likely.  This scheme is
1505 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1506 # resort.
1507 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1508                 ls a.out conftest 2>/dev/null;
1509                 ls a.* conftest.* 2>/dev/null`; do
1510   case $ac_file in
1511     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1512     a.out ) # We found the default executable, but exeext='' is most
1513             # certainly right.
1514             break;;
1515     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1516           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1517           export ac_cv_exeext
1518           break;;
1519     * ) break;;
1520   esac
1521 done
1522 else
1523   echo "$as_me: failed program was:" >&5
1524 cat "conftest.$ac_ext" >&5
1525 { { echo "$as_me:1525: error: C compiler cannot create executables" >&5
1526 echo "$as_me: error: C compiler cannot create executables" >&2;}
1527    { (exit 77); exit 77; }; }
1528 fi
1529
1530 ac_exeext=$ac_cv_exeext
1531 echo "$as_me:1531: result: $ac_file" >&5
1532 echo "${ECHO_T}$ac_file" >&6
1533
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether the C compiler works" >&5
1537 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1538 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1539 # If not cross compiling, check that we can run a simple program.
1540 if test "$cross_compiling" != yes; then
1541   if { ac_try='./$ac_file'
1542   { (eval echo "$as_me:1542: \"$ac_try\"") >&5
1543   (eval $ac_try) 2>&5
1544   ac_status=$?
1545   echo "$as_me:1545: \$? = $ac_status" >&5
1546   (exit "$ac_status"); }; }; then
1547     cross_compiling=no
1548   else
1549     if test "$cross_compiling" = maybe; then
1550         cross_compiling=yes
1551     else
1552         { { echo "$as_me:1552: error: cannot run C compiled programs.
1553 If you meant to cross compile, use \`--host'." >&5
1554 echo "$as_me: error: cannot run C compiled programs.
1555 If you meant to cross compile, use \`--host'." >&2;}
1556    { (exit 1); exit 1; }; }
1557     fi
1558   fi
1559 fi
1560 echo "$as_me:1560: result: yes" >&5
1561 echo "${ECHO_T}yes" >&6
1562
1563 rm -f a.out a.exe "conftest$ac_cv_exeext"
1564 ac_clean_files=$ac_clean_files_save
1565 # Check the compiler produces executables we can run.  If not, either
1566 # the compiler is broken, or we cross compile.
1567 echo "$as_me:1567: checking whether we are cross compiling" >&5
1568 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1569 echo "$as_me:1569: result: $cross_compiling" >&5
1570 echo "${ECHO_T}$cross_compiling" >&6
1571
1572 echo "$as_me:1572: checking for executable suffix" >&5
1573 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1574 if { (eval echo "$as_me:1574: \"$ac_link\"") >&5
1575   (eval $ac_link) 2>&5
1576   ac_status=$?
1577   echo "$as_me:1577: \$? = $ac_status" >&5
1578   (exit "$ac_status"); }; then
1579   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1580 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1581 # work properly (i.e., refer to `conftest.exe'), while it won't with
1582 # `rm'.
1583 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1584   case $ac_file in
1585     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1586     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1587           export ac_cv_exeext
1588           break;;
1589     * ) break;;
1590   esac
1591 done
1592 else
1593   { { echo "$as_me:1593: error: cannot compute EXEEXT: cannot compile and link" >&5
1594 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1595    { (exit 1); exit 1; }; }
1596 fi
1597
1598 rm -f "conftest$ac_cv_exeext"
1599 echo "$as_me:1599: result: $ac_cv_exeext" >&5
1600 echo "${ECHO_T}$ac_cv_exeext" >&6
1601
1602 rm -f "conftest.$ac_ext"
1603 EXEEXT=$ac_cv_exeext
1604 ac_exeext=$EXEEXT
1605 echo "$as_me:1605: checking for object suffix" >&5
1606 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1607 if test "${ac_cv_objext+set}" = set; then
1608   echo $ECHO_N "(cached) $ECHO_C" >&6
1609 else
1610   cat >"conftest.$ac_ext" <<_ACEOF
1611 #line 1611 "configure"
1612 #include "confdefs.h"
1613
1614 int
1615 main (void)
1616 {
1617
1618   ;
1619   return 0;
1620 }
1621 _ACEOF
1622 rm -f conftest.o conftest.obj
1623 if { (eval echo "$as_me:1623: \"$ac_compile\"") >&5
1624   (eval $ac_compile) 2>&5
1625   ac_status=$?
1626   echo "$as_me:1626: \$? = $ac_status" >&5
1627   (exit "$ac_status"); }; then
1628   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1629   case $ac_file in
1630     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1631     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1632        break;;
1633   esac
1634 done
1635 else
1636   echo "$as_me: failed program was:" >&5
1637 cat "conftest.$ac_ext" >&5
1638 { { echo "$as_me:1638: error: cannot compute OBJEXT: cannot compile" >&5
1639 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1640    { (exit 1); exit 1; }; }
1641 fi
1642
1643 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1644 fi
1645 echo "$as_me:1645: result: $ac_cv_objext" >&5
1646 echo "${ECHO_T}$ac_cv_objext" >&6
1647 OBJEXT=$ac_cv_objext
1648 ac_objext=$OBJEXT
1649 echo "$as_me:1649: checking whether we are using the GNU C compiler" >&5
1650 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1651 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1652   echo $ECHO_N "(cached) $ECHO_C" >&6
1653 else
1654   cat >"conftest.$ac_ext" <<_ACEOF
1655 #line 1655 "configure"
1656 #include "confdefs.h"
1657
1658 int
1659 main (void)
1660 {
1661 #ifndef __GNUC__
1662        choke me
1663 #endif
1664
1665   ;
1666   return 0;
1667 }
1668 _ACEOF
1669 rm -f "conftest.$ac_objext"
1670 if { (eval echo "$as_me:1670: \"$ac_compile\"") >&5
1671   (eval $ac_compile) 2>&5
1672   ac_status=$?
1673   echo "$as_me:1673: \$? = $ac_status" >&5
1674   (exit "$ac_status"); } &&
1675          { ac_try='test -s "conftest.$ac_objext"'
1676   { (eval echo "$as_me:1676: \"$ac_try\"") >&5
1677   (eval $ac_try) 2>&5
1678   ac_status=$?
1679   echo "$as_me:1679: \$? = $ac_status" >&5
1680   (exit "$ac_status"); }; }; then
1681   ac_compiler_gnu=yes
1682 else
1683   echo "$as_me: failed program was:" >&5
1684 cat "conftest.$ac_ext" >&5
1685 ac_compiler_gnu=no
1686 fi
1687 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1688 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1689
1690 fi
1691 echo "$as_me:1691: result: $ac_cv_c_compiler_gnu" >&5
1692 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1693 GCC=`test $ac_compiler_gnu = yes && echo yes`
1694 ac_test_CFLAGS=${CFLAGS+set}
1695 ac_save_CFLAGS=$CFLAGS
1696 CFLAGS="-g"
1697 echo "$as_me:1697: checking whether $CC accepts -g" >&5
1698 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1699 if test "${ac_cv_prog_cc_g+set}" = set; then
1700   echo $ECHO_N "(cached) $ECHO_C" >&6
1701 else
1702   cat >"conftest.$ac_ext" <<_ACEOF
1703 #line 1703 "configure"
1704 #include "confdefs.h"
1705
1706 int
1707 main (void)
1708 {
1709
1710   ;
1711   return 0;
1712 }
1713 _ACEOF
1714 rm -f "conftest.$ac_objext"
1715 if { (eval echo "$as_me:1715: \"$ac_compile\"") >&5
1716   (eval $ac_compile) 2>&5
1717   ac_status=$?
1718   echo "$as_me:1718: \$? = $ac_status" >&5
1719   (exit "$ac_status"); } &&
1720          { ac_try='test -s "conftest.$ac_objext"'
1721   { (eval echo "$as_me:1721: \"$ac_try\"") >&5
1722   (eval $ac_try) 2>&5
1723   ac_status=$?
1724   echo "$as_me:1724: \$? = $ac_status" >&5
1725   (exit "$ac_status"); }; }; then
1726   ac_cv_prog_cc_g=yes
1727 else
1728   echo "$as_me: failed program was:" >&5
1729 cat "conftest.$ac_ext" >&5
1730 ac_cv_prog_cc_g=no
1731 fi
1732 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1733 fi
1734 echo "$as_me:1734: result: $ac_cv_prog_cc_g" >&5
1735 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1736 if test "$ac_test_CFLAGS" = set; then
1737   CFLAGS=$ac_save_CFLAGS
1738 elif test $ac_cv_prog_cc_g = yes; then
1739   if test "$GCC" = yes; then
1740     CFLAGS="-g -O2"
1741   else
1742     CFLAGS="-g"
1743   fi
1744 else
1745   if test "$GCC" = yes; then
1746     CFLAGS="-O2"
1747   else
1748     CFLAGS=
1749   fi
1750 fi
1751 # Some people use a C++ compiler to compile C.  Since we use `exit',
1752 # in C++ we need to declare it.  In case someone uses the same compiler
1753 # for both compiling C and C++ we need to have the C++ compiler decide
1754 # the declaration of exit, since it's the most demanding environment.
1755 cat >"conftest.$ac_ext" <<_ACEOF
1756 #ifndef __cplusplus
1757   choke me
1758 #endif
1759 _ACEOF
1760 rm -f "conftest.$ac_objext"
1761 if { (eval echo "$as_me:1761: \"$ac_compile\"") >&5
1762   (eval $ac_compile) 2>&5
1763   ac_status=$?
1764   echo "$as_me:1764: \$? = $ac_status" >&5
1765   (exit "$ac_status"); } &&
1766          { ac_try='test -s "conftest.$ac_objext"'
1767   { (eval echo "$as_me:1767: \"$ac_try\"") >&5
1768   (eval $ac_try) 2>&5
1769   ac_status=$?
1770   echo "$as_me:1770: \$? = $ac_status" >&5
1771   (exit "$ac_status"); }; }; then
1772   for ac_declaration in \
1773    ''\
1774    '#include <stdlib.h>' \
1775    'extern "C" void std::exit (int) throw (); using std::exit;' \
1776    'extern "C" void std::exit (int); using std::exit;' \
1777    'extern "C" void exit (int) throw ();' \
1778    'extern "C" void exit (int);' \
1779    'void exit (int);'
1780 do
1781   cat >"conftest.$ac_ext" <<_ACEOF
1782 #line 1782 "configure"
1783 #include "confdefs.h"
1784 #include <stdlib.h>
1785 $ac_declaration
1786 int
1787 main (void)
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f "conftest.$ac_objext"
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit "$ac_status"); } &&
1800          { ac_try='test -s "conftest.$ac_objext"'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit "$ac_status"); }; }; then
1806   :
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat "conftest.$ac_ext" >&5
1810 continue
1811 fi
1812 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1813   cat >"conftest.$ac_ext" <<_ACEOF
1814 #line 1814 "configure"
1815 #include "confdefs.h"
1816 $ac_declaration
1817 int
1818 main (void)
1819 {
1820 exit (42);
1821   ;
1822   return 0;
1823 }
1824 _ACEOF
1825 rm -f "conftest.$ac_objext"
1826 if { (eval echo "$as_me:1826: \"$ac_compile\"") >&5
1827   (eval $ac_compile) 2>&5
1828   ac_status=$?
1829   echo "$as_me:1829: \$? = $ac_status" >&5
1830   (exit "$ac_status"); } &&
1831          { ac_try='test -s "conftest.$ac_objext"'
1832   { (eval echo "$as_me:1832: \"$ac_try\"") >&5
1833   (eval $ac_try) 2>&5
1834   ac_status=$?
1835   echo "$as_me:1835: \$? = $ac_status" >&5
1836   (exit "$ac_status"); }; }; then
1837   break
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 done
1844 rm -rf conftest*
1845 if test -n "$ac_declaration"; then
1846   echo '#ifdef __cplusplus' >>confdefs.h
1847   echo "$ac_declaration"    >>confdefs.h
1848   echo '#endif'             >>confdefs.h
1849 fi
1850
1851 else
1852   echo "$as_me: failed program was:" >&5
1853 cat "conftest.$ac_ext" >&5
1854 fi
1855 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1856 ac_ext=c
1857 ac_cpp='$CPP $CPPFLAGS'
1858 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1859 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1860 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1861 ac_main_return="return"
1862
1863 GCC_VERSION=none
1864 if test "$GCC" = yes ; then
1865         echo "$as_me:1865: checking version of $CC" >&5
1866 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1867         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.].*//'`"
1868         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1869         echo "$as_me:1869: result: $GCC_VERSION" >&5
1870 echo "${ECHO_T}$GCC_VERSION" >&6
1871 fi
1872
1873 INTEL_COMPILER=no
1874
1875 if test "$GCC" = yes ; then
1876         case "$host_os" in
1877         (linux*|gnu*)
1878                 echo "$as_me:1878: checking if this is really Intel C compiler" >&5
1879 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1880                 cf_save_CFLAGS="$CFLAGS"
1881                 CFLAGS="$CFLAGS -no-gcc"
1882                 cat >"conftest.$ac_ext" <<_ACEOF
1883 #line 1883 "configure"
1884 #include "confdefs.h"
1885
1886 int
1887 main (void)
1888 {
1889
1890 #ifdef __INTEL_COMPILER
1891 #else
1892 make an error
1893 #endif
1894
1895   ;
1896   return 0;
1897 }
1898 _ACEOF
1899 rm -f "conftest.$ac_objext"
1900 if { (eval echo "$as_me:1900: \"$ac_compile\"") >&5
1901   (eval $ac_compile) 2>&5
1902   ac_status=$?
1903   echo "$as_me:1903: \$? = $ac_status" >&5
1904   (exit "$ac_status"); } &&
1905          { ac_try='test -s "conftest.$ac_objext"'
1906   { (eval echo "$as_me:1906: \"$ac_try\"") >&5
1907   (eval $ac_try) 2>&5
1908   ac_status=$?
1909   echo "$as_me:1909: \$? = $ac_status" >&5
1910   (exit "$ac_status"); }; }; then
1911   INTEL_COMPILER=yes
1912 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1913
1914 else
1915   echo "$as_me: failed program was:" >&5
1916 cat "conftest.$ac_ext" >&5
1917 fi
1918 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1919                 CFLAGS="$cf_save_CFLAGS"
1920                 echo "$as_me:1920: result: $INTEL_COMPILER" >&5
1921 echo "${ECHO_T}$INTEL_COMPILER" >&6
1922                 ;;
1923         esac
1924 fi
1925
1926 CLANG_COMPILER=no
1927
1928 if test "$GCC" = yes ; then
1929         echo "$as_me:1929: checking if this is really Clang C compiler" >&5
1930 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1931         cf_save_CFLAGS="$CFLAGS"
1932         cat >"conftest.$ac_ext" <<_ACEOF
1933 #line 1933 "configure"
1934 #include "confdefs.h"
1935
1936 int
1937 main (void)
1938 {
1939
1940 #ifdef __clang__
1941 #else
1942 make an error
1943 #endif
1944
1945   ;
1946   return 0;
1947 }
1948 _ACEOF
1949 rm -f "conftest.$ac_objext"
1950 if { (eval echo "$as_me:1950: \"$ac_compile\"") >&5
1951   (eval $ac_compile) 2>&5
1952   ac_status=$?
1953   echo "$as_me:1953: \$? = $ac_status" >&5
1954   (exit "$ac_status"); } &&
1955          { ac_try='test -s "conftest.$ac_objext"'
1956   { (eval echo "$as_me:1956: \"$ac_try\"") >&5
1957   (eval $ac_try) 2>&5
1958   ac_status=$?
1959   echo "$as_me:1959: \$? = $ac_status" >&5
1960   (exit "$ac_status"); }; }; then
1961   CLANG_COMPILER=yes
1962
1963 else
1964   echo "$as_me: failed program was:" >&5
1965 cat "conftest.$ac_ext" >&5
1966 fi
1967 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1968         CFLAGS="$cf_save_CFLAGS"
1969         echo "$as_me:1969: result: $CLANG_COMPILER" >&5
1970 echo "${ECHO_T}$CLANG_COMPILER" >&6
1971 fi
1972
1973 CLANG_VERSION=none
1974
1975 if test "x$CLANG_COMPILER" = "xyes" ; then
1976         case "$CC" in
1977         (c[1-9][0-9]|*/c[1-9][0-9])
1978                 { echo "$as_me:1978: WARNING: replacing broken compiler alias $CC" >&5
1979 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1980                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1981                 CC=clang
1982                 ;;
1983         esac
1984
1985         echo "$as_me:1985: checking version of $CC" >&5
1986 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1987         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.].*//'`"
1988         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1989         echo "$as_me:1989: result: $CLANG_VERSION" >&5
1990 echo "${ECHO_T}$CLANG_VERSION" >&6
1991
1992         for cf_clang_opt in \
1993                 -Qunused-arguments \
1994                 -Wno-error=implicit-function-declaration
1995         do
1996                 echo "$as_me:1996: checking if option $cf_clang_opt works" >&5
1997 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1998                 cf_save_CFLAGS="$CFLAGS"
1999                 CFLAGS="$CFLAGS $cf_clang_opt"
2000                 cat >"conftest.$ac_ext" <<_ACEOF
2001 #line 2001 "configure"
2002 #include "confdefs.h"
2003
2004                         #include <stdio.h>
2005 int
2006 main (void)
2007 {
2008
2009                         printf("hello!\\n");
2010   ;
2011   return 0;
2012 }
2013 _ACEOF
2014 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2015 if { (eval echo "$as_me:2015: \"$ac_link\"") >&5
2016   (eval $ac_link) 2>&5
2017   ac_status=$?
2018   echo "$as_me:2018: \$? = $ac_status" >&5
2019   (exit "$ac_status"); } &&
2020          { ac_try='test -s "conftest$ac_exeext"'
2021   { (eval echo "$as_me:2021: \"$ac_try\"") >&5
2022   (eval $ac_try) 2>&5
2023   ac_status=$?
2024   echo "$as_me:2024: \$? = $ac_status" >&5
2025   (exit "$ac_status"); }; }; then
2026
2027                         cf_clang_optok=yes
2028 else
2029   echo "$as_me: failed program was:" >&5
2030 cat "conftest.$ac_ext" >&5
2031
2032                         cf_clang_optok=no
2033 fi
2034 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2035                 echo "$as_me:2035: result: $cf_clang_optok" >&5
2036 echo "${ECHO_T}$cf_clang_optok" >&6
2037                 CFLAGS="$cf_save_CFLAGS"
2038                 if test "$cf_clang_optok" = yes; then
2039                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2040
2041 echo "${as_me:-configure}:2041: testing adding option $cf_clang_opt ..." 1>&5
2042
2043         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2044         CFLAGS="${CFLAGS}$cf_clang_opt"
2045
2046                 fi
2047         done
2048 fi
2049
2050 echo "$as_me:2050: checking for $CC option to accept ANSI C" >&5
2051 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2052 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2053   echo $ECHO_N "(cached) $ECHO_C" >&6
2054 else
2055   ac_cv_prog_cc_stdc=no
2056 ac_save_CC=$CC
2057 cat >"conftest.$ac_ext" <<_ACEOF
2058 #line 2058 "configure"
2059 #include "confdefs.h"
2060 #include <stdarg.h>
2061 #include <stdio.h>
2062 #include <sys/types.h>
2063 #include <sys/stat.h>
2064 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2065 struct buf { int x; };
2066 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2067 static char *e (p, i)
2068      char **p;
2069      int i;
2070 {
2071   return p[i];
2072 }
2073 static char *f (char * (*g) (char **, int), char **p, ...)
2074 {
2075   char *s;
2076   va_list v;
2077   va_start (v,p);
2078   s = g (p, va_arg (v,int));
2079   va_end (v);
2080   return s;
2081 }
2082 int test (int i, double x);
2083 struct s1 {int (*f) (int a);};
2084 struct s2 {int (*f) (double a);};
2085 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2086 int argc;
2087 char **argv;
2088 int
2089 main (void)
2090 {
2091 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2092   ;
2093   return 0;
2094 }
2095 _ACEOF
2096 # Don't try gcc -ansi; that turns off useful extensions and
2097 # breaks some systems' header files.
2098 # AIX                   -qlanglvl=ansi
2099 # Ultrix and OSF/1      -std1
2100 # HP-UX 10.20 and later -Ae
2101 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2102 # SVR4                  -Xc -D__EXTENSIONS__
2103 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2104 do
2105   CC="$ac_save_CC $ac_arg"
2106   rm -f "conftest.$ac_objext"
2107 if { (eval echo "$as_me:2107: \"$ac_compile\"") >&5
2108   (eval $ac_compile) 2>&5
2109   ac_status=$?
2110   echo "$as_me:2110: \$? = $ac_status" >&5
2111   (exit "$ac_status"); } &&
2112          { ac_try='test -s "conftest.$ac_objext"'
2113   { (eval echo "$as_me:2113: \"$ac_try\"") >&5
2114   (eval $ac_try) 2>&5
2115   ac_status=$?
2116   echo "$as_me:2116: \$? = $ac_status" >&5
2117   (exit "$ac_status"); }; }; then
2118   ac_cv_prog_cc_stdc=$ac_arg
2119 break
2120 else
2121   echo "$as_me: failed program was:" >&5
2122 cat "conftest.$ac_ext" >&5
2123 fi
2124 rm -f "conftest.$ac_objext"
2125 done
2126 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2127 CC=$ac_save_CC
2128
2129 fi
2130
2131 case "x$ac_cv_prog_cc_stdc" in
2132   x|xno)
2133     echo "$as_me:2133: result: none needed" >&5
2134 echo "${ECHO_T}none needed" >&6 ;;
2135   *)
2136     echo "$as_me:2136: result: $ac_cv_prog_cc_stdc" >&5
2137 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2138     CC="$CC $ac_cv_prog_cc_stdc" ;;
2139 esac
2140
2141 # This should have been defined by AC_PROG_CC
2142 : "${CC:=cc}"
2143
2144 echo "$as_me:2144: checking \$CFLAGS variable" >&5
2145 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2146 case "x$CFLAGS" in
2147 (*-[IUD]*)
2148         echo "$as_me:2148: result: broken" >&5
2149 echo "${ECHO_T}broken" >&6
2150         { echo "$as_me:2150: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2151 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2152         cf_flags="$CFLAGS"
2153         CFLAGS=
2154         for cf_arg in $cf_flags
2155         do
2156
2157 cf_fix_cppflags=no
2158 cf_new_cflags=
2159 cf_new_cppflags=
2160 cf_new_extra_cppflags=
2161
2162 for cf_add_cflags in $cf_arg
2163 do
2164 case "$cf_fix_cppflags" in
2165 (no)
2166         case "$cf_add_cflags" in
2167         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2168                 case "$cf_add_cflags" in
2169                 (-D*)
2170                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2171
2172                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2173                                 && test -z "${cf_tst_cflags}" \
2174                                 && cf_fix_cppflags=yes
2175
2176                         if test "$cf_fix_cppflags" = yes ; then
2177
2178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2180
2181                                 continue
2182                         elif test "${cf_tst_cflags}" = "\"'" ; then
2183
2184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2186
2187                                 continue
2188                         fi
2189                         ;;
2190                 esac
2191                 case "$CPPFLAGS" in
2192                 (*$cf_add_cflags)
2193                         ;;
2194                 (*)
2195                         case "$cf_add_cflags" in
2196                         (-D*)
2197                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2198
2199 CPPFLAGS=`echo "$CPPFLAGS" | \
2200         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2201                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2202
2203                                 ;;
2204                         esac
2205
2206         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2207         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2208
2209                         ;;
2210                 esac
2211                 ;;
2212         (*)
2213
2214         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2215         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2216
2217                 ;;
2218         esac
2219         ;;
2220 (yes)
2221
2222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2224
2225         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2226
2227         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2228                 && test -z "${cf_tst_cflags}" \
2229                 && cf_fix_cppflags=no
2230         ;;
2231 esac
2232 done
2233
2234 if test -n "$cf_new_cflags" ; then
2235
2236         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2237         CFLAGS="${CFLAGS}$cf_new_cflags"
2238
2239 fi
2240
2241 if test -n "$cf_new_cppflags" ; then
2242
2243         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2244         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2245
2246 fi
2247
2248 if test -n "$cf_new_extra_cppflags" ; then
2249
2250         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2251         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2252
2253 fi
2254
2255         done
2256         ;;
2257 (*)
2258         echo "$as_me:2258: result: ok" >&5
2259 echo "${ECHO_T}ok" >&6
2260         ;;
2261 esac
2262
2263 echo "$as_me:2263: checking \$CC variable" >&5
2264 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2265 case "$CC" in
2266 (*[\ \  ]-*)
2267         echo "$as_me:2267: result: broken" >&5
2268 echo "${ECHO_T}broken" >&6
2269         { echo "$as_me:2269: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2270 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2271         # humor him...
2272         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2273         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2274         CC="$cf_prog"
2275         for cf_arg in $cf_flags
2276         do
2277                 case "x$cf_arg" in
2278                 (x-[IUDfgOW]*)
2279
2280 cf_fix_cppflags=no
2281 cf_new_cflags=
2282 cf_new_cppflags=
2283 cf_new_extra_cppflags=
2284
2285 for cf_add_cflags in $cf_arg
2286 do
2287 case "$cf_fix_cppflags" in
2288 (no)
2289         case "$cf_add_cflags" in
2290         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2291                 case "$cf_add_cflags" in
2292                 (-D*)
2293                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2294
2295                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2296                                 && test -z "${cf_tst_cflags}" \
2297                                 && cf_fix_cppflags=yes
2298
2299                         if test "$cf_fix_cppflags" = yes ; then
2300
2301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2303
2304                                 continue
2305                         elif test "${cf_tst_cflags}" = "\"'" ; then
2306
2307         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2308         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2309
2310                                 continue
2311                         fi
2312                         ;;
2313                 esac
2314                 case "$CPPFLAGS" in
2315                 (*$cf_add_cflags)
2316                         ;;
2317                 (*)
2318                         case "$cf_add_cflags" in
2319                         (-D*)
2320                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2321
2322 CPPFLAGS=`echo "$CPPFLAGS" | \
2323         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2324                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2325
2326                                 ;;
2327                         esac
2328
2329         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2330         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2331
2332                         ;;
2333                 esac
2334                 ;;
2335         (*)
2336
2337         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2338         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2339
2340                 ;;
2341         esac
2342         ;;
2343 (yes)
2344
2345         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2346         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2347
2348         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2349
2350         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2351                 && test -z "${cf_tst_cflags}" \
2352                 && cf_fix_cppflags=no
2353         ;;
2354 esac
2355 done
2356
2357 if test -n "$cf_new_cflags" ; then
2358
2359         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2360         CFLAGS="${CFLAGS}$cf_new_cflags"
2361
2362 fi
2363
2364 if test -n "$cf_new_cppflags" ; then
2365
2366         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2367         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2368
2369 fi
2370
2371 if test -n "$cf_new_extra_cppflags" ; then
2372
2373         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2374         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2375
2376 fi
2377
2378                         ;;
2379                 (*)
2380                         CC="$CC $cf_arg"
2381                         ;;
2382                 esac
2383         done
2384         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2385
2386 echo "${as_me:-configure}:2386: testing resulting CC: '$CC' ..." 1>&5
2387
2388         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2389
2390 echo "${as_me:-configure}:2390: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2391
2392         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2393
2394 echo "${as_me:-configure}:2394: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2395
2396         ;;
2397 (*)
2398         echo "$as_me:2398: result: ok" >&5
2399 echo "${ECHO_T}ok" >&6
2400         ;;
2401 esac
2402
2403 echo "$as_me:2403: checking for inline" >&5
2404 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2405 if test "${ac_cv_c_inline+set}" = set; then
2406   echo $ECHO_N "(cached) $ECHO_C" >&6
2407 else
2408   ac_cv_c_inline=no
2409 for ac_kw in inline __inline__ __inline; do
2410   cat >"conftest.$ac_ext" <<_ACEOF
2411 #line 2411 "configure"
2412 #include "confdefs.h"
2413 #ifndef __cplusplus
2414 static $ac_kw int static_foo () {return 0; }
2415 $ac_kw int foo () {return 0; }
2416 #endif
2417
2418 _ACEOF
2419 rm -f "conftest.$ac_objext"
2420 if { (eval echo "$as_me:2420: \"$ac_compile\"") >&5
2421   (eval $ac_compile) 2>&5
2422   ac_status=$?
2423   echo "$as_me:2423: \$? = $ac_status" >&5
2424   (exit "$ac_status"); } &&
2425          { ac_try='test -s "conftest.$ac_objext"'
2426   { (eval echo "$as_me:2426: \"$ac_try\"") >&5
2427   (eval $ac_try) 2>&5
2428   ac_status=$?
2429   echo "$as_me:2429: \$? = $ac_status" >&5
2430   (exit "$ac_status"); }; }; then
2431   ac_cv_c_inline=$ac_kw; break
2432 else
2433   echo "$as_me: failed program was:" >&5
2434 cat "conftest.$ac_ext" >&5
2435 fi
2436 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2437 done
2438
2439 fi
2440 echo "$as_me:2440: result: $ac_cv_c_inline" >&5
2441 echo "${ECHO_T}$ac_cv_c_inline" >&6
2442 case $ac_cv_c_inline in
2443   inline | yes) ;;
2444   no)
2445 cat >>confdefs.h <<\EOF
2446 #define inline
2447 EOF
2448  ;;
2449   *)  cat >>confdefs.h <<EOF
2450 #define inline $ac_cv_c_inline
2451 EOF
2452  ;;
2453 esac
2454
2455 for ac_prog in ggrep grep
2456 do
2457   # Extract the first word of "$ac_prog", so it can be a program name with args.
2458 set dummy $ac_prog; ac_word=$2
2459 echo "$as_me:2459: checking for $ac_word" >&5
2460 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2461 if test "${ac_cv_prog_GREP+set}" = set; then
2462   echo $ECHO_N "(cached) $ECHO_C" >&6
2463 else
2464   if test -n "$GREP"; then
2465   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2466 else
2467   ac_save_IFS=$IFS; IFS=$ac_path_separator
2468 ac_dummy="$PATH"
2469 for ac_dir in $ac_dummy; do
2470   IFS=$ac_save_IFS
2471   test -z "$ac_dir" && ac_dir=.
2472   $as_executable_p "$ac_dir/$ac_word" || continue
2473 ac_cv_prog_GREP="$ac_prog"
2474 echo "$as_me:2474: found $ac_dir/$ac_word" >&5
2475 break
2476 done
2477
2478 fi
2479 fi
2480 GREP=$ac_cv_prog_GREP
2481 if test -n "$GREP"; then
2482   echo "$as_me:2482: result: $GREP" >&5
2483 echo "${ECHO_T}$GREP" >&6
2484 else
2485   echo "$as_me:2485: result: no" >&5
2486 echo "${ECHO_T}no" >&6
2487 fi
2488
2489   test -n "$GREP" && break
2490 done
2491 test -n "$GREP" || GREP=": "
2492
2493 echo "$as_me:2493: checking for egrep" >&5
2494 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2495 if test "${ac_cv_path_EGREP+set}" = set; then
2496   echo $ECHO_N "(cached) $ECHO_C" >&6
2497 else
2498   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2499    then ac_cv_path_EGREP="$GREP -E"
2500    else
2501      for ac_prog in gegrep egrep
2502 do
2503   # Extract the first word of "$ac_prog", so it can be a program name with args.
2504 set dummy $ac_prog; ac_word=$2
2505 echo "$as_me:2505: checking for $ac_word" >&5
2506 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2507 if test "${ac_cv_path_EGREP+set}" = set; then
2508   echo $ECHO_N "(cached) $ECHO_C" >&6
2509 else
2510   case $EGREP in
2511   [\\/]* | ?:[\\/]*)
2512   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2513   ;;
2514   *)
2515   ac_save_IFS=$IFS; IFS=$ac_path_separator
2516 ac_dummy="$PATH"
2517 for ac_dir in $ac_dummy; do
2518   IFS=$ac_save_IFS
2519   test -z "$ac_dir" && ac_dir=.
2520   if $as_executable_p "$ac_dir/$ac_word"; then
2521    ac_cv_path_EGREP="$ac_dir/$ac_word"
2522    echo "$as_me:2522: found $ac_dir/$ac_word" >&5
2523    break
2524 fi
2525 done
2526
2527   ;;
2528 esac
2529 fi
2530 EGREP=$ac_cv_path_EGREP
2531
2532 if test -n "$EGREP"; then
2533   echo "$as_me:2533: result: $EGREP" >&5
2534 echo "${ECHO_T}$EGREP" >&6
2535 else
2536   echo "$as_me:2536: result: no" >&5
2537 echo "${ECHO_T}no" >&6
2538 fi
2539
2540   test -n "$EGREP" && break
2541 done
2542 test -n "$EGREP" || EGREP=": "
2543
2544      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2544: error: cannot find workable egrep" >&5
2545 echo "$as_me: error: cannot find workable egrep" >&2;}
2546    { (exit 1); exit 1; }; }
2547    fi
2548 fi
2549 echo "$as_me:2549: result: $ac_cv_path_EGREP" >&5
2550 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2551  EGREP="$ac_cv_path_EGREP"
2552
2553 ac_ext=c
2554 ac_cpp='$CPP $CPPFLAGS'
2555 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2556 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2557 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2558 ac_main_return="return"
2559 echo "$as_me:2559: checking how to run the C preprocessor" >&5
2560 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2561 # On Suns, sometimes $CPP names a directory.
2562 if test -n "$CPP" && test -d "$CPP"; then
2563   CPP=
2564 fi
2565 if test -z "$CPP"; then
2566   if test "${ac_cv_prog_CPP+set}" = set; then
2567   echo $ECHO_N "(cached) $ECHO_C" >&6
2568 else
2569       # Double quotes because CPP needs to be expanded
2570     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2571     do
2572       ac_preproc_ok=false
2573 for ac_c_preproc_warn_flag in '' yes
2574 do
2575   # Use a header file that comes with gcc, so configuring glibc
2576   # with a fresh cross-compiler works.
2577   # On the NeXT, cc -E runs the code through the compiler's parser,
2578   # not just through cpp. "Syntax error" is here to catch this case.
2579   cat >"conftest.$ac_ext" <<_ACEOF
2580 #line 2580 "configure"
2581 #include "confdefs.h"
2582 #include <assert.h>
2583                      Syntax error
2584 _ACEOF
2585 if { (eval echo "$as_me:2585: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2586   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2587   ac_status=$?
2588   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2589   rm -f conftest.er1
2590   cat conftest.err >&5
2591   echo "$as_me:2591: \$? = $ac_status" >&5
2592   (exit "$ac_status"); } >/dev/null; then
2593   if test -s conftest.err; then
2594     ac_cpp_err=$ac_c_preproc_warn_flag
2595   else
2596     ac_cpp_err=
2597   fi
2598 else
2599   ac_cpp_err=yes
2600 fi
2601 if test -z "$ac_cpp_err"; then
2602   :
2603 else
2604   echo "$as_me: failed program was:" >&5
2605   cat "conftest.$ac_ext" >&5
2606   # Broken: fails on valid input.
2607 continue
2608 fi
2609 rm -f conftest.err "conftest.$ac_ext"
2610
2611   # OK, works on sane cases.  Now check whether non-existent headers
2612   # can be detected and how.
2613   cat >"conftest.$ac_ext" <<_ACEOF
2614 #line 2614 "configure"
2615 #include "confdefs.h"
2616 #include <ac_nonexistent.h>
2617 _ACEOF
2618 if { (eval echo "$as_me:2618: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2619   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2620   ac_status=$?
2621   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2622   rm -f conftest.er1
2623   cat conftest.err >&5
2624   echo "$as_me:2624: \$? = $ac_status" >&5
2625   (exit "$ac_status"); } >/dev/null; then
2626   if test -s conftest.err; then
2627     ac_cpp_err=$ac_c_preproc_warn_flag
2628   else
2629     ac_cpp_err=
2630   fi
2631 else
2632   ac_cpp_err=yes
2633 fi
2634 if test -z "$ac_cpp_err"; then
2635   # Broken: success on invalid input.
2636 continue
2637 else
2638   echo "$as_me: failed program was:" >&5
2639   cat "conftest.$ac_ext" >&5
2640   # Passes both tests.
2641 ac_preproc_ok=:
2642 break
2643 fi
2644 rm -f conftest.err "conftest.$ac_ext"
2645
2646 done
2647 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2648 rm -f conftest.err "conftest.$ac_ext"
2649 if $ac_preproc_ok; then
2650   break
2651 fi
2652
2653     done
2654     ac_cv_prog_CPP=$CPP
2655
2656 fi
2657   CPP=$ac_cv_prog_CPP
2658 else
2659   ac_cv_prog_CPP=$CPP
2660 fi
2661 echo "$as_me:2661: result: $CPP" >&5
2662 echo "${ECHO_T}$CPP" >&6
2663 ac_preproc_ok=false
2664 for ac_c_preproc_warn_flag in '' yes
2665 do
2666   # Use a header file that comes with gcc, so configuring glibc
2667   # with a fresh cross-compiler works.
2668   # On the NeXT, cc -E runs the code through the compiler's parser,
2669   # not just through cpp. "Syntax error" is here to catch this case.
2670   cat >"conftest.$ac_ext" <<_ACEOF
2671 #line 2671 "configure"
2672 #include "confdefs.h"
2673 #include <assert.h>
2674                      Syntax error
2675 _ACEOF
2676 if { (eval echo "$as_me:2676: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2677   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2678   ac_status=$?
2679   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2680   rm -f conftest.er1
2681   cat conftest.err >&5
2682   echo "$as_me:2682: \$? = $ac_status" >&5
2683   (exit "$ac_status"); } >/dev/null; then
2684   if test -s conftest.err; then
2685     ac_cpp_err=$ac_c_preproc_warn_flag
2686   else
2687     ac_cpp_err=
2688   fi
2689 else
2690   ac_cpp_err=yes
2691 fi
2692 if test -z "$ac_cpp_err"; then
2693   :
2694 else
2695   echo "$as_me: failed program was:" >&5
2696   cat "conftest.$ac_ext" >&5
2697   # Broken: fails on valid input.
2698 continue
2699 fi
2700 rm -f conftest.err "conftest.$ac_ext"
2701
2702   # OK, works on sane cases.  Now check whether non-existent headers
2703   # can be detected and how.
2704   cat >"conftest.$ac_ext" <<_ACEOF
2705 #line 2705 "configure"
2706 #include "confdefs.h"
2707 #include <ac_nonexistent.h>
2708 _ACEOF
2709 if { (eval echo "$as_me:2709: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2710   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2711   ac_status=$?
2712   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2713   rm -f conftest.er1
2714   cat conftest.err >&5
2715   echo "$as_me:2715: \$? = $ac_status" >&5
2716   (exit "$ac_status"); } >/dev/null; then
2717   if test -s conftest.err; then
2718     ac_cpp_err=$ac_c_preproc_warn_flag
2719   else
2720     ac_cpp_err=
2721   fi
2722 else
2723   ac_cpp_err=yes
2724 fi
2725 if test -z "$ac_cpp_err"; then
2726   # Broken: success on invalid input.
2727 continue
2728 else
2729   echo "$as_me: failed program was:" >&5
2730   cat "conftest.$ac_ext" >&5
2731   # Passes both tests.
2732 ac_preproc_ok=:
2733 break
2734 fi
2735 rm -f conftest.err "conftest.$ac_ext"
2736
2737 done
2738 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2739 rm -f conftest.err "conftest.$ac_ext"
2740 if $ac_preproc_ok; then
2741   :
2742 else
2743   { { echo "$as_me:2743: error: C preprocessor \"$CPP\" fails sanity check" >&5
2744 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2745    { (exit 1); exit 1; }; }
2746 fi
2747
2748 ac_ext=c
2749 ac_cpp='$CPP $CPPFLAGS'
2750 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2751 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2752 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2753 ac_main_return="return"
2754
2755 for ac_prog in mawk gawk nawk awk
2756 do
2757   # Extract the first word of "$ac_prog", so it can be a program name with args.
2758 set dummy $ac_prog; ac_word=$2
2759 echo "$as_me:2759: checking for $ac_word" >&5
2760 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2761 if test "${ac_cv_prog_AWK+set}" = set; then
2762   echo $ECHO_N "(cached) $ECHO_C" >&6
2763 else
2764   if test -n "$AWK"; then
2765   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2766 else
2767   ac_save_IFS=$IFS; IFS=$ac_path_separator
2768 ac_dummy="$PATH"
2769 for ac_dir in $ac_dummy; do
2770   IFS=$ac_save_IFS
2771   test -z "$ac_dir" && ac_dir=.
2772   $as_executable_p "$ac_dir/$ac_word" || continue
2773 ac_cv_prog_AWK="$ac_prog"
2774 echo "$as_me:2774: found $ac_dir/$ac_word" >&5
2775 break
2776 done
2777
2778 fi
2779 fi
2780 AWK=$ac_cv_prog_AWK
2781 if test -n "$AWK"; then
2782   echo "$as_me:2782: result: $AWK" >&5
2783 echo "${ECHO_T}$AWK" >&6
2784 else
2785   echo "$as_me:2785: result: no" >&5
2786 echo "${ECHO_T}no" >&6
2787 fi
2788
2789   test -n "$AWK" && break
2790 done
2791
2792 # Find a good install program.  We prefer a C program (faster),
2793 # so one script is as good as another.  But avoid the broken or
2794 # incompatible versions:
2795 # SysV /etc/install, /usr/sbin/install
2796 # SunOS /usr/etc/install
2797 # IRIX /sbin/install
2798 # AIX /bin/install
2799 # AmigaOS /C/install, which installs bootblocks on floppy discs
2800 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2801 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2802 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2803 # ./install, which can be erroneously created by make from ./install.sh.
2804 echo "$as_me:2804: checking for a BSD compatible install" >&5
2805 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2806 if test -z "$INSTALL"; then
2807 if test "${ac_cv_path_install+set}" = set; then
2808   echo $ECHO_N "(cached) $ECHO_C" >&6
2809 else
2810     ac_save_IFS=$IFS; IFS=$ac_path_separator
2811   for ac_dir in $PATH; do
2812     IFS=$ac_save_IFS
2813     # Account for people who put trailing slashes in PATH elements.
2814     case $ac_dir/ in
2815     / | ./ | .// | /cC/* \
2816     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2817     | /usr/ucb/* ) ;;
2818     *)
2819       # OSF1 and SCO ODT 3.0 have their own names for install.
2820       # Don't use installbsd from OSF since it installs stuff as root
2821       # by default.
2822       for ac_prog in ginstall scoinst install; do
2823         if $as_executable_p "$ac_dir/$ac_prog"; then
2824           if test $ac_prog = install &&
2825             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2826             # AIX install.  It has an incompatible calling convention.
2827             :
2828           elif test $ac_prog = install &&
2829             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2830             # program-specific install script used by HP pwplus--don't use.
2831             :
2832           else
2833             ac_cv_path_install="$ac_dir/$ac_prog -c"
2834             break 2
2835           fi
2836         fi
2837       done
2838       ;;
2839     esac
2840   done
2841
2842 fi
2843   if test "${ac_cv_path_install+set}" = set; then
2844     INSTALL=$ac_cv_path_install
2845   else
2846     # As a last resort, use the slow shell script.  We don't cache a
2847     # path for INSTALL within a source directory, because that will
2848     # break other packages using the cache if that directory is
2849     # removed, or if the path is relative.
2850     INSTALL=$ac_install_sh
2851   fi
2852 fi
2853 echo "$as_me:2853: result: $INSTALL" >&5
2854 echo "${ECHO_T}$INSTALL" >&6
2855
2856 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2857 # It thinks the first close brace ends the variable substitution.
2858 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2859
2860 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2861
2862 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2863
2864 case $INSTALL in
2865 (/*)
2866         ;;
2867 (*)
2868         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2869         test -z "$cf_dir" && cf_dir=.
2870         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2871         ;;
2872 esac
2873
2874 echo "$as_me:2874: checking if you want to install stripped executables" >&5
2875 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2876
2877 # Check whether --enable-stripping or --disable-stripping was given.
2878 if test "${enable_stripping+set}" = set; then
2879   enableval="$enable_stripping"
2880   test "$enableval" != no && enableval=yes
2881         if test "$enableval" != "yes" ; then
2882     enable_stripping=no
2883         else
2884                 enable_stripping=yes
2885         fi
2886 else
2887   enableval=yes
2888         enable_stripping=yes
2889
2890 fi;
2891 echo "$as_me:2891: result: $enable_stripping" >&5
2892 echo "${ECHO_T}$enable_stripping" >&6
2893
2894 if test "$enable_stripping" = yes
2895 then
2896         INSTALL_OPT_S="-s"
2897 else
2898         INSTALL_OPT_S=
2899 fi
2900
2901 : "${INSTALL:=install}"
2902 echo "$as_me:2902: checking if install accepts -p option" >&5
2903 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2904 if test "${cf_cv_install_p+set}" = set; then
2905   echo $ECHO_N "(cached) $ECHO_C" >&6
2906 else
2907
2908         rm -rf ./conftest*
2909         date >conftest.in
2910         mkdir conftest.out
2911         sleep 3
2912         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2913         then
2914                 if test -f conftest.out/conftest.in
2915                 then
2916                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2917                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2918                         if test -s conftest.err
2919                         then
2920                                 cf_cv_install_p=no
2921                         else
2922                                 cf_cv_install_p=yes
2923                         fi
2924                 else
2925                         cf_cv_install_p=no
2926                 fi
2927         else
2928                 cf_cv_install_p=no
2929         fi
2930         rm -rf ./conftest*
2931
2932 fi
2933 echo "$as_me:2933: result: $cf_cv_install_p" >&5
2934 echo "${ECHO_T}$cf_cv_install_p" >&6
2935
2936 echo "$as_me:2936: checking if install needs to be told about ownership" >&5
2937 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2938 case `$ac_config_guess` in
2939 (*minix)
2940         with_install_o=yes
2941         ;;
2942 (*)
2943         with_install_o=no
2944         ;;
2945 esac
2946
2947 echo "$as_me:2947: result: $with_install_o" >&5
2948 echo "${ECHO_T}$with_install_o" >&6
2949 if test "x$with_install_o" = xyes
2950 then
2951         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'`"
2952 else
2953         INSTALL_OPT_O=
2954 fi
2955
2956 for ac_prog in lint cppcheck splint
2957 do
2958   # Extract the first word of "$ac_prog", so it can be a program name with args.
2959 set dummy $ac_prog; ac_word=$2
2960 echo "$as_me:2960: checking for $ac_word" >&5
2961 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2962 if test "${ac_cv_prog_LINT+set}" = set; then
2963   echo $ECHO_N "(cached) $ECHO_C" >&6
2964 else
2965   if test -n "$LINT"; then
2966   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2967 else
2968   ac_save_IFS=$IFS; IFS=$ac_path_separator
2969 ac_dummy="$PATH"
2970 for ac_dir in $ac_dummy; do
2971   IFS=$ac_save_IFS
2972   test -z "$ac_dir" && ac_dir=.
2973   $as_executable_p "$ac_dir/$ac_word" || continue
2974 ac_cv_prog_LINT="$ac_prog"
2975 echo "$as_me:2975: found $ac_dir/$ac_word" >&5
2976 break
2977 done
2978
2979 fi
2980 fi
2981 LINT=$ac_cv_prog_LINT
2982 if test -n "$LINT"; then
2983   echo "$as_me:2983: result: $LINT" >&5
2984 echo "${ECHO_T}$LINT" >&6
2985 else
2986   echo "$as_me:2986: result: no" >&5
2987 echo "${ECHO_T}no" >&6
2988 fi
2989
2990   test -n "$LINT" && break
2991 done
2992
2993 case "x$LINT" in
2994 (xcppcheck|x*/cppcheck)
2995         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2996         ;;
2997 esac
2998
2999 echo "$as_me:2999: checking if filesystem supports mixed-case filenames" >&5
3000 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3001 if test "${cf_cv_mixedcase+set}" = set; then
3002   echo $ECHO_N "(cached) $ECHO_C" >&6
3003 else
3004
3005 if test "$cross_compiling" = yes ; then
3006         case "$target_alias" in
3007         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3008                 cf_cv_mixedcase=no
3009                 ;;
3010         (*)
3011                 cf_cv_mixedcase=yes
3012                 ;;
3013         esac
3014 else
3015         rm -f conftest CONFTEST
3016         echo test >conftest
3017         if test -f CONFTEST ; then
3018                 cf_cv_mixedcase=no
3019         else
3020                 cf_cv_mixedcase=yes
3021         fi
3022         rm -f conftest CONFTEST
3023 fi
3024
3025 fi
3026 echo "$as_me:3026: result: $cf_cv_mixedcase" >&5
3027 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3028 test "$cf_cv_mixedcase" = yes &&
3029 cat >>confdefs.h <<\EOF
3030 #define MIXEDCASE_FILENAMES 1
3031 EOF
3032
3033 for ac_prog in exctags ctags
3034 do
3035   # Extract the first word of "$ac_prog", so it can be a program name with args.
3036 set dummy $ac_prog; ac_word=$2
3037 echo "$as_me:3037: checking for $ac_word" >&5
3038 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3039 if test "${ac_cv_prog_CTAGS+set}" = set; then
3040   echo $ECHO_N "(cached) $ECHO_C" >&6
3041 else
3042   if test -n "$CTAGS"; then
3043   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3044 else
3045   ac_save_IFS=$IFS; IFS=$ac_path_separator
3046 ac_dummy="$PATH"
3047 for ac_dir in $ac_dummy; do
3048   IFS=$ac_save_IFS
3049   test -z "$ac_dir" && ac_dir=.
3050   $as_executable_p "$ac_dir/$ac_word" || continue
3051 ac_cv_prog_CTAGS="$ac_prog"
3052 echo "$as_me:3052: found $ac_dir/$ac_word" >&5
3053 break
3054 done
3055
3056 fi
3057 fi
3058 CTAGS=$ac_cv_prog_CTAGS
3059 if test -n "$CTAGS"; then
3060   echo "$as_me:3060: result: $CTAGS" >&5
3061 echo "${ECHO_T}$CTAGS" >&6
3062 else
3063   echo "$as_me:3063: result: no" >&5
3064 echo "${ECHO_T}no" >&6
3065 fi
3066
3067   test -n "$CTAGS" && break
3068 done
3069
3070 for ac_prog in exetags etags
3071 do
3072   # Extract the first word of "$ac_prog", so it can be a program name with args.
3073 set dummy $ac_prog; ac_word=$2
3074 echo "$as_me:3074: checking for $ac_word" >&5
3075 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3076 if test "${ac_cv_prog_ETAGS+set}" = set; then
3077   echo $ECHO_N "(cached) $ECHO_C" >&6
3078 else
3079   if test -n "$ETAGS"; then
3080   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3081 else
3082   ac_save_IFS=$IFS; IFS=$ac_path_separator
3083 ac_dummy="$PATH"
3084 for ac_dir in $ac_dummy; do
3085   IFS=$ac_save_IFS
3086   test -z "$ac_dir" && ac_dir=.
3087   $as_executable_p "$ac_dir/$ac_word" || continue
3088 ac_cv_prog_ETAGS="$ac_prog"
3089 echo "$as_me:3089: found $ac_dir/$ac_word" >&5
3090 break
3091 done
3092
3093 fi
3094 fi
3095 ETAGS=$ac_cv_prog_ETAGS
3096 if test -n "$ETAGS"; then
3097   echo "$as_me:3097: result: $ETAGS" >&5
3098 echo "${ECHO_T}$ETAGS" >&6
3099 else
3100   echo "$as_me:3100: result: no" >&5
3101 echo "${ECHO_T}no" >&6
3102 fi
3103
3104   test -n "$ETAGS" && break
3105 done
3106
3107 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3108 set dummy ${CTAGS:-ctags}; ac_word=$2
3109 echo "$as_me:3109: checking for $ac_word" >&5
3110 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3111 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3112   echo $ECHO_N "(cached) $ECHO_C" >&6
3113 else
3114   if test -n "$MAKE_LOWER_TAGS"; then
3115   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3116 else
3117   ac_save_IFS=$IFS; IFS=$ac_path_separator
3118 ac_dummy="$PATH"
3119 for ac_dir in $ac_dummy; do
3120   IFS=$ac_save_IFS
3121   test -z "$ac_dir" && ac_dir=.
3122   $as_executable_p "$ac_dir/$ac_word" || continue
3123 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3124 echo "$as_me:3124: found $ac_dir/$ac_word" >&5
3125 break
3126 done
3127
3128   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3129 fi
3130 fi
3131 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3132 if test -n "$MAKE_LOWER_TAGS"; then
3133   echo "$as_me:3133: result: $MAKE_LOWER_TAGS" >&5
3134 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3135 else
3136   echo "$as_me:3136: result: no" >&5
3137 echo "${ECHO_T}no" >&6
3138 fi
3139
3140 if test "$cf_cv_mixedcase" = yes ; then
3141         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3142 set dummy ${ETAGS:-etags}; ac_word=$2
3143 echo "$as_me:3143: checking for $ac_word" >&5
3144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3145 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3146   echo $ECHO_N "(cached) $ECHO_C" >&6
3147 else
3148   if test -n "$MAKE_UPPER_TAGS"; then
3149   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3150 else
3151   ac_save_IFS=$IFS; IFS=$ac_path_separator
3152 ac_dummy="$PATH"
3153 for ac_dir in $ac_dummy; do
3154   IFS=$ac_save_IFS
3155   test -z "$ac_dir" && ac_dir=.
3156   $as_executable_p "$ac_dir/$ac_word" || continue
3157 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3158 echo "$as_me:3158: found $ac_dir/$ac_word" >&5
3159 break
3160 done
3161
3162   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3163 fi
3164 fi
3165 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3166 if test -n "$MAKE_UPPER_TAGS"; then
3167   echo "$as_me:3167: result: $MAKE_UPPER_TAGS" >&5
3168 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3169 else
3170   echo "$as_me:3170: result: no" >&5
3171 echo "${ECHO_T}no" >&6
3172 fi
3173
3174 else
3175         MAKE_UPPER_TAGS=no
3176 fi
3177
3178 if test "$MAKE_UPPER_TAGS" = yes ; then
3179         MAKE_UPPER_TAGS=
3180 else
3181         MAKE_UPPER_TAGS="#"
3182 fi
3183
3184 if test "$MAKE_LOWER_TAGS" = yes ; then
3185         MAKE_LOWER_TAGS=
3186 else
3187         MAKE_LOWER_TAGS="#"
3188 fi
3189
3190 echo "$as_me:3190: checking if -lm needed for math functions" >&5
3191 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3192 if test "${cf_cv_need_libm+set}" = set; then
3193   echo $ECHO_N "(cached) $ECHO_C" >&6
3194 else
3195
3196         cat >"conftest.$ac_ext" <<_ACEOF
3197 #line 3197 "configure"
3198 #include "confdefs.h"
3199
3200         #include <stdio.h>
3201         #include <stdlib.h>
3202         #include <math.h>
3203
3204 int
3205 main (void)
3206 {
3207 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3208   ;
3209   return 0;
3210 }
3211 _ACEOF
3212 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3213 if { (eval echo "$as_me:3213: \"$ac_link\"") >&5
3214   (eval $ac_link) 2>&5
3215   ac_status=$?
3216   echo "$as_me:3216: \$? = $ac_status" >&5
3217   (exit "$ac_status"); } &&
3218          { ac_try='test -s "conftest$ac_exeext"'
3219   { (eval echo "$as_me:3219: \"$ac_try\"") >&5
3220   (eval $ac_try) 2>&5
3221   ac_status=$?
3222   echo "$as_me:3222: \$? = $ac_status" >&5
3223   (exit "$ac_status"); }; }; then
3224   cf_cv_need_libm=no
3225 else
3226   echo "$as_me: failed program was:" >&5
3227 cat "conftest.$ac_ext" >&5
3228 cf_cv_need_libm=yes
3229 fi
3230 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3231 fi
3232 echo "$as_me:3232: result: $cf_cv_need_libm" >&5
3233 echo "${ECHO_T}$cf_cv_need_libm" >&6
3234 if test "$cf_cv_need_libm" = yes
3235 then
3236 MATH_LIB=-lm
3237 fi
3238
3239 top_builddir=`pwd`
3240
3241 CC_G_OPT="-g"
3242 CC_SHARED_OPTS=unknown
3243 CPPFLAGS="$CPPFLAGS"
3244 DFT_DEP_SUFFIX=""
3245 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3246 DFT_UPR_MODEL="NORMAL"
3247 LD="ld"
3248 LDFLAGS_SHARED=""
3249 LDFLAGS_STATIC=""
3250 LD_MODEL=""
3251 LD_SHARED_OPTS=""
3252 LIBTOOL=""
3253 LIBTOOL_OPTS=""
3254 LIB_CLEAN=""
3255 LIB_COMPILE=""
3256 LIB_LINK='${CC}'
3257 LINK_TESTS=""
3258 LOCAL_LDFLAGS=""
3259 PACKAGE="ncurses-examples"
3260 PTHREAD="-lm"
3261 TEST_ARGS=""
3262 TEST_DEPS=""
3263 TEST_LIBS=""
3264 TINFO_LDFLAGS=''
3265 TINFO_LIBS='$(LIBS_CURSES)'
3266 cf_cv_abi_version=""
3267 cf_cv_rel_version=""
3268 includesubdir=""
3269
3270 cf_cv_screen=curses
3271 cf_cv_libtype=
3272
3273 echo "$as_me:3273: checking for fgrep" >&5
3274 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3275 if test "${ac_cv_path_FGREP+set}" = set; then
3276   echo $ECHO_N "(cached) $ECHO_C" >&6
3277 else
3278   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3279    then ac_cv_path_FGREP="$GREP -F"
3280    else
3281      for ac_prog in gfgrep fgrep
3282 do
3283   # Extract the first word of "$ac_prog", so it can be a program name with args.
3284 set dummy $ac_prog; ac_word=$2
3285 echo "$as_me:3285: checking for $ac_word" >&5
3286 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3287 if test "${ac_cv_path_FGREP+set}" = set; then
3288   echo $ECHO_N "(cached) $ECHO_C" >&6
3289 else
3290   case $FGREP in
3291   [\\/]* | ?:[\\/]*)
3292   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3293   ;;
3294   *)
3295   ac_save_IFS=$IFS; IFS=$ac_path_separator
3296 ac_dummy="$PATH"
3297 for ac_dir in $ac_dummy; do
3298   IFS=$ac_save_IFS
3299   test -z "$ac_dir" && ac_dir=.
3300   if $as_executable_p "$ac_dir/$ac_word"; then
3301    ac_cv_path_FGREP="$ac_dir/$ac_word"
3302    echo "$as_me:3302: found $ac_dir/$ac_word" >&5
3303    break
3304 fi
3305 done
3306
3307   ;;
3308 esac
3309 fi
3310 FGREP=$ac_cv_path_FGREP
3311
3312 if test -n "$FGREP"; then
3313   echo "$as_me:3313: result: $FGREP" >&5
3314 echo "${ECHO_T}$FGREP" >&6
3315 else
3316   echo "$as_me:3316: result: no" >&5
3317 echo "${ECHO_T}no" >&6
3318 fi
3319
3320   test -n "$FGREP" && break
3321 done
3322 test -n "$FGREP" || FGREP=": "
3323
3324      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3324: error: cannot find workable fgrep" >&5
3325 echo "$as_me: error: cannot find workable fgrep" >&2;}
3326    { (exit 1); exit 1; }; }
3327    fi
3328 fi
3329 echo "$as_me:3329: result: $ac_cv_path_FGREP" >&5
3330 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3331  FGREP="$ac_cv_path_FGREP"
3332
3333 if test "$GCC" = yes || test "$GXX" = yes
3334 then
3335 cat > conftest.i <<EOF
3336 #ifndef GCC_PRINTF
3337 #define GCC_PRINTF 0
3338 #endif
3339 #ifndef GCC_SCANF
3340 #define GCC_SCANF 0
3341 #endif
3342 #ifndef GCC_NORETURN
3343 #define GCC_NORETURN /* nothing */
3344 #endif
3345 #ifndef GCC_UNUSED
3346 #define GCC_UNUSED /* nothing */
3347 #endif
3348 EOF
3349 if test "$GCC" = yes
3350 then
3351         { echo "$as_me:3351: checking for $CC __attribute__ directives..." >&5
3352 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3353 cat > "conftest.$ac_ext" <<EOF
3354 #line 3354 "${as_me:-configure}"
3355 #include "confdefs.h"
3356 #include "conftest.h"
3357 #include "conftest.i"
3358 #if     GCC_PRINTF
3359 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3360 #else
3361 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3362 #endif
3363 #if     GCC_SCANF
3364 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3365 #else
3366 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3367 #endif
3368 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3369 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3370 extern void foo(void) GCC_NORETURN;
3371 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3372 EOF
3373         cf_printf_attribute=no
3374         cf_scanf_attribute=no
3375         for cf_attribute in scanf printf unused noreturn
3376         do
3377
3378 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3379
3380                 cf_directive="__attribute__(($cf_attribute))"
3381                 echo "checking for $CC $cf_directive" 1>&5
3382
3383                 case "$cf_attribute" in
3384                 (printf)
3385                         cf_printf_attribute=yes
3386                         cat >conftest.h <<EOF
3387 #define GCC_$cf_ATTRIBUTE 1
3388 EOF
3389                         ;;
3390                 (scanf)
3391                         cf_scanf_attribute=yes
3392                         cat >conftest.h <<EOF
3393 #define GCC_$cf_ATTRIBUTE 1
3394 EOF
3395                         ;;
3396                 (*)
3397                         cat >conftest.h <<EOF
3398 #define GCC_$cf_ATTRIBUTE $cf_directive
3399 EOF
3400                         ;;
3401                 esac
3402
3403                 if { (eval echo "$as_me:3403: \"$ac_compile\"") >&5
3404   (eval $ac_compile) 2>&5
3405   ac_status=$?
3406   echo "$as_me:3406: \$? = $ac_status" >&5
3407   (exit "$ac_status"); }; then
3408                         test -n "$verbose" && echo "$as_me:3408: result: ... $cf_attribute" >&5
3409 echo "${ECHO_T}... $cf_attribute" >&6
3410                         cat conftest.h >>confdefs.h
3411                         case "$cf_attribute" in
3412                         (noreturn)
3413
3414 cat >>confdefs.h <<EOF
3415 #define GCC_NORETURN $cf_directive
3416 EOF
3417
3418                                 ;;
3419                         (printf)
3420                                 cf_value='/* nothing */'
3421                                 if test "$cf_printf_attribute" != no ; then
3422                                         cf_value='__attribute__((format(printf,fmt,var)))'
3423
3424 cat >>confdefs.h <<\EOF
3425 #define GCC_PRINTF 1
3426 EOF
3427
3428                                 fi
3429
3430 cat >>confdefs.h <<EOF
3431 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3432 EOF
3433
3434                                 ;;
3435                         (scanf)
3436                                 cf_value='/* nothing */'
3437                                 if test "$cf_scanf_attribute" != no ; then
3438                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3439
3440 cat >>confdefs.h <<\EOF
3441 #define GCC_SCANF 1
3442 EOF
3443
3444                                 fi
3445
3446 cat >>confdefs.h <<EOF
3447 #define GCC_SCANFLIKE(fmt,var) $cf_value
3448 EOF
3449
3450                                 ;;
3451                         (unused)
3452
3453 cat >>confdefs.h <<EOF
3454 #define GCC_UNUSED $cf_directive
3455 EOF
3456
3457                                 ;;
3458                         esac
3459                 fi
3460         done
3461 else
3462         ${FGREP-fgrep} define conftest.i >>confdefs.h
3463 fi
3464 rm -rf ./conftest*
3465 fi
3466
3467 echo "$as_me:3467: checking if you want to work around bogus compiler/loader warnings" >&5
3468 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3469
3470 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3471 if test "${enable_string_hacks+set}" = set; then
3472   enableval="$enable_string_hacks"
3473   enable_string_hacks=$enableval
3474 else
3475   enable_string_hacks=no
3476 fi;
3477 echo "$as_me:3477: result: $enable_string_hacks" >&5
3478 echo "${ECHO_T}$enable_string_hacks" >&6
3479
3480 if test "x$enable_string_hacks" = "xyes"; then
3481
3482 cat >>confdefs.h <<\EOF
3483 #define USE_STRING_HACKS 1
3484 EOF
3485
3486         { echo "$as_me:3486: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3487 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3488         echo "$as_me:3488: checking for strlcat" >&5
3489 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3490 if test "${ac_cv_func_strlcat+set}" = set; then
3491   echo $ECHO_N "(cached) $ECHO_C" >&6
3492 else
3493   cat >"conftest.$ac_ext" <<_ACEOF
3494 #line 3494 "configure"
3495 #include "confdefs.h"
3496 #define strlcat autoconf_temporary
3497 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3498 #undef strlcat
3499
3500 #ifdef __cplusplus
3501 extern "C"
3502 #endif
3503
3504 /* We use char because int might match the return type of a gcc2
3505    builtin and then its argument prototype would still apply.  */
3506 char strlcat (void);
3507
3508 int
3509 main (void)
3510 {
3511
3512 /* The GNU C library defines stubs for functions which it implements
3513     to always fail with ENOSYS.  Some functions are actually named
3514     something starting with __ and the normal name is an alias.  */
3515 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3516 #error found stub for strlcat
3517 #endif
3518
3519         return strlcat ();
3520   ;
3521   return 0;
3522 }
3523 _ACEOF
3524 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3525 if { (eval echo "$as_me:3525: \"$ac_link\"") >&5
3526   (eval $ac_link) 2>&5
3527   ac_status=$?
3528   echo "$as_me:3528: \$? = $ac_status" >&5
3529   (exit "$ac_status"); } &&
3530          { ac_try='test -s "conftest$ac_exeext"'
3531   { (eval echo "$as_me:3531: \"$ac_try\"") >&5
3532   (eval $ac_try) 2>&5
3533   ac_status=$?
3534   echo "$as_me:3534: \$? = $ac_status" >&5
3535   (exit "$ac_status"); }; }; then
3536   ac_cv_func_strlcat=yes
3537 else
3538   echo "$as_me: failed program was:" >&5
3539 cat "conftest.$ac_ext" >&5
3540 ac_cv_func_strlcat=no
3541 fi
3542 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3543 fi
3544 echo "$as_me:3544: result: $ac_cv_func_strlcat" >&5
3545 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3546 if test "$ac_cv_func_strlcat" = yes; then
3547
3548 cat >>confdefs.h <<\EOF
3549 #define HAVE_STRLCAT 1
3550 EOF
3551
3552 else
3553
3554                 echo "$as_me:3554: checking for strlcat in -lbsd" >&5
3555 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3556 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3557   echo $ECHO_N "(cached) $ECHO_C" >&6
3558 else
3559   ac_check_lib_save_LIBS=$LIBS
3560 LIBS="-lbsd  $LIBS"
3561 cat >"conftest.$ac_ext" <<_ACEOF
3562 #line 3562 "configure"
3563 #include "confdefs.h"
3564
3565 /* Override any gcc2 internal prototype to avoid an error.  */
3566 #ifdef __cplusplus
3567 extern "C"
3568 #endif
3569 /* We use char because int might match the return type of a gcc2
3570    builtin and then its argument prototype would still apply.  */
3571 char strlcat ();
3572 int
3573 main (void)
3574 {
3575 strlcat ();
3576   ;
3577   return 0;
3578 }
3579 _ACEOF
3580 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3581 if { (eval echo "$as_me:3581: \"$ac_link\"") >&5
3582   (eval $ac_link) 2>&5
3583   ac_status=$?
3584   echo "$as_me:3584: \$? = $ac_status" >&5
3585   (exit "$ac_status"); } &&
3586          { ac_try='test -s "conftest$ac_exeext"'
3587   { (eval echo "$as_me:3587: \"$ac_try\"") >&5
3588   (eval $ac_try) 2>&5
3589   ac_status=$?
3590   echo "$as_me:3590: \$? = $ac_status" >&5
3591   (exit "$ac_status"); }; }; then
3592   ac_cv_lib_bsd_strlcat=yes
3593 else
3594   echo "$as_me: failed program was:" >&5
3595 cat "conftest.$ac_ext" >&5
3596 ac_cv_lib_bsd_strlcat=no
3597 fi
3598 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3599 LIBS=$ac_check_lib_save_LIBS
3600 fi
3601 echo "$as_me:3601: result: $ac_cv_lib_bsd_strlcat" >&5
3602 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3603 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3604
3605 cf_add_libs="$LIBS"
3606 # reverse order
3607 cf_add_0lib=
3608 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3609 # filter duplicates
3610 for cf_add_1lib in $cf_add_0lib; do
3611         for cf_add_2lib in $cf_add_libs; do
3612                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3613                         cf_add_1lib=
3614                         break
3615                 fi
3616         done
3617         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3618 done
3619 LIBS="$cf_add_libs"
3620
3621 for ac_header in bsd/string.h
3622 do
3623 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3624 echo "$as_me:3624: checking for $ac_header" >&5
3625 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3626 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3627   echo $ECHO_N "(cached) $ECHO_C" >&6
3628 else
3629   cat >"conftest.$ac_ext" <<_ACEOF
3630 #line 3630 "configure"
3631 #include "confdefs.h"
3632 #include <$ac_header>
3633 _ACEOF
3634 if { (eval echo "$as_me:3634: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3635   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3636   ac_status=$?
3637   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3638   rm -f conftest.er1
3639   cat conftest.err >&5
3640   echo "$as_me:3640: \$? = $ac_status" >&5
3641   (exit "$ac_status"); } >/dev/null; then
3642   if test -s conftest.err; then
3643     ac_cpp_err=$ac_c_preproc_warn_flag
3644   else
3645     ac_cpp_err=
3646   fi
3647 else
3648   ac_cpp_err=yes
3649 fi
3650 if test -z "$ac_cpp_err"; then
3651   eval "$as_ac_Header=yes"
3652 else
3653   echo "$as_me: failed program was:" >&5
3654   cat "conftest.$ac_ext" >&5
3655   eval "$as_ac_Header=no"
3656 fi
3657 rm -f conftest.err "conftest.$ac_ext"
3658 fi
3659 echo "$as_me:3659: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3660 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3661 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3662   cat >>confdefs.h <<EOF
3663 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3664 EOF
3665
3666 fi
3667 done
3668
3669 cat >>confdefs.h <<\EOF
3670 #define HAVE_STRLCAT 1
3671 EOF
3672
3673 fi
3674
3675 fi
3676
3677 for ac_func in strlcpy snprintf
3678 do
3679 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3680 echo "$as_me:3680: checking for $ac_func" >&5
3681 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3682 if eval "test \"\${$as_ac_var+set}\" = set"; then
3683   echo $ECHO_N "(cached) $ECHO_C" >&6
3684 else
3685   cat >"conftest.$ac_ext" <<_ACEOF
3686 #line 3686 "configure"
3687 #include "confdefs.h"
3688 #define $ac_func autoconf_temporary
3689 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3690 #undef $ac_func
3691
3692 #ifdef __cplusplus
3693 extern "C"
3694 #endif
3695
3696 /* We use char because int might match the return type of a gcc2
3697    builtin and then its argument prototype would still apply.  */
3698 char $ac_func (void);
3699
3700 int
3701 main (void)
3702 {
3703
3704 /* The GNU C library defines stubs for functions which it implements
3705     to always fail with ENOSYS.  Some functions are actually named
3706     something starting with __ and the normal name is an alias.  */
3707 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3708 #error found stub for $ac_func
3709 #endif
3710
3711         return $ac_func ();
3712   ;
3713   return 0;
3714 }
3715 _ACEOF
3716 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3717 if { (eval echo "$as_me:3717: \"$ac_link\"") >&5
3718   (eval $ac_link) 2>&5
3719   ac_status=$?
3720   echo "$as_me:3720: \$? = $ac_status" >&5
3721   (exit "$ac_status"); } &&
3722          { ac_try='test -s "conftest$ac_exeext"'
3723   { (eval echo "$as_me:3723: \"$ac_try\"") >&5
3724   (eval $ac_try) 2>&5
3725   ac_status=$?
3726   echo "$as_me:3726: \$? = $ac_status" >&5
3727   (exit "$ac_status"); }; }; then
3728   eval "$as_ac_var=yes"
3729 else
3730   echo "$as_me: failed program was:" >&5
3731 cat "conftest.$ac_ext" >&5
3732 eval "$as_ac_var=no"
3733 fi
3734 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3735 fi
3736 echo "$as_me:3736: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3737 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3738 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3739   cat >>confdefs.h <<EOF
3740 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3741 EOF
3742
3743 fi
3744 done
3745
3746 fi
3747
3748 echo "$as_me:3748: checking if the POSIX test-macros are already defined" >&5
3749 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3750 if test "${cf_cv_posix_visible+set}" = set; then
3751   echo $ECHO_N "(cached) $ECHO_C" >&6
3752 else
3753
3754 cat >"conftest.$ac_ext" <<_ACEOF
3755 #line 3755 "configure"
3756 #include "confdefs.h"
3757 #include <stdio.h>
3758 int
3759 main (void)
3760 {
3761
3762 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3763         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3764         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3765         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3766 #error conflicting symbols found
3767 #endif
3768
3769   ;
3770   return 0;
3771 }
3772 _ACEOF
3773 rm -f "conftest.$ac_objext"
3774 if { (eval echo "$as_me:3774: \"$ac_compile\"") >&5
3775   (eval $ac_compile) 2>&5
3776   ac_status=$?
3777   echo "$as_me:3777: \$? = $ac_status" >&5
3778   (exit "$ac_status"); } &&
3779          { ac_try='test -s "conftest.$ac_objext"'
3780   { (eval echo "$as_me:3780: \"$ac_try\"") >&5
3781   (eval $ac_try) 2>&5
3782   ac_status=$?
3783   echo "$as_me:3783: \$? = $ac_status" >&5
3784   (exit "$ac_status"); }; }; then
3785   cf_cv_posix_visible=no
3786 else
3787   echo "$as_me: failed program was:" >&5
3788 cat "conftest.$ac_ext" >&5
3789 cf_cv_posix_visible=yes
3790 fi
3791 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3792
3793 fi
3794 echo "$as_me:3794: result: $cf_cv_posix_visible" >&5
3795 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3796
3797 if test "$cf_cv_posix_visible" = no; then
3798
3799 cf_XOPEN_SOURCE=600
3800 cf_POSIX_C_SOURCE=199506L
3801 cf_xopen_source=
3802
3803 case "$host_os" in
3804 (aix[4-7]*)
3805         cf_xopen_source="-D_ALL_SOURCE"
3806         ;;
3807 (msys)
3808         cf_XOPEN_SOURCE=600
3809         ;;
3810 (darwin[0-8].*)
3811         cf_xopen_source="-D_APPLE_C_SOURCE"
3812         ;;
3813 (darwin*)
3814         cf_xopen_source="-D_DARWIN_C_SOURCE"
3815         cf_XOPEN_SOURCE=
3816         ;;
3817 (freebsd*|dragonfly*|midnightbsd*)
3818         # 5.x headers associate
3819         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3820         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3821         cf_POSIX_C_SOURCE=200112L
3822         cf_XOPEN_SOURCE=600
3823         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3824         ;;
3825 (hpux11*)
3826         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3827         ;;
3828 (hpux*)
3829         cf_xopen_source="-D_HPUX_SOURCE"
3830         ;;
3831 (irix[56].*)
3832         cf_xopen_source="-D_SGI_SOURCE"
3833         cf_XOPEN_SOURCE=
3834         ;;
3835 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3836
3837 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3838
3839 echo "$as_me:3839: checking if this is the GNU C library" >&5
3840 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3841 if test "${cf_cv_gnu_library+set}" = set; then
3842   echo $ECHO_N "(cached) $ECHO_C" >&6
3843 else
3844
3845 cat >"conftest.$ac_ext" <<_ACEOF
3846 #line 3846 "configure"
3847 #include "confdefs.h"
3848 #include <sys/types.h>
3849 int
3850 main (void)
3851 {
3852
3853         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3854                 return 0;
3855         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3856                 return 0;
3857         #else
3858         #       error not GNU C library
3859         #endif
3860   ;
3861   return 0;
3862 }
3863 _ACEOF
3864 rm -f "conftest.$ac_objext"
3865 if { (eval echo "$as_me:3865: \"$ac_compile\"") >&5
3866   (eval $ac_compile) 2>&5
3867   ac_status=$?
3868   echo "$as_me:3868: \$? = $ac_status" >&5
3869   (exit "$ac_status"); } &&
3870          { ac_try='test -s "conftest.$ac_objext"'
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   cf_cv_gnu_library=yes
3877 else
3878   echo "$as_me: failed program was:" >&5
3879 cat "conftest.$ac_ext" >&5
3880 cf_cv_gnu_library=no
3881 fi
3882 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3883
3884 fi
3885 echo "$as_me:3885: result: $cf_cv_gnu_library" >&5
3886 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3887
3888 if test x$cf_cv_gnu_library = xyes; then
3889
3890         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3891         # was changed to help a little.  newlib incorporated the change about 4
3892         # years later.
3893         echo "$as_me:3893: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3894 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3895 if test "${cf_cv_gnu_library_219+set}" = set; then
3896   echo $ECHO_N "(cached) $ECHO_C" >&6
3897 else
3898
3899                 cf_save="$CPPFLAGS"
3900
3901         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3902         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3903
3904                 cat >"conftest.$ac_ext" <<_ACEOF
3905 #line 3905 "configure"
3906 #include "confdefs.h"
3907 #include <sys/types.h>
3908 int
3909 main (void)
3910 {
3911
3912                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3913                                 return 0;
3914                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3915                                 return 0;
3916                         #else
3917                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3918                         #endif
3919   ;
3920   return 0;
3921 }
3922 _ACEOF
3923 rm -f "conftest.$ac_objext"
3924 if { (eval echo "$as_me:3924: \"$ac_compile\"") >&5
3925   (eval $ac_compile) 2>&5
3926   ac_status=$?
3927   echo "$as_me:3927: \$? = $ac_status" >&5
3928   (exit "$ac_status"); } &&
3929          { ac_try='test -s "conftest.$ac_objext"'
3930   { (eval echo "$as_me:3930: \"$ac_try\"") >&5
3931   (eval $ac_try) 2>&5
3932   ac_status=$?
3933   echo "$as_me:3933: \$? = $ac_status" >&5
3934   (exit "$ac_status"); }; }; then
3935   cf_cv_gnu_library_219=yes
3936 else
3937   echo "$as_me: failed program was:" >&5
3938 cat "conftest.$ac_ext" >&5
3939 cf_cv_gnu_library_219=no
3940 fi
3941 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3942                 CPPFLAGS="$cf_save"
3943
3944 fi
3945 echo "$as_me:3945: result: $cf_cv_gnu_library_219" >&5
3946 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3947
3948         if test "x$cf_cv_gnu_library_219" = xyes; then
3949                 cf_save="$CPPFLAGS"
3950                 echo "$as_me:3950: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3951 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3952 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3953   echo $ECHO_N "(cached) $ECHO_C" >&6
3954 else
3955
3956 cf_fix_cppflags=no
3957 cf_new_cflags=
3958 cf_new_cppflags=
3959 cf_new_extra_cppflags=
3960
3961 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3962 do
3963 case "$cf_fix_cppflags" in
3964 (no)
3965         case "$cf_add_cflags" in
3966         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3967                 case "$cf_add_cflags" in
3968                 (-D*)
3969                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3970
3971                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3972                                 && test -z "${cf_tst_cflags}" \
3973                                 && cf_fix_cppflags=yes
3974
3975                         if test "$cf_fix_cppflags" = yes ; then
3976
3977         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3978         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3979
3980                                 continue
3981                         elif test "${cf_tst_cflags}" = "\"'" ; then
3982
3983         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3984         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3985
3986                                 continue
3987                         fi
3988                         ;;
3989                 esac
3990                 case "$CPPFLAGS" in
3991                 (*$cf_add_cflags)
3992                         ;;
3993                 (*)
3994                         case "$cf_add_cflags" in
3995                         (-D*)
3996                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3997
3998 CPPFLAGS=`echo "$CPPFLAGS" | \
3999         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4000                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4001
4002                                 ;;
4003                         esac
4004
4005         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4006         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4007
4008                         ;;
4009                 esac
4010                 ;;
4011         (*)
4012
4013         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4014         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4015
4016                 ;;
4017         esac
4018         ;;
4019 (yes)
4020
4021         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4022         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4023
4024         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4025
4026         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4027                 && test -z "${cf_tst_cflags}" \
4028                 && cf_fix_cppflags=no
4029         ;;
4030 esac
4031 done
4032
4033 if test -n "$cf_new_cflags" ; then
4034
4035         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4036         CFLAGS="${CFLAGS}$cf_new_cflags"
4037
4038 fi
4039
4040 if test -n "$cf_new_cppflags" ; then
4041
4042         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4043         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4044
4045 fi
4046
4047 if test -n "$cf_new_extra_cppflags" ; then
4048
4049         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4050         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4051
4052 fi
4053
4054                         cat >"conftest.$ac_ext" <<_ACEOF
4055 #line 4055 "configure"
4056 #include "confdefs.h"
4057
4058                                 #include <limits.h>
4059                                 #include <sys/types.h>
4060
4061 int
4062 main (void)
4063 {
4064
4065                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4066                                         return 0;
4067                                 #else
4068                                 #       error GNU C library is too old
4069                                 #endif
4070   ;
4071   return 0;
4072 }
4073 _ACEOF
4074 rm -f "conftest.$ac_objext"
4075 if { (eval echo "$as_me:4075: \"$ac_compile\"") >&5
4076   (eval $ac_compile) 2>&5
4077   ac_status=$?
4078   echo "$as_me:4078: \$? = $ac_status" >&5
4079   (exit "$ac_status"); } &&
4080          { ac_try='test -s "conftest.$ac_objext"'
4081   { (eval echo "$as_me:4081: \"$ac_try\"") >&5
4082   (eval $ac_try) 2>&5
4083   ac_status=$?
4084   echo "$as_me:4084: \$? = $ac_status" >&5
4085   (exit "$ac_status"); }; }; then
4086   cf_cv_gnu_dftsrc_219=yes
4087 else
4088   echo "$as_me: failed program was:" >&5
4089 cat "conftest.$ac_ext" >&5
4090 cf_cv_gnu_dftsrc_219=no
4091 fi
4092 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4093
4094 fi
4095 echo "$as_me:4095: result: $cf_cv_gnu_dftsrc_219" >&5
4096 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4097                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4098         else
4099                 cf_cv_gnu_dftsrc_219=maybe
4100         fi
4101
4102         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4103
4104                 echo "$as_me:4104: checking if we must define _GNU_SOURCE" >&5
4105 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4106 if test "${cf_cv_gnu_source+set}" = set; then
4107   echo $ECHO_N "(cached) $ECHO_C" >&6
4108 else
4109
4110                 cat >"conftest.$ac_ext" <<_ACEOF
4111 #line 4111 "configure"
4112 #include "confdefs.h"
4113 #include <sys/types.h>
4114 int
4115 main (void)
4116 {
4117
4118                         #ifndef _XOPEN_SOURCE
4119                         #error  expected _XOPEN_SOURCE to be defined
4120                         #endif
4121   ;
4122   return 0;
4123 }
4124 _ACEOF
4125 rm -f "conftest.$ac_objext"
4126 if { (eval echo "$as_me:4126: \"$ac_compile\"") >&5
4127   (eval $ac_compile) 2>&5
4128   ac_status=$?
4129   echo "$as_me:4129: \$? = $ac_status" >&5
4130   (exit "$ac_status"); } &&
4131          { ac_try='test -s "conftest.$ac_objext"'
4132   { (eval echo "$as_me:4132: \"$ac_try\"") >&5
4133   (eval $ac_try) 2>&5
4134   ac_status=$?
4135   echo "$as_me:4135: \$? = $ac_status" >&5
4136   (exit "$ac_status"); }; }; then
4137   cf_cv_gnu_source=no
4138 else
4139   echo "$as_me: failed program was:" >&5
4140 cat "conftest.$ac_ext" >&5
4141 cf_save="$CPPFLAGS"
4142
4143 cf_fix_cppflags=no
4144 cf_new_cflags=
4145 cf_new_cppflags=
4146 cf_new_extra_cppflags=
4147
4148 for cf_add_cflags in -D_GNU_SOURCE
4149 do
4150 case "$cf_fix_cppflags" in
4151 (no)
4152         case "$cf_add_cflags" in
4153         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4154                 case "$cf_add_cflags" in
4155                 (-D*)
4156                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4157
4158                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4159                                 && test -z "${cf_tst_cflags}" \
4160                                 && cf_fix_cppflags=yes
4161
4162                         if test "$cf_fix_cppflags" = yes ; then
4163
4164         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4165         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4166
4167                                 continue
4168                         elif test "${cf_tst_cflags}" = "\"'" ; then
4169
4170         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4171         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4172
4173                                 continue
4174                         fi
4175                         ;;
4176                 esac
4177                 case "$CPPFLAGS" in
4178                 (*$cf_add_cflags)
4179                         ;;
4180                 (*)
4181                         case "$cf_add_cflags" in
4182                         (-D*)
4183                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4184
4185 CPPFLAGS=`echo "$CPPFLAGS" | \
4186         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4187                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4188
4189                                 ;;
4190                         esac
4191
4192         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4193         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4194
4195                         ;;
4196                 esac
4197                 ;;
4198         (*)
4199
4200         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4201         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4202
4203                 ;;
4204         esac
4205         ;;
4206 (yes)
4207
4208         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4209         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4210
4211         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4212
4213         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4214                 && test -z "${cf_tst_cflags}" \
4215                 && cf_fix_cppflags=no
4216         ;;
4217 esac
4218 done
4219
4220 if test -n "$cf_new_cflags" ; then
4221
4222         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4223         CFLAGS="${CFLAGS}$cf_new_cflags"
4224
4225 fi
4226
4227 if test -n "$cf_new_cppflags" ; then
4228
4229         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4230         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4231
4232 fi
4233
4234 if test -n "$cf_new_extra_cppflags" ; then
4235
4236         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4237         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4238
4239 fi
4240
4241                          cat >"conftest.$ac_ext" <<_ACEOF
4242 #line 4242 "configure"
4243 #include "confdefs.h"
4244 #include <sys/types.h>
4245 int
4246 main (void)
4247 {
4248
4249                                 #ifdef _XOPEN_SOURCE
4250                                 #error  expected _XOPEN_SOURCE to be undefined
4251                                 #endif
4252   ;
4253   return 0;
4254 }
4255 _ACEOF
4256 rm -f "conftest.$ac_objext"
4257 if { (eval echo "$as_me:4257: \"$ac_compile\"") >&5
4258   (eval $ac_compile) 2>&5
4259   ac_status=$?
4260   echo "$as_me:4260: \$? = $ac_status" >&5
4261   (exit "$ac_status"); } &&
4262          { ac_try='test -s "conftest.$ac_objext"'
4263   { (eval echo "$as_me:4263: \"$ac_try\"") >&5
4264   (eval $ac_try) 2>&5
4265   ac_status=$?
4266   echo "$as_me:4266: \$? = $ac_status" >&5
4267   (exit "$ac_status"); }; }; then
4268   cf_cv_gnu_source=no
4269 else
4270   echo "$as_me: failed program was:" >&5
4271 cat "conftest.$ac_ext" >&5
4272 cf_cv_gnu_source=yes
4273 fi
4274 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4275                         CPPFLAGS="$cf_save"
4276
4277 fi
4278 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4279
4280 fi
4281 echo "$as_me:4281: result: $cf_cv_gnu_source" >&5
4282 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4283
4284                 if test "$cf_cv_gnu_source" = yes
4285                 then
4286                 echo "$as_me:4286: checking if we should also define _DEFAULT_SOURCE" >&5
4287 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4288 if test "${cf_cv_default_source+set}" = set; then
4289   echo $ECHO_N "(cached) $ECHO_C" >&6
4290 else
4291
4292         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4293         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4294
4295                         cat >"conftest.$ac_ext" <<_ACEOF
4296 #line 4296 "configure"
4297 #include "confdefs.h"
4298 #include <sys/types.h>
4299 int
4300 main (void)
4301 {
4302
4303                                 #ifdef _DEFAULT_SOURCE
4304                                 #error  expected _DEFAULT_SOURCE to be undefined
4305                                 #endif
4306   ;
4307   return 0;
4308 }
4309 _ACEOF
4310 rm -f "conftest.$ac_objext"
4311 if { (eval echo "$as_me:4311: \"$ac_compile\"") >&5
4312   (eval $ac_compile) 2>&5
4313   ac_status=$?
4314   echo "$as_me:4314: \$? = $ac_status" >&5
4315   (exit "$ac_status"); } &&
4316          { ac_try='test -s "conftest.$ac_objext"'
4317   { (eval echo "$as_me:4317: \"$ac_try\"") >&5
4318   (eval $ac_try) 2>&5
4319   ac_status=$?
4320   echo "$as_me:4320: \$? = $ac_status" >&5
4321   (exit "$ac_status"); }; }; then
4322   cf_cv_default_source=no
4323 else
4324   echo "$as_me: failed program was:" >&5
4325 cat "conftest.$ac_ext" >&5
4326 cf_cv_default_source=yes
4327 fi
4328 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4329
4330 fi
4331 echo "$as_me:4331: result: $cf_cv_default_source" >&5
4332 echo "${ECHO_T}$cf_cv_default_source" >&6
4333                         if test "$cf_cv_default_source" = yes
4334                         then
4335
4336         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4337         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4338
4339                         fi
4340                 fi
4341         fi
4342
4343 fi
4344
4345         ;;
4346 (minix*)
4347         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4348         ;;
4349 (mirbsd*)
4350         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4351         cf_XOPEN_SOURCE=
4352
4353 if test "$cf_cv_posix_visible" = no; then
4354
4355 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4356
4357 cf_save_CFLAGS="$CFLAGS"
4358 cf_save_CPPFLAGS="$CPPFLAGS"
4359
4360 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4361         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4362                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4363
4364 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4365         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4366                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4367
4368 echo "$as_me:4368: checking if we should define _POSIX_C_SOURCE" >&5
4369 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4370 if test "${cf_cv_posix_c_source+set}" = set; then
4371   echo $ECHO_N "(cached) $ECHO_C" >&6
4372 else
4373
4374 echo "${as_me:-configure}:4374: testing if the symbol is already defined go no further ..." 1>&5
4375
4376         cat >"conftest.$ac_ext" <<_ACEOF
4377 #line 4377 "configure"
4378 #include "confdefs.h"
4379 #include <sys/types.h>
4380 int
4381 main (void)
4382 {
4383
4384 #ifndef _POSIX_C_SOURCE
4385 make an error
4386 #endif
4387   ;
4388   return 0;
4389 }
4390 _ACEOF
4391 rm -f "conftest.$ac_objext"
4392 if { (eval echo "$as_me:4392: \"$ac_compile\"") >&5
4393   (eval $ac_compile) 2>&5
4394   ac_status=$?
4395   echo "$as_me:4395: \$? = $ac_status" >&5
4396   (exit "$ac_status"); } &&
4397          { ac_try='test -s "conftest.$ac_objext"'
4398   { (eval echo "$as_me:4398: \"$ac_try\"") >&5
4399   (eval $ac_try) 2>&5
4400   ac_status=$?
4401   echo "$as_me:4401: \$? = $ac_status" >&5
4402   (exit "$ac_status"); }; }; then
4403   cf_cv_posix_c_source=no
4404 else
4405   echo "$as_me: failed program was:" >&5
4406 cat "conftest.$ac_ext" >&5
4407 cf_want_posix_source=no
4408          case .$cf_POSIX_C_SOURCE in
4409          (.[12]??*)
4410                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4411                 ;;
4412          (.2)
4413                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4414                 cf_want_posix_source=yes
4415                 ;;
4416          (.*)
4417                 cf_want_posix_source=yes
4418                 ;;
4419          esac
4420          if test "$cf_want_posix_source" = yes ; then
4421                 cat >"conftest.$ac_ext" <<_ACEOF
4422 #line 4422 "configure"
4423 #include "confdefs.h"
4424 #include <sys/types.h>
4425 int
4426 main (void)
4427 {
4428
4429 #ifdef _POSIX_SOURCE
4430 make an error
4431 #endif
4432   ;
4433   return 0;
4434 }
4435 _ACEOF
4436 rm -f "conftest.$ac_objext"
4437 if { (eval echo "$as_me:4437: \"$ac_compile\"") >&5
4438   (eval $ac_compile) 2>&5
4439   ac_status=$?
4440   echo "$as_me:4440: \$? = $ac_status" >&5
4441   (exit "$ac_status"); } &&
4442          { ac_try='test -s "conftest.$ac_objext"'
4443   { (eval echo "$as_me:4443: \"$ac_try\"") >&5
4444   (eval $ac_try) 2>&5
4445   ac_status=$?
4446   echo "$as_me:4446: \$? = $ac_status" >&5
4447   (exit "$ac_status"); }; }; then
4448   :
4449 else
4450   echo "$as_me: failed program was:" >&5
4451 cat "conftest.$ac_ext" >&5
4452 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4453 fi
4454 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4455          fi
4456
4457 echo "${as_me:-configure}:4457: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4458
4459          CFLAGS="$cf_trim_CFLAGS"
4460          CPPFLAGS="$cf_trim_CPPFLAGS"
4461
4462         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4463         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4464
4465 echo "${as_me:-configure}:4465: testing if the second compile does not leave our definition intact error ..." 1>&5
4466
4467          cat >"conftest.$ac_ext" <<_ACEOF
4468 #line 4468 "configure"
4469 #include "confdefs.h"
4470 #include <sys/types.h>
4471 int
4472 main (void)
4473 {
4474
4475 #ifndef _POSIX_C_SOURCE
4476 make an error
4477 #endif
4478   ;
4479   return 0;
4480 }
4481 _ACEOF
4482 rm -f "conftest.$ac_objext"
4483 if { (eval echo "$as_me:4483: \"$ac_compile\"") >&5
4484   (eval $ac_compile) 2>&5
4485   ac_status=$?
4486   echo "$as_me:4486: \$? = $ac_status" >&5
4487   (exit "$ac_status"); } &&
4488          { ac_try='test -s "conftest.$ac_objext"'
4489   { (eval echo "$as_me:4489: \"$ac_try\"") >&5
4490   (eval $ac_try) 2>&5
4491   ac_status=$?
4492   echo "$as_me:4492: \$? = $ac_status" >&5
4493   (exit "$ac_status"); }; }; then
4494   :
4495 else
4496   echo "$as_me: failed program was:" >&5
4497 cat "conftest.$ac_ext" >&5
4498 cf_cv_posix_c_source=no
4499 fi
4500 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4501          CFLAGS="$cf_save_CFLAGS"
4502          CPPFLAGS="$cf_save_CPPFLAGS"
4503
4504 fi
4505 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4506
4507 fi
4508 echo "$as_me:4508: result: $cf_cv_posix_c_source" >&5
4509 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4510
4511 if test "$cf_cv_posix_c_source" != no ; then
4512         CFLAGS="$cf_trim_CFLAGS"
4513         CPPFLAGS="$cf_trim_CPPFLAGS"
4514
4515 cf_fix_cppflags=no
4516 cf_new_cflags=
4517 cf_new_cppflags=
4518 cf_new_extra_cppflags=
4519
4520 for cf_add_cflags in $cf_cv_posix_c_source
4521 do
4522 case "$cf_fix_cppflags" in
4523 (no)
4524         case "$cf_add_cflags" in
4525         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4526                 case "$cf_add_cflags" in
4527                 (-D*)
4528                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4529
4530                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4531                                 && test -z "${cf_tst_cflags}" \
4532                                 && cf_fix_cppflags=yes
4533
4534                         if test "$cf_fix_cppflags" = yes ; then
4535
4536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4538
4539                                 continue
4540                         elif test "${cf_tst_cflags}" = "\"'" ; then
4541
4542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4544
4545                                 continue
4546                         fi
4547                         ;;
4548                 esac
4549                 case "$CPPFLAGS" in
4550                 (*$cf_add_cflags)
4551                         ;;
4552                 (*)
4553                         case "$cf_add_cflags" in
4554                         (-D*)
4555                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4556
4557 CPPFLAGS=`echo "$CPPFLAGS" | \
4558         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4559                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4560
4561                                 ;;
4562                         esac
4563
4564         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4565         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4566
4567                         ;;
4568                 esac
4569                 ;;
4570         (*)
4571
4572         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4573         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4574
4575                 ;;
4576         esac
4577         ;;
4578 (yes)
4579
4580         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4581         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4582
4583         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4584
4585         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4586                 && test -z "${cf_tst_cflags}" \
4587                 && cf_fix_cppflags=no
4588         ;;
4589 esac
4590 done
4591
4592 if test -n "$cf_new_cflags" ; then
4593
4594         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4595         CFLAGS="${CFLAGS}$cf_new_cflags"
4596
4597 fi
4598
4599 if test -n "$cf_new_cppflags" ; then
4600
4601         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4602         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4603
4604 fi
4605
4606 if test -n "$cf_new_extra_cppflags" ; then
4607
4608         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4609         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4610
4611 fi
4612
4613 fi
4614
4615 fi # cf_cv_posix_visible
4616
4617         ;;
4618 (netbsd*)
4619         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4620         ;;
4621 (openbsd[4-9]*)
4622         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4623         cf_xopen_source="-D_BSD_SOURCE"
4624         cf_XOPEN_SOURCE=600
4625         ;;
4626 (openbsd*)
4627         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4628         ;;
4629 (osf[45]*)
4630         cf_xopen_source="-D_OSF_SOURCE"
4631         ;;
4632 (nto-qnx*)
4633         cf_xopen_source="-D_QNX_SOURCE"
4634         ;;
4635 (sco*)
4636         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4637         ;;
4638 (solaris2.*)
4639         cf_xopen_source="-D__EXTENSIONS__"
4640         cf_cv_xopen_source=broken
4641         ;;
4642 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4643         cf_XOPEN_SOURCE=
4644         cf_POSIX_C_SOURCE=
4645         ;;
4646 (*)
4647
4648 echo "$as_me:4648: checking if we should define _XOPEN_SOURCE" >&5
4649 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4650 if test "${cf_cv_xopen_source+set}" = set; then
4651   echo $ECHO_N "(cached) $ECHO_C" >&6
4652 else
4653
4654         cat >"conftest.$ac_ext" <<_ACEOF
4655 #line 4655 "configure"
4656 #include "confdefs.h"
4657
4658 #include <stdlib.h>
4659 #include <string.h>
4660 #include <sys/types.h>
4661
4662 int
4663 main (void)
4664 {
4665
4666 #ifndef _XOPEN_SOURCE
4667 make an error
4668 #endif
4669   ;
4670   return 0;
4671 }
4672 _ACEOF
4673 rm -f "conftest.$ac_objext"
4674 if { (eval echo "$as_me:4674: \"$ac_compile\"") >&5
4675   (eval $ac_compile) 2>&5
4676   ac_status=$?
4677   echo "$as_me:4677: \$? = $ac_status" >&5
4678   (exit "$ac_status"); } &&
4679          { ac_try='test -s "conftest.$ac_objext"'
4680   { (eval echo "$as_me:4680: \"$ac_try\"") >&5
4681   (eval $ac_try) 2>&5
4682   ac_status=$?
4683   echo "$as_me:4683: \$? = $ac_status" >&5
4684   (exit "$ac_status"); }; }; then
4685   cf_cv_xopen_source=no
4686 else
4687   echo "$as_me: failed program was:" >&5
4688 cat "conftest.$ac_ext" >&5
4689 cf_save="$CPPFLAGS"
4690
4691         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4692         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4693
4694          cat >"conftest.$ac_ext" <<_ACEOF
4695 #line 4695 "configure"
4696 #include "confdefs.h"
4697
4698 #include <stdlib.h>
4699 #include <string.h>
4700 #include <sys/types.h>
4701
4702 int
4703 main (void)
4704 {
4705
4706 #ifdef _XOPEN_SOURCE
4707 make an error
4708 #endif
4709   ;
4710   return 0;
4711 }
4712 _ACEOF
4713 rm -f "conftest.$ac_objext"
4714 if { (eval echo "$as_me:4714: \"$ac_compile\"") >&5
4715   (eval $ac_compile) 2>&5
4716   ac_status=$?
4717   echo "$as_me:4717: \$? = $ac_status" >&5
4718   (exit "$ac_status"); } &&
4719          { ac_try='test -s "conftest.$ac_objext"'
4720   { (eval echo "$as_me:4720: \"$ac_try\"") >&5
4721   (eval $ac_try) 2>&5
4722   ac_status=$?
4723   echo "$as_me:4723: \$? = $ac_status" >&5
4724   (exit "$ac_status"); }; }; then
4725   cf_cv_xopen_source=no
4726 else
4727   echo "$as_me: failed program was:" >&5
4728 cat "conftest.$ac_ext" >&5
4729 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4730 fi
4731 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4732         CPPFLAGS="$cf_save"
4733
4734 fi
4735 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4736
4737 fi
4738 echo "$as_me:4738: result: $cf_cv_xopen_source" >&5
4739 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4740
4741 if test "$cf_cv_xopen_source" != no ; then
4742
4743 CFLAGS=`echo "$CFLAGS" | \
4744         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4745                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4746
4747 CPPFLAGS=`echo "$CPPFLAGS" | \
4748         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4749                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4750
4751         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4752
4753 cf_fix_cppflags=no
4754 cf_new_cflags=
4755 cf_new_cppflags=
4756 cf_new_extra_cppflags=
4757
4758 for cf_add_cflags in $cf_temp_xopen_source
4759 do
4760 case "$cf_fix_cppflags" in
4761 (no)
4762         case "$cf_add_cflags" in
4763         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4764                 case "$cf_add_cflags" in
4765                 (-D*)
4766                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4767
4768                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4769                                 && test -z "${cf_tst_cflags}" \
4770                                 && cf_fix_cppflags=yes
4771
4772                         if test "$cf_fix_cppflags" = yes ; then
4773
4774         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4775         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4776
4777                                 continue
4778                         elif test "${cf_tst_cflags}" = "\"'" ; then
4779
4780         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4781         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4782
4783                                 continue
4784                         fi
4785                         ;;
4786                 esac
4787                 case "$CPPFLAGS" in
4788                 (*$cf_add_cflags)
4789                         ;;
4790                 (*)
4791                         case "$cf_add_cflags" in
4792                         (-D*)
4793                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4794
4795 CPPFLAGS=`echo "$CPPFLAGS" | \
4796         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4797                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4798
4799                                 ;;
4800                         esac
4801
4802         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4803         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4804
4805                         ;;
4806                 esac
4807                 ;;
4808         (*)
4809
4810         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4811         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4812
4813                 ;;
4814         esac
4815         ;;
4816 (yes)
4817
4818         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4819         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4820
4821         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4822
4823         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4824                 && test -z "${cf_tst_cflags}" \
4825                 && cf_fix_cppflags=no
4826         ;;
4827 esac
4828 done
4829
4830 if test -n "$cf_new_cflags" ; then
4831
4832         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4833         CFLAGS="${CFLAGS}$cf_new_cflags"
4834
4835 fi
4836
4837 if test -n "$cf_new_cppflags" ; then
4838
4839         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4840         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4841
4842 fi
4843
4844 if test -n "$cf_new_extra_cppflags" ; then
4845
4846         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4847         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4848
4849 fi
4850
4851 fi
4852
4853 if test "$cf_cv_posix_visible" = no; then
4854
4855 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4856
4857 cf_save_CFLAGS="$CFLAGS"
4858 cf_save_CPPFLAGS="$CPPFLAGS"
4859
4860 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4861         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4862                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4863
4864 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4865         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4866                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4867
4868 echo "$as_me:4868: checking if we should define _POSIX_C_SOURCE" >&5
4869 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4870 if test "${cf_cv_posix_c_source+set}" = set; then
4871   echo $ECHO_N "(cached) $ECHO_C" >&6
4872 else
4873
4874 echo "${as_me:-configure}:4874: testing if the symbol is already defined go no further ..." 1>&5
4875
4876         cat >"conftest.$ac_ext" <<_ACEOF
4877 #line 4877 "configure"
4878 #include "confdefs.h"
4879 #include <sys/types.h>
4880 int
4881 main (void)
4882 {
4883
4884 #ifndef _POSIX_C_SOURCE
4885 make an error
4886 #endif
4887   ;
4888   return 0;
4889 }
4890 _ACEOF
4891 rm -f "conftest.$ac_objext"
4892 if { (eval echo "$as_me:4892: \"$ac_compile\"") >&5
4893   (eval $ac_compile) 2>&5
4894   ac_status=$?
4895   echo "$as_me:4895: \$? = $ac_status" >&5
4896   (exit "$ac_status"); } &&
4897          { ac_try='test -s "conftest.$ac_objext"'
4898   { (eval echo "$as_me:4898: \"$ac_try\"") >&5
4899   (eval $ac_try) 2>&5
4900   ac_status=$?
4901   echo "$as_me:4901: \$? = $ac_status" >&5
4902   (exit "$ac_status"); }; }; then
4903   cf_cv_posix_c_source=no
4904 else
4905   echo "$as_me: failed program was:" >&5
4906 cat "conftest.$ac_ext" >&5
4907 cf_want_posix_source=no
4908          case .$cf_POSIX_C_SOURCE in
4909          (.[12]??*)
4910                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4911                 ;;
4912          (.2)
4913                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4914                 cf_want_posix_source=yes
4915                 ;;
4916          (.*)
4917                 cf_want_posix_source=yes
4918                 ;;
4919          esac
4920          if test "$cf_want_posix_source" = yes ; then
4921                 cat >"conftest.$ac_ext" <<_ACEOF
4922 #line 4922 "configure"
4923 #include "confdefs.h"
4924 #include <sys/types.h>
4925 int
4926 main (void)
4927 {
4928
4929 #ifdef _POSIX_SOURCE
4930 make an error
4931 #endif
4932   ;
4933   return 0;
4934 }
4935 _ACEOF
4936 rm -f "conftest.$ac_objext"
4937 if { (eval echo "$as_me:4937: \"$ac_compile\"") >&5
4938   (eval $ac_compile) 2>&5
4939   ac_status=$?
4940   echo "$as_me:4940: \$? = $ac_status" >&5
4941   (exit "$ac_status"); } &&
4942          { ac_try='test -s "conftest.$ac_objext"'
4943   { (eval echo "$as_me:4943: \"$ac_try\"") >&5
4944   (eval $ac_try) 2>&5
4945   ac_status=$?
4946   echo "$as_me:4946: \$? = $ac_status" >&5
4947   (exit "$ac_status"); }; }; then
4948   :
4949 else
4950   echo "$as_me: failed program was:" >&5
4951 cat "conftest.$ac_ext" >&5
4952 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4953 fi
4954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4955          fi
4956
4957 echo "${as_me:-configure}:4957: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4958
4959          CFLAGS="$cf_trim_CFLAGS"
4960          CPPFLAGS="$cf_trim_CPPFLAGS"
4961
4962         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4963         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4964
4965 echo "${as_me:-configure}:4965: testing if the second compile does not leave our definition intact error ..." 1>&5
4966
4967          cat >"conftest.$ac_ext" <<_ACEOF
4968 #line 4968 "configure"
4969 #include "confdefs.h"
4970 #include <sys/types.h>
4971 int
4972 main (void)
4973 {
4974
4975 #ifndef _POSIX_C_SOURCE
4976 make an error
4977 #endif
4978   ;
4979   return 0;
4980 }
4981 _ACEOF
4982 rm -f "conftest.$ac_objext"
4983 if { (eval echo "$as_me:4983: \"$ac_compile\"") >&5
4984   (eval $ac_compile) 2>&5
4985   ac_status=$?
4986   echo "$as_me:4986: \$? = $ac_status" >&5
4987   (exit "$ac_status"); } &&
4988          { ac_try='test -s "conftest.$ac_objext"'
4989   { (eval echo "$as_me:4989: \"$ac_try\"") >&5
4990   (eval $ac_try) 2>&5
4991   ac_status=$?
4992   echo "$as_me:4992: \$? = $ac_status" >&5
4993   (exit "$ac_status"); }; }; then
4994   :
4995 else
4996   echo "$as_me: failed program was:" >&5
4997 cat "conftest.$ac_ext" >&5
4998 cf_cv_posix_c_source=no
4999 fi
5000 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5001          CFLAGS="$cf_save_CFLAGS"
5002          CPPFLAGS="$cf_save_CPPFLAGS"
5003
5004 fi
5005 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5006
5007 fi
5008 echo "$as_me:5008: result: $cf_cv_posix_c_source" >&5
5009 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5010
5011 if test "$cf_cv_posix_c_source" != no ; then
5012         CFLAGS="$cf_trim_CFLAGS"
5013         CPPFLAGS="$cf_trim_CPPFLAGS"
5014
5015 cf_fix_cppflags=no
5016 cf_new_cflags=
5017 cf_new_cppflags=
5018 cf_new_extra_cppflags=
5019
5020 for cf_add_cflags in $cf_cv_posix_c_source
5021 do
5022 case "$cf_fix_cppflags" in
5023 (no)
5024         case "$cf_add_cflags" in
5025         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5026                 case "$cf_add_cflags" in
5027                 (-D*)
5028                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5029
5030                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5031                                 && test -z "${cf_tst_cflags}" \
5032                                 && cf_fix_cppflags=yes
5033
5034                         if test "$cf_fix_cppflags" = yes ; then
5035
5036         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5037         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5038
5039                                 continue
5040                         elif test "${cf_tst_cflags}" = "\"'" ; then
5041
5042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5044
5045                                 continue
5046                         fi
5047                         ;;
5048                 esac
5049                 case "$CPPFLAGS" in
5050                 (*$cf_add_cflags)
5051                         ;;
5052                 (*)
5053                         case "$cf_add_cflags" in
5054                         (-D*)
5055                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5056
5057 CPPFLAGS=`echo "$CPPFLAGS" | \
5058         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5059                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5060
5061                                 ;;
5062                         esac
5063
5064         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5065         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5066
5067                         ;;
5068                 esac
5069                 ;;
5070         (*)
5071
5072         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5073         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5074
5075                 ;;
5076         esac
5077         ;;
5078 (yes)
5079
5080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5082
5083         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5084
5085         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5086                 && test -z "${cf_tst_cflags}" \
5087                 && cf_fix_cppflags=no
5088         ;;
5089 esac
5090 done
5091
5092 if test -n "$cf_new_cflags" ; then
5093
5094         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5095         CFLAGS="${CFLAGS}$cf_new_cflags"
5096
5097 fi
5098
5099 if test -n "$cf_new_cppflags" ; then
5100
5101         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5102         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5103
5104 fi
5105
5106 if test -n "$cf_new_extra_cppflags" ; then
5107
5108         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5109         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5110
5111 fi
5112
5113 fi
5114
5115 fi # cf_cv_posix_visible
5116
5117         ;;
5118 esac
5119
5120 if test -n "$cf_xopen_source" ; then
5121
5122 cf_fix_cppflags=no
5123 cf_new_cflags=
5124 cf_new_cppflags=
5125 cf_new_extra_cppflags=
5126
5127 for cf_add_cflags in $cf_xopen_source
5128 do
5129 case "$cf_fix_cppflags" in
5130 (no)
5131         case "$cf_add_cflags" in
5132         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5133                 case "$cf_add_cflags" in
5134                 (-D*)
5135                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5136
5137                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5138                                 && test -z "${cf_tst_cflags}" \
5139                                 && cf_fix_cppflags=yes
5140
5141                         if test "$cf_fix_cppflags" = yes ; then
5142
5143         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5144         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5145
5146                                 continue
5147                         elif test "${cf_tst_cflags}" = "\"'" ; then
5148
5149         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5150         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5151
5152                                 continue
5153                         fi
5154                         ;;
5155                 esac
5156                 case "$CPPFLAGS" in
5157                 (*$cf_add_cflags)
5158                         ;;
5159                 (*)
5160                         case "$cf_add_cflags" in
5161                         (-D*)
5162                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5163
5164 CPPFLAGS=`echo "$CPPFLAGS" | \
5165         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5166                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5167
5168                                 ;;
5169                         esac
5170
5171         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5172         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5173
5174                         ;;
5175                 esac
5176                 ;;
5177         (*)
5178
5179         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5180         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5181
5182                 ;;
5183         esac
5184         ;;
5185 (yes)
5186
5187         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5188         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5189
5190         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5191
5192         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5193                 && test -z "${cf_tst_cflags}" \
5194                 && cf_fix_cppflags=no
5195         ;;
5196 esac
5197 done
5198
5199 if test -n "$cf_new_cflags" ; then
5200         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5201
5202 echo "${as_me:-configure}:5202: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5203
5204         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5205         CFLAGS="${CFLAGS}$cf_new_cflags"
5206
5207 fi
5208
5209 if test -n "$cf_new_cppflags" ; then
5210         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5211
5212 echo "${as_me:-configure}:5212: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5213
5214         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5215         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5216
5217 fi
5218
5219 if test -n "$cf_new_extra_cppflags" ; then
5220         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5221
5222 echo "${as_me:-configure}:5222: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5223
5224         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5225         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5226
5227 fi
5228
5229 fi
5230
5231 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5232         echo "$as_me:5232: checking if _XOPEN_SOURCE really is set" >&5
5233 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5234         cat >"conftest.$ac_ext" <<_ACEOF
5235 #line 5235 "configure"
5236 #include "confdefs.h"
5237 #include <stdlib.h>
5238 int
5239 main (void)
5240 {
5241
5242 #ifndef _XOPEN_SOURCE
5243 make an error
5244 #endif
5245   ;
5246   return 0;
5247 }
5248 _ACEOF
5249 rm -f "conftest.$ac_objext"
5250 if { (eval echo "$as_me:5250: \"$ac_compile\"") >&5
5251   (eval $ac_compile) 2>&5
5252   ac_status=$?
5253   echo "$as_me:5253: \$? = $ac_status" >&5
5254   (exit "$ac_status"); } &&
5255          { ac_try='test -s "conftest.$ac_objext"'
5256   { (eval echo "$as_me:5256: \"$ac_try\"") >&5
5257   (eval $ac_try) 2>&5
5258   ac_status=$?
5259   echo "$as_me:5259: \$? = $ac_status" >&5
5260   (exit "$ac_status"); }; }; then
5261   cf_XOPEN_SOURCE_set=yes
5262 else
5263   echo "$as_me: failed program was:" >&5
5264 cat "conftest.$ac_ext" >&5
5265 cf_XOPEN_SOURCE_set=no
5266 fi
5267 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5268         echo "$as_me:5268: result: $cf_XOPEN_SOURCE_set" >&5
5269 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5270         if test "$cf_XOPEN_SOURCE_set" = yes
5271         then
5272                 cat >"conftest.$ac_ext" <<_ACEOF
5273 #line 5273 "configure"
5274 #include "confdefs.h"
5275 #include <stdlib.h>
5276 int
5277 main (void)
5278 {
5279
5280 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5281 make an error
5282 #endif
5283   ;
5284   return 0;
5285 }
5286 _ACEOF
5287 rm -f "conftest.$ac_objext"
5288 if { (eval echo "$as_me:5288: \"$ac_compile\"") >&5
5289   (eval $ac_compile) 2>&5
5290   ac_status=$?
5291   echo "$as_me:5291: \$? = $ac_status" >&5
5292   (exit "$ac_status"); } &&
5293          { ac_try='test -s "conftest.$ac_objext"'
5294   { (eval echo "$as_me:5294: \"$ac_try\"") >&5
5295   (eval $ac_try) 2>&5
5296   ac_status=$?
5297   echo "$as_me:5297: \$? = $ac_status" >&5
5298   (exit "$ac_status"); }; }; then
5299   cf_XOPEN_SOURCE_set_ok=yes
5300 else
5301   echo "$as_me: failed program was:" >&5
5302 cat "conftest.$ac_ext" >&5
5303 cf_XOPEN_SOURCE_set_ok=no
5304 fi
5305 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5306                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5307                 then
5308                         { echo "$as_me:5308: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5309 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5310                 fi
5311         else
5312
5313 echo "$as_me:5313: checking if we should define _XOPEN_SOURCE" >&5
5314 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5315 if test "${cf_cv_xopen_source+set}" = set; then
5316   echo $ECHO_N "(cached) $ECHO_C" >&6
5317 else
5318
5319         cat >"conftest.$ac_ext" <<_ACEOF
5320 #line 5320 "configure"
5321 #include "confdefs.h"
5322
5323 #include <stdlib.h>
5324 #include <string.h>
5325 #include <sys/types.h>
5326
5327 int
5328 main (void)
5329 {
5330
5331 #ifndef _XOPEN_SOURCE
5332 make an error
5333 #endif
5334   ;
5335   return 0;
5336 }
5337 _ACEOF
5338 rm -f "conftest.$ac_objext"
5339 if { (eval echo "$as_me:5339: \"$ac_compile\"") >&5
5340   (eval $ac_compile) 2>&5
5341   ac_status=$?
5342   echo "$as_me:5342: \$? = $ac_status" >&5
5343   (exit "$ac_status"); } &&
5344          { ac_try='test -s "conftest.$ac_objext"'
5345   { (eval echo "$as_me:5345: \"$ac_try\"") >&5
5346   (eval $ac_try) 2>&5
5347   ac_status=$?
5348   echo "$as_me:5348: \$? = $ac_status" >&5
5349   (exit "$ac_status"); }; }; then
5350   cf_cv_xopen_source=no
5351 else
5352   echo "$as_me: failed program was:" >&5
5353 cat "conftest.$ac_ext" >&5
5354 cf_save="$CPPFLAGS"
5355
5356         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5357         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5358
5359          cat >"conftest.$ac_ext" <<_ACEOF
5360 #line 5360 "configure"
5361 #include "confdefs.h"
5362
5363 #include <stdlib.h>
5364 #include <string.h>
5365 #include <sys/types.h>
5366
5367 int
5368 main (void)
5369 {
5370
5371 #ifdef _XOPEN_SOURCE
5372 make an error
5373 #endif
5374   ;
5375   return 0;
5376 }
5377 _ACEOF
5378 rm -f "conftest.$ac_objext"
5379 if { (eval echo "$as_me:5379: \"$ac_compile\"") >&5
5380   (eval $ac_compile) 2>&5
5381   ac_status=$?
5382   echo "$as_me:5382: \$? = $ac_status" >&5
5383   (exit "$ac_status"); } &&
5384          { ac_try='test -s "conftest.$ac_objext"'
5385   { (eval echo "$as_me:5385: \"$ac_try\"") >&5
5386   (eval $ac_try) 2>&5
5387   ac_status=$?
5388   echo "$as_me:5388: \$? = $ac_status" >&5
5389   (exit "$ac_status"); }; }; then
5390   cf_cv_xopen_source=no
5391 else
5392   echo "$as_me: failed program was:" >&5
5393 cat "conftest.$ac_ext" >&5
5394 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5395 fi
5396 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5397         CPPFLAGS="$cf_save"
5398
5399 fi
5400 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5401
5402 fi
5403 echo "$as_me:5403: result: $cf_cv_xopen_source" >&5
5404 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5405
5406 if test "$cf_cv_xopen_source" != no ; then
5407
5408 CFLAGS=`echo "$CFLAGS" | \
5409         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5410                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5411
5412 CPPFLAGS=`echo "$CPPFLAGS" | \
5413         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5414                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5415
5416         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5417
5418 cf_fix_cppflags=no
5419 cf_new_cflags=
5420 cf_new_cppflags=
5421 cf_new_extra_cppflags=
5422
5423 for cf_add_cflags in $cf_temp_xopen_source
5424 do
5425 case "$cf_fix_cppflags" in
5426 (no)
5427         case "$cf_add_cflags" in
5428         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5429                 case "$cf_add_cflags" in
5430                 (-D*)
5431                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5432
5433                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5434                                 && test -z "${cf_tst_cflags}" \
5435                                 && cf_fix_cppflags=yes
5436
5437                         if test "$cf_fix_cppflags" = yes ; then
5438
5439         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5440         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5441
5442                                 continue
5443                         elif test "${cf_tst_cflags}" = "\"'" ; then
5444
5445         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5446         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5447
5448                                 continue
5449                         fi
5450                         ;;
5451                 esac
5452                 case "$CPPFLAGS" in
5453                 (*$cf_add_cflags)
5454                         ;;
5455                 (*)
5456                         case "$cf_add_cflags" in
5457                         (-D*)
5458                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5459
5460 CPPFLAGS=`echo "$CPPFLAGS" | \
5461         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5462                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5463
5464                                 ;;
5465                         esac
5466
5467         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5468         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5469
5470                         ;;
5471                 esac
5472                 ;;
5473         (*)
5474
5475         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5476         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5477
5478                 ;;
5479         esac
5480         ;;
5481 (yes)
5482
5483         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5484         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5485
5486         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5487
5488         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5489                 && test -z "${cf_tst_cflags}" \
5490                 && cf_fix_cppflags=no
5491         ;;
5492 esac
5493 done
5494
5495 if test -n "$cf_new_cflags" ; then
5496
5497         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5498         CFLAGS="${CFLAGS}$cf_new_cflags"
5499
5500 fi
5501
5502 if test -n "$cf_new_cppflags" ; then
5503
5504         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5505         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5506
5507 fi
5508
5509 if test -n "$cf_new_extra_cppflags" ; then
5510
5511         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5512         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5513
5514 fi
5515
5516 fi
5517
5518         fi
5519 fi
5520 fi # cf_cv_posix_visible
5521
5522 echo "$as_me:5522: checking for signal global datatype" >&5
5523 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5524 if test "${cf_cv_sig_atomic_t+set}" = set; then
5525   echo $ECHO_N "(cached) $ECHO_C" >&6
5526 else
5527
5528         for cf_type in \
5529                 "volatile sig_atomic_t" \
5530                 "sig_atomic_t" \
5531                 "int"
5532         do
5533         cat >"conftest.$ac_ext" <<_ACEOF
5534 #line 5534 "configure"
5535 #include "confdefs.h"
5536
5537 #include <sys/types.h>
5538 #include <signal.h>
5539 #include <stdio.h>
5540
5541 extern $cf_type x;
5542 $cf_type x;
5543 static void handler(int sig)
5544 {
5545         (void)sig;
5546         x = 5;
5547 }
5548 int
5549 main (void)
5550 {
5551 signal(SIGINT, handler);
5552                  x = 1
5553   ;
5554   return 0;
5555 }
5556 _ACEOF
5557 rm -f "conftest.$ac_objext"
5558 if { (eval echo "$as_me:5558: \"$ac_compile\"") >&5
5559   (eval $ac_compile) 2>&5
5560   ac_status=$?
5561   echo "$as_me:5561: \$? = $ac_status" >&5
5562   (exit "$ac_status"); } &&
5563          { ac_try='test -s "conftest.$ac_objext"'
5564   { (eval echo "$as_me:5564: \"$ac_try\"") >&5
5565   (eval $ac_try) 2>&5
5566   ac_status=$?
5567   echo "$as_me:5567: \$? = $ac_status" >&5
5568   (exit "$ac_status"); }; }; then
5569   cf_cv_sig_atomic_t=$cf_type
5570 else
5571   echo "$as_me: failed program was:" >&5
5572 cat "conftest.$ac_ext" >&5
5573 cf_cv_sig_atomic_t=no
5574 fi
5575 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5576                 test "$cf_cv_sig_atomic_t" != no && break
5577         done
5578
5579 fi
5580
5581 echo "$as_me:5581: result: $cf_cv_sig_atomic_t" >&5
5582 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5583 test "$cf_cv_sig_atomic_t" != no &&
5584 cat >>confdefs.h <<EOF
5585 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5586 EOF
5587
5588 # Work around breakage on OS X
5589
5590 echo "$as_me:5590: checking if SIGWINCH is defined" >&5
5591 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5592 if test "${cf_cv_define_sigwinch+set}" = set; then
5593   echo $ECHO_N "(cached) $ECHO_C" >&6
5594 else
5595
5596         cat >"conftest.$ac_ext" <<_ACEOF
5597 #line 5597 "configure"
5598 #include "confdefs.h"
5599
5600 #include <sys/types.h>
5601 #include <sys/signal.h>
5602
5603 int
5604 main (void)
5605 {
5606 int x = SIGWINCH; (void)x
5607   ;
5608   return 0;
5609 }
5610 _ACEOF
5611 rm -f "conftest.$ac_objext"
5612 if { (eval echo "$as_me:5612: \"$ac_compile\"") >&5
5613   (eval $ac_compile) 2>&5
5614   ac_status=$?
5615   echo "$as_me:5615: \$? = $ac_status" >&5
5616   (exit "$ac_status"); } &&
5617          { ac_try='test -s "conftest.$ac_objext"'
5618   { (eval echo "$as_me:5618: \"$ac_try\"") >&5
5619   (eval $ac_try) 2>&5
5620   ac_status=$?
5621   echo "$as_me:5621: \$? = $ac_status" >&5
5622   (exit "$ac_status"); }; }; then
5623   cf_cv_define_sigwinch=yes
5624 else
5625   echo "$as_me: failed program was:" >&5
5626 cat "conftest.$ac_ext" >&5
5627 cat >"conftest.$ac_ext" <<_ACEOF
5628 #line 5628 "configure"
5629 #include "confdefs.h"
5630
5631 #undef _XOPEN_SOURCE
5632 #undef _POSIX_SOURCE
5633 #undef _POSIX_C_SOURCE
5634 #include <sys/types.h>
5635 #include <sys/signal.h>
5636
5637 int
5638 main (void)
5639 {
5640 int x = SIGWINCH; (void)x
5641   ;
5642   return 0;
5643 }
5644 _ACEOF
5645 rm -f "conftest.$ac_objext"
5646 if { (eval echo "$as_me:5646: \"$ac_compile\"") >&5
5647   (eval $ac_compile) 2>&5
5648   ac_status=$?
5649   echo "$as_me:5649: \$? = $ac_status" >&5
5650   (exit "$ac_status"); } &&
5651          { ac_try='test -s "conftest.$ac_objext"'
5652   { (eval echo "$as_me:5652: \"$ac_try\"") >&5
5653   (eval $ac_try) 2>&5
5654   ac_status=$?
5655   echo "$as_me:5655: \$? = $ac_status" >&5
5656   (exit "$ac_status"); }; }; then
5657   cf_cv_define_sigwinch=maybe
5658 else
5659   echo "$as_me: failed program was:" >&5
5660 cat "conftest.$ac_ext" >&5
5661 cf_cv_define_sigwinch=no
5662 fi
5663 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5664
5665 fi
5666 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5667
5668 fi
5669 echo "$as_me:5669: result: $cf_cv_define_sigwinch" >&5
5670 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5671
5672 if test "$cf_cv_define_sigwinch" = maybe ; then
5673 echo "$as_me:5673: checking for actual SIGWINCH definition" >&5
5674 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5675 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5676   echo $ECHO_N "(cached) $ECHO_C" >&6
5677 else
5678
5679 cf_cv_fixup_sigwinch=unknown
5680 cf_sigwinch=32
5681 while test "$cf_sigwinch" != 1
5682 do
5683         cat >"conftest.$ac_ext" <<_ACEOF
5684 #line 5684 "configure"
5685 #include "confdefs.h"
5686
5687 #undef _XOPEN_SOURCE
5688 #undef _POSIX_SOURCE
5689 #undef _POSIX_C_SOURCE
5690 #include <sys/types.h>
5691 #include <sys/signal.h>
5692
5693 int
5694 main (void)
5695 {
5696
5697 #if SIGWINCH != $cf_sigwinch
5698 make an error
5699 #endif
5700 int x = SIGWINCH; (void)x
5701   ;
5702   return 0;
5703 }
5704 _ACEOF
5705 rm -f "conftest.$ac_objext"
5706 if { (eval echo "$as_me:5706: \"$ac_compile\"") >&5
5707   (eval $ac_compile) 2>&5
5708   ac_status=$?
5709   echo "$as_me:5709: \$? = $ac_status" >&5
5710   (exit "$ac_status"); } &&
5711          { ac_try='test -s "conftest.$ac_objext"'
5712   { (eval echo "$as_me:5712: \"$ac_try\"") >&5
5713   (eval $ac_try) 2>&5
5714   ac_status=$?
5715   echo "$as_me:5715: \$? = $ac_status" >&5
5716   (exit "$ac_status"); }; }; then
5717   cf_cv_fixup_sigwinch=$cf_sigwinch
5718          break
5719 else
5720   echo "$as_me: failed program was:" >&5
5721 cat "conftest.$ac_ext" >&5
5722 fi
5723 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5724
5725 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
5726 done
5727
5728 fi
5729 echo "$as_me:5729: result: $cf_cv_fixup_sigwinch" >&5
5730 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5731
5732         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5733                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5734         fi
5735 fi
5736
5737 # Checks for CODESET support.
5738
5739 echo "$as_me:5739: checking for nl_langinfo and CODESET" >&5
5740 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5741 if test "${am_cv_langinfo_codeset+set}" = set; then
5742   echo $ECHO_N "(cached) $ECHO_C" >&6
5743 else
5744   cat >"conftest.$ac_ext" <<_ACEOF
5745 #line 5745 "configure"
5746 #include "confdefs.h"
5747 #include <langinfo.h>
5748 int
5749 main (void)
5750 {
5751 char* cs = nl_langinfo(CODESET); (void)cs
5752   ;
5753   return 0;
5754 }
5755 _ACEOF
5756 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5757 if { (eval echo "$as_me:5757: \"$ac_link\"") >&5
5758   (eval $ac_link) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit "$ac_status"); } &&
5762          { ac_try='test -s "conftest$ac_exeext"'
5763   { (eval echo "$as_me:5763: \"$ac_try\"") >&5
5764   (eval $ac_try) 2>&5
5765   ac_status=$?
5766   echo "$as_me:5766: \$? = $ac_status" >&5
5767   (exit "$ac_status"); }; }; then
5768   am_cv_langinfo_codeset=yes
5769 else
5770   echo "$as_me: failed program was:" >&5
5771 cat "conftest.$ac_ext" >&5
5772 am_cv_langinfo_codeset=no
5773 fi
5774 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5775
5776 fi
5777 echo "$as_me:5777: result: $am_cv_langinfo_codeset" >&5
5778 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5779         if test "$am_cv_langinfo_codeset" = yes; then
5780
5781 cat >>confdefs.h <<\EOF
5782 #define HAVE_LANGINFO_CODESET 1
5783 EOF
5784
5785         fi
5786
5787 echo "$as_me:5787: checking if you want to use pkg-config" >&5
5788 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5789
5790 # Check whether --with-pkg-config or --without-pkg-config was given.
5791 if test "${with_pkg_config+set}" = set; then
5792   withval="$with_pkg_config"
5793   cf_pkg_config=$withval
5794 else
5795   cf_pkg_config=yes
5796 fi;
5797 echo "$as_me:5797: result: $cf_pkg_config" >&5
5798 echo "${ECHO_T}$cf_pkg_config" >&6
5799
5800 case "$cf_pkg_config" in
5801 (no)
5802         PKG_CONFIG=none
5803         ;;
5804 (yes)
5805
5806 if test -n "$ac_tool_prefix"; then
5807   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5808 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5809 echo "$as_me:5809: checking for $ac_word" >&5
5810 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5811 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5812   echo $ECHO_N "(cached) $ECHO_C" >&6
5813 else
5814   case $PKG_CONFIG in
5815   [\\/]* | ?:[\\/]*)
5816   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5817   ;;
5818   *)
5819   ac_save_IFS=$IFS; IFS=$ac_path_separator
5820 ac_dummy="$PATH"
5821 for ac_dir in $ac_dummy; do
5822   IFS=$ac_save_IFS
5823   test -z "$ac_dir" && ac_dir=.
5824   if $as_executable_p "$ac_dir/$ac_word"; then
5825    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5826    echo "$as_me:5826: found $ac_dir/$ac_word" >&5
5827    break
5828 fi
5829 done
5830
5831   ;;
5832 esac
5833 fi
5834 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5835
5836 if test -n "$PKG_CONFIG"; then
5837   echo "$as_me:5837: result: $PKG_CONFIG" >&5
5838 echo "${ECHO_T}$PKG_CONFIG" >&6
5839 else
5840   echo "$as_me:5840: result: no" >&5
5841 echo "${ECHO_T}no" >&6
5842 fi
5843
5844 fi
5845 if test -z "$ac_cv_path_PKG_CONFIG"; then
5846   ac_pt_PKG_CONFIG=$PKG_CONFIG
5847   # Extract the first word of "pkg-config", so it can be a program name with args.
5848 set dummy pkg-config; ac_word=$2
5849 echo "$as_me:5849: checking for $ac_word" >&5
5850 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5851 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5852   echo $ECHO_N "(cached) $ECHO_C" >&6
5853 else
5854   case $ac_pt_PKG_CONFIG in
5855   [\\/]* | ?:[\\/]*)
5856   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5857   ;;
5858   *)
5859   ac_save_IFS=$IFS; IFS=$ac_path_separator
5860 ac_dummy="$PATH"
5861 for ac_dir in $ac_dummy; do
5862   IFS=$ac_save_IFS
5863   test -z "$ac_dir" && ac_dir=.
5864   if $as_executable_p "$ac_dir/$ac_word"; then
5865    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5866    echo "$as_me:5866: found $ac_dir/$ac_word" >&5
5867    break
5868 fi
5869 done
5870
5871   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5872   ;;
5873 esac
5874 fi
5875 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5876
5877 if test -n "$ac_pt_PKG_CONFIG"; then
5878   echo "$as_me:5878: result: $ac_pt_PKG_CONFIG" >&5
5879 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5880 else
5881   echo "$as_me:5881: result: no" >&5
5882 echo "${ECHO_T}no" >&6
5883 fi
5884
5885   PKG_CONFIG=$ac_pt_PKG_CONFIG
5886 else
5887   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5888 fi
5889
5890         ;;
5891 (*)
5892         PKG_CONFIG=$withval
5893         ;;
5894 esac
5895
5896 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5897 if test "$PKG_CONFIG" != none ; then
5898
5899 if test "x$prefix" != xNONE; then
5900         cf_path_syntax="$prefix"
5901 else
5902         cf_path_syntax="$ac_default_prefix"
5903 fi
5904
5905 case ".$PKG_CONFIG" in
5906 (.\$\(*\)*|.\'*\'*)
5907         ;;
5908 (..|./*|.\\*)
5909         ;;
5910 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5911         ;;
5912 (.\$\{*prefix\}*|.\$\{*dir\}*)
5913         eval PKG_CONFIG="$PKG_CONFIG"
5914         case ".$PKG_CONFIG" in
5915         (.NONE/*)
5916                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
5917                 ;;
5918         esac
5919         ;;
5920 (.no|.NONE/*)
5921         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
5922         ;;
5923 (*)
5924         { { echo "$as_me:5924: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5925 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5926    { (exit 1); exit 1; }; }
5927         ;;
5928 esac
5929
5930 elif test "x$cf_pkg_config" != xno ; then
5931         { echo "$as_me:5931: WARNING: pkg-config is not installed" >&5
5932 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5933 fi
5934
5935 echo "$as_me:5935: checking if you want to see long compiling messages" >&5
5936 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5937
5938 # Check whether --enable-echo or --disable-echo was given.
5939 if test "${enable_echo+set}" = set; then
5940   enableval="$enable_echo"
5941   test "$enableval" != no && enableval=yes
5942         if test "$enableval" != "yes" ; then
5943
5944         ECHO_LT='--silent'
5945         ECHO_LD='@echo linking $@;'
5946         RULE_CC='@echo compiling $<'
5947         SHOW_CC='@echo compiling $@'
5948         ECHO_CC='@'
5949
5950         else
5951
5952         ECHO_LT=''
5953         ECHO_LD=''
5954         RULE_CC=''
5955         SHOW_CC=''
5956         ECHO_CC=''
5957
5958         fi
5959 else
5960   enableval=yes
5961
5962         ECHO_LT=''
5963         ECHO_LD=''
5964         RULE_CC=''
5965         SHOW_CC=''
5966         ECHO_CC=''
5967
5968 fi;
5969 echo "$as_me:5969: result: $enableval" >&5
5970 echo "${ECHO_T}$enableval" >&6
5971
5972 echo "$as_me:5972: checking for ncurses wrap-prefix" >&5
5973 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5974
5975 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5976 if test "${with_ncurses_wrap_prefix+set}" = set; then
5977   withval="$with_ncurses_wrap_prefix"
5978   NCURSES_WRAP_PREFIX=$withval
5979 else
5980   NCURSES_WRAP_PREFIX=_nc_
5981 fi;
5982 echo "$as_me:5982: result: $NCURSES_WRAP_PREFIX" >&5
5983 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5984
5985 echo "$as_me:5985: checking if you want to check for wide-character functions" >&5
5986 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5987
5988 # Check whether --enable-widec or --disable-widec was given.
5989 if test "${enable_widec+set}" = set; then
5990   enableval="$enable_widec"
5991   test "$enableval" != no && enableval=yes
5992         if test "$enableval" != "yes" ; then
5993     cf_enable_widec=no
5994         else
5995                 cf_enable_widec=yes
5996         fi
5997 else
5998   enableval=yes
5999         cf_enable_widec=yes
6000
6001 fi;
6002 echo "$as_me:6002: result: $cf_enable_widec" >&5
6003 echo "${ECHO_T}$cf_enable_widec" >&6
6004
6005 echo "$as_me:6005: checking for specific curses-directory" >&5
6006 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6007
6008 # Check whether --with-curses-dir or --without-curses-dir was given.
6009 if test "${with_curses_dir+set}" = set; then
6010   withval="$with_curses_dir"
6011   cf_cv_curses_dir=$withval
6012 else
6013   cf_cv_curses_dir=no
6014 fi;
6015 echo "$as_me:6015: result: $cf_cv_curses_dir" >&5
6016 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6017
6018 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6019 then
6020
6021 if test "x$prefix" != xNONE; then
6022         cf_path_syntax="$prefix"
6023 else
6024         cf_path_syntax="$ac_default_prefix"
6025 fi
6026
6027 case ".$withval" in
6028 (.\$\(*\)*|.\'*\'*)
6029         ;;
6030 (..|./*|.\\*)
6031         ;;
6032 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6033         ;;
6034 (.\$\{*prefix\}*|.\$\{*dir\}*)
6035         eval withval="$withval"
6036         case ".$withval" in
6037         (.NONE/*)
6038                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6039                 ;;
6040         esac
6041         ;;
6042 (.no|.NONE/*)
6043         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6044         ;;
6045 (*)
6046         { { echo "$as_me:6046: error: expected a pathname, not \"$withval\"" >&5
6047 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6048    { (exit 1); exit 1; }; }
6049         ;;
6050 esac
6051
6052         if test -d "$cf_cv_curses_dir"
6053         then
6054
6055 if test -n "$cf_cv_curses_dir/include" ; then
6056   for cf_add_incdir in $cf_cv_curses_dir/include
6057   do
6058         while test "$cf_add_incdir" != /usr/include
6059         do
6060           if test -d "$cf_add_incdir"
6061           then
6062                 cf_have_incdir=no
6063                 if test -n "$CFLAGS$CPPFLAGS" ; then
6064                   # a loop is needed to ensure we can add subdirs of existing dirs
6065                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6066                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6067                           cf_have_incdir=yes; break
6068                         fi
6069                   done
6070                 fi
6071
6072                 if test "$cf_have_incdir" = no ; then
6073                   if test "$cf_add_incdir" = /usr/local/include ; then
6074                         if test "$GCC" = yes
6075                         then
6076                           cf_save_CPPFLAGS=$CPPFLAGS
6077
6078         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6079         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6080
6081                           cat >"conftest.$ac_ext" <<_ACEOF
6082 #line 6082 "configure"
6083 #include "confdefs.h"
6084 #include <stdio.h>
6085 int
6086 main (void)
6087 {
6088 printf("Hello")
6089   ;
6090   return 0;
6091 }
6092 _ACEOF
6093 rm -f "conftest.$ac_objext"
6094 if { (eval echo "$as_me:6094: \"$ac_compile\"") >&5
6095   (eval $ac_compile) 2>&5
6096   ac_status=$?
6097   echo "$as_me:6097: \$? = $ac_status" >&5
6098   (exit "$ac_status"); } &&
6099          { ac_try='test -s "conftest.$ac_objext"'
6100   { (eval echo "$as_me:6100: \"$ac_try\"") >&5
6101   (eval $ac_try) 2>&5
6102   ac_status=$?
6103   echo "$as_me:6103: \$? = $ac_status" >&5
6104   (exit "$ac_status"); }; }; then
6105   :
6106 else
6107   echo "$as_me: failed program was:" >&5
6108 cat "conftest.$ac_ext" >&5
6109 cf_have_incdir=yes
6110 fi
6111 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6112                           CPPFLAGS=$cf_save_CPPFLAGS
6113                         fi
6114                   fi
6115                 fi
6116
6117                 if test "$cf_have_incdir" = no ; then
6118                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6119
6120 echo "${as_me:-configure}:6120: testing adding $cf_add_incdir to include-path ..." 1>&5
6121
6122                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6123
6124                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6125                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6126                   cf_add_incdir="$cf_top_incdir"
6127                 else
6128                   break
6129                 fi
6130           else
6131                 break
6132           fi
6133         done
6134   done
6135 fi
6136
6137 if test -n "$cf_cv_curses_dir/lib" ; then
6138         for cf_add_libdir in $cf_cv_curses_dir/lib
6139         do
6140                 if test "$cf_add_libdir" = /usr/lib ; then
6141                         :
6142                 elif test -d "$cf_add_libdir"
6143                 then
6144                         cf_have_libdir=no
6145                         if test -n "$LDFLAGS$LIBS" ; then
6146                                 # a loop is needed to ensure we can add subdirs of existing dirs
6147                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6148                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6149                                                 cf_have_libdir=yes; break
6150                                         fi
6151                                 done
6152                         fi
6153                         if test "$cf_have_libdir" = no ; then
6154                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6155
6156 echo "${as_me:-configure}:6156: testing adding $cf_add_libdir to library-path ..." 1>&5
6157
6158                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6159                         fi
6160                 fi
6161         done
6162 fi
6163
6164         fi
6165 fi
6166
6167 cf_cv_screen=curses
6168
6169 echo "$as_me:6169: checking for specified curses library type" >&5
6170 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6171
6172 # Check whether --with-screen or --without-screen was given.
6173 if test "${with_screen+set}" = set; then
6174   withval="$with_screen"
6175   cf_cv_screen=$withval
6176 else
6177
6178 # Check whether --with-ncursesw or --without-ncursesw was given.
6179 if test "${with_ncursesw+set}" = set; then
6180   withval="$with_ncursesw"
6181   cf_cv_screen=ncursesw
6182 else
6183
6184 # Check whether --with-ncurses or --without-ncurses was given.
6185 if test "${with_ncurses+set}" = set; then
6186   withval="$with_ncurses"
6187   cf_cv_screen=ncurses
6188 else
6189
6190 # Check whether --with-pdcurses or --without-pdcurses was given.
6191 if test "${with_pdcurses+set}" = set; then
6192   withval="$with_pdcurses"
6193   cf_cv_screen=pdcurses
6194 else
6195
6196 # Check whether --with-curses-colr or --without-curses-colr was given.
6197 if test "${with_curses_colr+set}" = set; then
6198   withval="$with_curses_colr"
6199   cf_cv_screen=curses_colr
6200 else
6201
6202 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6203 if test "${with_curses_5lib+set}" = set; then
6204   withval="$with_curses_5lib"
6205   cf_cv_screen=curses_5lib
6206 fi;
6207 fi;
6208 fi;
6209 fi;
6210 fi;
6211 fi;
6212
6213 echo "$as_me:6213: result: $cf_cv_screen" >&5
6214 echo "${ECHO_T}$cf_cv_screen" >&6
6215
6216 case $cf_cv_screen in
6217 (curses|curses_*)
6218
6219 echo "$as_me:6219: checking for extra include directories" >&5
6220 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6221 if test "${cf_cv_curses_incdir+set}" = set; then
6222   echo $ECHO_N "(cached) $ECHO_C" >&6
6223 else
6224
6225 cf_cv_curses_incdir=no
6226 case "$host_os" in
6227 (hpux10.*)
6228         if test "x$cf_cv_screen" = "xcurses_colr"
6229         then
6230                 test -d /usr/include/curses_colr && \
6231                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6232         fi
6233         ;;
6234 (sunos3*|sunos4*)
6235         if test "x$cf_cv_screen" = "xcurses_5lib"
6236         then
6237                 test -d /usr/5lib && \
6238                 test -d /usr/5include && \
6239                 cf_cv_curses_incdir="-I/usr/5include"
6240         fi
6241         ;;
6242 esac
6243
6244 fi
6245 echo "$as_me:6245: result: $cf_cv_curses_incdir" >&5
6246 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6247 if test "$cf_cv_curses_incdir" != no
6248 then
6249
6250         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6251         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6252
6253 fi
6254
6255 echo "$as_me:6255: checking if we have identified curses headers" >&5
6256 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6257 if test "${cf_cv_ncurses_header+set}" = set; then
6258   echo $ECHO_N "(cached) $ECHO_C" >&6
6259 else
6260
6261 cf_cv_ncurses_header=none
6262 for cf_header in \
6263         ncurses.h  \
6264         curses.h  ncurses/ncurses.h ncurses/curses.h
6265 do
6266 cat >"conftest.$ac_ext" <<_ACEOF
6267 #line 6267 "configure"
6268 #include "confdefs.h"
6269 #include <${cf_header}>
6270 int
6271 main (void)
6272 {
6273 initscr(); tgoto("?", 0,0)
6274   ;
6275   return 0;
6276 }
6277 _ACEOF
6278 rm -f "conftest.$ac_objext"
6279 if { (eval echo "$as_me:6279: \"$ac_compile\"") >&5
6280   (eval $ac_compile) 2>&5
6281   ac_status=$?
6282   echo "$as_me:6282: \$? = $ac_status" >&5
6283   (exit "$ac_status"); } &&
6284          { ac_try='test -s "conftest.$ac_objext"'
6285   { (eval echo "$as_me:6285: \"$ac_try\"") >&5
6286   (eval $ac_try) 2>&5
6287   ac_status=$?
6288   echo "$as_me:6288: \$? = $ac_status" >&5
6289   (exit "$ac_status"); }; }; then
6290   cf_cv_ncurses_header=$cf_header; break
6291 else
6292   echo "$as_me: failed program was:" >&5
6293 cat "conftest.$ac_ext" >&5
6294 fi
6295 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6296 done
6297
6298 fi
6299 echo "$as_me:6299: result: $cf_cv_ncurses_header" >&5
6300 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6301
6302 if test "$cf_cv_ncurses_header" = none ; then
6303         { { echo "$as_me:6303: error: No curses header-files found" >&5
6304 echo "$as_me: error: No curses header-files found" >&2;}
6305    { (exit 1); exit 1; }; }
6306 fi
6307
6308 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6309
6310 for ac_header in $cf_cv_ncurses_header
6311 do
6312 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6313 echo "$as_me:6313: checking for $ac_header" >&5
6314 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6315 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6316   echo $ECHO_N "(cached) $ECHO_C" >&6
6317 else
6318   cat >"conftest.$ac_ext" <<_ACEOF
6319 #line 6319 "configure"
6320 #include "confdefs.h"
6321 #include <$ac_header>
6322 _ACEOF
6323 if { (eval echo "$as_me:6323: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6324   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6325   ac_status=$?
6326   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6327   rm -f conftest.er1
6328   cat conftest.err >&5
6329   echo "$as_me:6329: \$? = $ac_status" >&5
6330   (exit "$ac_status"); } >/dev/null; then
6331   if test -s conftest.err; then
6332     ac_cpp_err=$ac_c_preproc_warn_flag
6333   else
6334     ac_cpp_err=
6335   fi
6336 else
6337   ac_cpp_err=yes
6338 fi
6339 if test -z "$ac_cpp_err"; then
6340   eval "$as_ac_Header=yes"
6341 else
6342   echo "$as_me: failed program was:" >&5
6343   cat "conftest.$ac_ext" >&5
6344   eval "$as_ac_Header=no"
6345 fi
6346 rm -f conftest.err "conftest.$ac_ext"
6347 fi
6348 echo "$as_me:6348: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6349 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6350 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6351   cat >>confdefs.h <<EOF
6352 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6353 EOF
6354
6355 fi
6356 done
6357
6358 echo "$as_me:6358: checking for terminfo header" >&5
6359 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6360 if test "${cf_cv_term_header+set}" = set; then
6361   echo $ECHO_N "(cached) $ECHO_C" >&6
6362 else
6363
6364 case "${cf_cv_ncurses_header}" in
6365 (*/ncurses.h|*/ncursesw.h)
6366         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6367         ;;
6368 (*)
6369         cf_term_header=term.h
6370         ;;
6371 esac
6372
6373 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6374 do
6375 cat >"conftest.$ac_ext" <<_ACEOF
6376 #line 6376 "configure"
6377 #include "confdefs.h"
6378 #include <stdio.h>
6379 #include <${cf_cv_ncurses_header:-curses.h}>
6380 #include <$cf_test>
6381
6382 int
6383 main (void)
6384 {
6385 int x = auto_left_margin; (void)x
6386   ;
6387   return 0;
6388 }
6389 _ACEOF
6390 rm -f "conftest.$ac_objext"
6391 if { (eval echo "$as_me:6391: \"$ac_compile\"") >&5
6392   (eval $ac_compile) 2>&5
6393   ac_status=$?
6394   echo "$as_me:6394: \$? = $ac_status" >&5
6395   (exit "$ac_status"); } &&
6396          { ac_try='test -s "conftest.$ac_objext"'
6397   { (eval echo "$as_me:6397: \"$ac_try\"") >&5
6398   (eval $ac_try) 2>&5
6399   ac_status=$?
6400   echo "$as_me:6400: \$? = $ac_status" >&5
6401   (exit "$ac_status"); }; }; then
6402
6403         cf_cv_term_header="$cf_test"
6404 else
6405   echo "$as_me: failed program was:" >&5
6406 cat "conftest.$ac_ext" >&5
6407
6408         cf_cv_term_header=unknown
6409
6410 fi
6411 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6412         test "$cf_cv_term_header" != unknown && break
6413 done
6414
6415 fi
6416 echo "$as_me:6416: result: $cf_cv_term_header" >&5
6417 echo "${ECHO_T}$cf_cv_term_header" >&6
6418
6419 # Set definitions to allow ifdef'ing to accommodate subdirectories
6420
6421 case "$cf_cv_term_header" in
6422 (*term.h)
6423
6424 cat >>confdefs.h <<\EOF
6425 #define HAVE_TERM_H 1
6426 EOF
6427
6428         ;;
6429 esac
6430
6431 case "$cf_cv_term_header" in
6432 (ncurses/term.h)
6433
6434 cat >>confdefs.h <<\EOF
6435 #define HAVE_NCURSES_TERM_H 1
6436 EOF
6437
6438         ;;
6439 (ncursesw/term.h)
6440
6441 cat >>confdefs.h <<\EOF
6442 #define HAVE_NCURSESW_TERM_H 1
6443 EOF
6444
6445         ;;
6446 esac
6447
6448 echo "$as_me:6448: checking for ncurses version" >&5
6449 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6450 if test "${cf_cv_ncurses_version+set}" = set; then
6451   echo $ECHO_N "(cached) $ECHO_C" >&6
6452 else
6453
6454         cf_cv_ncurses_version=no
6455         cf_tempfile=out$$
6456         rm -f "$cf_tempfile"
6457         if test "$cross_compiling" = yes; then
6458
6459         # This will not work if the preprocessor splits the line after the
6460         # Autoconf token.  The 'unproto' program does that.
6461         cat > "conftest.$ac_ext" <<EOF
6462 #include <${cf_cv_ncurses_header:-curses.h}>
6463 #undef Autoconf
6464 #ifdef NCURSES_VERSION
6465 Autoconf NCURSES_VERSION
6466 #else
6467 #ifdef __NCURSES_H
6468 Autoconf "old"
6469 #endif
6470 ;
6471 #endif
6472 EOF
6473         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6474         { (eval echo "$as_me:6474: \"$cf_try\"") >&5
6475   (eval $cf_try) 2>&5
6476   ac_status=$?
6477   echo "$as_me:6477: \$? = $ac_status" >&5
6478   (exit "$ac_status"); }
6479         if test -f conftest.out ; then
6480                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6481                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6482                 rm -f conftest.out
6483         fi
6484
6485 else
6486   cat >"conftest.$ac_ext" <<_ACEOF
6487 #line 6487 "configure"
6488 #include "confdefs.h"
6489
6490 #include <${cf_cv_ncurses_header:-curses.h}>
6491 #include <stdio.h>
6492 int main(void)
6493 {
6494         FILE *fp = fopen("$cf_tempfile", "w");
6495 #ifdef NCURSES_VERSION
6496 # ifdef NCURSES_VERSION_PATCH
6497         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6498 # else
6499         fprintf(fp, "%s\\n", NCURSES_VERSION);
6500 # endif
6501 #else
6502 # ifdef __NCURSES_H
6503         fprintf(fp, "old\\n");
6504 # else
6505         make an error
6506 # endif
6507 #endif
6508         ${cf_cv_main_return:-return}(0);
6509 }
6510 _ACEOF
6511 rm -f "conftest$ac_exeext"
6512 if { (eval echo "$as_me:6512: \"$ac_link\"") >&5
6513   (eval $ac_link) 2>&5
6514   ac_status=$?
6515   echo "$as_me:6515: \$? = $ac_status" >&5
6516   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6517   { (eval echo "$as_me:6517: \"$ac_try\"") >&5
6518   (eval $ac_try) 2>&5
6519   ac_status=$?
6520   echo "$as_me:6520: \$? = $ac_status" >&5
6521   (exit "$ac_status"); }; }; then
6522
6523         cf_cv_ncurses_version=`cat $cf_tempfile`
6524 else
6525   echo "$as_me: program exited with status $ac_status" >&5
6526 echo "$as_me: failed program was:" >&5
6527 cat "conftest.$ac_ext" >&5
6528 fi
6529 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6530 fi
6531         rm -f "$cf_tempfile"
6532
6533 fi
6534 echo "$as_me:6534: result: $cf_cv_ncurses_version" >&5
6535 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6536 test "$cf_cv_ncurses_version" = no ||
6537 cat >>confdefs.h <<\EOF
6538 #define NCURSES 1
6539 EOF
6540
6541 echo "$as_me:6541: checking if we have identified curses libraries" >&5
6542 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6543 cat >"conftest.$ac_ext" <<_ACEOF
6544 #line 6544 "configure"
6545 #include "confdefs.h"
6546 #include <${cf_cv_ncurses_header:-curses.h}>
6547 int
6548 main (void)
6549 {
6550 initscr(); tgoto("?", 0,0)
6551   ;
6552   return 0;
6553 }
6554 _ACEOF
6555 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6556 if { (eval echo "$as_me:6556: \"$ac_link\"") >&5
6557   (eval $ac_link) 2>&5
6558   ac_status=$?
6559   echo "$as_me:6559: \$? = $ac_status" >&5
6560   (exit "$ac_status"); } &&
6561          { ac_try='test -s "conftest$ac_exeext"'
6562   { (eval echo "$as_me:6562: \"$ac_try\"") >&5
6563   (eval $ac_try) 2>&5
6564   ac_status=$?
6565   echo "$as_me:6565: \$? = $ac_status" >&5
6566   (exit "$ac_status"); }; }; then
6567   cf_result=yes
6568 else
6569   echo "$as_me: failed program was:" >&5
6570 cat "conftest.$ac_ext" >&5
6571 cf_result=no
6572 fi
6573 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6574 echo "$as_me:6574: result: $cf_result" >&5
6575 echo "${ECHO_T}$cf_result" >&6
6576
6577 if test "$cf_result" = no ; then
6578 case "$host_os" in
6579 (freebsd*)
6580         echo "$as_me:6580: checking for tgoto in -lmytinfo" >&5
6581 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6582 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6583   echo $ECHO_N "(cached) $ECHO_C" >&6
6584 else
6585   ac_check_lib_save_LIBS=$LIBS
6586 LIBS="-lmytinfo  $LIBS"
6587 cat >"conftest.$ac_ext" <<_ACEOF
6588 #line 6588 "configure"
6589 #include "confdefs.h"
6590
6591 /* Override any gcc2 internal prototype to avoid an error.  */
6592 #ifdef __cplusplus
6593 extern "C"
6594 #endif
6595 /* We use char because int might match the return type of a gcc2
6596    builtin and then its argument prototype would still apply.  */
6597 char tgoto ();
6598 int
6599 main (void)
6600 {
6601 tgoto ();
6602   ;
6603   return 0;
6604 }
6605 _ACEOF
6606 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6607 if { (eval echo "$as_me:6607: \"$ac_link\"") >&5
6608   (eval $ac_link) 2>&5
6609   ac_status=$?
6610   echo "$as_me:6610: \$? = $ac_status" >&5
6611   (exit "$ac_status"); } &&
6612          { ac_try='test -s "conftest$ac_exeext"'
6613   { (eval echo "$as_me:6613: \"$ac_try\"") >&5
6614   (eval $ac_try) 2>&5
6615   ac_status=$?
6616   echo "$as_me:6616: \$? = $ac_status" >&5
6617   (exit "$ac_status"); }; }; then
6618   ac_cv_lib_mytinfo_tgoto=yes
6619 else
6620   echo "$as_me: failed program was:" >&5
6621 cat "conftest.$ac_ext" >&5
6622 ac_cv_lib_mytinfo_tgoto=no
6623 fi
6624 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6625 LIBS=$ac_check_lib_save_LIBS
6626 fi
6627 echo "$as_me:6627: result: $ac_cv_lib_mytinfo_tgoto" >&5
6628 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6629 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6630
6631 cf_add_libs="$LIBS"
6632 # reverse order
6633 cf_add_0lib=
6634 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6635 # filter duplicates
6636 for cf_add_1lib in $cf_add_0lib; do
6637         for cf_add_2lib in $cf_add_libs; do
6638                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6639                         cf_add_1lib=
6640                         break
6641                 fi
6642         done
6643         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6644 done
6645 LIBS="$cf_add_libs"
6646
6647 fi
6648
6649         ;;
6650 (hpux10.*)
6651         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6652         # next (1998), and xcurses "newer" (2000).  There is no header file for
6653         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6654         # term.h) for cur_colr
6655         if test "x$cf_cv_screen" = "xcurses_colr"
6656         then
6657                 echo "$as_me:6657: checking for initscr in -lcur_colr" >&5
6658 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6659 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6660   echo $ECHO_N "(cached) $ECHO_C" >&6
6661 else
6662   ac_check_lib_save_LIBS=$LIBS
6663 LIBS="-lcur_colr  $LIBS"
6664 cat >"conftest.$ac_ext" <<_ACEOF
6665 #line 6665 "configure"
6666 #include "confdefs.h"
6667
6668 /* Override any gcc2 internal prototype to avoid an error.  */
6669 #ifdef __cplusplus
6670 extern "C"
6671 #endif
6672 /* We use char because int might match the return type of a gcc2
6673    builtin and then its argument prototype would still apply.  */
6674 char initscr ();
6675 int
6676 main (void)
6677 {
6678 initscr ();
6679   ;
6680   return 0;
6681 }
6682 _ACEOF
6683 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6684 if { (eval echo "$as_me:6684: \"$ac_link\"") >&5
6685   (eval $ac_link) 2>&5
6686   ac_status=$?
6687   echo "$as_me:6687: \$? = $ac_status" >&5
6688   (exit "$ac_status"); } &&
6689          { ac_try='test -s "conftest$ac_exeext"'
6690   { (eval echo "$as_me:6690: \"$ac_try\"") >&5
6691   (eval $ac_try) 2>&5
6692   ac_status=$?
6693   echo "$as_me:6693: \$? = $ac_status" >&5
6694   (exit "$ac_status"); }; }; then
6695   ac_cv_lib_cur_colr_initscr=yes
6696 else
6697   echo "$as_me: failed program was:" >&5
6698 cat "conftest.$ac_ext" >&5
6699 ac_cv_lib_cur_colr_initscr=no
6700 fi
6701 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6702 LIBS=$ac_check_lib_save_LIBS
6703 fi
6704 echo "$as_me:6704: result: $ac_cv_lib_cur_colr_initscr" >&5
6705 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6706 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
6707
6708 cf_add_libs="$LIBS"
6709 # reverse order
6710 cf_add_0lib=
6711 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6712 # filter duplicates
6713 for cf_add_1lib in $cf_add_0lib; do
6714         for cf_add_2lib in $cf_add_libs; do
6715                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6716                         cf_add_1lib=
6717                         break
6718                 fi
6719         done
6720         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6721 done
6722 LIBS="$cf_add_libs"
6723
6724                         ac_cv_func_initscr=yes
6725
6726 else
6727
6728                 echo "$as_me:6728: checking for initscr in -lHcurses" >&5
6729 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6730 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6731   echo $ECHO_N "(cached) $ECHO_C" >&6
6732 else
6733   ac_check_lib_save_LIBS=$LIBS
6734 LIBS="-lHcurses  $LIBS"
6735 cat >"conftest.$ac_ext" <<_ACEOF
6736 #line 6736 "configure"
6737 #include "confdefs.h"
6738
6739 /* Override any gcc2 internal prototype to avoid an error.  */
6740 #ifdef __cplusplus
6741 extern "C"
6742 #endif
6743 /* We use char because int might match the return type of a gcc2
6744    builtin and then its argument prototype would still apply.  */
6745 char initscr ();
6746 int
6747 main (void)
6748 {
6749 initscr ();
6750   ;
6751   return 0;
6752 }
6753 _ACEOF
6754 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6755 if { (eval echo "$as_me:6755: \"$ac_link\"") >&5
6756   (eval $ac_link) 2>&5
6757   ac_status=$?
6758   echo "$as_me:6758: \$? = $ac_status" >&5
6759   (exit "$ac_status"); } &&
6760          { ac_try='test -s "conftest$ac_exeext"'
6761   { (eval echo "$as_me:6761: \"$ac_try\"") >&5
6762   (eval $ac_try) 2>&5
6763   ac_status=$?
6764   echo "$as_me:6764: \$? = $ac_status" >&5
6765   (exit "$ac_status"); }; }; then
6766   ac_cv_lib_Hcurses_initscr=yes
6767 else
6768   echo "$as_me: failed program was:" >&5
6769 cat "conftest.$ac_ext" >&5
6770 ac_cv_lib_Hcurses_initscr=no
6771 fi
6772 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6773 LIBS=$ac_check_lib_save_LIBS
6774 fi
6775 echo "$as_me:6775: result: $ac_cv_lib_Hcurses_initscr" >&5
6776 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6777 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
6778
6779                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6780
6781 cf_add_libs="$LIBS"
6782 # reverse order
6783 cf_add_0lib=
6784 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6785 # filter duplicates
6786 for cf_add_1lib in $cf_add_0lib; do
6787         for cf_add_2lib in $cf_add_libs; do
6788                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6789                         cf_add_1lib=
6790                         break
6791                 fi
6792         done
6793         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6794 done
6795 LIBS="$cf_add_libs"
6796
6797         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6798         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6799
6800                         ac_cv_func_initscr=yes
6801
6802 fi
6803
6804 fi
6805
6806         fi
6807         ;;
6808 (linux*)
6809         case `arch 2>/dev/null` in
6810         (x86_64)
6811                 if test -d /lib64
6812                 then
6813
6814 if test -n "/lib64" ; then
6815         for cf_add_libdir in /lib64
6816         do
6817                 if test "$cf_add_libdir" = /usr/lib ; then
6818                         :
6819                 elif test -d "$cf_add_libdir"
6820                 then
6821                         cf_have_libdir=no
6822                         if test -n "$LDFLAGS$LIBS" ; then
6823                                 # a loop is needed to ensure we can add subdirs of existing dirs
6824                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6825                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6826                                                 cf_have_libdir=yes; break
6827                                         fi
6828                                 done
6829                         fi
6830                         if test "$cf_have_libdir" = no ; then
6831                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6832
6833 echo "${as_me:-configure}:6833: testing adding $cf_add_libdir to library-path ..." 1>&5
6834
6835                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6836                         fi
6837                 fi
6838         done
6839 fi
6840
6841                 else
6842
6843 if test -n "/lib" ; then
6844         for cf_add_libdir in /lib
6845         do
6846                 if test "$cf_add_libdir" = /usr/lib ; then
6847                         :
6848                 elif test -d "$cf_add_libdir"
6849                 then
6850                         cf_have_libdir=no
6851                         if test -n "$LDFLAGS$LIBS" ; then
6852                                 # a loop is needed to ensure we can add subdirs of existing dirs
6853                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6854                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6855                                                 cf_have_libdir=yes; break
6856                                         fi
6857                                 done
6858                         fi
6859                         if test "$cf_have_libdir" = no ; then
6860                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6861
6862 echo "${as_me:-configure}:6862: testing adding $cf_add_libdir to library-path ..." 1>&5
6863
6864                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6865                         fi
6866                 fi
6867         done
6868 fi
6869
6870                 fi
6871                 ;;
6872         (*)
6873
6874 if test -n "/lib" ; then
6875         for cf_add_libdir in /lib
6876         do
6877                 if test "$cf_add_libdir" = /usr/lib ; then
6878                         :
6879                 elif test -d "$cf_add_libdir"
6880                 then
6881                         cf_have_libdir=no
6882                         if test -n "$LDFLAGS$LIBS" ; then
6883                                 # a loop is needed to ensure we can add subdirs of existing dirs
6884                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6885                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6886                                                 cf_have_libdir=yes; break
6887                                         fi
6888                                 done
6889                         fi
6890                         if test "$cf_have_libdir" = no ; then
6891                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6892
6893 echo "${as_me:-configure}:6893: testing adding $cf_add_libdir to library-path ..." 1>&5
6894
6895                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6896                         fi
6897                 fi
6898         done
6899 fi
6900
6901                 ;;
6902         esac
6903         ;;
6904 (sunos3*|sunos4*)
6905         if test "x$cf_cv_screen" = "xcurses_5lib"
6906         then
6907                 if test -d /usr/5lib ; then
6908
6909 if test -n "/usr/5lib" ; then
6910         for cf_add_libdir in /usr/5lib
6911         do
6912                 if test "$cf_add_libdir" = /usr/lib ; then
6913                         :
6914                 elif test -d "$cf_add_libdir"
6915                 then
6916                         cf_have_libdir=no
6917                         if test -n "$LDFLAGS$LIBS" ; then
6918                                 # a loop is needed to ensure we can add subdirs of existing dirs
6919                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6920                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6921                                                 cf_have_libdir=yes; break
6922                                         fi
6923                                 done
6924                         fi
6925                         if test "$cf_have_libdir" = no ; then
6926                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6927
6928 echo "${as_me:-configure}:6928: testing adding $cf_add_libdir to library-path ..." 1>&5
6929
6930                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6931                         fi
6932                 fi
6933         done
6934 fi
6935
6936 cf_add_libs="$LIBS"
6937 # reverse order
6938 cf_add_0lib=
6939 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6940 # filter duplicates
6941 for cf_add_1lib in $cf_add_0lib; do
6942         for cf_add_2lib in $cf_add_libs; do
6943                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6944                         cf_add_1lib=
6945                         break
6946                 fi
6947         done
6948         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6949 done
6950 LIBS="$cf_add_libs"
6951
6952                 fi
6953         fi
6954         ac_cv_func_initscr=yes
6955         ;;
6956 esac
6957
6958 if test ".$ac_cv_func_initscr" != .yes ; then
6959         cf_save_LIBS="$LIBS"
6960
6961         if test ".${cf_cv_ncurses_version:-no}" != .no
6962         then
6963                 cf_check_list="ncurses curses cursesX"
6964         else
6965                 cf_check_list="cursesX curses ncurses"
6966         fi
6967
6968         # Check for library containing tgoto.  Do this before curses library
6969         # because it may be needed to link the test-case for initscr.
6970         if test "x$cf_term_lib" = x
6971         then
6972                 echo "$as_me:6972: checking for tgoto" >&5
6973 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6974 if test "${ac_cv_func_tgoto+set}" = set; then
6975   echo $ECHO_N "(cached) $ECHO_C" >&6
6976 else
6977   cat >"conftest.$ac_ext" <<_ACEOF
6978 #line 6978 "configure"
6979 #include "confdefs.h"
6980 #define tgoto autoconf_temporary
6981 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6982 #undef tgoto
6983
6984 #ifdef __cplusplus
6985 extern "C"
6986 #endif
6987
6988 /* We use char because int might match the return type of a gcc2
6989    builtin and then its argument prototype would still apply.  */
6990 char tgoto (void);
6991
6992 int
6993 main (void)
6994 {
6995
6996 /* The GNU C library defines stubs for functions which it implements
6997     to always fail with ENOSYS.  Some functions are actually named
6998     something starting with __ and the normal name is an alias.  */
6999 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7000 #error found stub for tgoto
7001 #endif
7002
7003         return tgoto ();
7004   ;
7005   return 0;
7006 }
7007 _ACEOF
7008 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7009 if { (eval echo "$as_me:7009: \"$ac_link\"") >&5
7010   (eval $ac_link) 2>&5
7011   ac_status=$?
7012   echo "$as_me:7012: \$? = $ac_status" >&5
7013   (exit "$ac_status"); } &&
7014          { ac_try='test -s "conftest$ac_exeext"'
7015   { (eval echo "$as_me:7015: \"$ac_try\"") >&5
7016   (eval $ac_try) 2>&5
7017   ac_status=$?
7018   echo "$as_me:7018: \$? = $ac_status" >&5
7019   (exit "$ac_status"); }; }; then
7020   ac_cv_func_tgoto=yes
7021 else
7022   echo "$as_me: failed program was:" >&5
7023 cat "conftest.$ac_ext" >&5
7024 ac_cv_func_tgoto=no
7025 fi
7026 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7027 fi
7028 echo "$as_me:7028: result: $ac_cv_func_tgoto" >&5
7029 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7030 if test "$ac_cv_func_tgoto" = yes; then
7031   cf_term_lib=predefined
7032 else
7033
7034                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7035                         do
7036                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7037 echo "$as_me:7037: checking for tgoto in -l$cf_term_lib" >&5
7038 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7039 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7040   echo $ECHO_N "(cached) $ECHO_C" >&6
7041 else
7042   ac_check_lib_save_LIBS=$LIBS
7043 LIBS="-l$cf_term_lib  $LIBS"
7044 cat >"conftest.$ac_ext" <<_ACEOF
7045 #line 7045 "configure"
7046 #include "confdefs.h"
7047
7048 /* Override any gcc2 internal prototype to avoid an error.  */
7049 #ifdef __cplusplus
7050 extern "C"
7051 #endif
7052 /* We use char because int might match the return type of a gcc2
7053    builtin and then its argument prototype would still apply.  */
7054 char tgoto ();
7055 int
7056 main (void)
7057 {
7058 tgoto ();
7059   ;
7060   return 0;
7061 }
7062 _ACEOF
7063 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7064 if { (eval echo "$as_me:7064: \"$ac_link\"") >&5
7065   (eval $ac_link) 2>&5
7066   ac_status=$?
7067   echo "$as_me:7067: \$? = $ac_status" >&5
7068   (exit "$ac_status"); } &&
7069          { ac_try='test -s "conftest$ac_exeext"'
7070   { (eval echo "$as_me:7070: \"$ac_try\"") >&5
7071   (eval $ac_try) 2>&5
7072   ac_status=$?
7073   echo "$as_me:7073: \$? = $ac_status" >&5
7074   (exit "$ac_status"); }; }; then
7075   eval "$as_ac_Lib=yes"
7076 else
7077   echo "$as_me: failed program was:" >&5
7078 cat "conftest.$ac_ext" >&5
7079 eval "$as_ac_Lib=no"
7080 fi
7081 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7082 LIBS=$ac_check_lib_save_LIBS
7083 fi
7084 echo "$as_me:7084: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7085 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7086 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7087
7088                                         : "${cf_nculib_root:=$cf_term_lib}"
7089                                         break
7090
7091 fi
7092
7093                         done
7094
7095 fi
7096
7097         fi
7098
7099         # Check for library containing initscr
7100         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7101         if test "x$cf_curs_lib" = x
7102         then
7103                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7104                 do
7105                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7106                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7107                                 echo "$as_me:7107: checking if we can link with $cf_curs_lib library" >&5
7108 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7109                                 cat >"conftest.$ac_ext" <<_ACEOF
7110 #line 7110 "configure"
7111 #include "confdefs.h"
7112 #include <${cf_cv_ncurses_header:-curses.h}>
7113 int
7114 main (void)
7115 {
7116 initscr()
7117   ;
7118   return 0;
7119 }
7120 _ACEOF
7121 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7122 if { (eval echo "$as_me:7122: \"$ac_link\"") >&5
7123   (eval $ac_link) 2>&5
7124   ac_status=$?
7125   echo "$as_me:7125: \$? = $ac_status" >&5
7126   (exit "$ac_status"); } &&
7127          { ac_try='test -s "conftest$ac_exeext"'
7128   { (eval echo "$as_me:7128: \"$ac_try\"") >&5
7129   (eval $ac_try) 2>&5
7130   ac_status=$?
7131   echo "$as_me:7131: \$? = $ac_status" >&5
7132   (exit "$ac_status"); }; }; then
7133   cf_result=yes
7134 else
7135   echo "$as_me: failed program was:" >&5
7136 cat "conftest.$ac_ext" >&5
7137 cf_result=no
7138 fi
7139 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7140                                 echo "$as_me:7140: result: $cf_result" >&5
7141 echo "${ECHO_T}$cf_result" >&6
7142                                 test "$cf_result" = yes && break
7143                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7144                                 cf_result=no
7145                         elif test "$cf_term_lib" != predefined ; then
7146                                 echo "$as_me:7146: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7147 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7148                                 cat >"conftest.$ac_ext" <<_ACEOF
7149 #line 7149 "configure"
7150 #include "confdefs.h"
7151 #include <${cf_cv_ncurses_header:-curses.h}>
7152 int
7153 main (void)
7154 {
7155 initscr(); tgoto((char *)0, 0, 0);
7156   ;
7157   return 0;
7158 }
7159 _ACEOF
7160 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7161 if { (eval echo "$as_me:7161: \"$ac_link\"") >&5
7162   (eval $ac_link) 2>&5
7163   ac_status=$?
7164   echo "$as_me:7164: \$? = $ac_status" >&5
7165   (exit "$ac_status"); } &&
7166          { ac_try='test -s "conftest$ac_exeext"'
7167   { (eval echo "$as_me:7167: \"$ac_try\"") >&5
7168   (eval $ac_try) 2>&5
7169   ac_status=$?
7170   echo "$as_me:7170: \$? = $ac_status" >&5
7171   (exit "$ac_status"); }; }; then
7172   cf_result=no
7173 else
7174   echo "$as_me: failed program was:" >&5
7175 cat "conftest.$ac_ext" >&5
7176
7177                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7178                                         cat >"conftest.$ac_ext" <<_ACEOF
7179 #line 7179 "configure"
7180 #include "confdefs.h"
7181 #include <${cf_cv_ncurses_header:-curses.h}>
7182 int
7183 main (void)
7184 {
7185 initscr()
7186   ;
7187   return 0;
7188 }
7189 _ACEOF
7190 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7191 if { (eval echo "$as_me:7191: \"$ac_link\"") >&5
7192   (eval $ac_link) 2>&5
7193   ac_status=$?
7194   echo "$as_me:7194: \$? = $ac_status" >&5
7195   (exit "$ac_status"); } &&
7196          { ac_try='test -s "conftest$ac_exeext"'
7197   { (eval echo "$as_me:7197: \"$ac_try\"") >&5
7198   (eval $ac_try) 2>&5
7199   ac_status=$?
7200   echo "$as_me:7200: \$? = $ac_status" >&5
7201   (exit "$ac_status"); }; }; then
7202   cf_result=yes
7203 else
7204   echo "$as_me: failed program was:" >&5
7205 cat "conftest.$ac_ext" >&5
7206 cf_result=error
7207 fi
7208 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7209
7210 fi
7211 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7212                                 echo "$as_me:7212: result: $cf_result" >&5
7213 echo "${ECHO_T}$cf_result" >&6
7214                                 test "$cf_result" != error && break
7215                         fi
7216                 done
7217         fi
7218         test "$cf_curs_lib" = unknown && { { echo "$as_me:7218: error: no curses library found" >&5
7219 echo "$as_me: error: no curses library found" >&2;}
7220    { (exit 1); exit 1; }; }
7221 fi
7222 fi
7223
7224         ;;
7225 (ncursesw*)
7226
7227 echo "$as_me:7227: checking for multibyte character support" >&5
7228 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7229 if test "${cf_cv_utf8_lib+set}" = set; then
7230   echo $ECHO_N "(cached) $ECHO_C" >&6
7231 else
7232
7233         cf_save_LIBS="$LIBS"
7234         cat >"conftest.$ac_ext" <<_ACEOF
7235 #line 7235 "configure"
7236 #include "confdefs.h"
7237
7238 #include <stdlib.h>
7239 int
7240 main (void)
7241 {
7242 putwc(0,0);
7243   ;
7244   return 0;
7245 }
7246 _ACEOF
7247 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7248 if { (eval echo "$as_me:7248: \"$ac_link\"") >&5
7249   (eval $ac_link) 2>&5
7250   ac_status=$?
7251   echo "$as_me:7251: \$? = $ac_status" >&5
7252   (exit "$ac_status"); } &&
7253          { ac_try='test -s "conftest$ac_exeext"'
7254   { (eval echo "$as_me:7254: \"$ac_try\"") >&5
7255   (eval $ac_try) 2>&5
7256   ac_status=$?
7257   echo "$as_me:7257: \$? = $ac_status" >&5
7258   (exit "$ac_status"); }; }; then
7259   cf_cv_utf8_lib=yes
7260 else
7261   echo "$as_me: failed program was:" >&5
7262 cat "conftest.$ac_ext" >&5
7263
7264 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7265 # will be set on completion of the AC_TRY_LINK below.
7266 cf_cv_header_path_utf8=
7267 cf_cv_library_path_utf8=
7268
7269 echo "${as_me:-configure}:7269: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7270
7271 cf_save_LIBS="$LIBS"
7272
7273 cat >"conftest.$ac_ext" <<_ACEOF
7274 #line 7274 "configure"
7275 #include "confdefs.h"
7276
7277 #include <libutf8.h>
7278 int
7279 main (void)
7280 {
7281 putwc(0,0);
7282   ;
7283   return 0;
7284 }
7285 _ACEOF
7286 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7287 if { (eval echo "$as_me:7287: \"$ac_link\"") >&5
7288   (eval $ac_link) 2>&5
7289   ac_status=$?
7290   echo "$as_me:7290: \$? = $ac_status" >&5
7291   (exit "$ac_status"); } &&
7292          { ac_try='test -s "conftest$ac_exeext"'
7293   { (eval echo "$as_me:7293: \"$ac_try\"") >&5
7294   (eval $ac_try) 2>&5
7295   ac_status=$?
7296   echo "$as_me:7296: \$? = $ac_status" >&5
7297   (exit "$ac_status"); }; }; then
7298
7299         cf_cv_find_linkage_utf8=yes
7300         cf_cv_header_path_utf8=/usr/include
7301         cf_cv_library_path_utf8=/usr/lib
7302
7303 else
7304   echo "$as_me: failed program was:" >&5
7305 cat "conftest.$ac_ext" >&5
7306
7307 LIBS="-lutf8  $cf_save_LIBS"
7308
7309 cat >"conftest.$ac_ext" <<_ACEOF
7310 #line 7310 "configure"
7311 #include "confdefs.h"
7312
7313 #include <libutf8.h>
7314 int
7315 main (void)
7316 {
7317 putwc(0,0);
7318   ;
7319   return 0;
7320 }
7321 _ACEOF
7322 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7323 if { (eval echo "$as_me:7323: \"$ac_link\"") >&5
7324   (eval $ac_link) 2>&5
7325   ac_status=$?
7326   echo "$as_me:7326: \$? = $ac_status" >&5
7327   (exit "$ac_status"); } &&
7328          { ac_try='test -s "conftest$ac_exeext"'
7329   { (eval echo "$as_me:7329: \"$ac_try\"") >&5
7330   (eval $ac_try) 2>&5
7331   ac_status=$?
7332   echo "$as_me:7332: \$? = $ac_status" >&5
7333   (exit "$ac_status"); }; }; then
7334
7335         cf_cv_find_linkage_utf8=yes
7336         cf_cv_header_path_utf8=/usr/include
7337         cf_cv_library_path_utf8=/usr/lib
7338         cf_cv_library_file_utf8="-lutf8"
7339
7340 else
7341   echo "$as_me: failed program was:" >&5
7342 cat "conftest.$ac_ext" >&5
7343
7344         cf_cv_find_linkage_utf8=no
7345         LIBS="$cf_save_LIBS"
7346
7347         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7348
7349 echo "${as_me:-configure}:7349: testing find linkage for utf8 library ..." 1>&5
7350
7351 echo "${as_me:-configure}:7351: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7352
7353         cf_save_CPPFLAGS="$CPPFLAGS"
7354         cf_test_CPPFLAGS="$CPPFLAGS"
7355
7356 cf_search=
7357
7358 # collect the current set of include-directories from compiler flags
7359 cf_header_path_list=""
7360 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7361         for cf_header_path in $CPPFLAGS $CFLAGS
7362         do
7363                 case "$cf_header_path" in
7364                 (-I*)
7365                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7366
7367 test "x$cf_header_path" != "xNONE" && \
7368 test -d "$cf_header_path" && \
7369  {
7370         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7371         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7372         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7373         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7374         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7375         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7376 }
7377
7378                         cf_header_path_list="$cf_header_path_list $cf_search"
7379                         ;;
7380                 esac
7381         done
7382 fi
7383
7384 # add the variations for the package we are looking for
7385
7386 cf_search=
7387
7388 test "x$prefix" != "xNONE" && \
7389 test -d "$prefix" && \
7390  {
7391         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7392         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7393         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7394         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7395         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7396         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7397 }
7398
7399 for cf_subdir_prefix in \
7400         /usr \
7401         /usr/local \
7402         /usr/pkg \
7403         /opt \
7404         /opt/local \
7405         $HOME
7406 do
7407
7408 test "x$cf_subdir_prefix" != "x$prefix" && \
7409 test -d "$cf_subdir_prefix" && \
7410 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7411         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7412         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7413         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7414         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7415         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7416         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7417 }
7418
7419 done
7420
7421 test "$includedir" != NONE && \
7422 test "$includedir" != "/usr/include" && \
7423 test -d "$includedir" && {
7424         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7425         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7426 }
7427
7428 test "$oldincludedir" != NONE && \
7429 test "$oldincludedir" != "/usr/include" && \
7430 test -d "$oldincludedir" && {
7431         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7432         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7433 }
7434
7435 cf_search="$cf_search $cf_header_path_list"
7436
7437         for cf_cv_header_path_utf8 in $cf_search
7438         do
7439                 if test -d "$cf_cv_header_path_utf8" ; then
7440                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7441
7442 echo "${as_me:-configure}:7442: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7443
7444                         CPPFLAGS="$cf_save_CPPFLAGS"
7445
7446         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7447         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7448
7449                         cat >"conftest.$ac_ext" <<_ACEOF
7450 #line 7450 "configure"
7451 #include "confdefs.h"
7452
7453 #include <libutf8.h>
7454 int
7455 main (void)
7456 {
7457 putwc(0,0);
7458   ;
7459   return 0;
7460 }
7461 _ACEOF
7462 rm -f "conftest.$ac_objext"
7463 if { (eval echo "$as_me:7463: \"$ac_compile\"") >&5
7464   (eval $ac_compile) 2>&5
7465   ac_status=$?
7466   echo "$as_me:7466: \$? = $ac_status" >&5
7467   (exit "$ac_status"); } &&
7468          { ac_try='test -s "conftest.$ac_objext"'
7469   { (eval echo "$as_me:7469: \"$ac_try\"") >&5
7470   (eval $ac_try) 2>&5
7471   ac_status=$?
7472   echo "$as_me:7472: \$? = $ac_status" >&5
7473   (exit "$ac_status"); }; }; then
7474
7475                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7476
7477 echo "${as_me:-configure}:7477: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7478
7479                                 cf_cv_find_linkage_utf8=maybe
7480                                 cf_test_CPPFLAGS="$CPPFLAGS"
7481                                 break
7482 else
7483   echo "$as_me: failed program was:" >&5
7484 cat "conftest.$ac_ext" >&5
7485
7486                                 CPPFLAGS="$cf_save_CPPFLAGS"
7487
7488 fi
7489 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7490                 fi
7491         done
7492
7493         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7494
7495 echo "${as_me:-configure}:7495: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7496
7497                 cf_save_LIBS="$LIBS"
7498                 cf_save_LDFLAGS="$LDFLAGS"
7499
7500                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7501
7502 cf_search=
7503 cf_library_path_list=""
7504 if test -n "${LDFLAGS}${LIBS}" ; then
7505         for cf_library_path in $LDFLAGS $LIBS
7506         do
7507                 case "$cf_library_path" in
7508                 (-L*)
7509                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7510
7511 test "x$cf_library_path" != "xNONE" && \
7512 test -d "$cf_library_path" && \
7513  {
7514         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7515         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7516         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7517         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7518         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7519         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7520 }
7521
7522                         cf_library_path_list="$cf_library_path_list $cf_search"
7523                         ;;
7524                 esac
7525         done
7526 fi
7527
7528 cf_search=
7529
7530 test "x$prefix" != "xNONE" && \
7531 test -d "$prefix" && \
7532  {
7533         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7534         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7535         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7536         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7537         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7538         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7539 }
7540
7541 for cf_subdir_prefix in \
7542         /usr \
7543         /usr/local \
7544         /usr/pkg \
7545         /opt \
7546         /opt/local \
7547         $HOME
7548 do
7549
7550 test "x$cf_subdir_prefix" != "x$prefix" && \
7551 test -d "$cf_subdir_prefix" && \
7552 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7553         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7554         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7555         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7556         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7557         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7558         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7559 }
7560
7561 done
7562
7563 cf_search="$cf_library_path_list $cf_search"
7564
7565                         for cf_cv_library_path_utf8 in $cf_search
7566                         do
7567                                 if test -d "$cf_cv_library_path_utf8" ; then
7568                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7569
7570 echo "${as_me:-configure}:7570: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7571
7572                                         CPPFLAGS="$cf_test_CPPFLAGS"
7573                                         LIBS="-lutf8  $cf_save_LIBS"
7574                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7575                                         cat >"conftest.$ac_ext" <<_ACEOF
7576 #line 7576 "configure"
7577 #include "confdefs.h"
7578
7579 #include <libutf8.h>
7580 int
7581 main (void)
7582 {
7583 putwc(0,0);
7584   ;
7585   return 0;
7586 }
7587 _ACEOF
7588 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7589 if { (eval echo "$as_me:7589: \"$ac_link\"") >&5
7590   (eval $ac_link) 2>&5
7591   ac_status=$?
7592   echo "$as_me:7592: \$? = $ac_status" >&5
7593   (exit "$ac_status"); } &&
7594          { ac_try='test -s "conftest$ac_exeext"'
7595   { (eval echo "$as_me:7595: \"$ac_try\"") >&5
7596   (eval $ac_try) 2>&5
7597   ac_status=$?
7598   echo "$as_me:7598: \$? = $ac_status" >&5
7599   (exit "$ac_status"); }; }; then
7600
7601                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7602
7603 echo "${as_me:-configure}:7603: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7604
7605                                         cf_cv_find_linkage_utf8=yes
7606                                         cf_cv_library_file_utf8="-lutf8"
7607                                         break
7608 else
7609   echo "$as_me: failed program was:" >&5
7610 cat "conftest.$ac_ext" >&5
7611
7612                                         CPPFLAGS="$cf_save_CPPFLAGS"
7613                                         LIBS="$cf_save_LIBS"
7614                                         LDFLAGS="$cf_save_LDFLAGS"
7615
7616 fi
7617 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7618                                 fi
7619                         done
7620                         CPPFLAGS="$cf_save_CPPFLAGS"
7621                         LDFLAGS="$cf_save_LDFLAGS"
7622                 fi
7623
7624         else
7625                 cf_cv_find_linkage_utf8=no
7626         fi
7627
7628 fi
7629 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7630
7631 fi
7632 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7633
7634 LIBS="$cf_save_LIBS"
7635
7636 if test "$cf_cv_find_linkage_utf8" = yes ; then
7637 cf_cv_utf8_lib=add-on
7638 else
7639 cf_cv_utf8_lib=no
7640 fi
7641
7642 fi
7643 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7644 fi
7645 echo "$as_me:7645: result: $cf_cv_utf8_lib" >&5
7646 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7647
7648 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7649 # ncurses/ncursesw:
7650 if test "$cf_cv_utf8_lib" = "add-on" ; then
7651
7652 cat >>confdefs.h <<\EOF
7653 #define HAVE_LIBUTF8_H 1
7654 EOF
7655
7656 if test -n "$cf_cv_header_path_utf8" ; then
7657   for cf_add_incdir in $cf_cv_header_path_utf8
7658   do
7659         while test "$cf_add_incdir" != /usr/include
7660         do
7661           if test -d "$cf_add_incdir"
7662           then
7663                 cf_have_incdir=no
7664                 if test -n "$CFLAGS$CPPFLAGS" ; then
7665                   # a loop is needed to ensure we can add subdirs of existing dirs
7666                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7667                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7668                           cf_have_incdir=yes; break
7669                         fi
7670                   done
7671                 fi
7672
7673                 if test "$cf_have_incdir" = no ; then
7674                   if test "$cf_add_incdir" = /usr/local/include ; then
7675                         if test "$GCC" = yes
7676                         then
7677                           cf_save_CPPFLAGS=$CPPFLAGS
7678
7679         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7680         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7681
7682                           cat >"conftest.$ac_ext" <<_ACEOF
7683 #line 7683 "configure"
7684 #include "confdefs.h"
7685 #include <stdio.h>
7686 int
7687 main (void)
7688 {
7689 printf("Hello")
7690   ;
7691   return 0;
7692 }
7693 _ACEOF
7694 rm -f "conftest.$ac_objext"
7695 if { (eval echo "$as_me:7695: \"$ac_compile\"") >&5
7696   (eval $ac_compile) 2>&5
7697   ac_status=$?
7698   echo "$as_me:7698: \$? = $ac_status" >&5
7699   (exit "$ac_status"); } &&
7700          { ac_try='test -s "conftest.$ac_objext"'
7701   { (eval echo "$as_me:7701: \"$ac_try\"") >&5
7702   (eval $ac_try) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit "$ac_status"); }; }; then
7706   :
7707 else
7708   echo "$as_me: failed program was:" >&5
7709 cat "conftest.$ac_ext" >&5
7710 cf_have_incdir=yes
7711 fi
7712 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7713                           CPPFLAGS=$cf_save_CPPFLAGS
7714                         fi
7715                   fi
7716                 fi
7717
7718                 if test "$cf_have_incdir" = no ; then
7719                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7720
7721 echo "${as_me:-configure}:7721: testing adding $cf_add_incdir to include-path ..." 1>&5
7722
7723                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7724
7725                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7726                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7727                   cf_add_incdir="$cf_top_incdir"
7728                 else
7729                   break
7730                 fi
7731           else
7732                 break
7733           fi
7734         done
7735   done
7736 fi
7737
7738 if test -n "$cf_cv_library_path_utf8" ; then
7739         for cf_add_libdir in $cf_cv_library_path_utf8
7740         do
7741                 if test "$cf_add_libdir" = /usr/lib ; then
7742                         :
7743                 elif test -d "$cf_add_libdir"
7744                 then
7745                         cf_have_libdir=no
7746                         if test -n "$LDFLAGS$LIBS" ; then
7747                                 # a loop is needed to ensure we can add subdirs of existing dirs
7748                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7749                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7750                                                 cf_have_libdir=yes; break
7751                                         fi
7752                                 done
7753                         fi
7754                         if test "$cf_have_libdir" = no ; then
7755                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7756
7757 echo "${as_me:-configure}:7757: testing adding $cf_add_libdir to library-path ..." 1>&5
7758
7759                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7760                         fi
7761                 fi
7762         done
7763 fi
7764
7765 cf_add_libs="$LIBS"
7766 # reverse order
7767 cf_add_0lib=
7768 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7769 # filter duplicates
7770 for cf_add_1lib in $cf_add_0lib; do
7771         for cf_add_2lib in $cf_add_libs; do
7772                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7773                         cf_add_1lib=
7774                         break
7775                 fi
7776         done
7777         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7778 done
7779 LIBS="$cf_add_libs"
7780
7781 fi
7782
7783 cf_ncuconfig_root=$cf_cv_screen
7784 cf_have_ncuconfig=no
7785
7786 if test "x${PKG_CONFIG:=none}" != xnone; then
7787         echo "$as_me:7787: checking pkg-config for $cf_ncuconfig_root" >&5
7788 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7789         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7790                 echo "$as_me:7790: result: yes" >&5
7791 echo "${ECHO_T}yes" >&6
7792
7793                 echo "$as_me:7793: checking if the $cf_ncuconfig_root package files work" >&5
7794 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7795                 cf_have_ncuconfig=unknown
7796
7797                 cf_save_CFLAGS="$CFLAGS"
7798                 cf_save_CPPFLAGS="$CPPFLAGS"
7799                 cf_save_LIBS="$LIBS"
7800
7801                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7802                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7803
7804                 # while -W for passing linker flags is prevalent, it is not "standard".
7805                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7806                 # incompatible _and_ non-standard -W option which gives an error.  Work
7807                 # around that pitfall.
7808                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7809                 (x*c[89]9@@*-W*)
7810
7811 cf_fix_cppflags=no
7812 cf_new_cflags=
7813 cf_new_cppflags=
7814 cf_new_extra_cppflags=
7815
7816 for cf_add_cflags in $cf_pkg_cflags
7817 do
7818 case "$cf_fix_cppflags" in
7819 (no)
7820         case "$cf_add_cflags" in
7821         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7822                 case "$cf_add_cflags" in
7823                 (-D*)
7824                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7825
7826                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7827                                 && test -z "${cf_tst_cflags}" \
7828                                 && cf_fix_cppflags=yes
7829
7830                         if test "$cf_fix_cppflags" = yes ; then
7831
7832         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7833         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7834
7835                                 continue
7836                         elif test "${cf_tst_cflags}" = "\"'" ; then
7837
7838         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7839         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7840
7841                                 continue
7842                         fi
7843                         ;;
7844                 esac
7845                 case "$CPPFLAGS" in
7846                 (*$cf_add_cflags)
7847                         ;;
7848                 (*)
7849                         case "$cf_add_cflags" in
7850                         (-D*)
7851                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7852
7853 CPPFLAGS=`echo "$CPPFLAGS" | \
7854         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7855                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7856
7857                                 ;;
7858                         esac
7859
7860         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7861         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7862
7863                         ;;
7864                 esac
7865                 ;;
7866         (*)
7867
7868         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7869         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7870
7871                 ;;
7872         esac
7873         ;;
7874 (yes)
7875
7876         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7877         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7878
7879         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7880
7881         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7882                 && test -z "${cf_tst_cflags}" \
7883                 && cf_fix_cppflags=no
7884         ;;
7885 esac
7886 done
7887
7888 if test -n "$cf_new_cflags" ; then
7889
7890         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7891         CFLAGS="${CFLAGS}$cf_new_cflags"
7892
7893 fi
7894
7895 if test -n "$cf_new_cppflags" ; then
7896
7897         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7898         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7899
7900 fi
7901
7902 if test -n "$cf_new_extra_cppflags" ; then
7903
7904         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7905         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7906
7907 fi
7908
7909 cf_add_libs="$LIBS"
7910 # reverse order
7911 cf_add_0lib=
7912 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7913 # filter duplicates
7914 for cf_add_1lib in $cf_add_0lib; do
7915         for cf_add_2lib in $cf_add_libs; do
7916                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7917                         cf_add_1lib=
7918                         break
7919                 fi
7920         done
7921         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7922 done
7923 LIBS="$cf_add_libs"
7924
7925                         cat >"conftest.$ac_ext" <<_ACEOF
7926 #line 7926 "configure"
7927 #include "confdefs.h"
7928 #include <${cf_cv_ncurses_header:-curses.h}>
7929 int
7930 main (void)
7931 {
7932 initscr(); mousemask(0,0); tigetstr((char *)0);
7933   ;
7934   return 0;
7935 }
7936 _ACEOF
7937 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7938 if { (eval echo "$as_me:7938: \"$ac_link\"") >&5
7939   (eval $ac_link) 2>&5
7940   ac_status=$?
7941   echo "$as_me:7941: \$? = $ac_status" >&5
7942   (exit "$ac_status"); } &&
7943          { ac_try='test -s "conftest$ac_exeext"'
7944   { (eval echo "$as_me:7944: \"$ac_try\"") >&5
7945   (eval $ac_try) 2>&5
7946   ac_status=$?
7947   echo "$as_me:7947: \$? = $ac_status" >&5
7948   (exit "$ac_status"); }; }; then
7949   if test "$cross_compiling" = yes; then
7950   cf_test_ncuconfig=maybe
7951 else
7952   cat >"conftest.$ac_ext" <<_ACEOF
7953 #line 7953 "configure"
7954 #include "confdefs.h"
7955 #include <${cf_cv_ncurses_header:-curses.h}>
7956                                         int main(void)
7957                                         { char *xx = curses_version(); return (xx == 0); }
7958 _ACEOF
7959 rm -f "conftest$ac_exeext"
7960 if { (eval echo "$as_me:7960: \"$ac_link\"") >&5
7961   (eval $ac_link) 2>&5
7962   ac_status=$?
7963   echo "$as_me:7963: \$? = $ac_status" >&5
7964   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7965   { (eval echo "$as_me:7965: \"$ac_try\"") >&5
7966   (eval $ac_try) 2>&5
7967   ac_status=$?
7968   echo "$as_me:7968: \$? = $ac_status" >&5
7969   (exit "$ac_status"); }; }; then
7970   cf_test_ncuconfig=yes
7971 else
7972   echo "$as_me: program exited with status $ac_status" >&5
7973 echo "$as_me: failed program was:" >&5
7974 cat "conftest.$ac_ext" >&5
7975 cf_test_ncuconfig=no
7976 fi
7977 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7978 fi
7979 else
7980   echo "$as_me: failed program was:" >&5
7981 cat "conftest.$ac_ext" >&5
7982 cf_test_ncuconfig=no
7983 fi
7984 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7985
7986                         CFLAGS="$cf_save_CFLAGS"
7987                         CPPFLAGS="$cf_save_CPPFLAGS"
7988                         LIBS="$cf_save_LIBS"
7989
7990                         if test "x$cf_test_ncuconfig" != xyes; then
7991                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7992                                 cf_pkg_cflags="$cf_temp"
7993                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7994                                 cf_pkg_libs="$cf_temp"
7995                         fi
7996                         ;;
7997                 esac
7998
7999 cf_fix_cppflags=no
8000 cf_new_cflags=
8001 cf_new_cppflags=
8002 cf_new_extra_cppflags=
8003
8004 for cf_add_cflags in $cf_pkg_cflags
8005 do
8006 case "$cf_fix_cppflags" in
8007 (no)
8008         case "$cf_add_cflags" in
8009         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8010                 case "$cf_add_cflags" in
8011                 (-D*)
8012                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8013
8014                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8015                                 && test -z "${cf_tst_cflags}" \
8016                                 && cf_fix_cppflags=yes
8017
8018                         if test "$cf_fix_cppflags" = yes ; then
8019
8020         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8021         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8022
8023                                 continue
8024                         elif test "${cf_tst_cflags}" = "\"'" ; then
8025
8026         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8027         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8028
8029                                 continue
8030                         fi
8031                         ;;
8032                 esac
8033                 case "$CPPFLAGS" in
8034                 (*$cf_add_cflags)
8035                         ;;
8036                 (*)
8037                         case "$cf_add_cflags" in
8038                         (-D*)
8039                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8040
8041 CPPFLAGS=`echo "$CPPFLAGS" | \
8042         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8043                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8044
8045                                 ;;
8046                         esac
8047
8048         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8049         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8050
8051                         ;;
8052                 esac
8053                 ;;
8054         (*)
8055
8056         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8057         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8058
8059                 ;;
8060         esac
8061         ;;
8062 (yes)
8063
8064         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8065         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8066
8067         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8068
8069         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8070                 && test -z "${cf_tst_cflags}" \
8071                 && cf_fix_cppflags=no
8072         ;;
8073 esac
8074 done
8075
8076 if test -n "$cf_new_cflags" ; then
8077
8078         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8079         CFLAGS="${CFLAGS}$cf_new_cflags"
8080
8081 fi
8082
8083 if test -n "$cf_new_cppflags" ; then
8084
8085         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8086         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8087
8088 fi
8089
8090 if test -n "$cf_new_extra_cppflags" ; then
8091
8092         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8093         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8094
8095 fi
8096
8097 cf_add_libs="$LIBS"
8098 # reverse order
8099 cf_add_0lib=
8100 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8101 # filter duplicates
8102 for cf_add_1lib in $cf_add_0lib; do
8103         for cf_add_2lib in $cf_add_libs; do
8104                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8105                         cf_add_1lib=
8106                         break
8107                 fi
8108         done
8109         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8110 done
8111 LIBS="$cf_add_libs"
8112
8113                 cat >"conftest.$ac_ext" <<_ACEOF
8114 #line 8114 "configure"
8115 #include "confdefs.h"
8116 #include <${cf_cv_ncurses_header:-curses.h}>
8117 int
8118 main (void)
8119 {
8120 initscr(); mousemask(0,0); tigetstr((char *)0);
8121   ;
8122   return 0;
8123 }
8124 _ACEOF
8125 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8126 if { (eval echo "$as_me:8126: \"$ac_link\"") >&5
8127   (eval $ac_link) 2>&5
8128   ac_status=$?
8129   echo "$as_me:8129: \$? = $ac_status" >&5
8130   (exit "$ac_status"); } &&
8131          { ac_try='test -s "conftest$ac_exeext"'
8132   { (eval echo "$as_me:8132: \"$ac_try\"") >&5
8133   (eval $ac_try) 2>&5
8134   ac_status=$?
8135   echo "$as_me:8135: \$? = $ac_status" >&5
8136   (exit "$ac_status"); }; }; then
8137   if test "$cross_compiling" = yes; then
8138   cf_have_ncuconfig=maybe
8139 else
8140   cat >"conftest.$ac_ext" <<_ACEOF
8141 #line 8141 "configure"
8142 #include "confdefs.h"
8143 #include <${cf_cv_ncurses_header:-curses.h}>
8144                                 int main(void)
8145                                 { char *xx = curses_version(); return (xx == 0); }
8146 _ACEOF
8147 rm -f "conftest$ac_exeext"
8148 if { (eval echo "$as_me:8148: \"$ac_link\"") >&5
8149   (eval $ac_link) 2>&5
8150   ac_status=$?
8151   echo "$as_me:8151: \$? = $ac_status" >&5
8152   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8153   { (eval echo "$as_me:8153: \"$ac_try\"") >&5
8154   (eval $ac_try) 2>&5
8155   ac_status=$?
8156   echo "$as_me:8156: \$? = $ac_status" >&5
8157   (exit "$ac_status"); }; }; then
8158   cf_have_ncuconfig=yes
8159 else
8160   echo "$as_me: program exited with status $ac_status" >&5
8161 echo "$as_me: failed program was:" >&5
8162 cat "conftest.$ac_ext" >&5
8163 cf_have_ncuconfig=no
8164 fi
8165 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8166 fi
8167 else
8168   echo "$as_me: failed program was:" >&5
8169 cat "conftest.$ac_ext" >&5
8170 cf_have_ncuconfig=no
8171 fi
8172 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8173                 echo "$as_me:8173: result: $cf_have_ncuconfig" >&5
8174 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8175                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8176                 if test "$cf_have_ncuconfig" != "yes"
8177                 then
8178                         CPPFLAGS="$cf_save_CPPFLAGS"
8179                         LIBS="$cf_save_LIBS"
8180                         NCURSES_CONFIG_PKG=none
8181                 else
8182
8183 cat >>confdefs.h <<\EOF
8184 #define NCURSES 1
8185 EOF
8186
8187                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8188
8189 echo "$as_me:8189: checking for terminfo header" >&5
8190 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8191 if test "${cf_cv_term_header+set}" = set; then
8192   echo $ECHO_N "(cached) $ECHO_C" >&6
8193 else
8194
8195 case "${cf_cv_ncurses_header}" in
8196 (*/ncurses.h|*/ncursesw.h)
8197         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8198         ;;
8199 (*)
8200         cf_term_header=term.h
8201         ;;
8202 esac
8203
8204 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8205 do
8206 cat >"conftest.$ac_ext" <<_ACEOF
8207 #line 8207 "configure"
8208 #include "confdefs.h"
8209 #include <stdio.h>
8210 #include <${cf_cv_ncurses_header:-curses.h}>
8211 #include <$cf_test>
8212
8213 int
8214 main (void)
8215 {
8216 int x = auto_left_margin; (void)x
8217   ;
8218   return 0;
8219 }
8220 _ACEOF
8221 rm -f "conftest.$ac_objext"
8222 if { (eval echo "$as_me:8222: \"$ac_compile\"") >&5
8223   (eval $ac_compile) 2>&5
8224   ac_status=$?
8225   echo "$as_me:8225: \$? = $ac_status" >&5
8226   (exit "$ac_status"); } &&
8227          { ac_try='test -s "conftest.$ac_objext"'
8228   { (eval echo "$as_me:8228: \"$ac_try\"") >&5
8229   (eval $ac_try) 2>&5
8230   ac_status=$?
8231   echo "$as_me:8231: \$? = $ac_status" >&5
8232   (exit "$ac_status"); }; }; then
8233
8234         cf_cv_term_header="$cf_test"
8235 else
8236   echo "$as_me: failed program was:" >&5
8237 cat "conftest.$ac_ext" >&5
8238
8239         cf_cv_term_header=unknown
8240
8241 fi
8242 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8243         test "$cf_cv_term_header" != unknown && break
8244 done
8245
8246 fi
8247 echo "$as_me:8247: result: $cf_cv_term_header" >&5
8248 echo "${ECHO_T}$cf_cv_term_header" >&6
8249
8250 # Set definitions to allow ifdef'ing to accommodate subdirectories
8251
8252 case "$cf_cv_term_header" in
8253 (*term.h)
8254
8255 cat >>confdefs.h <<\EOF
8256 #define HAVE_TERM_H 1
8257 EOF
8258
8259         ;;
8260 esac
8261
8262 case "$cf_cv_term_header" in
8263 (ncurses/term.h)
8264
8265 cat >>confdefs.h <<\EOF
8266 #define HAVE_NCURSES_TERM_H 1
8267 EOF
8268
8269         ;;
8270 (ncursesw/term.h)
8271
8272 cat >>confdefs.h <<\EOF
8273 #define HAVE_NCURSESW_TERM_H 1
8274 EOF
8275
8276         ;;
8277 esac
8278
8279                 fi
8280
8281         else
8282                 echo "$as_me:8282: result: no" >&5
8283 echo "${ECHO_T}no" >&6
8284                 NCURSES_CONFIG_PKG=none
8285         fi
8286 else
8287         NCURSES_CONFIG_PKG=none
8288 fi
8289
8290 if test "x$cf_have_ncuconfig" = "xno"; then
8291         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8292
8293 if test -n "$ac_tool_prefix"; then
8294   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8295   do
8296     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8297 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8298 echo "$as_me:8298: checking for $ac_word" >&5
8299 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8300 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8301   echo $ECHO_N "(cached) $ECHO_C" >&6
8302 else
8303   if test -n "$NCURSES_CONFIG"; then
8304   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8305 else
8306   ac_save_IFS=$IFS; IFS=$ac_path_separator
8307 ac_dummy="$PATH"
8308 for ac_dir in $ac_dummy; do
8309   IFS=$ac_save_IFS
8310   test -z "$ac_dir" && ac_dir=.
8311   $as_executable_p "$ac_dir/$ac_word" || continue
8312 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8313 echo "$as_me:8313: found $ac_dir/$ac_word" >&5
8314 break
8315 done
8316
8317 fi
8318 fi
8319 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8320 if test -n "$NCURSES_CONFIG"; then
8321   echo "$as_me:8321: result: $NCURSES_CONFIG" >&5
8322 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8323 else
8324   echo "$as_me:8324: result: no" >&5
8325 echo "${ECHO_T}no" >&6
8326 fi
8327
8328     test -n "$NCURSES_CONFIG" && break
8329   done
8330 fi
8331 if test -z "$NCURSES_CONFIG"; then
8332   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8333   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8334 do
8335   # Extract the first word of "$ac_prog", so it can be a program name with args.
8336 set dummy $ac_prog; ac_word=$2
8337 echo "$as_me:8337: checking for $ac_word" >&5
8338 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8339 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8340   echo $ECHO_N "(cached) $ECHO_C" >&6
8341 else
8342   if test -n "$ac_ct_NCURSES_CONFIG"; then
8343   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8344 else
8345   ac_save_IFS=$IFS; IFS=$ac_path_separator
8346 ac_dummy="$PATH"
8347 for ac_dir in $ac_dummy; do
8348   IFS=$ac_save_IFS
8349   test -z "$ac_dir" && ac_dir=.
8350   $as_executable_p "$ac_dir/$ac_word" || continue
8351 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8352 echo "$as_me:8352: found $ac_dir/$ac_word" >&5
8353 break
8354 done
8355
8356 fi
8357 fi
8358 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8359 if test -n "$ac_ct_NCURSES_CONFIG"; then
8360   echo "$as_me:8360: result: $ac_ct_NCURSES_CONFIG" >&5
8361 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8362 else
8363   echo "$as_me:8363: result: no" >&5
8364 echo "${ECHO_T}no" >&6
8365 fi
8366
8367   test -n "$ac_ct_NCURSES_CONFIG" && break
8368 done
8369 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8370
8371   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8372 fi
8373
8374         if test "$NCURSES_CONFIG" != none ; then
8375
8376 cf_fix_cppflags=no
8377 cf_new_cflags=
8378 cf_new_cppflags=
8379 cf_new_extra_cppflags=
8380
8381 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8382 do
8383 case "$cf_fix_cppflags" in
8384 (no)
8385         case "$cf_add_cflags" in
8386         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8387                 case "$cf_add_cflags" in
8388                 (-D*)
8389                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8390
8391                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8392                                 && test -z "${cf_tst_cflags}" \
8393                                 && cf_fix_cppflags=yes
8394
8395                         if test "$cf_fix_cppflags" = yes ; then
8396
8397         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8398         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8399
8400                                 continue
8401                         elif test "${cf_tst_cflags}" = "\"'" ; then
8402
8403         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8404         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8405
8406                                 continue
8407                         fi
8408                         ;;
8409                 esac
8410                 case "$CPPFLAGS" in
8411                 (*$cf_add_cflags)
8412                         ;;
8413                 (*)
8414                         case "$cf_add_cflags" in
8415                         (-D*)
8416                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8417
8418 CPPFLAGS=`echo "$CPPFLAGS" | \
8419         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8420                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8421
8422                                 ;;
8423                         esac
8424
8425         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8426         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8427
8428                         ;;
8429                 esac
8430                 ;;
8431         (*)
8432
8433         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8434         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8435
8436                 ;;
8437         esac
8438         ;;
8439 (yes)
8440
8441         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8442         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8443
8444         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8445
8446         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8447                 && test -z "${cf_tst_cflags}" \
8448                 && cf_fix_cppflags=no
8449         ;;
8450 esac
8451 done
8452
8453 if test -n "$cf_new_cflags" ; then
8454
8455         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8456         CFLAGS="${CFLAGS}$cf_new_cflags"
8457
8458 fi
8459
8460 if test -n "$cf_new_cppflags" ; then
8461
8462         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8463         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8464
8465 fi
8466
8467 if test -n "$cf_new_extra_cppflags" ; then
8468
8469         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8470         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8471
8472 fi
8473
8474 cf_add_libs="$LIBS"
8475 # reverse order
8476 cf_add_0lib=
8477 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8478 # filter duplicates
8479 for cf_add_1lib in $cf_add_0lib; do
8480         for cf_add_2lib in $cf_add_libs; do
8481                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8482                         cf_add_1lib=
8483                         break
8484                 fi
8485         done
8486         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8487 done
8488 LIBS="$cf_add_libs"
8489
8490                 # even with config script, some packages use no-override for curses.h
8491
8492 echo "$as_me:8492: checking if we have identified curses headers" >&5
8493 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8494 if test "${cf_cv_ncurses_header+set}" = set; then
8495   echo $ECHO_N "(cached) $ECHO_C" >&6
8496 else
8497
8498 cf_cv_ncurses_header=none
8499 for cf_header in \
8500         ncurses.h $cf_cv_screen/ncurses.h \
8501         curses.h $cf_cv_screen/curses.h
8502 do
8503 cat >"conftest.$ac_ext" <<_ACEOF
8504 #line 8504 "configure"
8505 #include "confdefs.h"
8506 #include <${cf_header}>
8507 int
8508 main (void)
8509 {
8510 initscr(); tgoto("?", 0,0)
8511   ;
8512   return 0;
8513 }
8514 _ACEOF
8515 rm -f "conftest.$ac_objext"
8516 if { (eval echo "$as_me:8516: \"$ac_compile\"") >&5
8517   (eval $ac_compile) 2>&5
8518   ac_status=$?
8519   echo "$as_me:8519: \$? = $ac_status" >&5
8520   (exit "$ac_status"); } &&
8521          { ac_try='test -s "conftest.$ac_objext"'
8522   { (eval echo "$as_me:8522: \"$ac_try\"") >&5
8523   (eval $ac_try) 2>&5
8524   ac_status=$?
8525   echo "$as_me:8525: \$? = $ac_status" >&5
8526   (exit "$ac_status"); }; }; then
8527   cf_cv_ncurses_header=$cf_header; break
8528 else
8529   echo "$as_me: failed program was:" >&5
8530 cat "conftest.$ac_ext" >&5
8531 fi
8532 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8533 done
8534
8535 fi
8536 echo "$as_me:8536: result: $cf_cv_ncurses_header" >&5
8537 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8538
8539 if test "$cf_cv_ncurses_header" = none ; then
8540         { { echo "$as_me:8540: error: No curses header-files found" >&5
8541 echo "$as_me: error: No curses header-files found" >&2;}
8542    { (exit 1); exit 1; }; }
8543 fi
8544
8545 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8546
8547 for ac_header in $cf_cv_ncurses_header
8548 do
8549 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8550 echo "$as_me:8550: checking for $ac_header" >&5
8551 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8552 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8553   echo $ECHO_N "(cached) $ECHO_C" >&6
8554 else
8555   cat >"conftest.$ac_ext" <<_ACEOF
8556 #line 8556 "configure"
8557 #include "confdefs.h"
8558 #include <$ac_header>
8559 _ACEOF
8560 if { (eval echo "$as_me:8560: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8561   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8562   ac_status=$?
8563   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8564   rm -f conftest.er1
8565   cat conftest.err >&5
8566   echo "$as_me:8566: \$? = $ac_status" >&5
8567   (exit "$ac_status"); } >/dev/null; then
8568   if test -s conftest.err; then
8569     ac_cpp_err=$ac_c_preproc_warn_flag
8570   else
8571     ac_cpp_err=
8572   fi
8573 else
8574   ac_cpp_err=yes
8575 fi
8576 if test -z "$ac_cpp_err"; then
8577   eval "$as_ac_Header=yes"
8578 else
8579   echo "$as_me: failed program was:" >&5
8580   cat "conftest.$ac_ext" >&5
8581   eval "$as_ac_Header=no"
8582 fi
8583 rm -f conftest.err "conftest.$ac_ext"
8584 fi
8585 echo "$as_me:8585: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8586 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8587 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8588   cat >>confdefs.h <<EOF
8589 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8590 EOF
8591
8592 fi
8593 done
8594
8595 cat >>confdefs.h <<\EOF
8596 #define NCURSES 1
8597 EOF
8598
8599 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8600
8601                 cat >>confdefs.h <<EOF
8602 #define $cf_nculib_ROOT 1
8603 EOF
8604
8605                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8606
8607         else
8608
8609 cf_ncuhdr_root=$cf_cv_screen
8610
8611 test -n "$cf_cv_curses_dir" && \
8612 test "$cf_cv_curses_dir" != "no" && { \
8613
8614 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8615   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8616   do
8617         while test "$cf_add_incdir" != /usr/include
8618         do
8619           if test -d "$cf_add_incdir"
8620           then
8621                 cf_have_incdir=no
8622                 if test -n "$CFLAGS$CPPFLAGS" ; then
8623                   # a loop is needed to ensure we can add subdirs of existing dirs
8624                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8625                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8626                           cf_have_incdir=yes; break
8627                         fi
8628                   done
8629                 fi
8630
8631                 if test "$cf_have_incdir" = no ; then
8632                   if test "$cf_add_incdir" = /usr/local/include ; then
8633                         if test "$GCC" = yes
8634                         then
8635                           cf_save_CPPFLAGS=$CPPFLAGS
8636
8637         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8638         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8639
8640                           cat >"conftest.$ac_ext" <<_ACEOF
8641 #line 8641 "configure"
8642 #include "confdefs.h"
8643 #include <stdio.h>
8644 int
8645 main (void)
8646 {
8647 printf("Hello")
8648   ;
8649   return 0;
8650 }
8651 _ACEOF
8652 rm -f "conftest.$ac_objext"
8653 if { (eval echo "$as_me:8653: \"$ac_compile\"") >&5
8654   (eval $ac_compile) 2>&5
8655   ac_status=$?
8656   echo "$as_me:8656: \$? = $ac_status" >&5
8657   (exit "$ac_status"); } &&
8658          { ac_try='test -s "conftest.$ac_objext"'
8659   { (eval echo "$as_me:8659: \"$ac_try\"") >&5
8660   (eval $ac_try) 2>&5
8661   ac_status=$?
8662   echo "$as_me:8662: \$? = $ac_status" >&5
8663   (exit "$ac_status"); }; }; then
8664   :
8665 else
8666   echo "$as_me: failed program was:" >&5
8667 cat "conftest.$ac_ext" >&5
8668 cf_have_incdir=yes
8669 fi
8670 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8671                           CPPFLAGS=$cf_save_CPPFLAGS
8672                         fi
8673                   fi
8674                 fi
8675
8676                 if test "$cf_have_incdir" = no ; then
8677                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8678
8679 echo "${as_me:-configure}:8679: testing adding $cf_add_incdir to include-path ..." 1>&5
8680
8681                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8682
8683                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8684                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8685                   cf_add_incdir="$cf_top_incdir"
8686                 else
8687                   break
8688                 fi
8689           else
8690                 break
8691           fi
8692         done
8693   done
8694 fi
8695
8696 }
8697
8698 echo "$as_me:8698: checking for $cf_ncuhdr_root header in include-path" >&5
8699 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8700 if test "${cf_cv_ncurses_h+set}" = set; then
8701   echo $ECHO_N "(cached) $ECHO_C" >&6
8702 else
8703
8704         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8705         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8706         for cf_header in $cf_header_list
8707         do
8708
8709         cat >"conftest.$ac_ext" <<_ACEOF
8710 #line 8710 "configure"
8711 #include "confdefs.h"
8712
8713 #include <$cf_header>
8714 int
8715 main (void)
8716 {
8717
8718 #ifdef NCURSES_VERSION
8719
8720 printf("%s\\n", NCURSES_VERSION);
8721 #else
8722 #ifdef __NCURSES_H
8723 printf("old\\n");
8724 #else
8725         make an error
8726 #endif
8727 #endif
8728
8729   ;
8730   return 0;
8731 }
8732 _ACEOF
8733 rm -f "conftest.$ac_objext"
8734 if { (eval echo "$as_me:8734: \"$ac_compile\"") >&5
8735   (eval $ac_compile) 2>&5
8736   ac_status=$?
8737   echo "$as_me:8737: \$? = $ac_status" >&5
8738   (exit "$ac_status"); } &&
8739          { ac_try='test -s "conftest.$ac_objext"'
8740   { (eval echo "$as_me:8740: \"$ac_try\"") >&5
8741   (eval $ac_try) 2>&5
8742   ac_status=$?
8743   echo "$as_me:8743: \$? = $ac_status" >&5
8744   (exit "$ac_status"); }; }; then
8745   cf_cv_ncurses_h=$cf_header
8746
8747 else
8748   echo "$as_me: failed program was:" >&5
8749 cat "conftest.$ac_ext" >&5
8750 cf_cv_ncurses_h=no
8751 fi
8752 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8753
8754                 test "$cf_cv_ncurses_h" != no && break
8755         done
8756
8757 fi
8758 echo "$as_me:8758: result: $cf_cv_ncurses_h" >&5
8759 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8760
8761 if test "$cf_cv_ncurses_h" != no ; then
8762         cf_cv_ncurses_header=$cf_cv_ncurses_h
8763 else
8764
8765 echo "$as_me:8765: checking for $cf_ncuhdr_root include-path" >&5
8766 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8767 if test "${cf_cv_ncurses_h2+set}" = set; then
8768   echo $ECHO_N "(cached) $ECHO_C" >&6
8769 else
8770
8771         test -n "$verbose" && echo
8772
8773 cf_search=
8774
8775 # collect the current set of include-directories from compiler flags
8776 cf_header_path_list=""
8777 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8778         for cf_header_path in $CPPFLAGS $CFLAGS
8779         do
8780                 case "$cf_header_path" in
8781                 (-I*)
8782                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8783
8784 test "x$cf_header_path" != "xNONE" && \
8785 test -d "$cf_header_path" && \
8786  {
8787         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8788         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8789         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8790         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8791         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8792         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"
8793 }
8794
8795                         cf_header_path_list="$cf_header_path_list $cf_search"
8796                         ;;
8797                 esac
8798         done
8799 fi
8800
8801 # add the variations for the package we are looking for
8802
8803 cf_search=
8804
8805 test "x$prefix" != "xNONE" && \
8806 test -d "$prefix" && \
8807  {
8808         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8809         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8810         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8811         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8812         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8813         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8814 }
8815
8816 for cf_subdir_prefix in \
8817         /usr \
8818         /usr/local \
8819         /usr/pkg \
8820         /opt \
8821         /opt/local \
8822         $HOME
8823 do
8824
8825 test "x$cf_subdir_prefix" != "x$prefix" && \
8826 test -d "$cf_subdir_prefix" && \
8827 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8828         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8829         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8830         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8831         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8832         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8833         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"
8834 }
8835
8836 done
8837
8838 test "$includedir" != NONE && \
8839 test "$includedir" != "/usr/include" && \
8840 test -d "$includedir" && {
8841         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8842         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8843 }
8844
8845 test "$oldincludedir" != NONE && \
8846 test "$oldincludedir" != "/usr/include" && \
8847 test -d "$oldincludedir" && {
8848         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8849         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8850 }
8851
8852 cf_search="$cf_search $cf_header_path_list"
8853
8854         test -n "$verbose" && echo "search path $cf_search"
8855         cf_save2_CPPFLAGS="$CPPFLAGS"
8856         for cf_incdir in $cf_search
8857         do
8858
8859 if test -n "$cf_incdir" ; then
8860   for cf_add_incdir in $cf_incdir
8861   do
8862         while test "$cf_add_incdir" != /usr/include
8863         do
8864           if test -d "$cf_add_incdir"
8865           then
8866                 cf_have_incdir=no
8867                 if test -n "$CFLAGS$CPPFLAGS" ; then
8868                   # a loop is needed to ensure we can add subdirs of existing dirs
8869                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8870                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8871                           cf_have_incdir=yes; break
8872                         fi
8873                   done
8874                 fi
8875
8876                 if test "$cf_have_incdir" = no ; then
8877                   if test "$cf_add_incdir" = /usr/local/include ; then
8878                         if test "$GCC" = yes
8879                         then
8880                           cf_save_CPPFLAGS=$CPPFLAGS
8881
8882         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8883         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8884
8885                           cat >"conftest.$ac_ext" <<_ACEOF
8886 #line 8886 "configure"
8887 #include "confdefs.h"
8888 #include <stdio.h>
8889 int
8890 main (void)
8891 {
8892 printf("Hello")
8893   ;
8894   return 0;
8895 }
8896 _ACEOF
8897 rm -f "conftest.$ac_objext"
8898 if { (eval echo "$as_me:8898: \"$ac_compile\"") >&5
8899   (eval $ac_compile) 2>&5
8900   ac_status=$?
8901   echo "$as_me:8901: \$? = $ac_status" >&5
8902   (exit "$ac_status"); } &&
8903          { ac_try='test -s "conftest.$ac_objext"'
8904   { (eval echo "$as_me:8904: \"$ac_try\"") >&5
8905   (eval $ac_try) 2>&5
8906   ac_status=$?
8907   echo "$as_me:8907: \$? = $ac_status" >&5
8908   (exit "$ac_status"); }; }; then
8909   :
8910 else
8911   echo "$as_me: failed program was:" >&5
8912 cat "conftest.$ac_ext" >&5
8913 cf_have_incdir=yes
8914 fi
8915 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8916                           CPPFLAGS=$cf_save_CPPFLAGS
8917                         fi
8918                   fi
8919                 fi
8920
8921                 if test "$cf_have_incdir" = no ; then
8922                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8923
8924 echo "${as_me:-configure}:8924: testing adding $cf_add_incdir to include-path ..." 1>&5
8925
8926                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8927
8928                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8929                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8930                   cf_add_incdir="$cf_top_incdir"
8931                 else
8932                   break
8933                 fi
8934           else
8935                 break
8936           fi
8937         done
8938   done
8939 fi
8940
8941                 for cf_header in \
8942                         ncurses.h \
8943                         curses.h
8944                 do
8945
8946         cat >"conftest.$ac_ext" <<_ACEOF
8947 #line 8947 "configure"
8948 #include "confdefs.h"
8949
8950 #include <$cf_header>
8951 int
8952 main (void)
8953 {
8954
8955 #ifdef NCURSES_VERSION
8956
8957 printf("%s\\n", NCURSES_VERSION);
8958 #else
8959 #ifdef __NCURSES_H
8960 printf("old\\n");
8961 #else
8962         make an error
8963 #endif
8964 #endif
8965
8966   ;
8967   return 0;
8968 }
8969 _ACEOF
8970 rm -f "conftest.$ac_objext"
8971 if { (eval echo "$as_me:8971: \"$ac_compile\"") >&5
8972   (eval $ac_compile) 2>&5
8973   ac_status=$?
8974   echo "$as_me:8974: \$? = $ac_status" >&5
8975   (exit "$ac_status"); } &&
8976          { ac_try='test -s "conftest.$ac_objext"'
8977   { (eval echo "$as_me:8977: \"$ac_try\"") >&5
8978   (eval $ac_try) 2>&5
8979   ac_status=$?
8980   echo "$as_me:8980: \$? = $ac_status" >&5
8981   (exit "$ac_status"); }; }; then
8982   cf_cv_ncurses_h2=$cf_header
8983
8984 else
8985   echo "$as_me: failed program was:" >&5
8986 cat "conftest.$ac_ext" >&5
8987 cf_cv_ncurses_h2=no
8988 fi
8989 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8990
8991                         if test "$cf_cv_ncurses_h2" != no ; then
8992                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8993                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8994                                 break
8995                         fi
8996                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8997                 done
8998                 CPPFLAGS="$cf_save2_CPPFLAGS"
8999                 test "$cf_cv_ncurses_h2" != no && break
9000         done
9001         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9001: error: not found" >&5
9002 echo "$as_me: error: not found" >&2;}
9003    { (exit 1); exit 1; }; }
9004
9005 fi
9006 echo "$as_me:9006: result: $cf_cv_ncurses_h2" >&5
9007 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9008
9009         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9010         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9011         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9012                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9013         fi
9014
9015 if test -n "$cf_1st_incdir" ; then
9016   for cf_add_incdir in $cf_1st_incdir
9017   do
9018         while test "$cf_add_incdir" != /usr/include
9019         do
9020           if test -d "$cf_add_incdir"
9021           then
9022                 cf_have_incdir=no
9023                 if test -n "$CFLAGS$CPPFLAGS" ; then
9024                   # a loop is needed to ensure we can add subdirs of existing dirs
9025                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9026                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9027                           cf_have_incdir=yes; break
9028                         fi
9029                   done
9030                 fi
9031
9032                 if test "$cf_have_incdir" = no ; then
9033                   if test "$cf_add_incdir" = /usr/local/include ; then
9034                         if test "$GCC" = yes
9035                         then
9036                           cf_save_CPPFLAGS=$CPPFLAGS
9037
9038         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9039         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9040
9041                           cat >"conftest.$ac_ext" <<_ACEOF
9042 #line 9042 "configure"
9043 #include "confdefs.h"
9044 #include <stdio.h>
9045 int
9046 main (void)
9047 {
9048 printf("Hello")
9049   ;
9050   return 0;
9051 }
9052 _ACEOF
9053 rm -f "conftest.$ac_objext"
9054 if { (eval echo "$as_me:9054: \"$ac_compile\"") >&5
9055   (eval $ac_compile) 2>&5
9056   ac_status=$?
9057   echo "$as_me:9057: \$? = $ac_status" >&5
9058   (exit "$ac_status"); } &&
9059          { ac_try='test -s "conftest.$ac_objext"'
9060   { (eval echo "$as_me:9060: \"$ac_try\"") >&5
9061   (eval $ac_try) 2>&5
9062   ac_status=$?
9063   echo "$as_me:9063: \$? = $ac_status" >&5
9064   (exit "$ac_status"); }; }; then
9065   :
9066 else
9067   echo "$as_me: failed program was:" >&5
9068 cat "conftest.$ac_ext" >&5
9069 cf_have_incdir=yes
9070 fi
9071 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9072                           CPPFLAGS=$cf_save_CPPFLAGS
9073                         fi
9074                   fi
9075                 fi
9076
9077                 if test "$cf_have_incdir" = no ; then
9078                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9079
9080 echo "${as_me:-configure}:9080: testing adding $cf_add_incdir to include-path ..." 1>&5
9081
9082                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9083
9084                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9085                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9086                   cf_add_incdir="$cf_top_incdir"
9087                 else
9088                   break
9089                 fi
9090           else
9091                 break
9092           fi
9093         done
9094   done
9095 fi
9096
9097 fi
9098
9099 # Set definitions to allow ifdef'ing for ncurses.h
9100
9101 case "$cf_cv_ncurses_header" in
9102 (*ncurses.h)
9103
9104 cat >>confdefs.h <<\EOF
9105 #define HAVE_NCURSES_H 1
9106 EOF
9107
9108         ;;
9109 esac
9110
9111 case "$cf_cv_ncurses_header" in
9112 (ncurses/curses.h|ncurses/ncurses.h)
9113
9114 cat >>confdefs.h <<\EOF
9115 #define HAVE_NCURSES_NCURSES_H 1
9116 EOF
9117
9118         ;;
9119 (ncursesw/curses.h|ncursesw/ncurses.h)
9120
9121 cat >>confdefs.h <<\EOF
9122 #define HAVE_NCURSESW_NCURSES_H 1
9123 EOF
9124
9125         ;;
9126 esac
9127
9128 echo "$as_me:9128: checking for terminfo header" >&5
9129 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9130 if test "${cf_cv_term_header+set}" = set; then
9131   echo $ECHO_N "(cached) $ECHO_C" >&6
9132 else
9133
9134 case "${cf_cv_ncurses_header}" in
9135 (*/ncurses.h|*/ncursesw.h)
9136         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9137         ;;
9138 (*)
9139         cf_term_header=term.h
9140         ;;
9141 esac
9142
9143 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9144 do
9145 cat >"conftest.$ac_ext" <<_ACEOF
9146 #line 9146 "configure"
9147 #include "confdefs.h"
9148 #include <stdio.h>
9149 #include <${cf_cv_ncurses_header:-curses.h}>
9150 #include <$cf_test>
9151
9152 int
9153 main (void)
9154 {
9155 int x = auto_left_margin; (void)x
9156   ;
9157   return 0;
9158 }
9159 _ACEOF
9160 rm -f "conftest.$ac_objext"
9161 if { (eval echo "$as_me:9161: \"$ac_compile\"") >&5
9162   (eval $ac_compile) 2>&5
9163   ac_status=$?
9164   echo "$as_me:9164: \$? = $ac_status" >&5
9165   (exit "$ac_status"); } &&
9166          { ac_try='test -s "conftest.$ac_objext"'
9167   { (eval echo "$as_me:9167: \"$ac_try\"") >&5
9168   (eval $ac_try) 2>&5
9169   ac_status=$?
9170   echo "$as_me:9170: \$? = $ac_status" >&5
9171   (exit "$ac_status"); }; }; then
9172
9173         cf_cv_term_header="$cf_test"
9174 else
9175   echo "$as_me: failed program was:" >&5
9176 cat "conftest.$ac_ext" >&5
9177
9178         cf_cv_term_header=unknown
9179
9180 fi
9181 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9182         test "$cf_cv_term_header" != unknown && break
9183 done
9184
9185 fi
9186 echo "$as_me:9186: result: $cf_cv_term_header" >&5
9187 echo "${ECHO_T}$cf_cv_term_header" >&6
9188
9189 # Set definitions to allow ifdef'ing to accommodate subdirectories
9190
9191 case "$cf_cv_term_header" in
9192 (*term.h)
9193
9194 cat >>confdefs.h <<\EOF
9195 #define HAVE_TERM_H 1
9196 EOF
9197
9198         ;;
9199 esac
9200
9201 case "$cf_cv_term_header" in
9202 (ncurses/term.h)
9203
9204 cat >>confdefs.h <<\EOF
9205 #define HAVE_NCURSES_TERM_H 1
9206 EOF
9207
9208         ;;
9209 (ncursesw/term.h)
9210
9211 cat >>confdefs.h <<\EOF
9212 #define HAVE_NCURSESW_TERM_H 1
9213 EOF
9214
9215         ;;
9216 esac
9217
9218 # some applications need this, but should check for NCURSES_VERSION
9219
9220 cat >>confdefs.h <<\EOF
9221 #define NCURSES 1
9222 EOF
9223
9224 echo "$as_me:9224: checking for ncurses version" >&5
9225 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9226 if test "${cf_cv_ncurses_version+set}" = set; then
9227   echo $ECHO_N "(cached) $ECHO_C" >&6
9228 else
9229
9230         cf_cv_ncurses_version=no
9231         cf_tempfile=out$$
9232         rm -f "$cf_tempfile"
9233         if test "$cross_compiling" = yes; then
9234
9235         # This will not work if the preprocessor splits the line after the
9236         # Autoconf token.  The 'unproto' program does that.
9237         cat > "conftest.$ac_ext" <<EOF
9238 #include <${cf_cv_ncurses_header:-curses.h}>
9239 #undef Autoconf
9240 #ifdef NCURSES_VERSION
9241 Autoconf NCURSES_VERSION
9242 #else
9243 #ifdef __NCURSES_H
9244 Autoconf "old"
9245 #endif
9246 ;
9247 #endif
9248 EOF
9249         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9250         { (eval echo "$as_me:9250: \"$cf_try\"") >&5
9251   (eval $cf_try) 2>&5
9252   ac_status=$?
9253   echo "$as_me:9253: \$? = $ac_status" >&5
9254   (exit "$ac_status"); }
9255         if test -f conftest.out ; then
9256                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9257                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9258                 rm -f conftest.out
9259         fi
9260
9261 else
9262   cat >"conftest.$ac_ext" <<_ACEOF
9263 #line 9263 "configure"
9264 #include "confdefs.h"
9265
9266 #include <${cf_cv_ncurses_header:-curses.h}>
9267 #include <stdio.h>
9268 int main(void)
9269 {
9270         FILE *fp = fopen("$cf_tempfile", "w");
9271 #ifdef NCURSES_VERSION
9272 # ifdef NCURSES_VERSION_PATCH
9273         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9274 # else
9275         fprintf(fp, "%s\\n", NCURSES_VERSION);
9276 # endif
9277 #else
9278 # ifdef __NCURSES_H
9279         fprintf(fp, "old\\n");
9280 # else
9281         make an error
9282 # endif
9283 #endif
9284         ${cf_cv_main_return:-return}(0);
9285 }
9286 _ACEOF
9287 rm -f "conftest$ac_exeext"
9288 if { (eval echo "$as_me:9288: \"$ac_link\"") >&5
9289   (eval $ac_link) 2>&5
9290   ac_status=$?
9291   echo "$as_me:9291: \$? = $ac_status" >&5
9292   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9293   { (eval echo "$as_me:9293: \"$ac_try\"") >&5
9294   (eval $ac_try) 2>&5
9295   ac_status=$?
9296   echo "$as_me:9296: \$? = $ac_status" >&5
9297   (exit "$ac_status"); }; }; then
9298
9299         cf_cv_ncurses_version=`cat $cf_tempfile`
9300 else
9301   echo "$as_me: program exited with status $ac_status" >&5
9302 echo "$as_me: failed program was:" >&5
9303 cat "conftest.$ac_ext" >&5
9304 fi
9305 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9306 fi
9307         rm -f "$cf_tempfile"
9308
9309 fi
9310 echo "$as_me:9310: result: $cf_cv_ncurses_version" >&5
9311 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9312 test "$cf_cv_ncurses_version" = no ||
9313 cat >>confdefs.h <<\EOF
9314 #define NCURSES 1
9315 EOF
9316
9317 cf_nculib_root=$cf_cv_screen
9318         # This works, except for the special case where we find gpm, but
9319         # ncurses is in a nonstandard location via $LIBS, and we really want
9320         # to link gpm.
9321 cf_ncurses_LIBS=""
9322 cf_ncurses_SAVE="$LIBS"
9323 echo "$as_me:9323: checking for Gpm_Open in -lgpm" >&5
9324 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9325 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9326   echo $ECHO_N "(cached) $ECHO_C" >&6
9327 else
9328   ac_check_lib_save_LIBS=$LIBS
9329 LIBS="-lgpm  $LIBS"
9330 cat >"conftest.$ac_ext" <<_ACEOF
9331 #line 9331 "configure"
9332 #include "confdefs.h"
9333
9334 /* Override any gcc2 internal prototype to avoid an error.  */
9335 #ifdef __cplusplus
9336 extern "C"
9337 #endif
9338 /* We use char because int might match the return type of a gcc2
9339    builtin and then its argument prototype would still apply.  */
9340 char Gpm_Open ();
9341 int
9342 main (void)
9343 {
9344 Gpm_Open ();
9345   ;
9346   return 0;
9347 }
9348 _ACEOF
9349 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9350 if { (eval echo "$as_me:9350: \"$ac_link\"") >&5
9351   (eval $ac_link) 2>&5
9352   ac_status=$?
9353   echo "$as_me:9353: \$? = $ac_status" >&5
9354   (exit "$ac_status"); } &&
9355          { ac_try='test -s "conftest$ac_exeext"'
9356   { (eval echo "$as_me:9356: \"$ac_try\"") >&5
9357   (eval $ac_try) 2>&5
9358   ac_status=$?
9359   echo "$as_me:9359: \$? = $ac_status" >&5
9360   (exit "$ac_status"); }; }; then
9361   ac_cv_lib_gpm_Gpm_Open=yes
9362 else
9363   echo "$as_me: failed program was:" >&5
9364 cat "conftest.$ac_ext" >&5
9365 ac_cv_lib_gpm_Gpm_Open=no
9366 fi
9367 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9368 LIBS=$ac_check_lib_save_LIBS
9369 fi
9370 echo "$as_me:9370: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9371 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9372 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9373   echo "$as_me:9373: checking for initscr in -lgpm" >&5
9374 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9375 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9376   echo $ECHO_N "(cached) $ECHO_C" >&6
9377 else
9378   ac_check_lib_save_LIBS=$LIBS
9379 LIBS="-lgpm  $LIBS"
9380 cat >"conftest.$ac_ext" <<_ACEOF
9381 #line 9381 "configure"
9382 #include "confdefs.h"
9383
9384 /* Override any gcc2 internal prototype to avoid an error.  */
9385 #ifdef __cplusplus
9386 extern "C"
9387 #endif
9388 /* We use char because int might match the return type of a gcc2
9389    builtin and then its argument prototype would still apply.  */
9390 char initscr ();
9391 int
9392 main (void)
9393 {
9394 initscr ();
9395   ;
9396   return 0;
9397 }
9398 _ACEOF
9399 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9400 if { (eval echo "$as_me:9400: \"$ac_link\"") >&5
9401   (eval $ac_link) 2>&5
9402   ac_status=$?
9403   echo "$as_me:9403: \$? = $ac_status" >&5
9404   (exit "$ac_status"); } &&
9405          { ac_try='test -s "conftest$ac_exeext"'
9406   { (eval echo "$as_me:9406: \"$ac_try\"") >&5
9407   (eval $ac_try) 2>&5
9408   ac_status=$?
9409   echo "$as_me:9409: \$? = $ac_status" >&5
9410   (exit "$ac_status"); }; }; then
9411   ac_cv_lib_gpm_initscr=yes
9412 else
9413   echo "$as_me: failed program was:" >&5
9414 cat "conftest.$ac_ext" >&5
9415 ac_cv_lib_gpm_initscr=no
9416 fi
9417 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9418 LIBS=$ac_check_lib_save_LIBS
9419 fi
9420 echo "$as_me:9420: result: $ac_cv_lib_gpm_initscr" >&5
9421 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9422 if test "$ac_cv_lib_gpm_initscr" = yes; then
9423   LIBS="$cf_ncurses_SAVE"
9424 else
9425   cf_ncurses_LIBS="-lgpm"
9426 fi
9427
9428 fi
9429
9430 case "$host_os" in
9431 (freebsd*)
9432         # This is only necessary if you are linking against an obsolete
9433         # version of ncurses (but it should do no harm, since it's static).
9434         if test "$cf_nculib_root" = ncurses ; then
9435                 echo "$as_me:9435: checking for tgoto in -lmytinfo" >&5
9436 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9437 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9438   echo $ECHO_N "(cached) $ECHO_C" >&6
9439 else
9440   ac_check_lib_save_LIBS=$LIBS
9441 LIBS="-lmytinfo  $LIBS"
9442 cat >"conftest.$ac_ext" <<_ACEOF
9443 #line 9443 "configure"
9444 #include "confdefs.h"
9445
9446 /* Override any gcc2 internal prototype to avoid an error.  */
9447 #ifdef __cplusplus
9448 extern "C"
9449 #endif
9450 /* We use char because int might match the return type of a gcc2
9451    builtin and then its argument prototype would still apply.  */
9452 char tgoto ();
9453 int
9454 main (void)
9455 {
9456 tgoto ();
9457   ;
9458   return 0;
9459 }
9460 _ACEOF
9461 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9462 if { (eval echo "$as_me:9462: \"$ac_link\"") >&5
9463   (eval $ac_link) 2>&5
9464   ac_status=$?
9465   echo "$as_me:9465: \$? = $ac_status" >&5
9466   (exit "$ac_status"); } &&
9467          { ac_try='test -s "conftest$ac_exeext"'
9468   { (eval echo "$as_me:9468: \"$ac_try\"") >&5
9469   (eval $ac_try) 2>&5
9470   ac_status=$?
9471   echo "$as_me:9471: \$? = $ac_status" >&5
9472   (exit "$ac_status"); }; }; then
9473   ac_cv_lib_mytinfo_tgoto=yes
9474 else
9475   echo "$as_me: failed program was:" >&5
9476 cat "conftest.$ac_ext" >&5
9477 ac_cv_lib_mytinfo_tgoto=no
9478 fi
9479 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9480 LIBS=$ac_check_lib_save_LIBS
9481 fi
9482 echo "$as_me:9482: result: $ac_cv_lib_mytinfo_tgoto" >&5
9483 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9484 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9485   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9486 fi
9487
9488         fi
9489         ;;
9490 esac
9491
9492 cf_add_libs="$LIBS"
9493 # reverse order
9494 cf_add_0lib=
9495 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9496 # filter duplicates
9497 for cf_add_1lib in $cf_add_0lib; do
9498         for cf_add_2lib in $cf_add_libs; do
9499                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9500                         cf_add_1lib=
9501                         break
9502                 fi
9503         done
9504         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9505 done
9506 LIBS="$cf_add_libs"
9507
9508 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9509 then
9510
9511 cf_add_libs="$LIBS"
9512 # reverse order
9513 cf_add_0lib=
9514 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9515 # filter duplicates
9516 for cf_add_1lib in $cf_add_0lib; do
9517         for cf_add_2lib in $cf_add_libs; do
9518                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9519                         cf_add_1lib=
9520                         break
9521                 fi
9522         done
9523         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9524 done
9525 LIBS="$cf_add_libs"
9526
9527 else
9528
9529         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9530         cf_libdir=""
9531         echo "$as_me:9531: checking for initscr" >&5
9532 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9533 if test "${ac_cv_func_initscr+set}" = set; then
9534   echo $ECHO_N "(cached) $ECHO_C" >&6
9535 else
9536   cat >"conftest.$ac_ext" <<_ACEOF
9537 #line 9537 "configure"
9538 #include "confdefs.h"
9539 #define initscr autoconf_temporary
9540 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9541 #undef initscr
9542
9543 #ifdef __cplusplus
9544 extern "C"
9545 #endif
9546
9547 /* We use char because int might match the return type of a gcc2
9548    builtin and then its argument prototype would still apply.  */
9549 char initscr (void);
9550
9551 int
9552 main (void)
9553 {
9554
9555 /* The GNU C library defines stubs for functions which it implements
9556     to always fail with ENOSYS.  Some functions are actually named
9557     something starting with __ and the normal name is an alias.  */
9558 #if defined (__stub_initscr) || defined (__stub___initscr)
9559 #error found stub for initscr
9560 #endif
9561
9562         return initscr ();
9563   ;
9564   return 0;
9565 }
9566 _ACEOF
9567 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9568 if { (eval echo "$as_me:9568: \"$ac_link\"") >&5
9569   (eval $ac_link) 2>&5
9570   ac_status=$?
9571   echo "$as_me:9571: \$? = $ac_status" >&5
9572   (exit "$ac_status"); } &&
9573          { ac_try='test -s "conftest$ac_exeext"'
9574   { (eval echo "$as_me:9574: \"$ac_try\"") >&5
9575   (eval $ac_try) 2>&5
9576   ac_status=$?
9577   echo "$as_me:9577: \$? = $ac_status" >&5
9578   (exit "$ac_status"); }; }; then
9579   ac_cv_func_initscr=yes
9580 else
9581   echo "$as_me: failed program was:" >&5
9582 cat "conftest.$ac_ext" >&5
9583 ac_cv_func_initscr=no
9584 fi
9585 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9586 fi
9587 echo "$as_me:9587: result: $ac_cv_func_initscr" >&5
9588 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9589 if test "$ac_cv_func_initscr" = yes; then
9590   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9591 else
9592
9593                 cf_save_LIBS="$LIBS"
9594                 echo "$as_me:9594: checking for initscr in -l$cf_nculib_root" >&5
9595 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9596                 LIBS="-l$cf_nculib_root $LIBS"
9597                 cat >"conftest.$ac_ext" <<_ACEOF
9598 #line 9598 "configure"
9599 #include "confdefs.h"
9600 #include <${cf_cv_ncurses_header:-curses.h}>
9601 int
9602 main (void)
9603 {
9604 initscr()
9605   ;
9606   return 0;
9607 }
9608 _ACEOF
9609 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9610 if { (eval echo "$as_me:9610: \"$ac_link\"") >&5
9611   (eval $ac_link) 2>&5
9612   ac_status=$?
9613   echo "$as_me:9613: \$? = $ac_status" >&5
9614   (exit "$ac_status"); } &&
9615          { ac_try='test -s "conftest$ac_exeext"'
9616   { (eval echo "$as_me:9616: \"$ac_try\"") >&5
9617   (eval $ac_try) 2>&5
9618   ac_status=$?
9619   echo "$as_me:9619: \$? = $ac_status" >&5
9620   (exit "$ac_status"); }; }; then
9621   echo "$as_me:9621: result: yes" >&5
9622 echo "${ECHO_T}yes" >&6
9623                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9624
9625 else
9626   echo "$as_me: failed program was:" >&5
9627 cat "conftest.$ac_ext" >&5
9628 echo "$as_me:9628: result: no" >&5
9629 echo "${ECHO_T}no" >&6
9630
9631 cf_search=
9632 cf_library_path_list=""
9633 if test -n "${LDFLAGS}${LIBS}" ; then
9634         for cf_library_path in $LDFLAGS $LIBS
9635         do
9636                 case "$cf_library_path" in
9637                 (-L*)
9638                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9639
9640 test "x$cf_library_path" != "xNONE" && \
9641 test -d "$cf_library_path" && \
9642  {
9643         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9644         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9645         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9646         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9647         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9648         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"
9649 }
9650
9651                         cf_library_path_list="$cf_library_path_list $cf_search"
9652                         ;;
9653                 esac
9654         done
9655 fi
9656
9657 cf_search=
9658
9659 test "x$prefix" != "xNONE" && \
9660 test -d "$prefix" && \
9661  {
9662         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9663         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9664         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9665         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9666         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9667         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9668 }
9669
9670 for cf_subdir_prefix in \
9671         /usr \
9672         /usr/local \
9673         /usr/pkg \
9674         /opt \
9675         /opt/local \
9676         $HOME
9677 do
9678
9679 test "x$cf_subdir_prefix" != "x$prefix" && \
9680 test -d "$cf_subdir_prefix" && \
9681 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9682         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9683         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9684         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9685         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9686         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9687         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"
9688 }
9689
9690 done
9691
9692 cf_search="$cf_library_path_list $cf_search"
9693
9694                         for cf_libdir in $cf_search
9695                         do
9696                                 echo "$as_me:9696: checking for -l$cf_nculib_root in $cf_libdir" >&5
9697 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9698                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9699                                 cat >"conftest.$ac_ext" <<_ACEOF
9700 #line 9700 "configure"
9701 #include "confdefs.h"
9702 #include <${cf_cv_ncurses_header:-curses.h}>
9703 int
9704 main (void)
9705 {
9706 initscr()
9707   ;
9708   return 0;
9709 }
9710 _ACEOF
9711 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9712 if { (eval echo "$as_me:9712: \"$ac_link\"") >&5
9713   (eval $ac_link) 2>&5
9714   ac_status=$?
9715   echo "$as_me:9715: \$? = $ac_status" >&5
9716   (exit "$ac_status"); } &&
9717          { ac_try='test -s "conftest$ac_exeext"'
9718   { (eval echo "$as_me:9718: \"$ac_try\"") >&5
9719   (eval $ac_try) 2>&5
9720   ac_status=$?
9721   echo "$as_me:9721: \$? = $ac_status" >&5
9722   (exit "$ac_status"); }; }; then
9723   echo "$as_me:9723: result: yes" >&5
9724 echo "${ECHO_T}yes" >&6
9725                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9726                                          break
9727 else
9728   echo "$as_me: failed program was:" >&5
9729 cat "conftest.$ac_ext" >&5
9730 echo "$as_me:9730: result: no" >&5
9731 echo "${ECHO_T}no" >&6
9732                                          LIBS="$cf_save_LIBS"
9733 fi
9734 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9735                         done
9736
9737 fi
9738 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9739
9740 fi
9741
9742 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9743
9744 if test "$cf_found_library" = no ; then
9745         { { echo "$as_me:9745: error: Cannot link $cf_nculib_root library" >&5
9746 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9747    { (exit 1); exit 1; }; }
9748 fi
9749
9750 fi
9751
9752 if test -n "$cf_ncurses_LIBS" ; then
9753         echo "$as_me:9753: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9754 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9755         cf_ncurses_SAVE="$LIBS"
9756         for p in $cf_ncurses_LIBS ; do
9757                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9758                 if test "$q" != "$LIBS" ; then
9759                         LIBS="$q"
9760                 fi
9761         done
9762         cat >"conftest.$ac_ext" <<_ACEOF
9763 #line 9763 "configure"
9764 #include "confdefs.h"
9765 #include <${cf_cv_ncurses_header:-curses.h}>
9766 int
9767 main (void)
9768 {
9769 initscr(); mousemask(0,0); tigetstr((char *)0);
9770   ;
9771   return 0;
9772 }
9773 _ACEOF
9774 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9775 if { (eval echo "$as_me:9775: \"$ac_link\"") >&5
9776   (eval $ac_link) 2>&5
9777   ac_status=$?
9778   echo "$as_me:9778: \$? = $ac_status" >&5
9779   (exit "$ac_status"); } &&
9780          { ac_try='test -s "conftest$ac_exeext"'
9781   { (eval echo "$as_me:9781: \"$ac_try\"") >&5
9782   (eval $ac_try) 2>&5
9783   ac_status=$?
9784   echo "$as_me:9784: \$? = $ac_status" >&5
9785   (exit "$ac_status"); }; }; then
9786   echo "$as_me:9786: result: yes" >&5
9787 echo "${ECHO_T}yes" >&6
9788 else
9789   echo "$as_me: failed program was:" >&5
9790 cat "conftest.$ac_ext" >&5
9791 echo "$as_me:9791: result: no" >&5
9792 echo "${ECHO_T}no" >&6
9793                  LIBS="$cf_ncurses_SAVE"
9794 fi
9795 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9796 fi
9797
9798 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9799
9800 cat >>confdefs.h <<EOF
9801 #define $cf_nculib_ROOT 1
9802 EOF
9803
9804         fi
9805 else
9806         NCURSES_CONFIG=none
9807 fi
9808
9809         ;;
9810 (ncurses*)
9811
9812 cf_ncuconfig_root=$cf_cv_screen
9813 cf_have_ncuconfig=no
9814
9815 if test "x${PKG_CONFIG:=none}" != xnone; then
9816         echo "$as_me:9816: checking pkg-config for $cf_ncuconfig_root" >&5
9817 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9818         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9819                 echo "$as_me:9819: result: yes" >&5
9820 echo "${ECHO_T}yes" >&6
9821
9822                 echo "$as_me:9822: checking if the $cf_ncuconfig_root package files work" >&5
9823 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9824                 cf_have_ncuconfig=unknown
9825
9826                 cf_save_CFLAGS="$CFLAGS"
9827                 cf_save_CPPFLAGS="$CPPFLAGS"
9828                 cf_save_LIBS="$LIBS"
9829
9830                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9831                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9832
9833                 # while -W for passing linker flags is prevalent, it is not "standard".
9834                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9835                 # incompatible _and_ non-standard -W option which gives an error.  Work
9836                 # around that pitfall.
9837                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9838                 (x*c[89]9@@*-W*)
9839
9840 cf_fix_cppflags=no
9841 cf_new_cflags=
9842 cf_new_cppflags=
9843 cf_new_extra_cppflags=
9844
9845 for cf_add_cflags in $cf_pkg_cflags
9846 do
9847 case "$cf_fix_cppflags" in
9848 (no)
9849         case "$cf_add_cflags" in
9850         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9851                 case "$cf_add_cflags" in
9852                 (-D*)
9853                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9854
9855                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9856                                 && test -z "${cf_tst_cflags}" \
9857                                 && cf_fix_cppflags=yes
9858
9859                         if test "$cf_fix_cppflags" = yes ; then
9860
9861         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9862         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9863
9864                                 continue
9865                         elif test "${cf_tst_cflags}" = "\"'" ; then
9866
9867         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9868         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9869
9870                                 continue
9871                         fi
9872                         ;;
9873                 esac
9874                 case "$CPPFLAGS" in
9875                 (*$cf_add_cflags)
9876                         ;;
9877                 (*)
9878                         case "$cf_add_cflags" in
9879                         (-D*)
9880                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9881
9882 CPPFLAGS=`echo "$CPPFLAGS" | \
9883         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9884                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9885
9886                                 ;;
9887                         esac
9888
9889         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9890         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9891
9892                         ;;
9893                 esac
9894                 ;;
9895         (*)
9896
9897         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9898         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9899
9900                 ;;
9901         esac
9902         ;;
9903 (yes)
9904
9905         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9906         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9907
9908         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9909
9910         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9911                 && test -z "${cf_tst_cflags}" \
9912                 && cf_fix_cppflags=no
9913         ;;
9914 esac
9915 done
9916
9917 if test -n "$cf_new_cflags" ; then
9918
9919         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9920         CFLAGS="${CFLAGS}$cf_new_cflags"
9921
9922 fi
9923
9924 if test -n "$cf_new_cppflags" ; then
9925
9926         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9927         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9928
9929 fi
9930
9931 if test -n "$cf_new_extra_cppflags" ; then
9932
9933         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9934         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9935
9936 fi
9937
9938 cf_add_libs="$LIBS"
9939 # reverse order
9940 cf_add_0lib=
9941 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9942 # filter duplicates
9943 for cf_add_1lib in $cf_add_0lib; do
9944         for cf_add_2lib in $cf_add_libs; do
9945                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9946                         cf_add_1lib=
9947                         break
9948                 fi
9949         done
9950         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9951 done
9952 LIBS="$cf_add_libs"
9953
9954                         cat >"conftest.$ac_ext" <<_ACEOF
9955 #line 9955 "configure"
9956 #include "confdefs.h"
9957 #include <${cf_cv_ncurses_header:-curses.h}>
9958 int
9959 main (void)
9960 {
9961 initscr(); mousemask(0,0); tigetstr((char *)0);
9962   ;
9963   return 0;
9964 }
9965 _ACEOF
9966 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9967 if { (eval echo "$as_me:9967: \"$ac_link\"") >&5
9968   (eval $ac_link) 2>&5
9969   ac_status=$?
9970   echo "$as_me:9970: \$? = $ac_status" >&5
9971   (exit "$ac_status"); } &&
9972          { ac_try='test -s "conftest$ac_exeext"'
9973   { (eval echo "$as_me:9973: \"$ac_try\"") >&5
9974   (eval $ac_try) 2>&5
9975   ac_status=$?
9976   echo "$as_me:9976: \$? = $ac_status" >&5
9977   (exit "$ac_status"); }; }; then
9978   if test "$cross_compiling" = yes; then
9979   cf_test_ncuconfig=maybe
9980 else
9981   cat >"conftest.$ac_ext" <<_ACEOF
9982 #line 9982 "configure"
9983 #include "confdefs.h"
9984 #include <${cf_cv_ncurses_header:-curses.h}>
9985                                         int main(void)
9986                                         { char *xx = curses_version(); return (xx == 0); }
9987 _ACEOF
9988 rm -f "conftest$ac_exeext"
9989 if { (eval echo "$as_me:9989: \"$ac_link\"") >&5
9990   (eval $ac_link) 2>&5
9991   ac_status=$?
9992   echo "$as_me:9992: \$? = $ac_status" >&5
9993   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9994   { (eval echo "$as_me:9994: \"$ac_try\"") >&5
9995   (eval $ac_try) 2>&5
9996   ac_status=$?
9997   echo "$as_me:9997: \$? = $ac_status" >&5
9998   (exit "$ac_status"); }; }; then
9999   cf_test_ncuconfig=yes
10000 else
10001   echo "$as_me: program exited with status $ac_status" >&5
10002 echo "$as_me: failed program was:" >&5
10003 cat "conftest.$ac_ext" >&5
10004 cf_test_ncuconfig=no
10005 fi
10006 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10007 fi
10008 else
10009   echo "$as_me: failed program was:" >&5
10010 cat "conftest.$ac_ext" >&5
10011 cf_test_ncuconfig=no
10012 fi
10013 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10014
10015                         CFLAGS="$cf_save_CFLAGS"
10016                         CPPFLAGS="$cf_save_CPPFLAGS"
10017                         LIBS="$cf_save_LIBS"
10018
10019                         if test "x$cf_test_ncuconfig" != xyes; then
10020                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10021                                 cf_pkg_cflags="$cf_temp"
10022                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10023                                 cf_pkg_libs="$cf_temp"
10024                         fi
10025                         ;;
10026                 esac
10027
10028 cf_fix_cppflags=no
10029 cf_new_cflags=
10030 cf_new_cppflags=
10031 cf_new_extra_cppflags=
10032
10033 for cf_add_cflags in $cf_pkg_cflags
10034 do
10035 case "$cf_fix_cppflags" in
10036 (no)
10037         case "$cf_add_cflags" in
10038         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10039                 case "$cf_add_cflags" in
10040                 (-D*)
10041                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10042
10043                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10044                                 && test -z "${cf_tst_cflags}" \
10045                                 && cf_fix_cppflags=yes
10046
10047                         if test "$cf_fix_cppflags" = yes ; then
10048
10049         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10050         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10051
10052                                 continue
10053                         elif test "${cf_tst_cflags}" = "\"'" ; then
10054
10055         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10056         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10057
10058                                 continue
10059                         fi
10060                         ;;
10061                 esac
10062                 case "$CPPFLAGS" in
10063                 (*$cf_add_cflags)
10064                         ;;
10065                 (*)
10066                         case "$cf_add_cflags" in
10067                         (-D*)
10068                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10069
10070 CPPFLAGS=`echo "$CPPFLAGS" | \
10071         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10072                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10073
10074                                 ;;
10075                         esac
10076
10077         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10078         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10079
10080                         ;;
10081                 esac
10082                 ;;
10083         (*)
10084
10085         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10086         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10087
10088                 ;;
10089         esac
10090         ;;
10091 (yes)
10092
10093         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10094         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10095
10096         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10097
10098         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10099                 && test -z "${cf_tst_cflags}" \
10100                 && cf_fix_cppflags=no
10101         ;;
10102 esac
10103 done
10104
10105 if test -n "$cf_new_cflags" ; then
10106
10107         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10108         CFLAGS="${CFLAGS}$cf_new_cflags"
10109
10110 fi
10111
10112 if test -n "$cf_new_cppflags" ; then
10113
10114         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10115         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10116
10117 fi
10118
10119 if test -n "$cf_new_extra_cppflags" ; then
10120
10121         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10122         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10123
10124 fi
10125
10126 cf_add_libs="$LIBS"
10127 # reverse order
10128 cf_add_0lib=
10129 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10130 # filter duplicates
10131 for cf_add_1lib in $cf_add_0lib; do
10132         for cf_add_2lib in $cf_add_libs; do
10133                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10134                         cf_add_1lib=
10135                         break
10136                 fi
10137         done
10138         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10139 done
10140 LIBS="$cf_add_libs"
10141
10142                 cat >"conftest.$ac_ext" <<_ACEOF
10143 #line 10143 "configure"
10144 #include "confdefs.h"
10145 #include <${cf_cv_ncurses_header:-curses.h}>
10146 int
10147 main (void)
10148 {
10149 initscr(); mousemask(0,0); tigetstr((char *)0);
10150   ;
10151   return 0;
10152 }
10153 _ACEOF
10154 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10155 if { (eval echo "$as_me:10155: \"$ac_link\"") >&5
10156   (eval $ac_link) 2>&5
10157   ac_status=$?
10158   echo "$as_me:10158: \$? = $ac_status" >&5
10159   (exit "$ac_status"); } &&
10160          { ac_try='test -s "conftest$ac_exeext"'
10161   { (eval echo "$as_me:10161: \"$ac_try\"") >&5
10162   (eval $ac_try) 2>&5
10163   ac_status=$?
10164   echo "$as_me:10164: \$? = $ac_status" >&5
10165   (exit "$ac_status"); }; }; then
10166   if test "$cross_compiling" = yes; then
10167   cf_have_ncuconfig=maybe
10168 else
10169   cat >"conftest.$ac_ext" <<_ACEOF
10170 #line 10170 "configure"
10171 #include "confdefs.h"
10172 #include <${cf_cv_ncurses_header:-curses.h}>
10173                                 int main(void)
10174                                 { char *xx = curses_version(); return (xx == 0); }
10175 _ACEOF
10176 rm -f "conftest$ac_exeext"
10177 if { (eval echo "$as_me:10177: \"$ac_link\"") >&5
10178   (eval $ac_link) 2>&5
10179   ac_status=$?
10180   echo "$as_me:10180: \$? = $ac_status" >&5
10181   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10182   { (eval echo "$as_me:10182: \"$ac_try\"") >&5
10183   (eval $ac_try) 2>&5
10184   ac_status=$?
10185   echo "$as_me:10185: \$? = $ac_status" >&5
10186   (exit "$ac_status"); }; }; then
10187   cf_have_ncuconfig=yes
10188 else
10189   echo "$as_me: program exited with status $ac_status" >&5
10190 echo "$as_me: failed program was:" >&5
10191 cat "conftest.$ac_ext" >&5
10192 cf_have_ncuconfig=no
10193 fi
10194 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10195 fi
10196 else
10197   echo "$as_me: failed program was:" >&5
10198 cat "conftest.$ac_ext" >&5
10199 cf_have_ncuconfig=no
10200 fi
10201 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10202                 echo "$as_me:10202: result: $cf_have_ncuconfig" >&5
10203 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10204                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10205                 if test "$cf_have_ncuconfig" != "yes"
10206                 then
10207                         CPPFLAGS="$cf_save_CPPFLAGS"
10208                         LIBS="$cf_save_LIBS"
10209                         NCURSES_CONFIG_PKG=none
10210                 else
10211
10212 cat >>confdefs.h <<\EOF
10213 #define NCURSES 1
10214 EOF
10215
10216                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10217
10218 echo "$as_me:10218: checking for terminfo header" >&5
10219 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10220 if test "${cf_cv_term_header+set}" = set; then
10221   echo $ECHO_N "(cached) $ECHO_C" >&6
10222 else
10223
10224 case "${cf_cv_ncurses_header}" in
10225 (*/ncurses.h|*/ncursesw.h)
10226         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10227         ;;
10228 (*)
10229         cf_term_header=term.h
10230         ;;
10231 esac
10232
10233 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10234 do
10235 cat >"conftest.$ac_ext" <<_ACEOF
10236 #line 10236 "configure"
10237 #include "confdefs.h"
10238 #include <stdio.h>
10239 #include <${cf_cv_ncurses_header:-curses.h}>
10240 #include <$cf_test>
10241
10242 int
10243 main (void)
10244 {
10245 int x = auto_left_margin; (void)x
10246   ;
10247   return 0;
10248 }
10249 _ACEOF
10250 rm -f "conftest.$ac_objext"
10251 if { (eval echo "$as_me:10251: \"$ac_compile\"") >&5
10252   (eval $ac_compile) 2>&5
10253   ac_status=$?
10254   echo "$as_me:10254: \$? = $ac_status" >&5
10255   (exit "$ac_status"); } &&
10256          { ac_try='test -s "conftest.$ac_objext"'
10257   { (eval echo "$as_me:10257: \"$ac_try\"") >&5
10258   (eval $ac_try) 2>&5
10259   ac_status=$?
10260   echo "$as_me:10260: \$? = $ac_status" >&5
10261   (exit "$ac_status"); }; }; then
10262
10263         cf_cv_term_header="$cf_test"
10264 else
10265   echo "$as_me: failed program was:" >&5
10266 cat "conftest.$ac_ext" >&5
10267
10268         cf_cv_term_header=unknown
10269
10270 fi
10271 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10272         test "$cf_cv_term_header" != unknown && break
10273 done
10274
10275 fi
10276 echo "$as_me:10276: result: $cf_cv_term_header" >&5
10277 echo "${ECHO_T}$cf_cv_term_header" >&6
10278
10279 # Set definitions to allow ifdef'ing to accommodate subdirectories
10280
10281 case "$cf_cv_term_header" in
10282 (*term.h)
10283
10284 cat >>confdefs.h <<\EOF
10285 #define HAVE_TERM_H 1
10286 EOF
10287
10288         ;;
10289 esac
10290
10291 case "$cf_cv_term_header" in
10292 (ncurses/term.h)
10293
10294 cat >>confdefs.h <<\EOF
10295 #define HAVE_NCURSES_TERM_H 1
10296 EOF
10297
10298         ;;
10299 (ncursesw/term.h)
10300
10301 cat >>confdefs.h <<\EOF
10302 #define HAVE_NCURSESW_TERM_H 1
10303 EOF
10304
10305         ;;
10306 esac
10307
10308                 fi
10309
10310         else
10311                 echo "$as_me:10311: result: no" >&5
10312 echo "${ECHO_T}no" >&6
10313                 NCURSES_CONFIG_PKG=none
10314         fi
10315 else
10316         NCURSES_CONFIG_PKG=none
10317 fi
10318
10319 if test "x$cf_have_ncuconfig" = "xno"; then
10320         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10321
10322 if test -n "$ac_tool_prefix"; then
10323   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10324   do
10325     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10326 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10327 echo "$as_me:10327: checking for $ac_word" >&5
10328 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10329 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10330   echo $ECHO_N "(cached) $ECHO_C" >&6
10331 else
10332   if test -n "$NCURSES_CONFIG"; then
10333   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10334 else
10335   ac_save_IFS=$IFS; IFS=$ac_path_separator
10336 ac_dummy="$PATH"
10337 for ac_dir in $ac_dummy; do
10338   IFS=$ac_save_IFS
10339   test -z "$ac_dir" && ac_dir=.
10340   $as_executable_p "$ac_dir/$ac_word" || continue
10341 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10342 echo "$as_me:10342: found $ac_dir/$ac_word" >&5
10343 break
10344 done
10345
10346 fi
10347 fi
10348 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10349 if test -n "$NCURSES_CONFIG"; then
10350   echo "$as_me:10350: result: $NCURSES_CONFIG" >&5
10351 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10352 else
10353   echo "$as_me:10353: result: no" >&5
10354 echo "${ECHO_T}no" >&6
10355 fi
10356
10357     test -n "$NCURSES_CONFIG" && break
10358   done
10359 fi
10360 if test -z "$NCURSES_CONFIG"; then
10361   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10362   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10363 do
10364   # Extract the first word of "$ac_prog", so it can be a program name with args.
10365 set dummy $ac_prog; ac_word=$2
10366 echo "$as_me:10366: checking for $ac_word" >&5
10367 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10368 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10369   echo $ECHO_N "(cached) $ECHO_C" >&6
10370 else
10371   if test -n "$ac_ct_NCURSES_CONFIG"; then
10372   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10373 else
10374   ac_save_IFS=$IFS; IFS=$ac_path_separator
10375 ac_dummy="$PATH"
10376 for ac_dir in $ac_dummy; do
10377   IFS=$ac_save_IFS
10378   test -z "$ac_dir" && ac_dir=.
10379   $as_executable_p "$ac_dir/$ac_word" || continue
10380 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10381 echo "$as_me:10381: found $ac_dir/$ac_word" >&5
10382 break
10383 done
10384
10385 fi
10386 fi
10387 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10388 if test -n "$ac_ct_NCURSES_CONFIG"; then
10389   echo "$as_me:10389: result: $ac_ct_NCURSES_CONFIG" >&5
10390 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10391 else
10392   echo "$as_me:10392: result: no" >&5
10393 echo "${ECHO_T}no" >&6
10394 fi
10395
10396   test -n "$ac_ct_NCURSES_CONFIG" && break
10397 done
10398 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10399
10400   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10401 fi
10402
10403         if test "$NCURSES_CONFIG" != none ; then
10404
10405 cf_fix_cppflags=no
10406 cf_new_cflags=
10407 cf_new_cppflags=
10408 cf_new_extra_cppflags=
10409
10410 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10411 do
10412 case "$cf_fix_cppflags" in
10413 (no)
10414         case "$cf_add_cflags" in
10415         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10416                 case "$cf_add_cflags" in
10417                 (-D*)
10418                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10419
10420                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10421                                 && test -z "${cf_tst_cflags}" \
10422                                 && cf_fix_cppflags=yes
10423
10424                         if test "$cf_fix_cppflags" = yes ; then
10425
10426         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10427         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10428
10429                                 continue
10430                         elif test "${cf_tst_cflags}" = "\"'" ; then
10431
10432         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10433         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10434
10435                                 continue
10436                         fi
10437                         ;;
10438                 esac
10439                 case "$CPPFLAGS" in
10440                 (*$cf_add_cflags)
10441                         ;;
10442                 (*)
10443                         case "$cf_add_cflags" in
10444                         (-D*)
10445                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10446
10447 CPPFLAGS=`echo "$CPPFLAGS" | \
10448         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10449                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10450
10451                                 ;;
10452                         esac
10453
10454         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10455         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10456
10457                         ;;
10458                 esac
10459                 ;;
10460         (*)
10461
10462         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10463         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10464
10465                 ;;
10466         esac
10467         ;;
10468 (yes)
10469
10470         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10471         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10472
10473         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10474
10475         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10476                 && test -z "${cf_tst_cflags}" \
10477                 && cf_fix_cppflags=no
10478         ;;
10479 esac
10480 done
10481
10482 if test -n "$cf_new_cflags" ; then
10483
10484         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10485         CFLAGS="${CFLAGS}$cf_new_cflags"
10486
10487 fi
10488
10489 if test -n "$cf_new_cppflags" ; then
10490
10491         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10492         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10493
10494 fi
10495
10496 if test -n "$cf_new_extra_cppflags" ; then
10497
10498         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10499         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10500
10501 fi
10502
10503 cf_add_libs="$LIBS"
10504 # reverse order
10505 cf_add_0lib=
10506 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10507 # filter duplicates
10508 for cf_add_1lib in $cf_add_0lib; do
10509         for cf_add_2lib in $cf_add_libs; do
10510                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10511                         cf_add_1lib=
10512                         break
10513                 fi
10514         done
10515         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10516 done
10517 LIBS="$cf_add_libs"
10518
10519                 # even with config script, some packages use no-override for curses.h
10520
10521 echo "$as_me:10521: checking if we have identified curses headers" >&5
10522 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10523 if test "${cf_cv_ncurses_header+set}" = set; then
10524   echo $ECHO_N "(cached) $ECHO_C" >&6
10525 else
10526
10527 cf_cv_ncurses_header=none
10528 for cf_header in \
10529         ncurses.h $cf_cv_screen/ncurses.h \
10530         curses.h $cf_cv_screen/curses.h
10531 do
10532 cat >"conftest.$ac_ext" <<_ACEOF
10533 #line 10533 "configure"
10534 #include "confdefs.h"
10535 #include <${cf_header}>
10536 int
10537 main (void)
10538 {
10539 initscr(); tgoto("?", 0,0)
10540   ;
10541   return 0;
10542 }
10543 _ACEOF
10544 rm -f "conftest.$ac_objext"
10545 if { (eval echo "$as_me:10545: \"$ac_compile\"") >&5
10546   (eval $ac_compile) 2>&5
10547   ac_status=$?
10548   echo "$as_me:10548: \$? = $ac_status" >&5
10549   (exit "$ac_status"); } &&
10550          { ac_try='test -s "conftest.$ac_objext"'
10551   { (eval echo "$as_me:10551: \"$ac_try\"") >&5
10552   (eval $ac_try) 2>&5
10553   ac_status=$?
10554   echo "$as_me:10554: \$? = $ac_status" >&5
10555   (exit "$ac_status"); }; }; then
10556   cf_cv_ncurses_header=$cf_header; break
10557 else
10558   echo "$as_me: failed program was:" >&5
10559 cat "conftest.$ac_ext" >&5
10560 fi
10561 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10562 done
10563
10564 fi
10565 echo "$as_me:10565: result: $cf_cv_ncurses_header" >&5
10566 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10567
10568 if test "$cf_cv_ncurses_header" = none ; then
10569         { { echo "$as_me:10569: error: No curses header-files found" >&5
10570 echo "$as_me: error: No curses header-files found" >&2;}
10571    { (exit 1); exit 1; }; }
10572 fi
10573
10574 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10575
10576 for ac_header in $cf_cv_ncurses_header
10577 do
10578 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10579 echo "$as_me:10579: checking for $ac_header" >&5
10580 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10581 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10582   echo $ECHO_N "(cached) $ECHO_C" >&6
10583 else
10584   cat >"conftest.$ac_ext" <<_ACEOF
10585 #line 10585 "configure"
10586 #include "confdefs.h"
10587 #include <$ac_header>
10588 _ACEOF
10589 if { (eval echo "$as_me:10589: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10590   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10591   ac_status=$?
10592   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10593   rm -f conftest.er1
10594   cat conftest.err >&5
10595   echo "$as_me:10595: \$? = $ac_status" >&5
10596   (exit "$ac_status"); } >/dev/null; then
10597   if test -s conftest.err; then
10598     ac_cpp_err=$ac_c_preproc_warn_flag
10599   else
10600     ac_cpp_err=
10601   fi
10602 else
10603   ac_cpp_err=yes
10604 fi
10605 if test -z "$ac_cpp_err"; then
10606   eval "$as_ac_Header=yes"
10607 else
10608   echo "$as_me: failed program was:" >&5
10609   cat "conftest.$ac_ext" >&5
10610   eval "$as_ac_Header=no"
10611 fi
10612 rm -f conftest.err "conftest.$ac_ext"
10613 fi
10614 echo "$as_me:10614: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10615 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10616 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10617   cat >>confdefs.h <<EOF
10618 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10619 EOF
10620
10621 fi
10622 done
10623
10624 cat >>confdefs.h <<\EOF
10625 #define NCURSES 1
10626 EOF
10627
10628 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10629
10630                 cat >>confdefs.h <<EOF
10631 #define $cf_nculib_ROOT 1
10632 EOF
10633
10634                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10635
10636         else
10637
10638 cf_ncuhdr_root=$cf_cv_screen
10639
10640 test -n "$cf_cv_curses_dir" && \
10641 test "$cf_cv_curses_dir" != "no" && { \
10642
10643 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10644   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10645   do
10646         while test "$cf_add_incdir" != /usr/include
10647         do
10648           if test -d "$cf_add_incdir"
10649           then
10650                 cf_have_incdir=no
10651                 if test -n "$CFLAGS$CPPFLAGS" ; then
10652                   # a loop is needed to ensure we can add subdirs of existing dirs
10653                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10654                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10655                           cf_have_incdir=yes; break
10656                         fi
10657                   done
10658                 fi
10659
10660                 if test "$cf_have_incdir" = no ; then
10661                   if test "$cf_add_incdir" = /usr/local/include ; then
10662                         if test "$GCC" = yes
10663                         then
10664                           cf_save_CPPFLAGS=$CPPFLAGS
10665
10666         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10667         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10668
10669                           cat >"conftest.$ac_ext" <<_ACEOF
10670 #line 10670 "configure"
10671 #include "confdefs.h"
10672 #include <stdio.h>
10673 int
10674 main (void)
10675 {
10676 printf("Hello")
10677   ;
10678   return 0;
10679 }
10680 _ACEOF
10681 rm -f "conftest.$ac_objext"
10682 if { (eval echo "$as_me:10682: \"$ac_compile\"") >&5
10683   (eval $ac_compile) 2>&5
10684   ac_status=$?
10685   echo "$as_me:10685: \$? = $ac_status" >&5
10686   (exit "$ac_status"); } &&
10687          { ac_try='test -s "conftest.$ac_objext"'
10688   { (eval echo "$as_me:10688: \"$ac_try\"") >&5
10689   (eval $ac_try) 2>&5
10690   ac_status=$?
10691   echo "$as_me:10691: \$? = $ac_status" >&5
10692   (exit "$ac_status"); }; }; then
10693   :
10694 else
10695   echo "$as_me: failed program was:" >&5
10696 cat "conftest.$ac_ext" >&5
10697 cf_have_incdir=yes
10698 fi
10699 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10700                           CPPFLAGS=$cf_save_CPPFLAGS
10701                         fi
10702                   fi
10703                 fi
10704
10705                 if test "$cf_have_incdir" = no ; then
10706                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10707
10708 echo "${as_me:-configure}:10708: testing adding $cf_add_incdir to include-path ..." 1>&5
10709
10710                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10711
10712                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10713                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10714                   cf_add_incdir="$cf_top_incdir"
10715                 else
10716                   break
10717                 fi
10718           else
10719                 break
10720           fi
10721         done
10722   done
10723 fi
10724
10725 }
10726
10727 echo "$as_me:10727: checking for $cf_ncuhdr_root header in include-path" >&5
10728 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10729 if test "${cf_cv_ncurses_h+set}" = set; then
10730   echo $ECHO_N "(cached) $ECHO_C" >&6
10731 else
10732
10733         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10734         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10735         for cf_header in $cf_header_list
10736         do
10737
10738         cat >"conftest.$ac_ext" <<_ACEOF
10739 #line 10739 "configure"
10740 #include "confdefs.h"
10741
10742 #include <$cf_header>
10743 int
10744 main (void)
10745 {
10746
10747 #ifdef NCURSES_VERSION
10748
10749 printf("%s\\n", NCURSES_VERSION);
10750 #else
10751 #ifdef __NCURSES_H
10752 printf("old\\n");
10753 #else
10754         make an error
10755 #endif
10756 #endif
10757
10758   ;
10759   return 0;
10760 }
10761 _ACEOF
10762 rm -f "conftest.$ac_objext"
10763 if { (eval echo "$as_me:10763: \"$ac_compile\"") >&5
10764   (eval $ac_compile) 2>&5
10765   ac_status=$?
10766   echo "$as_me:10766: \$? = $ac_status" >&5
10767   (exit "$ac_status"); } &&
10768          { ac_try='test -s "conftest.$ac_objext"'
10769   { (eval echo "$as_me:10769: \"$ac_try\"") >&5
10770   (eval $ac_try) 2>&5
10771   ac_status=$?
10772   echo "$as_me:10772: \$? = $ac_status" >&5
10773   (exit "$ac_status"); }; }; then
10774   cf_cv_ncurses_h=$cf_header
10775
10776 else
10777   echo "$as_me: failed program was:" >&5
10778 cat "conftest.$ac_ext" >&5
10779 cf_cv_ncurses_h=no
10780 fi
10781 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10782
10783                 test "$cf_cv_ncurses_h" != no && break
10784         done
10785
10786 fi
10787 echo "$as_me:10787: result: $cf_cv_ncurses_h" >&5
10788 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10789
10790 if test "$cf_cv_ncurses_h" != no ; then
10791         cf_cv_ncurses_header=$cf_cv_ncurses_h
10792 else
10793
10794 echo "$as_me:10794: checking for $cf_ncuhdr_root include-path" >&5
10795 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10796 if test "${cf_cv_ncurses_h2+set}" = set; then
10797   echo $ECHO_N "(cached) $ECHO_C" >&6
10798 else
10799
10800         test -n "$verbose" && echo
10801
10802 cf_search=
10803
10804 # collect the current set of include-directories from compiler flags
10805 cf_header_path_list=""
10806 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10807         for cf_header_path in $CPPFLAGS $CFLAGS
10808         do
10809                 case "$cf_header_path" in
10810                 (-I*)
10811                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10812
10813 test "x$cf_header_path" != "xNONE" && \
10814 test -d "$cf_header_path" && \
10815  {
10816         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10817         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10818         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10819         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10820         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10821         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"
10822 }
10823
10824                         cf_header_path_list="$cf_header_path_list $cf_search"
10825                         ;;
10826                 esac
10827         done
10828 fi
10829
10830 # add the variations for the package we are looking for
10831
10832 cf_search=
10833
10834 test "x$prefix" != "xNONE" && \
10835 test -d "$prefix" && \
10836  {
10837         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10838         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10839         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10840         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10841         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10842         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10843 }
10844
10845 for cf_subdir_prefix in \
10846         /usr \
10847         /usr/local \
10848         /usr/pkg \
10849         /opt \
10850         /opt/local \
10851         $HOME
10852 do
10853
10854 test "x$cf_subdir_prefix" != "x$prefix" && \
10855 test -d "$cf_subdir_prefix" && \
10856 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10857         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10858         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10859         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10860         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10861         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10862         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"
10863 }
10864
10865 done
10866
10867 test "$includedir" != NONE && \
10868 test "$includedir" != "/usr/include" && \
10869 test -d "$includedir" && {
10870         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10871         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10872 }
10873
10874 test "$oldincludedir" != NONE && \
10875 test "$oldincludedir" != "/usr/include" && \
10876 test -d "$oldincludedir" && {
10877         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10878         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10879 }
10880
10881 cf_search="$cf_search $cf_header_path_list"
10882
10883         test -n "$verbose" && echo "search path $cf_search"
10884         cf_save2_CPPFLAGS="$CPPFLAGS"
10885         for cf_incdir in $cf_search
10886         do
10887
10888 if test -n "$cf_incdir" ; then
10889   for cf_add_incdir in $cf_incdir
10890   do
10891         while test "$cf_add_incdir" != /usr/include
10892         do
10893           if test -d "$cf_add_incdir"
10894           then
10895                 cf_have_incdir=no
10896                 if test -n "$CFLAGS$CPPFLAGS" ; then
10897                   # a loop is needed to ensure we can add subdirs of existing dirs
10898                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10899                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10900                           cf_have_incdir=yes; break
10901                         fi
10902                   done
10903                 fi
10904
10905                 if test "$cf_have_incdir" = no ; then
10906                   if test "$cf_add_incdir" = /usr/local/include ; then
10907                         if test "$GCC" = yes
10908                         then
10909                           cf_save_CPPFLAGS=$CPPFLAGS
10910
10911         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10912         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10913
10914                           cat >"conftest.$ac_ext" <<_ACEOF
10915 #line 10915 "configure"
10916 #include "confdefs.h"
10917 #include <stdio.h>
10918 int
10919 main (void)
10920 {
10921 printf("Hello")
10922   ;
10923   return 0;
10924 }
10925 _ACEOF
10926 rm -f "conftest.$ac_objext"
10927 if { (eval echo "$as_me:10927: \"$ac_compile\"") >&5
10928   (eval $ac_compile) 2>&5
10929   ac_status=$?
10930   echo "$as_me:10930: \$? = $ac_status" >&5
10931   (exit "$ac_status"); } &&
10932          { ac_try='test -s "conftest.$ac_objext"'
10933   { (eval echo "$as_me:10933: \"$ac_try\"") >&5
10934   (eval $ac_try) 2>&5
10935   ac_status=$?
10936   echo "$as_me:10936: \$? = $ac_status" >&5
10937   (exit "$ac_status"); }; }; then
10938   :
10939 else
10940   echo "$as_me: failed program was:" >&5
10941 cat "conftest.$ac_ext" >&5
10942 cf_have_incdir=yes
10943 fi
10944 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10945                           CPPFLAGS=$cf_save_CPPFLAGS
10946                         fi
10947                   fi
10948                 fi
10949
10950                 if test "$cf_have_incdir" = no ; then
10951                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10952
10953 echo "${as_me:-configure}:10953: testing adding $cf_add_incdir to include-path ..." 1>&5
10954
10955                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10956
10957                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10958                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10959                   cf_add_incdir="$cf_top_incdir"
10960                 else
10961                   break
10962                 fi
10963           else
10964                 break
10965           fi
10966         done
10967   done
10968 fi
10969
10970                 for cf_header in \
10971                         ncurses.h \
10972                         curses.h
10973                 do
10974
10975         cat >"conftest.$ac_ext" <<_ACEOF
10976 #line 10976 "configure"
10977 #include "confdefs.h"
10978
10979 #include <$cf_header>
10980 int
10981 main (void)
10982 {
10983
10984 #ifdef NCURSES_VERSION
10985
10986 printf("%s\\n", NCURSES_VERSION);
10987 #else
10988 #ifdef __NCURSES_H
10989 printf("old\\n");
10990 #else
10991         make an error
10992 #endif
10993 #endif
10994
10995   ;
10996   return 0;
10997 }
10998 _ACEOF
10999 rm -f "conftest.$ac_objext"
11000 if { (eval echo "$as_me:11000: \"$ac_compile\"") >&5
11001   (eval $ac_compile) 2>&5
11002   ac_status=$?
11003   echo "$as_me:11003: \$? = $ac_status" >&5
11004   (exit "$ac_status"); } &&
11005          { ac_try='test -s "conftest.$ac_objext"'
11006   { (eval echo "$as_me:11006: \"$ac_try\"") >&5
11007   (eval $ac_try) 2>&5
11008   ac_status=$?
11009   echo "$as_me:11009: \$? = $ac_status" >&5
11010   (exit "$ac_status"); }; }; then
11011   cf_cv_ncurses_h2=$cf_header
11012
11013 else
11014   echo "$as_me: failed program was:" >&5
11015 cat "conftest.$ac_ext" >&5
11016 cf_cv_ncurses_h2=no
11017 fi
11018 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11019
11020                         if test "$cf_cv_ncurses_h2" != no ; then
11021                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11022                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11023                                 break
11024                         fi
11025                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11026                 done
11027                 CPPFLAGS="$cf_save2_CPPFLAGS"
11028                 test "$cf_cv_ncurses_h2" != no && break
11029         done
11030         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11030: error: not found" >&5
11031 echo "$as_me: error: not found" >&2;}
11032    { (exit 1); exit 1; }; }
11033
11034 fi
11035 echo "$as_me:11035: result: $cf_cv_ncurses_h2" >&5
11036 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11037
11038         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11039         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11040         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11041                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11042         fi
11043
11044 if test -n "$cf_1st_incdir" ; then
11045   for cf_add_incdir in $cf_1st_incdir
11046   do
11047         while test "$cf_add_incdir" != /usr/include
11048         do
11049           if test -d "$cf_add_incdir"
11050           then
11051                 cf_have_incdir=no
11052                 if test -n "$CFLAGS$CPPFLAGS" ; then
11053                   # a loop is needed to ensure we can add subdirs of existing dirs
11054                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11055                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11056                           cf_have_incdir=yes; break
11057                         fi
11058                   done
11059                 fi
11060
11061                 if test "$cf_have_incdir" = no ; then
11062                   if test "$cf_add_incdir" = /usr/local/include ; then
11063                         if test "$GCC" = yes
11064                         then
11065                           cf_save_CPPFLAGS=$CPPFLAGS
11066
11067         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11068         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11069
11070                           cat >"conftest.$ac_ext" <<_ACEOF
11071 #line 11071 "configure"
11072 #include "confdefs.h"
11073 #include <stdio.h>
11074 int
11075 main (void)
11076 {
11077 printf("Hello")
11078   ;
11079   return 0;
11080 }
11081 _ACEOF
11082 rm -f "conftest.$ac_objext"
11083 if { (eval echo "$as_me:11083: \"$ac_compile\"") >&5
11084   (eval $ac_compile) 2>&5
11085   ac_status=$?
11086   echo "$as_me:11086: \$? = $ac_status" >&5
11087   (exit "$ac_status"); } &&
11088          { ac_try='test -s "conftest.$ac_objext"'
11089   { (eval echo "$as_me:11089: \"$ac_try\"") >&5
11090   (eval $ac_try) 2>&5
11091   ac_status=$?
11092   echo "$as_me:11092: \$? = $ac_status" >&5
11093   (exit "$ac_status"); }; }; then
11094   :
11095 else
11096   echo "$as_me: failed program was:" >&5
11097 cat "conftest.$ac_ext" >&5
11098 cf_have_incdir=yes
11099 fi
11100 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11101                           CPPFLAGS=$cf_save_CPPFLAGS
11102                         fi
11103                   fi
11104                 fi
11105
11106                 if test "$cf_have_incdir" = no ; then
11107                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11108
11109 echo "${as_me:-configure}:11109: testing adding $cf_add_incdir to include-path ..." 1>&5
11110
11111                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11112
11113                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11114                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11115                   cf_add_incdir="$cf_top_incdir"
11116                 else
11117                   break
11118                 fi
11119           else
11120                 break
11121           fi
11122         done
11123   done
11124 fi
11125
11126 fi
11127
11128 # Set definitions to allow ifdef'ing for ncurses.h
11129
11130 case "$cf_cv_ncurses_header" in
11131 (*ncurses.h)
11132
11133 cat >>confdefs.h <<\EOF
11134 #define HAVE_NCURSES_H 1
11135 EOF
11136
11137         ;;
11138 esac
11139
11140 case "$cf_cv_ncurses_header" in
11141 (ncurses/curses.h|ncurses/ncurses.h)
11142
11143 cat >>confdefs.h <<\EOF
11144 #define HAVE_NCURSES_NCURSES_H 1
11145 EOF
11146
11147         ;;
11148 (ncursesw/curses.h|ncursesw/ncurses.h)
11149
11150 cat >>confdefs.h <<\EOF
11151 #define HAVE_NCURSESW_NCURSES_H 1
11152 EOF
11153
11154         ;;
11155 esac
11156
11157 echo "$as_me:11157: checking for terminfo header" >&5
11158 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11159 if test "${cf_cv_term_header+set}" = set; then
11160   echo $ECHO_N "(cached) $ECHO_C" >&6
11161 else
11162
11163 case "${cf_cv_ncurses_header}" in
11164 (*/ncurses.h|*/ncursesw.h)
11165         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11166         ;;
11167 (*)
11168         cf_term_header=term.h
11169         ;;
11170 esac
11171
11172 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11173 do
11174 cat >"conftest.$ac_ext" <<_ACEOF
11175 #line 11175 "configure"
11176 #include "confdefs.h"
11177 #include <stdio.h>
11178 #include <${cf_cv_ncurses_header:-curses.h}>
11179 #include <$cf_test>
11180
11181 int
11182 main (void)
11183 {
11184 int x = auto_left_margin; (void)x
11185   ;
11186   return 0;
11187 }
11188 _ACEOF
11189 rm -f "conftest.$ac_objext"
11190 if { (eval echo "$as_me:11190: \"$ac_compile\"") >&5
11191   (eval $ac_compile) 2>&5
11192   ac_status=$?
11193   echo "$as_me:11193: \$? = $ac_status" >&5
11194   (exit "$ac_status"); } &&
11195          { ac_try='test -s "conftest.$ac_objext"'
11196   { (eval echo "$as_me:11196: \"$ac_try\"") >&5
11197   (eval $ac_try) 2>&5
11198   ac_status=$?
11199   echo "$as_me:11199: \$? = $ac_status" >&5
11200   (exit "$ac_status"); }; }; then
11201
11202         cf_cv_term_header="$cf_test"
11203 else
11204   echo "$as_me: failed program was:" >&5
11205 cat "conftest.$ac_ext" >&5
11206
11207         cf_cv_term_header=unknown
11208
11209 fi
11210 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11211         test "$cf_cv_term_header" != unknown && break
11212 done
11213
11214 fi
11215 echo "$as_me:11215: result: $cf_cv_term_header" >&5
11216 echo "${ECHO_T}$cf_cv_term_header" >&6
11217
11218 # Set definitions to allow ifdef'ing to accommodate subdirectories
11219
11220 case "$cf_cv_term_header" in
11221 (*term.h)
11222
11223 cat >>confdefs.h <<\EOF
11224 #define HAVE_TERM_H 1
11225 EOF
11226
11227         ;;
11228 esac
11229
11230 case "$cf_cv_term_header" in
11231 (ncurses/term.h)
11232
11233 cat >>confdefs.h <<\EOF
11234 #define HAVE_NCURSES_TERM_H 1
11235 EOF
11236
11237         ;;
11238 (ncursesw/term.h)
11239
11240 cat >>confdefs.h <<\EOF
11241 #define HAVE_NCURSESW_TERM_H 1
11242 EOF
11243
11244         ;;
11245 esac
11246
11247 # some applications need this, but should check for NCURSES_VERSION
11248
11249 cat >>confdefs.h <<\EOF
11250 #define NCURSES 1
11251 EOF
11252
11253 echo "$as_me:11253: checking for ncurses version" >&5
11254 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11255 if test "${cf_cv_ncurses_version+set}" = set; then
11256   echo $ECHO_N "(cached) $ECHO_C" >&6
11257 else
11258
11259         cf_cv_ncurses_version=no
11260         cf_tempfile=out$$
11261         rm -f "$cf_tempfile"
11262         if test "$cross_compiling" = yes; then
11263
11264         # This will not work if the preprocessor splits the line after the
11265         # Autoconf token.  The 'unproto' program does that.
11266         cat > "conftest.$ac_ext" <<EOF
11267 #include <${cf_cv_ncurses_header:-curses.h}>
11268 #undef Autoconf
11269 #ifdef NCURSES_VERSION
11270 Autoconf NCURSES_VERSION
11271 #else
11272 #ifdef __NCURSES_H
11273 Autoconf "old"
11274 #endif
11275 ;
11276 #endif
11277 EOF
11278         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11279         { (eval echo "$as_me:11279: \"$cf_try\"") >&5
11280   (eval $cf_try) 2>&5
11281   ac_status=$?
11282   echo "$as_me:11282: \$? = $ac_status" >&5
11283   (exit "$ac_status"); }
11284         if test -f conftest.out ; then
11285                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11286                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11287                 rm -f conftest.out
11288         fi
11289
11290 else
11291   cat >"conftest.$ac_ext" <<_ACEOF
11292 #line 11292 "configure"
11293 #include "confdefs.h"
11294
11295 #include <${cf_cv_ncurses_header:-curses.h}>
11296 #include <stdio.h>
11297 int main(void)
11298 {
11299         FILE *fp = fopen("$cf_tempfile", "w");
11300 #ifdef NCURSES_VERSION
11301 # ifdef NCURSES_VERSION_PATCH
11302         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11303 # else
11304         fprintf(fp, "%s\\n", NCURSES_VERSION);
11305 # endif
11306 #else
11307 # ifdef __NCURSES_H
11308         fprintf(fp, "old\\n");
11309 # else
11310         make an error
11311 # endif
11312 #endif
11313         ${cf_cv_main_return:-return}(0);
11314 }
11315 _ACEOF
11316 rm -f "conftest$ac_exeext"
11317 if { (eval echo "$as_me:11317: \"$ac_link\"") >&5
11318   (eval $ac_link) 2>&5
11319   ac_status=$?
11320   echo "$as_me:11320: \$? = $ac_status" >&5
11321   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11322   { (eval echo "$as_me:11322: \"$ac_try\"") >&5
11323   (eval $ac_try) 2>&5
11324   ac_status=$?
11325   echo "$as_me:11325: \$? = $ac_status" >&5
11326   (exit "$ac_status"); }; }; then
11327
11328         cf_cv_ncurses_version=`cat $cf_tempfile`
11329 else
11330   echo "$as_me: program exited with status $ac_status" >&5
11331 echo "$as_me: failed program was:" >&5
11332 cat "conftest.$ac_ext" >&5
11333 fi
11334 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11335 fi
11336         rm -f "$cf_tempfile"
11337
11338 fi
11339 echo "$as_me:11339: result: $cf_cv_ncurses_version" >&5
11340 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11341 test "$cf_cv_ncurses_version" = no ||
11342 cat >>confdefs.h <<\EOF
11343 #define NCURSES 1
11344 EOF
11345
11346 cf_nculib_root=$cf_cv_screen
11347         # This works, except for the special case where we find gpm, but
11348         # ncurses is in a nonstandard location via $LIBS, and we really want
11349         # to link gpm.
11350 cf_ncurses_LIBS=""
11351 cf_ncurses_SAVE="$LIBS"
11352 echo "$as_me:11352: checking for Gpm_Open in -lgpm" >&5
11353 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11354 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11355   echo $ECHO_N "(cached) $ECHO_C" >&6
11356 else
11357   ac_check_lib_save_LIBS=$LIBS
11358 LIBS="-lgpm  $LIBS"
11359 cat >"conftest.$ac_ext" <<_ACEOF
11360 #line 11360 "configure"
11361 #include "confdefs.h"
11362
11363 /* Override any gcc2 internal prototype to avoid an error.  */
11364 #ifdef __cplusplus
11365 extern "C"
11366 #endif
11367 /* We use char because int might match the return type of a gcc2
11368    builtin and then its argument prototype would still apply.  */
11369 char Gpm_Open ();
11370 int
11371 main (void)
11372 {
11373 Gpm_Open ();
11374   ;
11375   return 0;
11376 }
11377 _ACEOF
11378 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11379 if { (eval echo "$as_me:11379: \"$ac_link\"") >&5
11380   (eval $ac_link) 2>&5
11381   ac_status=$?
11382   echo "$as_me:11382: \$? = $ac_status" >&5
11383   (exit "$ac_status"); } &&
11384          { ac_try='test -s "conftest$ac_exeext"'
11385   { (eval echo "$as_me:11385: \"$ac_try\"") >&5
11386   (eval $ac_try) 2>&5
11387   ac_status=$?
11388   echo "$as_me:11388: \$? = $ac_status" >&5
11389   (exit "$ac_status"); }; }; then
11390   ac_cv_lib_gpm_Gpm_Open=yes
11391 else
11392   echo "$as_me: failed program was:" >&5
11393 cat "conftest.$ac_ext" >&5
11394 ac_cv_lib_gpm_Gpm_Open=no
11395 fi
11396 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11397 LIBS=$ac_check_lib_save_LIBS
11398 fi
11399 echo "$as_me:11399: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11400 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11401 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11402   echo "$as_me:11402: checking for initscr in -lgpm" >&5
11403 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11404 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11405   echo $ECHO_N "(cached) $ECHO_C" >&6
11406 else
11407   ac_check_lib_save_LIBS=$LIBS
11408 LIBS="-lgpm  $LIBS"
11409 cat >"conftest.$ac_ext" <<_ACEOF
11410 #line 11410 "configure"
11411 #include "confdefs.h"
11412
11413 /* Override any gcc2 internal prototype to avoid an error.  */
11414 #ifdef __cplusplus
11415 extern "C"
11416 #endif
11417 /* We use char because int might match the return type of a gcc2
11418    builtin and then its argument prototype would still apply.  */
11419 char initscr ();
11420 int
11421 main (void)
11422 {
11423 initscr ();
11424   ;
11425   return 0;
11426 }
11427 _ACEOF
11428 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11429 if { (eval echo "$as_me:11429: \"$ac_link\"") >&5
11430   (eval $ac_link) 2>&5
11431   ac_status=$?
11432   echo "$as_me:11432: \$? = $ac_status" >&5
11433   (exit "$ac_status"); } &&
11434          { ac_try='test -s "conftest$ac_exeext"'
11435   { (eval echo "$as_me:11435: \"$ac_try\"") >&5
11436   (eval $ac_try) 2>&5
11437   ac_status=$?
11438   echo "$as_me:11438: \$? = $ac_status" >&5
11439   (exit "$ac_status"); }; }; then
11440   ac_cv_lib_gpm_initscr=yes
11441 else
11442   echo "$as_me: failed program was:" >&5
11443 cat "conftest.$ac_ext" >&5
11444 ac_cv_lib_gpm_initscr=no
11445 fi
11446 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11447 LIBS=$ac_check_lib_save_LIBS
11448 fi
11449 echo "$as_me:11449: result: $ac_cv_lib_gpm_initscr" >&5
11450 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11451 if test "$ac_cv_lib_gpm_initscr" = yes; then
11452   LIBS="$cf_ncurses_SAVE"
11453 else
11454   cf_ncurses_LIBS="-lgpm"
11455 fi
11456
11457 fi
11458
11459 case "$host_os" in
11460 (freebsd*)
11461         # This is only necessary if you are linking against an obsolete
11462         # version of ncurses (but it should do no harm, since it's static).
11463         if test "$cf_nculib_root" = ncurses ; then
11464                 echo "$as_me:11464: checking for tgoto in -lmytinfo" >&5
11465 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11466 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11467   echo $ECHO_N "(cached) $ECHO_C" >&6
11468 else
11469   ac_check_lib_save_LIBS=$LIBS
11470 LIBS="-lmytinfo  $LIBS"
11471 cat >"conftest.$ac_ext" <<_ACEOF
11472 #line 11472 "configure"
11473 #include "confdefs.h"
11474
11475 /* Override any gcc2 internal prototype to avoid an error.  */
11476 #ifdef __cplusplus
11477 extern "C"
11478 #endif
11479 /* We use char because int might match the return type of a gcc2
11480    builtin and then its argument prototype would still apply.  */
11481 char tgoto ();
11482 int
11483 main (void)
11484 {
11485 tgoto ();
11486   ;
11487   return 0;
11488 }
11489 _ACEOF
11490 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11491 if { (eval echo "$as_me:11491: \"$ac_link\"") >&5
11492   (eval $ac_link) 2>&5
11493   ac_status=$?
11494   echo "$as_me:11494: \$? = $ac_status" >&5
11495   (exit "$ac_status"); } &&
11496          { ac_try='test -s "conftest$ac_exeext"'
11497   { (eval echo "$as_me:11497: \"$ac_try\"") >&5
11498   (eval $ac_try) 2>&5
11499   ac_status=$?
11500   echo "$as_me:11500: \$? = $ac_status" >&5
11501   (exit "$ac_status"); }; }; then
11502   ac_cv_lib_mytinfo_tgoto=yes
11503 else
11504   echo "$as_me: failed program was:" >&5
11505 cat "conftest.$ac_ext" >&5
11506 ac_cv_lib_mytinfo_tgoto=no
11507 fi
11508 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11509 LIBS=$ac_check_lib_save_LIBS
11510 fi
11511 echo "$as_me:11511: result: $ac_cv_lib_mytinfo_tgoto" >&5
11512 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11513 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11514   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11515 fi
11516
11517         fi
11518         ;;
11519 esac
11520
11521 cf_add_libs="$LIBS"
11522 # reverse order
11523 cf_add_0lib=
11524 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11525 # filter duplicates
11526 for cf_add_1lib in $cf_add_0lib; do
11527         for cf_add_2lib in $cf_add_libs; do
11528                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11529                         cf_add_1lib=
11530                         break
11531                 fi
11532         done
11533         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11534 done
11535 LIBS="$cf_add_libs"
11536
11537 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11538 then
11539
11540 cf_add_libs="$LIBS"
11541 # reverse order
11542 cf_add_0lib=
11543 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11544 # filter duplicates
11545 for cf_add_1lib in $cf_add_0lib; do
11546         for cf_add_2lib in $cf_add_libs; do
11547                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11548                         cf_add_1lib=
11549                         break
11550                 fi
11551         done
11552         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11553 done
11554 LIBS="$cf_add_libs"
11555
11556 else
11557
11558         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11559         cf_libdir=""
11560         echo "$as_me:11560: checking for initscr" >&5
11561 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11562 if test "${ac_cv_func_initscr+set}" = set; then
11563   echo $ECHO_N "(cached) $ECHO_C" >&6
11564 else
11565   cat >"conftest.$ac_ext" <<_ACEOF
11566 #line 11566 "configure"
11567 #include "confdefs.h"
11568 #define initscr autoconf_temporary
11569 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11570 #undef initscr
11571
11572 #ifdef __cplusplus
11573 extern "C"
11574 #endif
11575
11576 /* We use char because int might match the return type of a gcc2
11577    builtin and then its argument prototype would still apply.  */
11578 char initscr (void);
11579
11580 int
11581 main (void)
11582 {
11583
11584 /* The GNU C library defines stubs for functions which it implements
11585     to always fail with ENOSYS.  Some functions are actually named
11586     something starting with __ and the normal name is an alias.  */
11587 #if defined (__stub_initscr) || defined (__stub___initscr)
11588 #error found stub for initscr
11589 #endif
11590
11591         return initscr ();
11592   ;
11593   return 0;
11594 }
11595 _ACEOF
11596 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11597 if { (eval echo "$as_me:11597: \"$ac_link\"") >&5
11598   (eval $ac_link) 2>&5
11599   ac_status=$?
11600   echo "$as_me:11600: \$? = $ac_status" >&5
11601   (exit "$ac_status"); } &&
11602          { ac_try='test -s "conftest$ac_exeext"'
11603   { (eval echo "$as_me:11603: \"$ac_try\"") >&5
11604   (eval $ac_try) 2>&5
11605   ac_status=$?
11606   echo "$as_me:11606: \$? = $ac_status" >&5
11607   (exit "$ac_status"); }; }; then
11608   ac_cv_func_initscr=yes
11609 else
11610   echo "$as_me: failed program was:" >&5
11611 cat "conftest.$ac_ext" >&5
11612 ac_cv_func_initscr=no
11613 fi
11614 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11615 fi
11616 echo "$as_me:11616: result: $ac_cv_func_initscr" >&5
11617 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11618 if test "$ac_cv_func_initscr" = yes; then
11619   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11620 else
11621
11622                 cf_save_LIBS="$LIBS"
11623                 echo "$as_me:11623: checking for initscr in -l$cf_nculib_root" >&5
11624 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11625                 LIBS="-l$cf_nculib_root $LIBS"
11626                 cat >"conftest.$ac_ext" <<_ACEOF
11627 #line 11627 "configure"
11628 #include "confdefs.h"
11629 #include <${cf_cv_ncurses_header:-curses.h}>
11630 int
11631 main (void)
11632 {
11633 initscr()
11634   ;
11635   return 0;
11636 }
11637 _ACEOF
11638 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11639 if { (eval echo "$as_me:11639: \"$ac_link\"") >&5
11640   (eval $ac_link) 2>&5
11641   ac_status=$?
11642   echo "$as_me:11642: \$? = $ac_status" >&5
11643   (exit "$ac_status"); } &&
11644          { ac_try='test -s "conftest$ac_exeext"'
11645   { (eval echo "$as_me:11645: \"$ac_try\"") >&5
11646   (eval $ac_try) 2>&5
11647   ac_status=$?
11648   echo "$as_me:11648: \$? = $ac_status" >&5
11649   (exit "$ac_status"); }; }; then
11650   echo "$as_me:11650: result: yes" >&5
11651 echo "${ECHO_T}yes" >&6
11652                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11653
11654 else
11655   echo "$as_me: failed program was:" >&5
11656 cat "conftest.$ac_ext" >&5
11657 echo "$as_me:11657: result: no" >&5
11658 echo "${ECHO_T}no" >&6
11659
11660 cf_search=
11661 cf_library_path_list=""
11662 if test -n "${LDFLAGS}${LIBS}" ; then
11663         for cf_library_path in $LDFLAGS $LIBS
11664         do
11665                 case "$cf_library_path" in
11666                 (-L*)
11667                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11668
11669 test "x$cf_library_path" != "xNONE" && \
11670 test -d "$cf_library_path" && \
11671  {
11672         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11673         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11674         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11675         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11676         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11677         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"
11678 }
11679
11680                         cf_library_path_list="$cf_library_path_list $cf_search"
11681                         ;;
11682                 esac
11683         done
11684 fi
11685
11686 cf_search=
11687
11688 test "x$prefix" != "xNONE" && \
11689 test -d "$prefix" && \
11690  {
11691         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11692         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11693         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11694         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11695         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11696         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11697 }
11698
11699 for cf_subdir_prefix in \
11700         /usr \
11701         /usr/local \
11702         /usr/pkg \
11703         /opt \
11704         /opt/local \
11705         $HOME
11706 do
11707
11708 test "x$cf_subdir_prefix" != "x$prefix" && \
11709 test -d "$cf_subdir_prefix" && \
11710 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11711         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11712         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11713         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11714         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11715         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11716         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"
11717 }
11718
11719 done
11720
11721 cf_search="$cf_library_path_list $cf_search"
11722
11723                         for cf_libdir in $cf_search
11724                         do
11725                                 echo "$as_me:11725: checking for -l$cf_nculib_root in $cf_libdir" >&5
11726 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11727                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11728                                 cat >"conftest.$ac_ext" <<_ACEOF
11729 #line 11729 "configure"
11730 #include "confdefs.h"
11731 #include <${cf_cv_ncurses_header:-curses.h}>
11732 int
11733 main (void)
11734 {
11735 initscr()
11736   ;
11737   return 0;
11738 }
11739 _ACEOF
11740 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11741 if { (eval echo "$as_me:11741: \"$ac_link\"") >&5
11742   (eval $ac_link) 2>&5
11743   ac_status=$?
11744   echo "$as_me:11744: \$? = $ac_status" >&5
11745   (exit "$ac_status"); } &&
11746          { ac_try='test -s "conftest$ac_exeext"'
11747   { (eval echo "$as_me:11747: \"$ac_try\"") >&5
11748   (eval $ac_try) 2>&5
11749   ac_status=$?
11750   echo "$as_me:11750: \$? = $ac_status" >&5
11751   (exit "$ac_status"); }; }; then
11752   echo "$as_me:11752: result: yes" >&5
11753 echo "${ECHO_T}yes" >&6
11754                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11755                                          break
11756 else
11757   echo "$as_me: failed program was:" >&5
11758 cat "conftest.$ac_ext" >&5
11759 echo "$as_me:11759: result: no" >&5
11760 echo "${ECHO_T}no" >&6
11761                                          LIBS="$cf_save_LIBS"
11762 fi
11763 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11764                         done
11765
11766 fi
11767 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11768
11769 fi
11770
11771 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11772
11773 if test "$cf_found_library" = no ; then
11774         { { echo "$as_me:11774: error: Cannot link $cf_nculib_root library" >&5
11775 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11776    { (exit 1); exit 1; }; }
11777 fi
11778
11779 fi
11780
11781 if test -n "$cf_ncurses_LIBS" ; then
11782         echo "$as_me:11782: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11783 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11784         cf_ncurses_SAVE="$LIBS"
11785         for p in $cf_ncurses_LIBS ; do
11786                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11787                 if test "$q" != "$LIBS" ; then
11788                         LIBS="$q"
11789                 fi
11790         done
11791         cat >"conftest.$ac_ext" <<_ACEOF
11792 #line 11792 "configure"
11793 #include "confdefs.h"
11794 #include <${cf_cv_ncurses_header:-curses.h}>
11795 int
11796 main (void)
11797 {
11798 initscr(); mousemask(0,0); tigetstr((char *)0);
11799   ;
11800   return 0;
11801 }
11802 _ACEOF
11803 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11804 if { (eval echo "$as_me:11804: \"$ac_link\"") >&5
11805   (eval $ac_link) 2>&5
11806   ac_status=$?
11807   echo "$as_me:11807: \$? = $ac_status" >&5
11808   (exit "$ac_status"); } &&
11809          { ac_try='test -s "conftest$ac_exeext"'
11810   { (eval echo "$as_me:11810: \"$ac_try\"") >&5
11811   (eval $ac_try) 2>&5
11812   ac_status=$?
11813   echo "$as_me:11813: \$? = $ac_status" >&5
11814   (exit "$ac_status"); }; }; then
11815   echo "$as_me:11815: result: yes" >&5
11816 echo "${ECHO_T}yes" >&6
11817 else
11818   echo "$as_me: failed program was:" >&5
11819 cat "conftest.$ac_ext" >&5
11820 echo "$as_me:11820: result: no" >&5
11821 echo "${ECHO_T}no" >&6
11822                  LIBS="$cf_ncurses_SAVE"
11823 fi
11824 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11825 fi
11826
11827 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11828
11829 cat >>confdefs.h <<EOF
11830 #define $cf_nculib_ROOT 1
11831 EOF
11832
11833         fi
11834 else
11835         NCURSES_CONFIG=none
11836 fi
11837
11838         ;;
11839 (pdcurses)
11840         echo "$as_me:11840: checking for X" >&5
11841 echo $ECHO_N "checking for X... $ECHO_C" >&6
11842
11843 # Check whether --with-x or --without-x was given.
11844 if test "${with_x+set}" = set; then
11845   withval="$with_x"
11846
11847 fi;
11848 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11849 if test "x$with_x" = xno; then
11850   # The user explicitly disabled X.
11851   have_x=disabled
11852 else
11853   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11854     # Both variables are already set.
11855     have_x=yes
11856   else
11857     if test "${ac_cv_have_x+set}" = set; then
11858   echo $ECHO_N "(cached) $ECHO_C" >&6
11859 else
11860   # One or both of the vars are not set, and there is no cached value.
11861 ac_x_includes=no ac_x_libraries=no
11862 rm -fr conftest.dir
11863 if mkdir conftest.dir; then
11864   cd conftest.dir
11865   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11866   cat >Imakefile <<'EOF'
11867 acfindx:
11868         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11869 EOF
11870   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11871     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11872     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
11873     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11874     for ac_extension in a so sl dylib dll; do
11875       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
11876          test -f "$ac_im_libdir/libX11.$ac_extension"; then
11877         ac_im_usrlibdir=$ac_im_libdir; break
11878       fi
11879     done
11880     # Screen out bogus values from the imake configuration.  They are
11881     # bogus both because they are the default anyway, and because
11882     # using them would break gcc on systems where it needs fixed includes.
11883     case $ac_im_incroot in
11884         /usr/include) ;;
11885         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11886     esac
11887     case $ac_im_usrlibdir in
11888         /usr/lib | /lib) ;;
11889         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11890     esac
11891   fi
11892   cd ..
11893   rm -fr conftest.dir
11894 fi
11895
11896 # Standard set of common directories for X headers.
11897 # Check X11 before X11Rn because it is often a symlink to the current release.
11898 ac_x_header_dirs='
11899 /usr/X11/include
11900 /usr/X11R7/include
11901 /usr/X11R6/include
11902 /usr/X11R5/include
11903 /usr/X11R4/include
11904
11905 /opt/local/include
11906 /opt/X11/include
11907
11908 /usr/include/X11
11909 /usr/include/X11R7
11910 /usr/include/X11R6
11911 /usr/include/X11R5
11912 /usr/include/X11R4
11913
11914 /usr/local/X11/include
11915 /usr/local/X11R7/include
11916 /usr/local/X11R6/include
11917 /usr/local/X11R5/include
11918 /usr/local/X11R4/include
11919
11920 /usr/local/include/X11
11921 /usr/local/include/X11R7
11922 /usr/local/include/X11R6
11923 /usr/local/include/X11R5
11924 /usr/local/include/X11R4
11925
11926 /usr/X386/include
11927 /usr/x386/include
11928 /usr/XFree86/include/X11
11929
11930 /usr/include
11931 /usr/local/include
11932 /usr/unsupported/include
11933 /usr/athena/include
11934 /usr/local/x11r5/include
11935 /usr/lpp/Xamples/include
11936
11937 /usr/openwin/include
11938 /usr/openwin/share/include'
11939
11940 if test "$ac_x_includes" = no; then
11941   # Guess where to find include files, by looking for Intrinsic.h.
11942   # First, try using that file with no special directory specified.
11943   cat >"conftest.$ac_ext" <<_ACEOF
11944 #line 11944 "configure"
11945 #include "confdefs.h"
11946 #include <X11/Intrinsic.h>
11947 _ACEOF
11948 if { (eval echo "$as_me:11948: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11949   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
11950   ac_status=$?
11951   $EGREP -v '^ *\+' conftest.er1 >conftest.err
11952   rm -f conftest.er1
11953   cat conftest.err >&5
11954   echo "$as_me:11954: \$? = $ac_status" >&5
11955   (exit "$ac_status"); } >/dev/null; then
11956   if test -s conftest.err; then
11957     ac_cpp_err=$ac_c_preproc_warn_flag
11958   else
11959     ac_cpp_err=
11960   fi
11961 else
11962   ac_cpp_err=yes
11963 fi
11964 if test -z "$ac_cpp_err"; then
11965   # We can compile using X headers with no special include directory.
11966 ac_x_includes=
11967 else
11968   echo "$as_me: failed program was:" >&5
11969   cat "conftest.$ac_ext" >&5
11970   for ac_dir in $ac_x_header_dirs; do
11971   if test -r "$ac_dir/X11/Intrinsic.h"; then
11972     ac_x_includes=$ac_dir
11973     break
11974   fi
11975 done
11976 fi
11977 rm -f conftest.err "conftest.$ac_ext"
11978 fi # $ac_x_includes = no
11979
11980 if test "$ac_x_libraries" = no; then
11981   # Check for the libraries.
11982   # See if we find them without any special options.
11983   # Don't add to $LIBS permanently.
11984   ac_save_LIBS=$LIBS
11985   LIBS="-lXt $LIBS"
11986   cat >"conftest.$ac_ext" <<_ACEOF
11987 #line 11987 "configure"
11988 #include "confdefs.h"
11989 #include <X11/Intrinsic.h>
11990 int
11991 main (void)
11992 {
11993 XtMalloc (0)
11994   ;
11995   return 0;
11996 }
11997 _ACEOF
11998 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11999 if { (eval echo "$as_me:11999: \"$ac_link\"") >&5
12000   (eval $ac_link) 2>&5
12001   ac_status=$?
12002   echo "$as_me:12002: \$? = $ac_status" >&5
12003   (exit "$ac_status"); } &&
12004          { ac_try='test -s "conftest$ac_exeext"'
12005   { (eval echo "$as_me:12005: \"$ac_try\"") >&5
12006   (eval $ac_try) 2>&5
12007   ac_status=$?
12008   echo "$as_me:12008: \$? = $ac_status" >&5
12009   (exit "$ac_status"); }; }; then
12010   LIBS=$ac_save_LIBS
12011 # We can link X programs with no special library path.
12012 ac_x_libraries=
12013 else
12014   echo "$as_me: failed program was:" >&5
12015 cat "conftest.$ac_ext" >&5
12016 LIBS=$ac_save_LIBS
12017 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12018 do
12019   # Don't even attempt the hair of trying to link an X program!
12020   for ac_extension in a so sl dylib dll; do
12021     if test -r "$ac_dir/libXt.$ac_extension"; then
12022       ac_x_libraries=$ac_dir
12023       break 2
12024     fi
12025   done
12026 done
12027 fi
12028 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12029 fi # $ac_x_libraries = no
12030
12031 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12032   # Didn't find X anywhere.  Cache the known absence of X.
12033   ac_cv_have_x="have_x=no"
12034 else
12035   # Record where we found X for the cache.
12036   ac_cv_have_x="have_x=yes \
12037                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12038 fi
12039 fi
12040
12041   fi
12042   eval "$ac_cv_have_x"
12043 fi # $with_x != no
12044
12045 if test "$have_x" != yes; then
12046   echo "$as_me:12046: result: $have_x" >&5
12047 echo "${ECHO_T}$have_x" >&6
12048   no_x=yes
12049 else
12050   # If each of the values was on the command line, it overrides each guess.
12051   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12052   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12053   # Update the cache value to reflect the command line values.
12054   ac_cv_have_x="have_x=yes \
12055                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12056   echo "$as_me:12056: result: libraries $x_libraries, headers $x_includes" >&5
12057 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12058 fi
12059
12060 if test "$no_x" = yes; then
12061   # Not all programs may use this symbol, but it does not hurt to define it.
12062
12063 cat >>confdefs.h <<\EOF
12064 #define X_DISPLAY_MISSING 1
12065 EOF
12066
12067   X_CFLAGS=
12068   X_PRE_LIBS=
12069   X_LIBS=
12070   X_EXTRA_LIBS=
12071 else
12072   if test -n "$x_includes"; then
12073     X_CFLAGS="$X_CFLAGS -I$x_includes"
12074   fi
12075
12076   # It would also be nice to do this for all -L options, not just this one.
12077   if test -n "$x_libraries"; then
12078     X_LIBS="$X_LIBS -L$x_libraries"
12079     # For Solaris; some versions of Sun CC require a space after -R and
12080     # others require no space.  Words are not sufficient . . . .
12081     case `(uname -sr) 2>/dev/null` in
12082     "SunOS 5"*)
12083       echo "$as_me:12083: checking whether -R must be followed by a space" >&5
12084 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12085       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12086       cat >"conftest.$ac_ext" <<_ACEOF
12087 #line 12087 "configure"
12088 #include "confdefs.h"
12089
12090 int
12091 main (void)
12092 {
12093
12094   ;
12095   return 0;
12096 }
12097 _ACEOF
12098 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12099 if { (eval echo "$as_me:12099: \"$ac_link\"") >&5
12100   (eval $ac_link) 2>&5
12101   ac_status=$?
12102   echo "$as_me:12102: \$? = $ac_status" >&5
12103   (exit "$ac_status"); } &&
12104          { ac_try='test -s "conftest$ac_exeext"'
12105   { (eval echo "$as_me:12105: \"$ac_try\"") >&5
12106   (eval $ac_try) 2>&5
12107   ac_status=$?
12108   echo "$as_me:12108: \$? = $ac_status" >&5
12109   (exit "$ac_status"); }; }; then
12110   ac_R_nospace=yes
12111 else
12112   echo "$as_me: failed program was:" >&5
12113 cat "conftest.$ac_ext" >&5
12114 ac_R_nospace=no
12115 fi
12116 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12117       if test $ac_R_nospace = yes; then
12118         echo "$as_me:12118: result: no" >&5
12119 echo "${ECHO_T}no" >&6
12120         X_LIBS="$X_LIBS -R$x_libraries"
12121       else
12122         LIBS="$ac_xsave_LIBS -R $x_libraries"
12123         cat >"conftest.$ac_ext" <<_ACEOF
12124 #line 12124 "configure"
12125 #include "confdefs.h"
12126
12127 int
12128 main (void)
12129 {
12130
12131   ;
12132   return 0;
12133 }
12134 _ACEOF
12135 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12136 if { (eval echo "$as_me:12136: \"$ac_link\"") >&5
12137   (eval $ac_link) 2>&5
12138   ac_status=$?
12139   echo "$as_me:12139: \$? = $ac_status" >&5
12140   (exit "$ac_status"); } &&
12141          { ac_try='test -s "conftest$ac_exeext"'
12142   { (eval echo "$as_me:12142: \"$ac_try\"") >&5
12143   (eval $ac_try) 2>&5
12144   ac_status=$?
12145   echo "$as_me:12145: \$? = $ac_status" >&5
12146   (exit "$ac_status"); }; }; then
12147   ac_R_space=yes
12148 else
12149   echo "$as_me: failed program was:" >&5
12150 cat "conftest.$ac_ext" >&5
12151 ac_R_space=no
12152 fi
12153 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12154         if test $ac_R_space = yes; then
12155           echo "$as_me:12155: result: yes" >&5
12156 echo "${ECHO_T}yes" >&6
12157           X_LIBS="$X_LIBS -R $x_libraries"
12158         else
12159           echo "$as_me:12159: result: neither works" >&5
12160 echo "${ECHO_T}neither works" >&6
12161         fi
12162       fi
12163       LIBS=$ac_xsave_LIBS
12164     esac
12165   fi
12166
12167   # Check for system-dependent libraries X programs must link with.
12168   # Do this before checking for the system-independent R6 libraries
12169   # (-lICE), since we may need -lsocket or whatever for X linking.
12170
12171   if test "$ISC" = yes; then
12172     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12173   else
12174     # Martyn Johnson says this is needed for Ultrix, if the X
12175     # libraries were built with DECnet support.  And Karl Berry says
12176     # the Alpha needs dnet_stub (dnet does not exist).
12177     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12178     cat >"conftest.$ac_ext" <<_ACEOF
12179 #line 12179 "configure"
12180 #include "confdefs.h"
12181
12182 /* Override any gcc2 internal prototype to avoid an error.  */
12183 #ifdef __cplusplus
12184 extern "C"
12185 #endif
12186 /* We use char because int might match the return type of a gcc2
12187    builtin and then its argument prototype would still apply.  */
12188 char XOpenDisplay ();
12189 int
12190 main (void)
12191 {
12192 XOpenDisplay ();
12193   ;
12194   return 0;
12195 }
12196 _ACEOF
12197 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12198 if { (eval echo "$as_me:12198: \"$ac_link\"") >&5
12199   (eval $ac_link) 2>&5
12200   ac_status=$?
12201   echo "$as_me:12201: \$? = $ac_status" >&5
12202   (exit "$ac_status"); } &&
12203          { ac_try='test -s "conftest$ac_exeext"'
12204   { (eval echo "$as_me:12204: \"$ac_try\"") >&5
12205   (eval $ac_try) 2>&5
12206   ac_status=$?
12207   echo "$as_me:12207: \$? = $ac_status" >&5
12208   (exit "$ac_status"); }; }; then
12209   :
12210 else
12211   echo "$as_me: failed program was:" >&5
12212 cat "conftest.$ac_ext" >&5
12213 echo "$as_me:12213: checking for dnet_ntoa in -ldnet" >&5
12214 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12215 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12216   echo $ECHO_N "(cached) $ECHO_C" >&6
12217 else
12218   ac_check_lib_save_LIBS=$LIBS
12219 LIBS="-ldnet  $LIBS"
12220 cat >"conftest.$ac_ext" <<_ACEOF
12221 #line 12221 "configure"
12222 #include "confdefs.h"
12223
12224 /* Override any gcc2 internal prototype to avoid an error.  */
12225 #ifdef __cplusplus
12226 extern "C"
12227 #endif
12228 /* We use char because int might match the return type of a gcc2
12229    builtin and then its argument prototype would still apply.  */
12230 char dnet_ntoa ();
12231 int
12232 main (void)
12233 {
12234 dnet_ntoa ();
12235   ;
12236   return 0;
12237 }
12238 _ACEOF
12239 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12240 if { (eval echo "$as_me:12240: \"$ac_link\"") >&5
12241   (eval $ac_link) 2>&5
12242   ac_status=$?
12243   echo "$as_me:12243: \$? = $ac_status" >&5
12244   (exit "$ac_status"); } &&
12245          { ac_try='test -s "conftest$ac_exeext"'
12246   { (eval echo "$as_me:12246: \"$ac_try\"") >&5
12247   (eval $ac_try) 2>&5
12248   ac_status=$?
12249   echo "$as_me:12249: \$? = $ac_status" >&5
12250   (exit "$ac_status"); }; }; then
12251   ac_cv_lib_dnet_dnet_ntoa=yes
12252 else
12253   echo "$as_me: failed program was:" >&5
12254 cat "conftest.$ac_ext" >&5
12255 ac_cv_lib_dnet_dnet_ntoa=no
12256 fi
12257 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12258 LIBS=$ac_check_lib_save_LIBS
12259 fi
12260 echo "$as_me:12260: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12261 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12262 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12263   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12264 fi
12265
12266     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12267       echo "$as_me:12267: checking for dnet_ntoa in -ldnet_stub" >&5
12268 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12269 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12270   echo $ECHO_N "(cached) $ECHO_C" >&6
12271 else
12272   ac_check_lib_save_LIBS=$LIBS
12273 LIBS="-ldnet_stub  $LIBS"
12274 cat >"conftest.$ac_ext" <<_ACEOF
12275 #line 12275 "configure"
12276 #include "confdefs.h"
12277
12278 /* Override any gcc2 internal prototype to avoid an error.  */
12279 #ifdef __cplusplus
12280 extern "C"
12281 #endif
12282 /* We use char because int might match the return type of a gcc2
12283    builtin and then its argument prototype would still apply.  */
12284 char dnet_ntoa ();
12285 int
12286 main (void)
12287 {
12288 dnet_ntoa ();
12289   ;
12290   return 0;
12291 }
12292 _ACEOF
12293 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12294 if { (eval echo "$as_me:12294: \"$ac_link\"") >&5
12295   (eval $ac_link) 2>&5
12296   ac_status=$?
12297   echo "$as_me:12297: \$? = $ac_status" >&5
12298   (exit "$ac_status"); } &&
12299          { ac_try='test -s "conftest$ac_exeext"'
12300   { (eval echo "$as_me:12300: \"$ac_try\"") >&5
12301   (eval $ac_try) 2>&5
12302   ac_status=$?
12303   echo "$as_me:12303: \$? = $ac_status" >&5
12304   (exit "$ac_status"); }; }; then
12305   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12306 else
12307   echo "$as_me: failed program was:" >&5
12308 cat "conftest.$ac_ext" >&5
12309 ac_cv_lib_dnet_stub_dnet_ntoa=no
12310 fi
12311 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12312 LIBS=$ac_check_lib_save_LIBS
12313 fi
12314 echo "$as_me:12314: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12315 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12316 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12317   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12318 fi
12319
12320     fi
12321 fi
12322 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12323     LIBS="$ac_xsave_LIBS"
12324
12325     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12326     # to get the SysV transport functions.
12327     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12328     # needs -lnsl.
12329     # The nsl library prevents programs from opening the X display
12330     # on Irix 5.2, according to T.E. Dickey.
12331     # The functions gethostbyname, getservbyname, and inet_addr are
12332     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12333     echo "$as_me:12333: checking for gethostbyname" >&5
12334 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12335 if test "${ac_cv_func_gethostbyname+set}" = set; then
12336   echo $ECHO_N "(cached) $ECHO_C" >&6
12337 else
12338   cat >"conftest.$ac_ext" <<_ACEOF
12339 #line 12339 "configure"
12340 #include "confdefs.h"
12341 #define gethostbyname autoconf_temporary
12342 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12343 #undef gethostbyname
12344
12345 #ifdef __cplusplus
12346 extern "C"
12347 #endif
12348
12349 /* We use char because int might match the return type of a gcc2
12350    builtin and then its argument prototype would still apply.  */
12351 char gethostbyname (void);
12352
12353 int
12354 main (void)
12355 {
12356
12357 /* The GNU C library defines stubs for functions which it implements
12358     to always fail with ENOSYS.  Some functions are actually named
12359     something starting with __ and the normal name is an alias.  */
12360 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12361 #error found stub for gethostbyname
12362 #endif
12363
12364         return gethostbyname ();
12365   ;
12366   return 0;
12367 }
12368 _ACEOF
12369 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12370 if { (eval echo "$as_me:12370: \"$ac_link\"") >&5
12371   (eval $ac_link) 2>&5
12372   ac_status=$?
12373   echo "$as_me:12373: \$? = $ac_status" >&5
12374   (exit "$ac_status"); } &&
12375          { ac_try='test -s "conftest$ac_exeext"'
12376   { (eval echo "$as_me:12376: \"$ac_try\"") >&5
12377   (eval $ac_try) 2>&5
12378   ac_status=$?
12379   echo "$as_me:12379: \$? = $ac_status" >&5
12380   (exit "$ac_status"); }; }; then
12381   ac_cv_func_gethostbyname=yes
12382 else
12383   echo "$as_me: failed program was:" >&5
12384 cat "conftest.$ac_ext" >&5
12385 ac_cv_func_gethostbyname=no
12386 fi
12387 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12388 fi
12389 echo "$as_me:12389: result: $ac_cv_func_gethostbyname" >&5
12390 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12391
12392     if test $ac_cv_func_gethostbyname = no; then
12393       echo "$as_me:12393: checking for gethostbyname in -lnsl" >&5
12394 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12395 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12396   echo $ECHO_N "(cached) $ECHO_C" >&6
12397 else
12398   ac_check_lib_save_LIBS=$LIBS
12399 LIBS="-lnsl  $LIBS"
12400 cat >"conftest.$ac_ext" <<_ACEOF
12401 #line 12401 "configure"
12402 #include "confdefs.h"
12403
12404 /* Override any gcc2 internal prototype to avoid an error.  */
12405 #ifdef __cplusplus
12406 extern "C"
12407 #endif
12408 /* We use char because int might match the return type of a gcc2
12409    builtin and then its argument prototype would still apply.  */
12410 char gethostbyname ();
12411 int
12412 main (void)
12413 {
12414 gethostbyname ();
12415   ;
12416   return 0;
12417 }
12418 _ACEOF
12419 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12420 if { (eval echo "$as_me:12420: \"$ac_link\"") >&5
12421   (eval $ac_link) 2>&5
12422   ac_status=$?
12423   echo "$as_me:12423: \$? = $ac_status" >&5
12424   (exit "$ac_status"); } &&
12425          { ac_try='test -s "conftest$ac_exeext"'
12426   { (eval echo "$as_me:12426: \"$ac_try\"") >&5
12427   (eval $ac_try) 2>&5
12428   ac_status=$?
12429   echo "$as_me:12429: \$? = $ac_status" >&5
12430   (exit "$ac_status"); }; }; then
12431   ac_cv_lib_nsl_gethostbyname=yes
12432 else
12433   echo "$as_me: failed program was:" >&5
12434 cat "conftest.$ac_ext" >&5
12435 ac_cv_lib_nsl_gethostbyname=no
12436 fi
12437 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12438 LIBS=$ac_check_lib_save_LIBS
12439 fi
12440 echo "$as_me:12440: result: $ac_cv_lib_nsl_gethostbyname" >&5
12441 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12442 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12443   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12444 fi
12445
12446       if test $ac_cv_lib_nsl_gethostbyname = no; then
12447         echo "$as_me:12447: checking for gethostbyname in -lbsd" >&5
12448 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12449 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12450   echo $ECHO_N "(cached) $ECHO_C" >&6
12451 else
12452   ac_check_lib_save_LIBS=$LIBS
12453 LIBS="-lbsd  $LIBS"
12454 cat >"conftest.$ac_ext" <<_ACEOF
12455 #line 12455 "configure"
12456 #include "confdefs.h"
12457
12458 /* Override any gcc2 internal prototype to avoid an error.  */
12459 #ifdef __cplusplus
12460 extern "C"
12461 #endif
12462 /* We use char because int might match the return type of a gcc2
12463    builtin and then its argument prototype would still apply.  */
12464 char gethostbyname ();
12465 int
12466 main (void)
12467 {
12468 gethostbyname ();
12469   ;
12470   return 0;
12471 }
12472 _ACEOF
12473 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12474 if { (eval echo "$as_me:12474: \"$ac_link\"") >&5
12475   (eval $ac_link) 2>&5
12476   ac_status=$?
12477   echo "$as_me:12477: \$? = $ac_status" >&5
12478   (exit "$ac_status"); } &&
12479          { ac_try='test -s "conftest$ac_exeext"'
12480   { (eval echo "$as_me:12480: \"$ac_try\"") >&5
12481   (eval $ac_try) 2>&5
12482   ac_status=$?
12483   echo "$as_me:12483: \$? = $ac_status" >&5
12484   (exit "$ac_status"); }; }; then
12485   ac_cv_lib_bsd_gethostbyname=yes
12486 else
12487   echo "$as_me: failed program was:" >&5
12488 cat "conftest.$ac_ext" >&5
12489 ac_cv_lib_bsd_gethostbyname=no
12490 fi
12491 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12492 LIBS=$ac_check_lib_save_LIBS
12493 fi
12494 echo "$as_me:12494: result: $ac_cv_lib_bsd_gethostbyname" >&5
12495 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12496 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
12497   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12498 fi
12499
12500       fi
12501     fi
12502
12503     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12504     # socket/setsockopt and other routines are undefined under SCO ODT
12505     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12506     # on later versions), says Simon Leinen: it contains gethostby*
12507     # variants that don't use the nameserver (or something).  -lsocket
12508     # must be given before -lnsl if both are needed.  We assume that
12509     # if connect needs -lnsl, so does gethostbyname.
12510     echo "$as_me:12510: checking for connect" >&5
12511 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12512 if test "${ac_cv_func_connect+set}" = set; then
12513   echo $ECHO_N "(cached) $ECHO_C" >&6
12514 else
12515   cat >"conftest.$ac_ext" <<_ACEOF
12516 #line 12516 "configure"
12517 #include "confdefs.h"
12518 #define connect autoconf_temporary
12519 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12520 #undef connect
12521
12522 #ifdef __cplusplus
12523 extern "C"
12524 #endif
12525
12526 /* We use char because int might match the return type of a gcc2
12527    builtin and then its argument prototype would still apply.  */
12528 char connect (void);
12529
12530 int
12531 main (void)
12532 {
12533
12534 /* The GNU C library defines stubs for functions which it implements
12535     to always fail with ENOSYS.  Some functions are actually named
12536     something starting with __ and the normal name is an alias.  */
12537 #if defined (__stub_connect) || defined (__stub___connect)
12538 #error found stub for connect
12539 #endif
12540
12541         return connect ();
12542   ;
12543   return 0;
12544 }
12545 _ACEOF
12546 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12547 if { (eval echo "$as_me:12547: \"$ac_link\"") >&5
12548   (eval $ac_link) 2>&5
12549   ac_status=$?
12550   echo "$as_me:12550: \$? = $ac_status" >&5
12551   (exit "$ac_status"); } &&
12552          { ac_try='test -s "conftest$ac_exeext"'
12553   { (eval echo "$as_me:12553: \"$ac_try\"") >&5
12554   (eval $ac_try) 2>&5
12555   ac_status=$?
12556   echo "$as_me:12556: \$? = $ac_status" >&5
12557   (exit "$ac_status"); }; }; then
12558   ac_cv_func_connect=yes
12559 else
12560   echo "$as_me: failed program was:" >&5
12561 cat "conftest.$ac_ext" >&5
12562 ac_cv_func_connect=no
12563 fi
12564 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12565 fi
12566 echo "$as_me:12566: result: $ac_cv_func_connect" >&5
12567 echo "${ECHO_T}$ac_cv_func_connect" >&6
12568
12569     if test $ac_cv_func_connect = no; then
12570       echo "$as_me:12570: checking for connect in -lsocket" >&5
12571 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12572 if test "${ac_cv_lib_socket_connect+set}" = set; then
12573   echo $ECHO_N "(cached) $ECHO_C" >&6
12574 else
12575   ac_check_lib_save_LIBS=$LIBS
12576 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12577 cat >"conftest.$ac_ext" <<_ACEOF
12578 #line 12578 "configure"
12579 #include "confdefs.h"
12580
12581 /* Override any gcc2 internal prototype to avoid an error.  */
12582 #ifdef __cplusplus
12583 extern "C"
12584 #endif
12585 /* We use char because int might match the return type of a gcc2
12586    builtin and then its argument prototype would still apply.  */
12587 char connect ();
12588 int
12589 main (void)
12590 {
12591 connect ();
12592   ;
12593   return 0;
12594 }
12595 _ACEOF
12596 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12597 if { (eval echo "$as_me:12597: \"$ac_link\"") >&5
12598   (eval $ac_link) 2>&5
12599   ac_status=$?
12600   echo "$as_me:12600: \$? = $ac_status" >&5
12601   (exit "$ac_status"); } &&
12602          { ac_try='test -s "conftest$ac_exeext"'
12603   { (eval echo "$as_me:12603: \"$ac_try\"") >&5
12604   (eval $ac_try) 2>&5
12605   ac_status=$?
12606   echo "$as_me:12606: \$? = $ac_status" >&5
12607   (exit "$ac_status"); }; }; then
12608   ac_cv_lib_socket_connect=yes
12609 else
12610   echo "$as_me: failed program was:" >&5
12611 cat "conftest.$ac_ext" >&5
12612 ac_cv_lib_socket_connect=no
12613 fi
12614 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12615 LIBS=$ac_check_lib_save_LIBS
12616 fi
12617 echo "$as_me:12617: result: $ac_cv_lib_socket_connect" >&5
12618 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12619 if test "$ac_cv_lib_socket_connect" = yes; then
12620   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12621 fi
12622
12623     fi
12624
12625     # Guillermo Gomez says -lposix is necessary on A/UX.
12626     echo "$as_me:12626: checking for remove" >&5
12627 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12628 if test "${ac_cv_func_remove+set}" = set; then
12629   echo $ECHO_N "(cached) $ECHO_C" >&6
12630 else
12631   cat >"conftest.$ac_ext" <<_ACEOF
12632 #line 12632 "configure"
12633 #include "confdefs.h"
12634 #define remove autoconf_temporary
12635 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12636 #undef remove
12637
12638 #ifdef __cplusplus
12639 extern "C"
12640 #endif
12641
12642 /* We use char because int might match the return type of a gcc2
12643    builtin and then its argument prototype would still apply.  */
12644 char remove (void);
12645
12646 int
12647 main (void)
12648 {
12649
12650 /* The GNU C library defines stubs for functions which it implements
12651     to always fail with ENOSYS.  Some functions are actually named
12652     something starting with __ and the normal name is an alias.  */
12653 #if defined (__stub_remove) || defined (__stub___remove)
12654 #error found stub for remove
12655 #endif
12656
12657         return remove ();
12658   ;
12659   return 0;
12660 }
12661 _ACEOF
12662 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12663 if { (eval echo "$as_me:12663: \"$ac_link\"") >&5
12664   (eval $ac_link) 2>&5
12665   ac_status=$?
12666   echo "$as_me:12666: \$? = $ac_status" >&5
12667   (exit "$ac_status"); } &&
12668          { ac_try='test -s "conftest$ac_exeext"'
12669   { (eval echo "$as_me:12669: \"$ac_try\"") >&5
12670   (eval $ac_try) 2>&5
12671   ac_status=$?
12672   echo "$as_me:12672: \$? = $ac_status" >&5
12673   (exit "$ac_status"); }; }; then
12674   ac_cv_func_remove=yes
12675 else
12676   echo "$as_me: failed program was:" >&5
12677 cat "conftest.$ac_ext" >&5
12678 ac_cv_func_remove=no
12679 fi
12680 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12681 fi
12682 echo "$as_me:12682: result: $ac_cv_func_remove" >&5
12683 echo "${ECHO_T}$ac_cv_func_remove" >&6
12684
12685     if test $ac_cv_func_remove = no; then
12686       echo "$as_me:12686: checking for remove in -lposix" >&5
12687 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12688 if test "${ac_cv_lib_posix_remove+set}" = set; then
12689   echo $ECHO_N "(cached) $ECHO_C" >&6
12690 else
12691   ac_check_lib_save_LIBS=$LIBS
12692 LIBS="-lposix  $LIBS"
12693 cat >"conftest.$ac_ext" <<_ACEOF
12694 #line 12694 "configure"
12695 #include "confdefs.h"
12696
12697 /* Override any gcc2 internal prototype to avoid an error.  */
12698 #ifdef __cplusplus
12699 extern "C"
12700 #endif
12701 /* We use char because int might match the return type of a gcc2
12702    builtin and then its argument prototype would still apply.  */
12703 char remove ();
12704 int
12705 main (void)
12706 {
12707 remove ();
12708   ;
12709   return 0;
12710 }
12711 _ACEOF
12712 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12713 if { (eval echo "$as_me:12713: \"$ac_link\"") >&5
12714   (eval $ac_link) 2>&5
12715   ac_status=$?
12716   echo "$as_me:12716: \$? = $ac_status" >&5
12717   (exit "$ac_status"); } &&
12718          { ac_try='test -s "conftest$ac_exeext"'
12719   { (eval echo "$as_me:12719: \"$ac_try\"") >&5
12720   (eval $ac_try) 2>&5
12721   ac_status=$?
12722   echo "$as_me:12722: \$? = $ac_status" >&5
12723   (exit "$ac_status"); }; }; then
12724   ac_cv_lib_posix_remove=yes
12725 else
12726   echo "$as_me: failed program was:" >&5
12727 cat "conftest.$ac_ext" >&5
12728 ac_cv_lib_posix_remove=no
12729 fi
12730 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12731 LIBS=$ac_check_lib_save_LIBS
12732 fi
12733 echo "$as_me:12733: result: $ac_cv_lib_posix_remove" >&5
12734 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12735 if test "$ac_cv_lib_posix_remove" = yes; then
12736   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12737 fi
12738
12739     fi
12740
12741     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12742     echo "$as_me:12742: checking for shmat" >&5
12743 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12744 if test "${ac_cv_func_shmat+set}" = set; then
12745   echo $ECHO_N "(cached) $ECHO_C" >&6
12746 else
12747   cat >"conftest.$ac_ext" <<_ACEOF
12748 #line 12748 "configure"
12749 #include "confdefs.h"
12750 #define shmat autoconf_temporary
12751 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12752 #undef shmat
12753
12754 #ifdef __cplusplus
12755 extern "C"
12756 #endif
12757
12758 /* We use char because int might match the return type of a gcc2
12759    builtin and then its argument prototype would still apply.  */
12760 char shmat (void);
12761
12762 int
12763 main (void)
12764 {
12765
12766 /* The GNU C library defines stubs for functions which it implements
12767     to always fail with ENOSYS.  Some functions are actually named
12768     something starting with __ and the normal name is an alias.  */
12769 #if defined (__stub_shmat) || defined (__stub___shmat)
12770 #error found stub for shmat
12771 #endif
12772
12773         return shmat ();
12774   ;
12775   return 0;
12776 }
12777 _ACEOF
12778 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12779 if { (eval echo "$as_me:12779: \"$ac_link\"") >&5
12780   (eval $ac_link) 2>&5
12781   ac_status=$?
12782   echo "$as_me:12782: \$? = $ac_status" >&5
12783   (exit "$ac_status"); } &&
12784          { ac_try='test -s "conftest$ac_exeext"'
12785   { (eval echo "$as_me:12785: \"$ac_try\"") >&5
12786   (eval $ac_try) 2>&5
12787   ac_status=$?
12788   echo "$as_me:12788: \$? = $ac_status" >&5
12789   (exit "$ac_status"); }; }; then
12790   ac_cv_func_shmat=yes
12791 else
12792   echo "$as_me: failed program was:" >&5
12793 cat "conftest.$ac_ext" >&5
12794 ac_cv_func_shmat=no
12795 fi
12796 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12797 fi
12798 echo "$as_me:12798: result: $ac_cv_func_shmat" >&5
12799 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12800
12801     if test $ac_cv_func_shmat = no; then
12802       echo "$as_me:12802: checking for shmat in -lipc" >&5
12803 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12804 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12805   echo $ECHO_N "(cached) $ECHO_C" >&6
12806 else
12807   ac_check_lib_save_LIBS=$LIBS
12808 LIBS="-lipc  $LIBS"
12809 cat >"conftest.$ac_ext" <<_ACEOF
12810 #line 12810 "configure"
12811 #include "confdefs.h"
12812
12813 /* Override any gcc2 internal prototype to avoid an error.  */
12814 #ifdef __cplusplus
12815 extern "C"
12816 #endif
12817 /* We use char because int might match the return type of a gcc2
12818    builtin and then its argument prototype would still apply.  */
12819 char shmat ();
12820 int
12821 main (void)
12822 {
12823 shmat ();
12824   ;
12825   return 0;
12826 }
12827 _ACEOF
12828 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12829 if { (eval echo "$as_me:12829: \"$ac_link\"") >&5
12830   (eval $ac_link) 2>&5
12831   ac_status=$?
12832   echo "$as_me:12832: \$? = $ac_status" >&5
12833   (exit "$ac_status"); } &&
12834          { ac_try='test -s "conftest$ac_exeext"'
12835   { (eval echo "$as_me:12835: \"$ac_try\"") >&5
12836   (eval $ac_try) 2>&5
12837   ac_status=$?
12838   echo "$as_me:12838: \$? = $ac_status" >&5
12839   (exit "$ac_status"); }; }; then
12840   ac_cv_lib_ipc_shmat=yes
12841 else
12842   echo "$as_me: failed program was:" >&5
12843 cat "conftest.$ac_ext" >&5
12844 ac_cv_lib_ipc_shmat=no
12845 fi
12846 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12847 LIBS=$ac_check_lib_save_LIBS
12848 fi
12849 echo "$as_me:12849: result: $ac_cv_lib_ipc_shmat" >&5
12850 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12851 if test "$ac_cv_lib_ipc_shmat" = yes; then
12852   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12853 fi
12854
12855     fi
12856   fi
12857
12858   # Check for libraries that X11R6 Xt/Xaw programs need.
12859   ac_save_LDFLAGS=$LDFLAGS
12860   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12861   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12862   # check for ICE first), but we must link in the order -lSM -lICE or
12863   # we get undefined symbols.  So assume we have SM if we have ICE.
12864   # These have to be linked with before -lX11, unlike the other
12865   # libraries we check for below, so use a different variable.
12866   # John Interrante, Karl Berry
12867   echo "$as_me:12867: checking for IceConnectionNumber in -lICE" >&5
12868 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12869 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12870   echo $ECHO_N "(cached) $ECHO_C" >&6
12871 else
12872   ac_check_lib_save_LIBS=$LIBS
12873 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12874 cat >"conftest.$ac_ext" <<_ACEOF
12875 #line 12875 "configure"
12876 #include "confdefs.h"
12877
12878 /* Override any gcc2 internal prototype to avoid an error.  */
12879 #ifdef __cplusplus
12880 extern "C"
12881 #endif
12882 /* We use char because int might match the return type of a gcc2
12883    builtin and then its argument prototype would still apply.  */
12884 char IceConnectionNumber ();
12885 int
12886 main (void)
12887 {
12888 IceConnectionNumber ();
12889   ;
12890   return 0;
12891 }
12892 _ACEOF
12893 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12894 if { (eval echo "$as_me:12894: \"$ac_link\"") >&5
12895   (eval $ac_link) 2>&5
12896   ac_status=$?
12897   echo "$as_me:12897: \$? = $ac_status" >&5
12898   (exit "$ac_status"); } &&
12899          { ac_try='test -s "conftest$ac_exeext"'
12900   { (eval echo "$as_me:12900: \"$ac_try\"") >&5
12901   (eval $ac_try) 2>&5
12902   ac_status=$?
12903   echo "$as_me:12903: \$? = $ac_status" >&5
12904   (exit "$ac_status"); }; }; then
12905   ac_cv_lib_ICE_IceConnectionNumber=yes
12906 else
12907   echo "$as_me: failed program was:" >&5
12908 cat "conftest.$ac_ext" >&5
12909 ac_cv_lib_ICE_IceConnectionNumber=no
12910 fi
12911 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12912 LIBS=$ac_check_lib_save_LIBS
12913 fi
12914 echo "$as_me:12914: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12915 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12916 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
12917   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12918 fi
12919
12920   LDFLAGS=$ac_save_LDFLAGS
12921
12922 fi
12923
12924 cf_x_athena=${cf_x_athena:-Xaw}
12925
12926 echo "$as_me:12926: checking if you want to link with Xaw 3d library" >&5
12927 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12928 withval=
12929
12930 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12931 if test "${with_Xaw3d+set}" = set; then
12932   withval="$with_Xaw3d"
12933
12934 fi;
12935 if test "$withval" = yes ; then
12936         cf_x_athena=Xaw3d
12937         echo "$as_me:12937: result: yes" >&5
12938 echo "${ECHO_T}yes" >&6
12939 else
12940         echo "$as_me:12940: result: no" >&5
12941 echo "${ECHO_T}no" >&6
12942 fi
12943
12944 echo "$as_me:12944: checking if you want to link with Xaw 3d xft library" >&5
12945 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12946 withval=
12947
12948 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12949 if test "${with_Xaw3dxft+set}" = set; then
12950   withval="$with_Xaw3dxft"
12951
12952 fi;
12953 if test "$withval" = yes ; then
12954         cf_x_athena=Xaw3dxft
12955         echo "$as_me:12955: result: yes" >&5
12956 echo "${ECHO_T}yes" >&6
12957 else
12958         echo "$as_me:12958: result: no" >&5
12959 echo "${ECHO_T}no" >&6
12960 fi
12961
12962 echo "$as_me:12962: checking if you want to link with neXT Athena library" >&5
12963 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12964 withval=
12965
12966 # Check whether --with-neXtaw or --without-neXtaw was given.
12967 if test "${with_neXtaw+set}" = set; then
12968   withval="$with_neXtaw"
12969
12970 fi;
12971 if test "$withval" = yes ; then
12972         cf_x_athena=neXtaw
12973         echo "$as_me:12973: result: yes" >&5
12974 echo "${ECHO_T}yes" >&6
12975 else
12976         echo "$as_me:12976: result: no" >&5
12977 echo "${ECHO_T}no" >&6
12978 fi
12979
12980 echo "$as_me:12980: checking if you want to link with Athena-Plus library" >&5
12981 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12982 withval=
12983
12984 # Check whether --with-XawPlus or --without-XawPlus was given.
12985 if test "${with_XawPlus+set}" = set; then
12986   withval="$with_XawPlus"
12987
12988 fi;
12989 if test "$withval" = yes ; then
12990         cf_x_athena=XawPlus
12991         echo "$as_me:12991: result: yes" >&5
12992 echo "${ECHO_T}yes" >&6
12993 else
12994         echo "$as_me:12994: result: no" >&5
12995 echo "${ECHO_T}no" >&6
12996 fi
12997
12998 cf_x_athena_lib=""
12999
13000 if test "$PKG_CONFIG" != none ; then
13001         cf_athena_list=
13002         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13003         for cf_athena_pkg in \
13004                 $cf_athena_list \
13005                 ${cf_x_athena} \
13006                 ${cf_x_athena}-devel \
13007                 lib${cf_x_athena} \
13008                 lib${cf_x_athena}-devel
13009         do
13010
13011 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13012         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13013
13014 echo "${as_me:-configure}:13014: testing found package $cf_athena_pkg ..." 1>&5
13015
13016         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13017         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13018         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13019
13020 echo "${as_me:-configure}:13020: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13021
13022         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13023
13024 echo "${as_me:-configure}:13024: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13025
13026 cf_fix_cppflags=no
13027 cf_new_cflags=
13028 cf_new_cppflags=
13029 cf_new_extra_cppflags=
13030
13031 for cf_add_cflags in $cf_pkgconfig_incs
13032 do
13033 case "$cf_fix_cppflags" in
13034 (no)
13035         case "$cf_add_cflags" in
13036         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13037                 case "$cf_add_cflags" in
13038                 (-D*)
13039                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13040
13041                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13042                                 && test -z "${cf_tst_cflags}" \
13043                                 && cf_fix_cppflags=yes
13044
13045                         if test "$cf_fix_cppflags" = yes ; then
13046
13047         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13048         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13049
13050                                 continue
13051                         elif test "${cf_tst_cflags}" = "\"'" ; then
13052
13053         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13054         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13055
13056                                 continue
13057                         fi
13058                         ;;
13059                 esac
13060                 case "$CPPFLAGS" in
13061                 (*$cf_add_cflags)
13062                         ;;
13063                 (*)
13064                         case "$cf_add_cflags" in
13065                         (-D*)
13066                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13067
13068 CPPFLAGS=`echo "$CPPFLAGS" | \
13069         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13070                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13071
13072                                 ;;
13073                         esac
13074
13075         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13076         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13077
13078                         ;;
13079                 esac
13080                 ;;
13081         (*)
13082
13083         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13084         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13085
13086                 ;;
13087         esac
13088         ;;
13089 (yes)
13090
13091         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13092         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13093
13094         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13095
13096         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13097                 && test -z "${cf_tst_cflags}" \
13098                 && cf_fix_cppflags=no
13099         ;;
13100 esac
13101 done
13102
13103 if test -n "$cf_new_cflags" ; then
13104
13105         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13106         CFLAGS="${CFLAGS}$cf_new_cflags"
13107
13108 fi
13109
13110 if test -n "$cf_new_cppflags" ; then
13111
13112         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13113         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13114
13115 fi
13116
13117 if test -n "$cf_new_extra_cppflags" ; then
13118
13119         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13120         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13121
13122 fi
13123
13124 cf_add_libs="$LIBS"
13125 # reverse order
13126 cf_add_0lib=
13127 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13128 # filter duplicates
13129 for cf_add_1lib in $cf_add_0lib; do
13130         for cf_add_2lib in $cf_add_libs; do
13131                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13132                         cf_add_1lib=
13133                         break
13134                 fi
13135         done
13136         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13137 done
13138 LIBS="$cf_add_libs"
13139
13140                         cf_x_athena_lib="$cf_pkgconfig_libs"
13141
13142 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13143
13144                         cat >>confdefs.h <<EOF
13145 #define $cf_x_athena_LIBS 1
13146 EOF
13147
13148         for cf_trim_lib in Xmu Xt X11
13149         do
13150                 case "$LIBS" in
13151                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13152                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13153                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13154
13155 echo "${as_me:-configure}:13155: testing ..trimmed $LIBS ..." 1>&5
13156
13157                         ;;
13158                 esac
13159         done
13160
13161 echo "$as_me:13161: checking for usable $cf_x_athena/Xmu package" >&5
13162 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13163 if test "${cf_cv_xaw_compat+set}" = set; then
13164   echo $ECHO_N "(cached) $ECHO_C" >&6
13165 else
13166
13167 cat >"conftest.$ac_ext" <<_ACEOF
13168 #line 13168 "configure"
13169 #include "confdefs.h"
13170
13171 #include <X11/Xmu/CharSet.h>
13172
13173 int
13174 main (void)
13175 {
13176
13177 int check = XmuCompareISOLatin1("big", "small");
13178 (void)check;
13179
13180   ;
13181   return 0;
13182 }
13183 _ACEOF
13184 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13185 if { (eval echo "$as_me:13185: \"$ac_link\"") >&5
13186   (eval $ac_link) 2>&5
13187   ac_status=$?
13188   echo "$as_me:13188: \$? = $ac_status" >&5
13189   (exit "$ac_status"); } &&
13190          { ac_try='test -s "conftest$ac_exeext"'
13191   { (eval echo "$as_me:13191: \"$ac_try\"") >&5
13192   (eval $ac_try) 2>&5
13193   ac_status=$?
13194   echo "$as_me:13194: \$? = $ac_status" >&5
13195   (exit "$ac_status"); }; }; then
13196   cf_cv_xaw_compat=yes
13197 else
13198   echo "$as_me: failed program was:" >&5
13199 cat "conftest.$ac_ext" >&5
13200 cf_cv_xaw_compat=no
13201 fi
13202 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13203 fi
13204 echo "$as_me:13204: result: $cf_cv_xaw_compat" >&5
13205 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13206
13207                         if test "$cf_cv_xaw_compat" = no
13208                         then
13209                                 # workaround for broken ".pc" files...
13210                                 case "$cf_x_athena_lib" in
13211                                 (*-lXmu*)
13212                                         ;;
13213                                 (*)
13214                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13215
13216 echo "${as_me:-configure}:13216: testing work around broken package ..." 1>&5
13217
13218                                         cf_save_xmu="$LIBS"
13219                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13220
13221 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13222         test -n "$verbose" && echo "    found package xmu" 1>&6
13223
13224 echo "${as_me:-configure}:13224: testing found package xmu ..." 1>&5
13225
13226         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13227         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13228         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13229
13230 echo "${as_me:-configure}:13230: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13231
13232         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13233
13234 echo "${as_me:-configure}:13234: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13235
13236 cf_fix_cppflags=no
13237 cf_new_cflags=
13238 cf_new_cppflags=
13239 cf_new_extra_cppflags=
13240
13241 for cf_add_cflags in $cf_pkgconfig_incs
13242 do
13243 case "$cf_fix_cppflags" in
13244 (no)
13245         case "$cf_add_cflags" in
13246         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13247                 case "$cf_add_cflags" in
13248                 (-D*)
13249                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13250
13251                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13252                                 && test -z "${cf_tst_cflags}" \
13253                                 && cf_fix_cppflags=yes
13254
13255                         if test "$cf_fix_cppflags" = yes ; then
13256
13257         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13258         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13259
13260                                 continue
13261                         elif test "${cf_tst_cflags}" = "\"'" ; then
13262
13263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13265
13266                                 continue
13267                         fi
13268                         ;;
13269                 esac
13270                 case "$CPPFLAGS" in
13271                 (*$cf_add_cflags)
13272                         ;;
13273                 (*)
13274                         case "$cf_add_cflags" in
13275                         (-D*)
13276                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13277
13278 CPPFLAGS=`echo "$CPPFLAGS" | \
13279         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13280                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13281
13282                                 ;;
13283                         esac
13284
13285         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13286         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13287
13288                         ;;
13289                 esac
13290                 ;;
13291         (*)
13292
13293         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13294         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13295
13296                 ;;
13297         esac
13298         ;;
13299 (yes)
13300
13301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13303
13304         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13305
13306         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13307                 && test -z "${cf_tst_cflags}" \
13308                 && cf_fix_cppflags=no
13309         ;;
13310 esac
13311 done
13312
13313 if test -n "$cf_new_cflags" ; then
13314
13315         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13316         CFLAGS="${CFLAGS}$cf_new_cflags"
13317
13318 fi
13319
13320 if test -n "$cf_new_cppflags" ; then
13321
13322         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13323         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13324
13325 fi
13326
13327 if test -n "$cf_new_extra_cppflags" ; then
13328
13329         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13330         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13331
13332 fi
13333
13334 cf_add_libs="$LIBS"
13335 # reverse order
13336 cf_add_0lib=
13337 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13338 # filter duplicates
13339 for cf_add_1lib in $cf_add_0lib; do
13340         for cf_add_2lib in $cf_add_libs; do
13341                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13342                         cf_add_1lib=
13343                         break
13344                 fi
13345         done
13346         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13347 done
13348 LIBS="$cf_add_libs"
13349
13350                                                         LIBS="$cf_save_xmu"
13351
13352 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13353
13354 echo "${as_me:-configure}:13354: testing ...before $LIBS ..." 1>&5
13355
13356 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13357 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13358
13359 echo "${as_me:-configure}:13359: testing ...after  $LIBS ..." 1>&5
13360
13361 else
13362         cf_pkgconfig_incs=
13363         cf_pkgconfig_libs=
13364
13365 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13366
13367 echo "${as_me:-configure}:13367: testing ...before $LIBS ..." 1>&5
13368
13369 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13370 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13371
13372 echo "${as_me:-configure}:13372: testing ...after  $LIBS ..." 1>&5
13373
13374 fi
13375
13376         for cf_trim_lib in Xmu Xt X11
13377         do
13378                 case "$LIBS" in
13379                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13380                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13381                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13382
13383 echo "${as_me:-configure}:13383: testing ..trimmed $LIBS ..." 1>&5
13384
13385                         ;;
13386                 esac
13387         done
13388
13389                                         ;;
13390                                 esac
13391                         fi
13392
13393                         break
13394 else
13395         cf_pkgconfig_incs=
13396         cf_pkgconfig_libs=
13397         :
13398 fi
13399
13400         done
13401 fi
13402
13403 if test -z "$cf_x_athena_lib" ; then
13404
13405 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13406         test -n "$verbose" && echo "    found package Xext" 1>&6
13407
13408 echo "${as_me:-configure}:13408: testing found package Xext ..." 1>&5
13409
13410         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13411         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13412         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13413
13414 echo "${as_me:-configure}:13414: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13415
13416         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13417
13418 echo "${as_me:-configure}:13418: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13419
13420 cf_fix_cppflags=no
13421 cf_new_cflags=
13422 cf_new_cppflags=
13423 cf_new_extra_cppflags=
13424
13425 for cf_add_cflags in $cf_pkgconfig_incs
13426 do
13427 case "$cf_fix_cppflags" in
13428 (no)
13429         case "$cf_add_cflags" in
13430         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13431                 case "$cf_add_cflags" in
13432                 (-D*)
13433                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13434
13435                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13436                                 && test -z "${cf_tst_cflags}" \
13437                                 && cf_fix_cppflags=yes
13438
13439                         if test "$cf_fix_cppflags" = yes ; then
13440
13441         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13442         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13443
13444                                 continue
13445                         elif test "${cf_tst_cflags}" = "\"'" ; then
13446
13447         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13448         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13449
13450                                 continue
13451                         fi
13452                         ;;
13453                 esac
13454                 case "$CPPFLAGS" in
13455                 (*$cf_add_cflags)
13456                         ;;
13457                 (*)
13458                         case "$cf_add_cflags" in
13459                         (-D*)
13460                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13461
13462 CPPFLAGS=`echo "$CPPFLAGS" | \
13463         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13464                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13465
13466                                 ;;
13467                         esac
13468
13469         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13470         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13471
13472                         ;;
13473                 esac
13474                 ;;
13475         (*)
13476
13477         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13478         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13479
13480                 ;;
13481         esac
13482         ;;
13483 (yes)
13484
13485         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13486         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13487
13488         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13489
13490         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13491                 && test -z "${cf_tst_cflags}" \
13492                 && cf_fix_cppflags=no
13493         ;;
13494 esac
13495 done
13496
13497 if test -n "$cf_new_cflags" ; then
13498
13499         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13500         CFLAGS="${CFLAGS}$cf_new_cflags"
13501
13502 fi
13503
13504 if test -n "$cf_new_cppflags" ; then
13505
13506         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13507         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13508
13509 fi
13510
13511 if test -n "$cf_new_extra_cppflags" ; then
13512
13513         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13514         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13515
13516 fi
13517
13518 cf_add_libs="$LIBS"
13519 # reverse order
13520 cf_add_0lib=
13521 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13522 # filter duplicates
13523 for cf_add_1lib in $cf_add_0lib; do
13524         for cf_add_2lib in $cf_add_libs; do
13525                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13526                         cf_add_1lib=
13527                         break
13528                 fi
13529         done
13530         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13531 done
13532 LIBS="$cf_add_libs"
13533
13534         :
13535 else
13536         cf_pkgconfig_incs=
13537         cf_pkgconfig_libs=
13538
13539         echo "$as_me:13539: checking for XextCreateExtension in -lXext" >&5
13540 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13541 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13542   echo $ECHO_N "(cached) $ECHO_C" >&6
13543 else
13544   ac_check_lib_save_LIBS=$LIBS
13545 LIBS="-lXext  $LIBS"
13546 cat >"conftest.$ac_ext" <<_ACEOF
13547 #line 13547 "configure"
13548 #include "confdefs.h"
13549
13550 /* Override any gcc2 internal prototype to avoid an error.  */
13551 #ifdef __cplusplus
13552 extern "C"
13553 #endif
13554 /* We use char because int might match the return type of a gcc2
13555    builtin and then its argument prototype would still apply.  */
13556 char XextCreateExtension ();
13557 int
13558 main (void)
13559 {
13560 XextCreateExtension ();
13561   ;
13562   return 0;
13563 }
13564 _ACEOF
13565 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13566 if { (eval echo "$as_me:13566: \"$ac_link\"") >&5
13567   (eval $ac_link) 2>&5
13568   ac_status=$?
13569   echo "$as_me:13569: \$? = $ac_status" >&5
13570   (exit "$ac_status"); } &&
13571          { ac_try='test -s "conftest$ac_exeext"'
13572   { (eval echo "$as_me:13572: \"$ac_try\"") >&5
13573   (eval $ac_try) 2>&5
13574   ac_status=$?
13575   echo "$as_me:13575: \$? = $ac_status" >&5
13576   (exit "$ac_status"); }; }; then
13577   ac_cv_lib_Xext_XextCreateExtension=yes
13578 else
13579   echo "$as_me: failed program was:" >&5
13580 cat "conftest.$ac_ext" >&5
13581 ac_cv_lib_Xext_XextCreateExtension=no
13582 fi
13583 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13584 LIBS=$ac_check_lib_save_LIBS
13585 fi
13586 echo "$as_me:13586: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13587 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13588 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
13589
13590 cf_add_libs="$LIBS"
13591 # reverse order
13592 cf_add_0lib=
13593 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13594 # filter duplicates
13595 for cf_add_1lib in $cf_add_0lib; do
13596         for cf_add_2lib in $cf_add_libs; do
13597                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13598                         cf_add_1lib=
13599                         break
13600                 fi
13601         done
13602         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13603 done
13604 LIBS="$cf_add_libs"
13605
13606 fi
13607
13608 fi
13609
13610 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13611 # in some cases has installed dummy files in the former, other cases replaced
13612 # it with a link to the new location).  This complicates the configure script.
13613 # Check for that pitfall, and recover using pkg-config
13614 #
13615 # If none of these are set, the configuration is almost certainly broken.
13616 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13617 then
13618
13619 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
13620         test -n "$verbose" && echo "    found package x11" 1>&6
13621
13622 echo "${as_me:-configure}:13622: testing found package x11 ..." 1>&5
13623
13624         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
13625         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
13626         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13627
13628 echo "${as_me:-configure}:13628: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13629
13630         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13631
13632 echo "${as_me:-configure}:13632: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13633
13634 cf_fix_cppflags=no
13635 cf_new_cflags=
13636 cf_new_cppflags=
13637 cf_new_extra_cppflags=
13638
13639 for cf_add_cflags in $cf_pkgconfig_incs
13640 do
13641 case "$cf_fix_cppflags" in
13642 (no)
13643         case "$cf_add_cflags" in
13644         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13645                 case "$cf_add_cflags" in
13646                 (-D*)
13647                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13648
13649                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13650                                 && test -z "${cf_tst_cflags}" \
13651                                 && cf_fix_cppflags=yes
13652
13653                         if test "$cf_fix_cppflags" = yes ; then
13654
13655         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13656         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13657
13658                                 continue
13659                         elif test "${cf_tst_cflags}" = "\"'" ; then
13660
13661         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13662         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13663
13664                                 continue
13665                         fi
13666                         ;;
13667                 esac
13668                 case "$CPPFLAGS" in
13669                 (*$cf_add_cflags)
13670                         ;;
13671                 (*)
13672                         case "$cf_add_cflags" in
13673                         (-D*)
13674                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13675
13676 CPPFLAGS=`echo "$CPPFLAGS" | \
13677         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13678                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13679
13680                                 ;;
13681                         esac
13682
13683         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13684         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13685
13686                         ;;
13687                 esac
13688                 ;;
13689         (*)
13690
13691         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13692         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13693
13694                 ;;
13695         esac
13696         ;;
13697 (yes)
13698
13699         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13700         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13701
13702         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13703
13704         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13705                 && test -z "${cf_tst_cflags}" \
13706                 && cf_fix_cppflags=no
13707         ;;
13708 esac
13709 done
13710
13711 if test -n "$cf_new_cflags" ; then
13712
13713         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13714         CFLAGS="${CFLAGS}$cf_new_cflags"
13715
13716 fi
13717
13718 if test -n "$cf_new_cppflags" ; then
13719
13720         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13721         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13722
13723 fi
13724
13725 if test -n "$cf_new_extra_cppflags" ; then
13726
13727         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13728         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13729
13730 fi
13731
13732 cf_add_libs="$LIBS"
13733 # reverse order
13734 cf_add_0lib=
13735 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13736 # filter duplicates
13737 for cf_add_1lib in $cf_add_0lib; do
13738         for cf_add_2lib in $cf_add_libs; do
13739                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13740                         cf_add_1lib=
13741                         break
13742                 fi
13743         done
13744         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13745 done
13746 LIBS="$cf_add_libs"
13747
13748         :
13749 else
13750         cf_pkgconfig_incs=
13751         cf_pkgconfig_libs=
13752         { echo "$as_me:13752: WARNING: unable to find X11 library" >&5
13753 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13754 fi
13755
13756 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
13757         test -n "$verbose" && echo "    found package ice" 1>&6
13758
13759 echo "${as_me:-configure}:13759: testing found package ice ..." 1>&5
13760
13761         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
13762         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
13763         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13764
13765 echo "${as_me:-configure}:13765: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13766
13767         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13768
13769 echo "${as_me:-configure}:13769: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13770
13771 cf_fix_cppflags=no
13772 cf_new_cflags=
13773 cf_new_cppflags=
13774 cf_new_extra_cppflags=
13775
13776 for cf_add_cflags in $cf_pkgconfig_incs
13777 do
13778 case "$cf_fix_cppflags" in
13779 (no)
13780         case "$cf_add_cflags" in
13781         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13782                 case "$cf_add_cflags" in
13783                 (-D*)
13784                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13785
13786                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13787                                 && test -z "${cf_tst_cflags}" \
13788                                 && cf_fix_cppflags=yes
13789
13790                         if test "$cf_fix_cppflags" = yes ; then
13791
13792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13794
13795                                 continue
13796                         elif test "${cf_tst_cflags}" = "\"'" ; then
13797
13798         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13799         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13800
13801                                 continue
13802                         fi
13803                         ;;
13804                 esac
13805                 case "$CPPFLAGS" in
13806                 (*$cf_add_cflags)
13807                         ;;
13808                 (*)
13809                         case "$cf_add_cflags" in
13810                         (-D*)
13811                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13812
13813 CPPFLAGS=`echo "$CPPFLAGS" | \
13814         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13815                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13816
13817                                 ;;
13818                         esac
13819
13820         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13821         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13822
13823                         ;;
13824                 esac
13825                 ;;
13826         (*)
13827
13828         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13829         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13830
13831                 ;;
13832         esac
13833         ;;
13834 (yes)
13835
13836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13838
13839         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13840
13841         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13842                 && test -z "${cf_tst_cflags}" \
13843                 && cf_fix_cppflags=no
13844         ;;
13845 esac
13846 done
13847
13848 if test -n "$cf_new_cflags" ; then
13849
13850         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13851         CFLAGS="${CFLAGS}$cf_new_cflags"
13852
13853 fi
13854
13855 if test -n "$cf_new_cppflags" ; then
13856
13857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13858         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13859
13860 fi
13861
13862 if test -n "$cf_new_extra_cppflags" ; then
13863
13864         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13865         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13866
13867 fi
13868
13869 cf_add_libs="$LIBS"
13870 # reverse order
13871 cf_add_0lib=
13872 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13873 # filter duplicates
13874 for cf_add_1lib in $cf_add_0lib; do
13875         for cf_add_2lib in $cf_add_libs; do
13876                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13877                         cf_add_1lib=
13878                         break
13879                 fi
13880         done
13881         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13882 done
13883 LIBS="$cf_add_libs"
13884
13885         :
13886 else
13887         cf_pkgconfig_incs=
13888         cf_pkgconfig_libs=
13889         { echo "$as_me:13889: WARNING: unable to find ICE library" >&5
13890 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13891 fi
13892
13893 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
13894         test -n "$verbose" && echo "    found package sm" 1>&6
13895
13896 echo "${as_me:-configure}:13896: testing found package sm ..." 1>&5
13897
13898         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
13899         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
13900         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13901
13902 echo "${as_me:-configure}:13902: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13903
13904         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13905
13906 echo "${as_me:-configure}:13906: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13907
13908 cf_fix_cppflags=no
13909 cf_new_cflags=
13910 cf_new_cppflags=
13911 cf_new_extra_cppflags=
13912
13913 for cf_add_cflags in $cf_pkgconfig_incs
13914 do
13915 case "$cf_fix_cppflags" in
13916 (no)
13917         case "$cf_add_cflags" in
13918         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13919                 case "$cf_add_cflags" in
13920                 (-D*)
13921                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13922
13923                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13924                                 && test -z "${cf_tst_cflags}" \
13925                                 && cf_fix_cppflags=yes
13926
13927                         if test "$cf_fix_cppflags" = yes ; then
13928
13929         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13930         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13931
13932                                 continue
13933                         elif test "${cf_tst_cflags}" = "\"'" ; then
13934
13935         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13936         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13937
13938                                 continue
13939                         fi
13940                         ;;
13941                 esac
13942                 case "$CPPFLAGS" in
13943                 (*$cf_add_cflags)
13944                         ;;
13945                 (*)
13946                         case "$cf_add_cflags" in
13947                         (-D*)
13948                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13949
13950 CPPFLAGS=`echo "$CPPFLAGS" | \
13951         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13952                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13953
13954                                 ;;
13955                         esac
13956
13957         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13958         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13959
13960                         ;;
13961                 esac
13962                 ;;
13963         (*)
13964
13965         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13966         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13967
13968                 ;;
13969         esac
13970         ;;
13971 (yes)
13972
13973         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13974         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13975
13976         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13977
13978         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13979                 && test -z "${cf_tst_cflags}" \
13980                 && cf_fix_cppflags=no
13981         ;;
13982 esac
13983 done
13984
13985 if test -n "$cf_new_cflags" ; then
13986
13987         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13988         CFLAGS="${CFLAGS}$cf_new_cflags"
13989
13990 fi
13991
13992 if test -n "$cf_new_cppflags" ; then
13993
13994         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13995         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13996
13997 fi
13998
13999 if test -n "$cf_new_extra_cppflags" ; then
14000
14001         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14002         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14003
14004 fi
14005
14006 cf_add_libs="$LIBS"
14007 # reverse order
14008 cf_add_0lib=
14009 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14010 # filter duplicates
14011 for cf_add_1lib in $cf_add_0lib; do
14012         for cf_add_2lib in $cf_add_libs; do
14013                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14014                         cf_add_1lib=
14015                         break
14016                 fi
14017         done
14018         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14019 done
14020 LIBS="$cf_add_libs"
14021
14022         :
14023 else
14024         cf_pkgconfig_incs=
14025         cf_pkgconfig_libs=
14026         { echo "$as_me:14026: WARNING: unable to find SM library" >&5
14027 echo "$as_me: WARNING: unable to find SM library" >&2;}
14028 fi
14029
14030 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14031         test -n "$verbose" && echo "    found package xt" 1>&6
14032
14033 echo "${as_me:-configure}:14033: testing found package xt ..." 1>&5
14034
14035         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14036         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14037         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14038
14039 echo "${as_me:-configure}:14039: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14040
14041         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14042
14043 echo "${as_me:-configure}:14043: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14044
14045 cf_fix_cppflags=no
14046 cf_new_cflags=
14047 cf_new_cppflags=
14048 cf_new_extra_cppflags=
14049
14050 for cf_add_cflags in $cf_pkgconfig_incs
14051 do
14052 case "$cf_fix_cppflags" in
14053 (no)
14054         case "$cf_add_cflags" in
14055         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14056                 case "$cf_add_cflags" in
14057                 (-D*)
14058                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14059
14060                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14061                                 && test -z "${cf_tst_cflags}" \
14062                                 && cf_fix_cppflags=yes
14063
14064                         if test "$cf_fix_cppflags" = yes ; then
14065
14066         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14067         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14068
14069                                 continue
14070                         elif test "${cf_tst_cflags}" = "\"'" ; then
14071
14072         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14073         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14074
14075                                 continue
14076                         fi
14077                         ;;
14078                 esac
14079                 case "$CPPFLAGS" in
14080                 (*$cf_add_cflags)
14081                         ;;
14082                 (*)
14083                         case "$cf_add_cflags" in
14084                         (-D*)
14085                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14086
14087 CPPFLAGS=`echo "$CPPFLAGS" | \
14088         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14089                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14090
14091                                 ;;
14092                         esac
14093
14094         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14095         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14096
14097                         ;;
14098                 esac
14099                 ;;
14100         (*)
14101
14102         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14103         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14104
14105                 ;;
14106         esac
14107         ;;
14108 (yes)
14109
14110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14112
14113         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14114
14115         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14116                 && test -z "${cf_tst_cflags}" \
14117                 && cf_fix_cppflags=no
14118         ;;
14119 esac
14120 done
14121
14122 if test -n "$cf_new_cflags" ; then
14123
14124         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14125         CFLAGS="${CFLAGS}$cf_new_cflags"
14126
14127 fi
14128
14129 if test -n "$cf_new_cppflags" ; then
14130
14131         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14132         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14133
14134 fi
14135
14136 if test -n "$cf_new_extra_cppflags" ; then
14137
14138         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14139         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14140
14141 fi
14142
14143 cf_add_libs="$LIBS"
14144 # reverse order
14145 cf_add_0lib=
14146 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14147 # filter duplicates
14148 for cf_add_1lib in $cf_add_0lib; do
14149         for cf_add_2lib in $cf_add_libs; do
14150                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14151                         cf_add_1lib=
14152                         break
14153                 fi
14154         done
14155         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14156 done
14157 LIBS="$cf_add_libs"
14158
14159         :
14160 else
14161         cf_pkgconfig_incs=
14162         cf_pkgconfig_libs=
14163         { echo "$as_me:14163: WARNING: unable to find Xt library" >&5
14164 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14165 fi
14166
14167 else
14168         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14169 fi
14170
14171 cf_have_X_LIBS=no
14172
14173 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14174         test -n "$verbose" && echo "    found package xt" 1>&6
14175
14176 echo "${as_me:-configure}:14176: testing found package xt ..." 1>&5
14177
14178         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14179         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14180         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14181
14182 echo "${as_me:-configure}:14182: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14183
14184         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14185
14186 echo "${as_me:-configure}:14186: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14187
14188 cf_fix_cppflags=no
14189 cf_new_cflags=
14190 cf_new_cppflags=
14191 cf_new_extra_cppflags=
14192
14193 for cf_add_cflags in $cf_pkgconfig_incs
14194 do
14195 case "$cf_fix_cppflags" in
14196 (no)
14197         case "$cf_add_cflags" in
14198         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14199                 case "$cf_add_cflags" in
14200                 (-D*)
14201                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14202
14203                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14204                                 && test -z "${cf_tst_cflags}" \
14205                                 && cf_fix_cppflags=yes
14206
14207                         if test "$cf_fix_cppflags" = yes ; then
14208
14209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14211
14212                                 continue
14213                         elif test "${cf_tst_cflags}" = "\"'" ; then
14214
14215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14217
14218                                 continue
14219                         fi
14220                         ;;
14221                 esac
14222                 case "$CPPFLAGS" in
14223                 (*$cf_add_cflags)
14224                         ;;
14225                 (*)
14226                         case "$cf_add_cflags" in
14227                         (-D*)
14228                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14229
14230 CPPFLAGS=`echo "$CPPFLAGS" | \
14231         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14232                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14233
14234                                 ;;
14235                         esac
14236
14237         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14238         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14239
14240                         ;;
14241                 esac
14242                 ;;
14243         (*)
14244
14245         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14246         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14247
14248                 ;;
14249         esac
14250         ;;
14251 (yes)
14252
14253         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14254         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14255
14256         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14257
14258         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14259                 && test -z "${cf_tst_cflags}" \
14260                 && cf_fix_cppflags=no
14261         ;;
14262 esac
14263 done
14264
14265 if test -n "$cf_new_cflags" ; then
14266
14267         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14268         CFLAGS="${CFLAGS}$cf_new_cflags"
14269
14270 fi
14271
14272 if test -n "$cf_new_cppflags" ; then
14273
14274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14275         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14276
14277 fi
14278
14279 if test -n "$cf_new_extra_cppflags" ; then
14280
14281         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14282         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14283
14284 fi
14285
14286 cf_add_libs="$LIBS"
14287 # reverse order
14288 cf_add_0lib=
14289 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14290 # filter duplicates
14291 for cf_add_1lib in $cf_add_0lib; do
14292         for cf_add_2lib in $cf_add_libs; do
14293                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14294                         cf_add_1lib=
14295                         break
14296                 fi
14297         done
14298         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14299 done
14300 LIBS="$cf_add_libs"
14301
14302         case "x$LIBS" in
14303         (*-lX11*)
14304                 ;;
14305         (*)
14306 # we have an "xt" package, but it may omit Xt's dependency on X11
14307 echo "$as_me:14307: checking for usable X dependency" >&5
14308 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14309 if test "${cf_cv_xt_x11_compat+set}" = set; then
14310   echo $ECHO_N "(cached) $ECHO_C" >&6
14311 else
14312
14313 cat >"conftest.$ac_ext" <<_ACEOF
14314 #line 14314 "configure"
14315 #include "confdefs.h"
14316
14317 #include <X11/Xlib.h>
14318
14319 int
14320 main (void)
14321 {
14322
14323         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14324         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14325         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14326         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14327
14328   ;
14329   return 0;
14330 }
14331 _ACEOF
14332 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14333 if { (eval echo "$as_me:14333: \"$ac_link\"") >&5
14334   (eval $ac_link) 2>&5
14335   ac_status=$?
14336   echo "$as_me:14336: \$? = $ac_status" >&5
14337   (exit "$ac_status"); } &&
14338          { ac_try='test -s "conftest$ac_exeext"'
14339   { (eval echo "$as_me:14339: \"$ac_try\"") >&5
14340   (eval $ac_try) 2>&5
14341   ac_status=$?
14342   echo "$as_me:14342: \$? = $ac_status" >&5
14343   (exit "$ac_status"); }; }; then
14344   cf_cv_xt_x11_compat=yes
14345 else
14346   echo "$as_me: failed program was:" >&5
14347 cat "conftest.$ac_ext" >&5
14348 cf_cv_xt_x11_compat=no
14349 fi
14350 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14351 fi
14352 echo "$as_me:14352: result: $cf_cv_xt_x11_compat" >&5
14353 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14354                 if test "$cf_cv_xt_x11_compat" = no
14355                 then
14356                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14357
14358 echo "${as_me:-configure}:14358: testing work around broken X11 dependency ..." 1>&5
14359
14360                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14361
14362 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14363         test -n "$verbose" && echo "    found package x11" 1>&6
14364
14365 echo "${as_me:-configure}:14365: testing found package x11 ..." 1>&5
14366
14367         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14368         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14369         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14370
14371 echo "${as_me:-configure}:14371: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14372
14373         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14374
14375 echo "${as_me:-configure}:14375: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14376
14377 cf_fix_cppflags=no
14378 cf_new_cflags=
14379 cf_new_cppflags=
14380 cf_new_extra_cppflags=
14381
14382 for cf_add_cflags in $cf_pkgconfig_incs
14383 do
14384 case "$cf_fix_cppflags" in
14385 (no)
14386         case "$cf_add_cflags" in
14387         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14388                 case "$cf_add_cflags" in
14389                 (-D*)
14390                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14391
14392                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14393                                 && test -z "${cf_tst_cflags}" \
14394                                 && cf_fix_cppflags=yes
14395
14396                         if test "$cf_fix_cppflags" = yes ; then
14397
14398         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14399         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14400
14401                                 continue
14402                         elif test "${cf_tst_cflags}" = "\"'" ; then
14403
14404         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14405         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14406
14407                                 continue
14408                         fi
14409                         ;;
14410                 esac
14411                 case "$CPPFLAGS" in
14412                 (*$cf_add_cflags)
14413                         ;;
14414                 (*)
14415                         case "$cf_add_cflags" in
14416                         (-D*)
14417                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14418
14419 CPPFLAGS=`echo "$CPPFLAGS" | \
14420         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14421                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14422
14423                                 ;;
14424                         esac
14425
14426         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14427         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14428
14429                         ;;
14430                 esac
14431                 ;;
14432         (*)
14433
14434         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14435         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14436
14437                 ;;
14438         esac
14439         ;;
14440 (yes)
14441
14442         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14443         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14444
14445         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14446
14447         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14448                 && test -z "${cf_tst_cflags}" \
14449                 && cf_fix_cppflags=no
14450         ;;
14451 esac
14452 done
14453
14454 if test -n "$cf_new_cflags" ; then
14455
14456         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14457         CFLAGS="${CFLAGS}$cf_new_cflags"
14458
14459 fi
14460
14461 if test -n "$cf_new_cppflags" ; then
14462
14463         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14464         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14465
14466 fi
14467
14468 if test -n "$cf_new_extra_cppflags" ; then
14469
14470         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14471         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14472
14473 fi
14474
14475 cf_add_libs="$LIBS"
14476 # reverse order
14477 cf_add_0lib=
14478 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14479 # filter duplicates
14480 for cf_add_1lib in $cf_add_0lib; do
14481         for cf_add_2lib in $cf_add_libs; do
14482                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14483                         cf_add_1lib=
14484                         break
14485                 fi
14486         done
14487         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14488 done
14489 LIBS="$cf_add_libs"
14490
14491         :
14492 else
14493         cf_pkgconfig_incs=
14494         cf_pkgconfig_libs=
14495
14496 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14497
14498 echo "${as_me:-configure}:14498: testing ...before $LIBS ..." 1>&5
14499
14500 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14501 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14502
14503 echo "${as_me:-configure}:14503: testing ...after  $LIBS ..." 1>&5
14504
14505 fi
14506
14507                 fi
14508                 ;;
14509         esac
14510
14511 echo "$as_me:14511: checking for usable X Toolkit package" >&5
14512 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14513 if test "${cf_cv_xt_ice_compat+set}" = set; then
14514   echo $ECHO_N "(cached) $ECHO_C" >&6
14515 else
14516
14517 cat >"conftest.$ac_ext" <<_ACEOF
14518 #line 14518 "configure"
14519 #include "confdefs.h"
14520
14521 #include <X11/Shell.h>
14522
14523 int
14524 main (void)
14525 {
14526 int num = IceConnectionNumber(0); (void) num
14527
14528   ;
14529   return 0;
14530 }
14531 _ACEOF
14532 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14533 if { (eval echo "$as_me:14533: \"$ac_link\"") >&5
14534   (eval $ac_link) 2>&5
14535   ac_status=$?
14536   echo "$as_me:14536: \$? = $ac_status" >&5
14537   (exit "$ac_status"); } &&
14538          { ac_try='test -s "conftest$ac_exeext"'
14539   { (eval echo "$as_me:14539: \"$ac_try\"") >&5
14540   (eval $ac_try) 2>&5
14541   ac_status=$?
14542   echo "$as_me:14542: \$? = $ac_status" >&5
14543   (exit "$ac_status"); }; }; then
14544   cf_cv_xt_ice_compat=yes
14545 else
14546   echo "$as_me: failed program was:" >&5
14547 cat "conftest.$ac_ext" >&5
14548 cf_cv_xt_ice_compat=no
14549 fi
14550 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14551 fi
14552 echo "$as_me:14552: result: $cf_cv_xt_ice_compat" >&5
14553 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14554
14555         if test "$cf_cv_xt_ice_compat" = no
14556         then
14557                 # workaround for broken ".pc" files used for X Toolkit.
14558                 case "x$X_PRE_LIBS" in
14559                 (*-lICE*)
14560                         case "x$LIBS" in
14561                         (*-lICE*)
14562                                 ;;
14563                         (*)
14564                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14565
14566 echo "${as_me:-configure}:14566: testing work around broken ICE dependency ..." 1>&5
14567
14568 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14569         test -n "$verbose" && echo "    found package ice" 1>&6
14570
14571 echo "${as_me:-configure}:14571: testing found package ice ..." 1>&5
14572
14573         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14574         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14575         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14576
14577 echo "${as_me:-configure}:14577: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14578
14579         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14580
14581 echo "${as_me:-configure}:14581: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14582
14583 cf_fix_cppflags=no
14584 cf_new_cflags=
14585 cf_new_cppflags=
14586 cf_new_extra_cppflags=
14587
14588 for cf_add_cflags in $cf_pkgconfig_incs
14589 do
14590 case "$cf_fix_cppflags" in
14591 (no)
14592         case "$cf_add_cflags" in
14593         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14594                 case "$cf_add_cflags" in
14595                 (-D*)
14596                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14597
14598                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14599                                 && test -z "${cf_tst_cflags}" \
14600                                 && cf_fix_cppflags=yes
14601
14602                         if test "$cf_fix_cppflags" = yes ; then
14603
14604         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14605         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14606
14607                                 continue
14608                         elif test "${cf_tst_cflags}" = "\"'" ; then
14609
14610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14612
14613                                 continue
14614                         fi
14615                         ;;
14616                 esac
14617                 case "$CPPFLAGS" in
14618                 (*$cf_add_cflags)
14619                         ;;
14620                 (*)
14621                         case "$cf_add_cflags" in
14622                         (-D*)
14623                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14624
14625 CPPFLAGS=`echo "$CPPFLAGS" | \
14626         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14627                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14628
14629                                 ;;
14630                         esac
14631
14632         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14633         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14634
14635                         ;;
14636                 esac
14637                 ;;
14638         (*)
14639
14640         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14641         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14642
14643                 ;;
14644         esac
14645         ;;
14646 (yes)
14647
14648         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14649         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14650
14651         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14652
14653         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14654                 && test -z "${cf_tst_cflags}" \
14655                 && cf_fix_cppflags=no
14656         ;;
14657 esac
14658 done
14659
14660 if test -n "$cf_new_cflags" ; then
14661
14662         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14663         CFLAGS="${CFLAGS}$cf_new_cflags"
14664
14665 fi
14666
14667 if test -n "$cf_new_cppflags" ; then
14668
14669         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14670         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14671
14672 fi
14673
14674 if test -n "$cf_new_extra_cppflags" ; then
14675
14676         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14677         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14678
14679 fi
14680
14681 cf_add_libs="$LIBS"
14682 # reverse order
14683 cf_add_0lib=
14684 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14685 # filter duplicates
14686 for cf_add_1lib in $cf_add_0lib; do
14687         for cf_add_2lib in $cf_add_libs; do
14688                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14689                         cf_add_1lib=
14690                         break
14691                 fi
14692         done
14693         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14694 done
14695 LIBS="$cf_add_libs"
14696
14697 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14698         test -n "$verbose" && echo "    found package sm" 1>&6
14699
14700 echo "${as_me:-configure}:14700: testing found package sm ..." 1>&5
14701
14702         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14703         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14704         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14705
14706 echo "${as_me:-configure}:14706: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14707
14708         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14709
14710 echo "${as_me:-configure}:14710: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14711
14712 cf_fix_cppflags=no
14713 cf_new_cflags=
14714 cf_new_cppflags=
14715 cf_new_extra_cppflags=
14716
14717 for cf_add_cflags in $cf_pkgconfig_incs
14718 do
14719 case "$cf_fix_cppflags" in
14720 (no)
14721         case "$cf_add_cflags" in
14722         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14723                 case "$cf_add_cflags" in
14724                 (-D*)
14725                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14726
14727                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14728                                 && test -z "${cf_tst_cflags}" \
14729                                 && cf_fix_cppflags=yes
14730
14731                         if test "$cf_fix_cppflags" = yes ; then
14732
14733         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14734         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14735
14736                                 continue
14737                         elif test "${cf_tst_cflags}" = "\"'" ; then
14738
14739         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14740         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14741
14742                                 continue
14743                         fi
14744                         ;;
14745                 esac
14746                 case "$CPPFLAGS" in
14747                 (*$cf_add_cflags)
14748                         ;;
14749                 (*)
14750                         case "$cf_add_cflags" in
14751                         (-D*)
14752                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14753
14754 CPPFLAGS=`echo "$CPPFLAGS" | \
14755         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14756                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14757
14758                                 ;;
14759                         esac
14760
14761         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14762         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14763
14764                         ;;
14765                 esac
14766                 ;;
14767         (*)
14768
14769         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14770         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14771
14772                 ;;
14773         esac
14774         ;;
14775 (yes)
14776
14777         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14778         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14779
14780         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14781
14782         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14783                 && test -z "${cf_tst_cflags}" \
14784                 && cf_fix_cppflags=no
14785         ;;
14786 esac
14787 done
14788
14789 if test -n "$cf_new_cflags" ; then
14790
14791         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14792         CFLAGS="${CFLAGS}$cf_new_cflags"
14793
14794 fi
14795
14796 if test -n "$cf_new_cppflags" ; then
14797
14798         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14799         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14800
14801 fi
14802
14803 if test -n "$cf_new_extra_cppflags" ; then
14804
14805         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14806         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14807
14808 fi
14809
14810 cf_add_libs="$LIBS"
14811 # reverse order
14812 cf_add_0lib=
14813 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14814 # filter duplicates
14815 for cf_add_1lib in $cf_add_0lib; do
14816         for cf_add_2lib in $cf_add_libs; do
14817                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14818                         cf_add_1lib=
14819                         break
14820                 fi
14821         done
14822         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14823 done
14824 LIBS="$cf_add_libs"
14825
14826         :
14827 else
14828         cf_pkgconfig_incs=
14829         cf_pkgconfig_libs=
14830         :
14831 fi
14832
14833 else
14834         cf_pkgconfig_incs=
14835         cf_pkgconfig_libs=
14836
14837 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14838
14839 echo "${as_me:-configure}:14839: testing ...before $LIBS ..." 1>&5
14840
14841 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14842 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14843
14844 echo "${as_me:-configure}:14844: testing ...after  $LIBS ..." 1>&5
14845
14846 fi
14847
14848                                 ;;
14849                         esac
14850                         ;;
14851                 esac
14852         fi
14853
14854         cf_have_X_LIBS=yes
14855
14856 else
14857         cf_pkgconfig_incs=
14858         cf_pkgconfig_libs=
14859
14860         LDFLAGS="$X_LIBS $LDFLAGS"
14861
14862 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14863
14864 echo "${as_me:-configure}:14864: testing checking additions to CFLAGS ..." 1>&5
14865
14866 cf_check_cflags="$CFLAGS"
14867 cf_check_cppflags="$CPPFLAGS"
14868
14869 cf_fix_cppflags=no
14870 cf_new_cflags=
14871 cf_new_cppflags=
14872 cf_new_extra_cppflags=
14873
14874 for cf_add_cflags in $X_CFLAGS
14875 do
14876 case "$cf_fix_cppflags" in
14877 (no)
14878         case "$cf_add_cflags" in
14879         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14880                 case "$cf_add_cflags" in
14881                 (-D*)
14882                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14883
14884                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14885                                 && test -z "${cf_tst_cflags}" \
14886                                 && cf_fix_cppflags=yes
14887
14888                         if test "$cf_fix_cppflags" = yes ; then
14889
14890         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14891         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14892
14893                                 continue
14894                         elif test "${cf_tst_cflags}" = "\"'" ; then
14895
14896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14898
14899                                 continue
14900                         fi
14901                         ;;
14902                 esac
14903                 case "$CPPFLAGS" in
14904                 (*$cf_add_cflags)
14905                         ;;
14906                 (*)
14907                         case "$cf_add_cflags" in
14908                         (-D*)
14909                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14910
14911 CPPFLAGS=`echo "$CPPFLAGS" | \
14912         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14913                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14914
14915                                 ;;
14916                         esac
14917
14918         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14919         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14920
14921                         ;;
14922                 esac
14923                 ;;
14924         (*)
14925
14926         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14927         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14928
14929                 ;;
14930         esac
14931         ;;
14932 (yes)
14933
14934         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14935         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14936
14937         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14938
14939         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14940                 && test -z "${cf_tst_cflags}" \
14941                 && cf_fix_cppflags=no
14942         ;;
14943 esac
14944 done
14945
14946 if test -n "$cf_new_cflags" ; then
14947         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14948
14949 echo "${as_me:-configure}:14949: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14950
14951         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14952         CFLAGS="${CFLAGS}$cf_new_cflags"
14953
14954 fi
14955
14956 if test -n "$cf_new_cppflags" ; then
14957         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14958
14959 echo "${as_me:-configure}:14959: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14960
14961         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14962         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14963
14964 fi
14965
14966 if test -n "$cf_new_extra_cppflags" ; then
14967         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14968
14969 echo "${as_me:-configure}:14969: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14970
14971         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14972         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14973
14974 fi
14975
14976 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14977 cat >"conftest.$ac_ext" <<_ACEOF
14978 #line 14978 "configure"
14979 #include "confdefs.h"
14980 #include <stdio.h>
14981 int
14982 main (void)
14983 {
14984 printf("Hello world");
14985   ;
14986   return 0;
14987 }
14988 _ACEOF
14989 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14990 if { (eval echo "$as_me:14990: \"$ac_link\"") >&5
14991   (eval $ac_link) 2>&5
14992   ac_status=$?
14993   echo "$as_me:14993: \$? = $ac_status" >&5
14994   (exit "$ac_status"); } &&
14995          { ac_try='test -s "conftest$ac_exeext"'
14996   { (eval echo "$as_me:14996: \"$ac_try\"") >&5
14997   (eval $ac_try) 2>&5
14998   ac_status=$?
14999   echo "$as_me:14999: \$? = $ac_status" >&5
15000   (exit "$ac_status"); }; }; then
15001   :
15002 else
15003   echo "$as_me: failed program was:" >&5
15004 cat "conftest.$ac_ext" >&5
15005 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15006
15007 echo "${as_me:-configure}:15007: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15008
15009          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15010                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15011
15012 echo "${as_me:-configure}:15012: testing but keeping change to \$CPPFLAGS ..." 1>&5
15013
15014          fi
15015          CFLAGS="$cf_check_cflags"
15016 fi
15017 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15018 fi
15019
15020         echo "$as_me:15020: checking for XOpenDisplay" >&5
15021 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15022 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15023   echo $ECHO_N "(cached) $ECHO_C" >&6
15024 else
15025   cat >"conftest.$ac_ext" <<_ACEOF
15026 #line 15026 "configure"
15027 #include "confdefs.h"
15028 #define XOpenDisplay autoconf_temporary
15029 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15030 #undef XOpenDisplay
15031
15032 #ifdef __cplusplus
15033 extern "C"
15034 #endif
15035
15036 /* We use char because int might match the return type of a gcc2
15037    builtin and then its argument prototype would still apply.  */
15038 char XOpenDisplay (void);
15039
15040 int
15041 main (void)
15042 {
15043
15044 /* The GNU C library defines stubs for functions which it implements
15045     to always fail with ENOSYS.  Some functions are actually named
15046     something starting with __ and the normal name is an alias.  */
15047 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15048 #error found stub for XOpenDisplay
15049 #endif
15050
15051         return XOpenDisplay ();
15052   ;
15053   return 0;
15054 }
15055 _ACEOF
15056 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15057 if { (eval echo "$as_me:15057: \"$ac_link\"") >&5
15058   (eval $ac_link) 2>&5
15059   ac_status=$?
15060   echo "$as_me:15060: \$? = $ac_status" >&5
15061   (exit "$ac_status"); } &&
15062          { ac_try='test -s "conftest$ac_exeext"'
15063   { (eval echo "$as_me:15063: \"$ac_try\"") >&5
15064   (eval $ac_try) 2>&5
15065   ac_status=$?
15066   echo "$as_me:15066: \$? = $ac_status" >&5
15067   (exit "$ac_status"); }; }; then
15068   ac_cv_func_XOpenDisplay=yes
15069 else
15070   echo "$as_me: failed program was:" >&5
15071 cat "conftest.$ac_ext" >&5
15072 ac_cv_func_XOpenDisplay=no
15073 fi
15074 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15075 fi
15076 echo "$as_me:15076: result: $ac_cv_func_XOpenDisplay" >&5
15077 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15078 if test "$ac_cv_func_XOpenDisplay" = yes; then
15079   :
15080 else
15081
15082         echo "$as_me:15082: checking for XOpenDisplay in -lX11" >&5
15083 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15084 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15085   echo $ECHO_N "(cached) $ECHO_C" >&6
15086 else
15087   ac_check_lib_save_LIBS=$LIBS
15088 LIBS="-lX11  $LIBS"
15089 cat >"conftest.$ac_ext" <<_ACEOF
15090 #line 15090 "configure"
15091 #include "confdefs.h"
15092
15093 /* Override any gcc2 internal prototype to avoid an error.  */
15094 #ifdef __cplusplus
15095 extern "C"
15096 #endif
15097 /* We use char because int might match the return type of a gcc2
15098    builtin and then its argument prototype would still apply.  */
15099 char XOpenDisplay ();
15100 int
15101 main (void)
15102 {
15103 XOpenDisplay ();
15104   ;
15105   return 0;
15106 }
15107 _ACEOF
15108 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15109 if { (eval echo "$as_me:15109: \"$ac_link\"") >&5
15110   (eval $ac_link) 2>&5
15111   ac_status=$?
15112   echo "$as_me:15112: \$? = $ac_status" >&5
15113   (exit "$ac_status"); } &&
15114          { ac_try='test -s "conftest$ac_exeext"'
15115   { (eval echo "$as_me:15115: \"$ac_try\"") >&5
15116   (eval $ac_try) 2>&5
15117   ac_status=$?
15118   echo "$as_me:15118: \$? = $ac_status" >&5
15119   (exit "$ac_status"); }; }; then
15120   ac_cv_lib_X11_XOpenDisplay=yes
15121 else
15122   echo "$as_me: failed program was:" >&5
15123 cat "conftest.$ac_ext" >&5
15124 ac_cv_lib_X11_XOpenDisplay=no
15125 fi
15126 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15127 LIBS=$ac_check_lib_save_LIBS
15128 fi
15129 echo "$as_me:15129: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15130 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15131 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15132
15133 cf_add_libs="$LIBS"
15134 # reverse order
15135 cf_add_0lib=
15136 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15137 # filter duplicates
15138 for cf_add_1lib in $cf_add_0lib; do
15139         for cf_add_2lib in $cf_add_libs; do
15140                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15141                         cf_add_1lib=
15142                         break
15143                 fi
15144         done
15145         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15146 done
15147 LIBS="$cf_add_libs"
15148
15149 fi
15150
15151 fi
15152
15153         echo "$as_me:15153: checking for XtAppInitialize" >&5
15154 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15155 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15156   echo $ECHO_N "(cached) $ECHO_C" >&6
15157 else
15158   cat >"conftest.$ac_ext" <<_ACEOF
15159 #line 15159 "configure"
15160 #include "confdefs.h"
15161 #define XtAppInitialize autoconf_temporary
15162 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15163 #undef XtAppInitialize
15164
15165 #ifdef __cplusplus
15166 extern "C"
15167 #endif
15168
15169 /* We use char because int might match the return type of a gcc2
15170    builtin and then its argument prototype would still apply.  */
15171 char XtAppInitialize (void);
15172
15173 int
15174 main (void)
15175 {
15176
15177 /* The GNU C library defines stubs for functions which it implements
15178     to always fail with ENOSYS.  Some functions are actually named
15179     something starting with __ and the normal name is an alias.  */
15180 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15181 #error found stub for XtAppInitialize
15182 #endif
15183
15184         return XtAppInitialize ();
15185   ;
15186   return 0;
15187 }
15188 _ACEOF
15189 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15190 if { (eval echo "$as_me:15190: \"$ac_link\"") >&5
15191   (eval $ac_link) 2>&5
15192   ac_status=$?
15193   echo "$as_me:15193: \$? = $ac_status" >&5
15194   (exit "$ac_status"); } &&
15195          { ac_try='test -s "conftest$ac_exeext"'
15196   { (eval echo "$as_me:15196: \"$ac_try\"") >&5
15197   (eval $ac_try) 2>&5
15198   ac_status=$?
15199   echo "$as_me:15199: \$? = $ac_status" >&5
15200   (exit "$ac_status"); }; }; then
15201   ac_cv_func_XtAppInitialize=yes
15202 else
15203   echo "$as_me: failed program was:" >&5
15204 cat "conftest.$ac_ext" >&5
15205 ac_cv_func_XtAppInitialize=no
15206 fi
15207 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15208 fi
15209 echo "$as_me:15209: result: $ac_cv_func_XtAppInitialize" >&5
15210 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15211 if test "$ac_cv_func_XtAppInitialize" = yes; then
15212   :
15213 else
15214
15215         echo "$as_me:15215: checking for XtAppInitialize in -lXt" >&5
15216 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15217 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15218   echo $ECHO_N "(cached) $ECHO_C" >&6
15219 else
15220   ac_check_lib_save_LIBS=$LIBS
15221 LIBS="-lXt  $LIBS"
15222 cat >"conftest.$ac_ext" <<_ACEOF
15223 #line 15223 "configure"
15224 #include "confdefs.h"
15225
15226 /* Override any gcc2 internal prototype to avoid an error.  */
15227 #ifdef __cplusplus
15228 extern "C"
15229 #endif
15230 /* We use char because int might match the return type of a gcc2
15231    builtin and then its argument prototype would still apply.  */
15232 char XtAppInitialize ();
15233 int
15234 main (void)
15235 {
15236 XtAppInitialize ();
15237   ;
15238   return 0;
15239 }
15240 _ACEOF
15241 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15242 if { (eval echo "$as_me:15242: \"$ac_link\"") >&5
15243   (eval $ac_link) 2>&5
15244   ac_status=$?
15245   echo "$as_me:15245: \$? = $ac_status" >&5
15246   (exit "$ac_status"); } &&
15247          { ac_try='test -s "conftest$ac_exeext"'
15248   { (eval echo "$as_me:15248: \"$ac_try\"") >&5
15249   (eval $ac_try) 2>&5
15250   ac_status=$?
15251   echo "$as_me:15251: \$? = $ac_status" >&5
15252   (exit "$ac_status"); }; }; then
15253   ac_cv_lib_Xt_XtAppInitialize=yes
15254 else
15255   echo "$as_me: failed program was:" >&5
15256 cat "conftest.$ac_ext" >&5
15257 ac_cv_lib_Xt_XtAppInitialize=no
15258 fi
15259 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15260 LIBS=$ac_check_lib_save_LIBS
15261 fi
15262 echo "$as_me:15262: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15263 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15264 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15265
15266 cat >>confdefs.h <<\EOF
15267 #define HAVE_LIBXT 1
15268 EOF
15269
15270                  cf_have_X_LIBS=Xt
15271                  LIBS="-lXt $LIBS"
15272 fi
15273
15274 fi
15275
15276 fi
15277
15278 if test "$cf_have_X_LIBS" = no ; then
15279         { echo "$as_me:15279: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15280 test program.  You will have to check and add the proper libraries by hand
15281 to makefile." >&5
15282 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15283 test program.  You will have to check and add the proper libraries by hand
15284 to makefile." >&2;}
15285 fi
15286
15287 cf_x_athena_root=$cf_x_athena
15288 cf_x_athena_inc=""
15289
15290 for cf_path in default \
15291         /usr/contrib/X11R6 \
15292         /usr/contrib/X11R5 \
15293         /usr/lib/X11R5 \
15294         /usr/local
15295 do
15296         if test -z "$cf_x_athena_inc" ; then
15297
15298 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15299 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15300 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15301 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15302 for cf_X_CFLAGS in $X_CFLAGS
15303 do
15304         case "x$cf_X_CFLAGS" in
15305         x-[IUD]*)
15306                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15307                 ;;
15308         *)
15309                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15310                 ;;
15311         esac
15312 done
15313
15314                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15315                 if test "$cf_path" != default ; then
15316
15317         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15318         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15319
15320                         echo "$as_me:15320: checking for $cf_test in $cf_path" >&5
15321 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15322                 else
15323                         echo "$as_me:15323: checking for $cf_test" >&5
15324 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15325                 fi
15326                 cat >"conftest.$ac_ext" <<_ACEOF
15327 #line 15327 "configure"
15328 #include "confdefs.h"
15329
15330 #include <X11/Intrinsic.h>
15331 #include <$cf_test>
15332 int
15333 main (void)
15334 {
15335
15336   ;
15337   return 0;
15338 }
15339 _ACEOF
15340 rm -f "conftest.$ac_objext"
15341 if { (eval echo "$as_me:15341: \"$ac_compile\"") >&5
15342   (eval $ac_compile) 2>&5
15343   ac_status=$?
15344   echo "$as_me:15344: \$? = $ac_status" >&5
15345   (exit "$ac_status"); } &&
15346          { ac_try='test -s "conftest.$ac_objext"'
15347   { (eval echo "$as_me:15347: \"$ac_try\"") >&5
15348   (eval $ac_try) 2>&5
15349   ac_status=$?
15350   echo "$as_me:15350: \$? = $ac_status" >&5
15351   (exit "$ac_status"); }; }; then
15352   cf_result=yes
15353 else
15354   echo "$as_me: failed program was:" >&5
15355 cat "conftest.$ac_ext" >&5
15356 cf_result=no
15357 fi
15358 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15359                 echo "$as_me:15359: result: $cf_result" >&5
15360 echo "${ECHO_T}$cf_result" >&6
15361
15362 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15363 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15364 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15365
15366                 if test "$cf_result" = yes ; then
15367                         test "$cf_path"  = default && cf_x_athena_inc=default
15368                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15369                         break
15370                 fi
15371         fi
15372 done
15373
15374 if test -z "$cf_x_athena_inc" ; then
15375         { echo "$as_me:15375: WARNING: Unable to find Athena header files" >&5
15376 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15377 elif test "$cf_x_athena_inc" != default ; then
15378
15379         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15380         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15381
15382 fi
15383
15384 cf_x_athena_root=$cf_x_athena
15385 cf_x_athena_lib=""
15386
15387 for cf_path in default \
15388         /usr/contrib/X11R6 \
15389         /usr/contrib/X11R5 \
15390         /usr/lib/X11R5 \
15391         /usr/local
15392 do
15393         for cf_lib in \
15394                 ${cf_x_athena_root} \
15395                 ${cf_x_athena_root}7 \
15396                 ${cf_x_athena_root}6
15397         do
15398         for cf_libs in \
15399                 "-l$cf_lib -lXmu" \
15400                 "-l$cf_lib -lXpm -lXmu" \
15401                 "-l${cf_lib}_s -lXmu_s"
15402         do
15403                 test -n "$cf_x_athena_lib" && break
15404
15405 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15406 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15407 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15408 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15409 for cf_X_CFLAGS in $X_CFLAGS
15410 do
15411         case "x$cf_X_CFLAGS" in
15412         x-[IUD]*)
15413                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15414                 ;;
15415         *)
15416                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15417                 ;;
15418         esac
15419 done
15420
15421                 cf_test=XawSimpleMenuAddGlobalActions
15422                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15423
15424 cf_add_libs="$LIBS"
15425 # reverse order
15426 cf_add_0lib=
15427 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15428 # filter duplicates
15429 for cf_add_1lib in $cf_add_0lib; do
15430         for cf_add_2lib in $cf_add_libs; do
15431                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15432                         cf_add_1lib=
15433                         break
15434                 fi
15435         done
15436         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15437 done
15438 LIBS="$cf_add_libs"
15439
15440                 echo "$as_me:15440: checking for $cf_test in $cf_libs" >&5
15441 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15442                 cat >"conftest.$ac_ext" <<_ACEOF
15443 #line 15443 "configure"
15444 #include "confdefs.h"
15445
15446 #include <X11/Intrinsic.h>
15447 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15448
15449 int
15450 main (void)
15451 {
15452
15453 $cf_test((XtAppContext) 0)
15454   ;
15455   return 0;
15456 }
15457 _ACEOF
15458 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15459 if { (eval echo "$as_me:15459: \"$ac_link\"") >&5
15460   (eval $ac_link) 2>&5
15461   ac_status=$?
15462   echo "$as_me:15462: \$? = $ac_status" >&5
15463   (exit "$ac_status"); } &&
15464          { ac_try='test -s "conftest$ac_exeext"'
15465   { (eval echo "$as_me:15465: \"$ac_try\"") >&5
15466   (eval $ac_try) 2>&5
15467   ac_status=$?
15468   echo "$as_me:15468: \$? = $ac_status" >&5
15469   (exit "$ac_status"); }; }; then
15470   cf_result=yes
15471 else
15472   echo "$as_me: failed program was:" >&5
15473 cat "conftest.$ac_ext" >&5
15474 cf_result=no
15475 fi
15476 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15477                 echo "$as_me:15477: result: $cf_result" >&5
15478 echo "${ECHO_T}$cf_result" >&6
15479
15480 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15481 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15482 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15483
15484                 if test "$cf_result" = yes ; then
15485                         cf_x_athena_lib="$cf_libs"
15486                         break
15487                 fi
15488         done # cf_libs
15489                 test -n "$cf_x_athena_lib" && break
15490         done # cf_lib
15491 done
15492
15493 if test -z "$cf_x_athena_lib" ; then
15494         { { echo "$as_me:15494: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15495 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15496    { (exit 1); exit 1; }; }
15497 fi
15498
15499 cf_add_libs="$LIBS"
15500 # reverse order
15501 cf_add_0lib=
15502 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15503 # filter duplicates
15504 for cf_add_1lib in $cf_add_0lib; do
15505         for cf_add_2lib in $cf_add_libs; do
15506                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15507                         cf_add_1lib=
15508                         break
15509                 fi
15510         done
15511         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15512 done
15513 LIBS="$cf_add_libs"
15514
15515 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15516
15517 cat >>confdefs.h <<EOF
15518 #define $cf_x_athena_LIBS 1
15519 EOF
15520
15521 fi
15522
15523 if test -n "$ac_tool_prefix"; then
15524   for ac_prog in xcurses-config
15525   do
15526     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15527 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15528 echo "$as_me:15528: checking for $ac_word" >&5
15529 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15530 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15531   echo $ECHO_N "(cached) $ECHO_C" >&6
15532 else
15533   if test -n "$XCURSES_CONFIG"; then
15534   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15535 else
15536   ac_save_IFS=$IFS; IFS=$ac_path_separator
15537 ac_dummy="$PATH"
15538 for ac_dir in $ac_dummy; do
15539   IFS=$ac_save_IFS
15540   test -z "$ac_dir" && ac_dir=.
15541   $as_executable_p "$ac_dir/$ac_word" || continue
15542 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15543 echo "$as_me:15543: found $ac_dir/$ac_word" >&5
15544 break
15545 done
15546
15547 fi
15548 fi
15549 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15550 if test -n "$XCURSES_CONFIG"; then
15551   echo "$as_me:15551: result: $XCURSES_CONFIG" >&5
15552 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15553 else
15554   echo "$as_me:15554: result: no" >&5
15555 echo "${ECHO_T}no" >&6
15556 fi
15557
15558     test -n "$XCURSES_CONFIG" && break
15559   done
15560 fi
15561 if test -z "$XCURSES_CONFIG"; then
15562   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15563   for ac_prog in xcurses-config
15564 do
15565   # Extract the first word of "$ac_prog", so it can be a program name with args.
15566 set dummy $ac_prog; ac_word=$2
15567 echo "$as_me:15567: checking for $ac_word" >&5
15568 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15569 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15570   echo $ECHO_N "(cached) $ECHO_C" >&6
15571 else
15572   if test -n "$ac_ct_XCURSES_CONFIG"; then
15573   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15574 else
15575   ac_save_IFS=$IFS; IFS=$ac_path_separator
15576 ac_dummy="$PATH"
15577 for ac_dir in $ac_dummy; do
15578   IFS=$ac_save_IFS
15579   test -z "$ac_dir" && ac_dir=.
15580   $as_executable_p "$ac_dir/$ac_word" || continue
15581 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15582 echo "$as_me:15582: found $ac_dir/$ac_word" >&5
15583 break
15584 done
15585
15586 fi
15587 fi
15588 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15589 if test -n "$ac_ct_XCURSES_CONFIG"; then
15590   echo "$as_me:15590: result: $ac_ct_XCURSES_CONFIG" >&5
15591 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15592 else
15593   echo "$as_me:15593: result: no" >&5
15594 echo "${ECHO_T}no" >&6
15595 fi
15596
15597   test -n "$ac_ct_XCURSES_CONFIG" && break
15598 done
15599 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15600
15601   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15602 fi
15603
15604 if test "$XCURSES_CONFIG" != none ; then
15605
15606 cf_fix_cppflags=no
15607 cf_new_cflags=
15608 cf_new_cppflags=
15609 cf_new_extra_cppflags=
15610
15611 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15612 do
15613 case "$cf_fix_cppflags" in
15614 (no)
15615         case "$cf_add_cflags" in
15616         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15617                 case "$cf_add_cflags" in
15618                 (-D*)
15619                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15620
15621                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15622                                 && test -z "${cf_tst_cflags}" \
15623                                 && cf_fix_cppflags=yes
15624
15625                         if test "$cf_fix_cppflags" = yes ; then
15626
15627         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15628         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15629
15630                                 continue
15631                         elif test "${cf_tst_cflags}" = "\"'" ; then
15632
15633         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15634         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15635
15636                                 continue
15637                         fi
15638                         ;;
15639                 esac
15640                 case "$CPPFLAGS" in
15641                 (*$cf_add_cflags)
15642                         ;;
15643                 (*)
15644                         case "$cf_add_cflags" in
15645                         (-D*)
15646                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15647
15648 CPPFLAGS=`echo "$CPPFLAGS" | \
15649         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15650                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15651
15652                                 ;;
15653                         esac
15654
15655         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15656         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15657
15658                         ;;
15659                 esac
15660                 ;;
15661         (*)
15662
15663         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15664         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15665
15666                 ;;
15667         esac
15668         ;;
15669 (yes)
15670
15671         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15672         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15673
15674         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15675
15676         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15677                 && test -z "${cf_tst_cflags}" \
15678                 && cf_fix_cppflags=no
15679         ;;
15680 esac
15681 done
15682
15683 if test -n "$cf_new_cflags" ; then
15684
15685         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15686         CFLAGS="${CFLAGS}$cf_new_cflags"
15687
15688 fi
15689
15690 if test -n "$cf_new_cppflags" ; then
15691
15692         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15693         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15694
15695 fi
15696
15697 if test -n "$cf_new_extra_cppflags" ; then
15698
15699         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15700         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15701
15702 fi
15703
15704 cf_add_libs="$LIBS"
15705 # reverse order
15706 cf_add_0lib=
15707 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15708 # filter duplicates
15709 for cf_add_1lib in $cf_add_0lib; do
15710         for cf_add_2lib in $cf_add_libs; do
15711                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15712                         cf_add_1lib=
15713                         break
15714                 fi
15715         done
15716         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15717 done
15718 LIBS="$cf_add_libs"
15719
15720 cf_cv_lib_XCurses=yes
15721
15722 else
15723
15724 LDFLAGS="$LDFLAGS $X_LIBS"
15725
15726 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15727
15728 echo "${as_me:-configure}:15728: testing checking additions to CFLAGS ..." 1>&5
15729
15730 cf_check_cflags="$CFLAGS"
15731 cf_check_cppflags="$CPPFLAGS"
15732
15733 cf_fix_cppflags=no
15734 cf_new_cflags=
15735 cf_new_cppflags=
15736 cf_new_extra_cppflags=
15737
15738 for cf_add_cflags in $X_CFLAGS
15739 do
15740 case "$cf_fix_cppflags" in
15741 (no)
15742         case "$cf_add_cflags" in
15743         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15744                 case "$cf_add_cflags" in
15745                 (-D*)
15746                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15747
15748                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15749                                 && test -z "${cf_tst_cflags}" \
15750                                 && cf_fix_cppflags=yes
15751
15752                         if test "$cf_fix_cppflags" = yes ; then
15753
15754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15756
15757                                 continue
15758                         elif test "${cf_tst_cflags}" = "\"'" ; then
15759
15760         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15761         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15762
15763                                 continue
15764                         fi
15765                         ;;
15766                 esac
15767                 case "$CPPFLAGS" in
15768                 (*$cf_add_cflags)
15769                         ;;
15770                 (*)
15771                         case "$cf_add_cflags" in
15772                         (-D*)
15773                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15774
15775 CPPFLAGS=`echo "$CPPFLAGS" | \
15776         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15777                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15778
15779                                 ;;
15780                         esac
15781
15782         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15783         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15784
15785                         ;;
15786                 esac
15787                 ;;
15788         (*)
15789
15790         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15791         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15792
15793                 ;;
15794         esac
15795         ;;
15796 (yes)
15797
15798         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15799         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15800
15801         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15802
15803         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15804                 && test -z "${cf_tst_cflags}" \
15805                 && cf_fix_cppflags=no
15806         ;;
15807 esac
15808 done
15809
15810 if test -n "$cf_new_cflags" ; then
15811         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15812
15813 echo "${as_me:-configure}:15813: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15814
15815         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15816         CFLAGS="${CFLAGS}$cf_new_cflags"
15817
15818 fi
15819
15820 if test -n "$cf_new_cppflags" ; then
15821         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15822
15823 echo "${as_me:-configure}:15823: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15824
15825         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15826         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15827
15828 fi
15829
15830 if test -n "$cf_new_extra_cppflags" ; then
15831         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15832
15833 echo "${as_me:-configure}:15833: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15834
15835         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15836         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15837
15838 fi
15839
15840 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15841 cat >"conftest.$ac_ext" <<_ACEOF
15842 #line 15842 "configure"
15843 #include "confdefs.h"
15844 #include <stdio.h>
15845 int
15846 main (void)
15847 {
15848 printf("Hello world");
15849   ;
15850   return 0;
15851 }
15852 _ACEOF
15853 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15854 if { (eval echo "$as_me:15854: \"$ac_link\"") >&5
15855   (eval $ac_link) 2>&5
15856   ac_status=$?
15857   echo "$as_me:15857: \$? = $ac_status" >&5
15858   (exit "$ac_status"); } &&
15859          { ac_try='test -s "conftest$ac_exeext"'
15860   { (eval echo "$as_me:15860: \"$ac_try\"") >&5
15861   (eval $ac_try) 2>&5
15862   ac_status=$?
15863   echo "$as_me:15863: \$? = $ac_status" >&5
15864   (exit "$ac_status"); }; }; then
15865   :
15866 else
15867   echo "$as_me: failed program was:" >&5
15868 cat "conftest.$ac_ext" >&5
15869 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15870
15871 echo "${as_me:-configure}:15871: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15872
15873          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15874                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15875
15876 echo "${as_me:-configure}:15876: testing but keeping change to \$CPPFLAGS ..." 1>&5
15877
15878          fi
15879          CFLAGS="$cf_check_cflags"
15880 fi
15881 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15882 fi
15883
15884 echo "$as_me:15884: checking for XOpenDisplay in -lX11" >&5
15885 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15886 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15887   echo $ECHO_N "(cached) $ECHO_C" >&6
15888 else
15889   ac_check_lib_save_LIBS=$LIBS
15890 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15891 cat >"conftest.$ac_ext" <<_ACEOF
15892 #line 15892 "configure"
15893 #include "confdefs.h"
15894
15895 /* Override any gcc2 internal prototype to avoid an error.  */
15896 #ifdef __cplusplus
15897 extern "C"
15898 #endif
15899 /* We use char because int might match the return type of a gcc2
15900    builtin and then its argument prototype would still apply.  */
15901 char XOpenDisplay ();
15902 int
15903 main (void)
15904 {
15905 XOpenDisplay ();
15906   ;
15907   return 0;
15908 }
15909 _ACEOF
15910 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15911 if { (eval echo "$as_me:15911: \"$ac_link\"") >&5
15912   (eval $ac_link) 2>&5
15913   ac_status=$?
15914   echo "$as_me:15914: \$? = $ac_status" >&5
15915   (exit "$ac_status"); } &&
15916          { ac_try='test -s "conftest$ac_exeext"'
15917   { (eval echo "$as_me:15917: \"$ac_try\"") >&5
15918   (eval $ac_try) 2>&5
15919   ac_status=$?
15920   echo "$as_me:15920: \$? = $ac_status" >&5
15921   (exit "$ac_status"); }; }; then
15922   ac_cv_lib_X11_XOpenDisplay=yes
15923 else
15924   echo "$as_me: failed program was:" >&5
15925 cat "conftest.$ac_ext" >&5
15926 ac_cv_lib_X11_XOpenDisplay=no
15927 fi
15928 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15929 LIBS=$ac_check_lib_save_LIBS
15930 fi
15931 echo "$as_me:15931: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15932 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15933 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15934
15935 cf_add_libs="$LIBS"
15936 # reverse order
15937 cf_add_0lib=
15938 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15939 # filter duplicates
15940 for cf_add_1lib in $cf_add_0lib; do
15941         for cf_add_2lib in $cf_add_libs; do
15942                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15943                         cf_add_1lib=
15944                         break
15945                 fi
15946         done
15947         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15948 done
15949 LIBS="$cf_add_libs"
15950
15951 fi
15952
15953 echo "$as_me:15953: checking for XCurses library" >&5
15954 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15955 if test "${cf_cv_lib_XCurses+set}" = set; then
15956   echo $ECHO_N "(cached) $ECHO_C" >&6
15957 else
15958
15959 cf_add_libs="$LIBS"
15960 # reverse order
15961 cf_add_0lib=
15962 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15963 # filter duplicates
15964 for cf_add_1lib in $cf_add_0lib; do
15965         for cf_add_2lib in $cf_add_libs; do
15966                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15967                         cf_add_1lib=
15968                         break
15969                 fi
15970         done
15971         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15972 done
15973 LIBS="$cf_add_libs"
15974
15975 cat >"conftest.$ac_ext" <<_ACEOF
15976 #line 15976 "configure"
15977 #include "confdefs.h"
15978
15979 #include <xcurses.h>
15980 char *XCursesProgramName = "test";
15981
15982 int
15983 main (void)
15984 {
15985 XCursesExit();
15986   ;
15987   return 0;
15988 }
15989 _ACEOF
15990 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15991 if { (eval echo "$as_me:15991: \"$ac_link\"") >&5
15992   (eval $ac_link) 2>&5
15993   ac_status=$?
15994   echo "$as_me:15994: \$? = $ac_status" >&5
15995   (exit "$ac_status"); } &&
15996          { ac_try='test -s "conftest$ac_exeext"'
15997   { (eval echo "$as_me:15997: \"$ac_try\"") >&5
15998   (eval $ac_try) 2>&5
15999   ac_status=$?
16000   echo "$as_me:16000: \$? = $ac_status" >&5
16001   (exit "$ac_status"); }; }; then
16002   cf_cv_lib_XCurses=yes
16003 else
16004   echo "$as_me: failed program was:" >&5
16005 cat "conftest.$ac_ext" >&5
16006 cf_cv_lib_XCurses=no
16007 fi
16008 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16009
16010 fi
16011 echo "$as_me:16011: result: $cf_cv_lib_XCurses" >&5
16012 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16013
16014 fi
16015
16016 if test "$cf_cv_lib_XCurses" = yes ; then
16017
16018 cat >>confdefs.h <<\EOF
16019 #define UNIX 1
16020 EOF
16021
16022 cat >>confdefs.h <<\EOF
16023 #define XCURSES 1
16024 EOF
16025
16026         echo "$as_me:16026: checking for xcurses.h" >&5
16027 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16028 if test "${ac_cv_header_xcurses_h+set}" = set; then
16029   echo $ECHO_N "(cached) $ECHO_C" >&6
16030 else
16031   cat >"conftest.$ac_ext" <<_ACEOF
16032 #line 16032 "configure"
16033 #include "confdefs.h"
16034 #include <xcurses.h>
16035 _ACEOF
16036 if { (eval echo "$as_me:16036: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16037   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16038   ac_status=$?
16039   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16040   rm -f conftest.er1
16041   cat conftest.err >&5
16042   echo "$as_me:16042: \$? = $ac_status" >&5
16043   (exit "$ac_status"); } >/dev/null; then
16044   if test -s conftest.err; then
16045     ac_cpp_err=$ac_c_preproc_warn_flag
16046   else
16047     ac_cpp_err=
16048   fi
16049 else
16050   ac_cpp_err=yes
16051 fi
16052 if test -z "$ac_cpp_err"; then
16053   ac_cv_header_xcurses_h=yes
16054 else
16055   echo "$as_me: failed program was:" >&5
16056   cat "conftest.$ac_ext" >&5
16057   ac_cv_header_xcurses_h=no
16058 fi
16059 rm -f conftest.err "conftest.$ac_ext"
16060 fi
16061 echo "$as_me:16061: result: $ac_cv_header_xcurses_h" >&5
16062 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16063 if test "$ac_cv_header_xcurses_h" = yes; then
16064
16065 cat >>confdefs.h <<\EOF
16066 #define HAVE_XCURSES 1
16067 EOF
16068
16069 fi
16070
16071 else
16072         { { echo "$as_me:16072: error: Cannot link with XCurses" >&5
16073 echo "$as_me: error: Cannot link with XCurses" >&2;}
16074    { (exit 1); exit 1; }; }
16075 fi
16076
16077         ;;
16078 (*)
16079         { { echo "$as_me:16079: error: unexpected screen-value: $cf_cv_screen" >&5
16080 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16081    { (exit 1); exit 1; }; }
16082         ;;
16083 esac
16084
16085 : ${cf_nculib_root:=$cf_cv_screen}
16086 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16087 echo "$as_me:16087: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16088 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16089 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16090   echo $ECHO_N "(cached) $ECHO_C" >&6
16091 else
16092   ac_check_lib_save_LIBS=$LIBS
16093 LIBS="-l$cf_nculib_root  $LIBS"
16094 cat >"conftest.$ac_ext" <<_ACEOF
16095 #line 16095 "configure"
16096 #include "confdefs.h"
16097
16098 /* Override any gcc2 internal prototype to avoid an error.  */
16099 #ifdef __cplusplus
16100 extern "C"
16101 #endif
16102 /* We use char because int might match the return type of a gcc2
16103    builtin and then its argument prototype would still apply.  */
16104 char _nc_init_pthreads ();
16105 int
16106 main (void)
16107 {
16108 _nc_init_pthreads ();
16109   ;
16110   return 0;
16111 }
16112 _ACEOF
16113 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16114 if { (eval echo "$as_me:16114: \"$ac_link\"") >&5
16115   (eval $ac_link) 2>&5
16116   ac_status=$?
16117   echo "$as_me:16117: \$? = $ac_status" >&5
16118   (exit "$ac_status"); } &&
16119          { ac_try='test -s "conftest$ac_exeext"'
16120   { (eval echo "$as_me:16120: \"$ac_try\"") >&5
16121   (eval $ac_try) 2>&5
16122   ac_status=$?
16123   echo "$as_me:16123: \$? = $ac_status" >&5
16124   (exit "$ac_status"); }; }; then
16125   eval "$as_ac_Lib=yes"
16126 else
16127   echo "$as_me: failed program was:" >&5
16128 cat "conftest.$ac_ext" >&5
16129 eval "$as_ac_Lib=no"
16130 fi
16131 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16132 LIBS=$ac_check_lib_save_LIBS
16133 fi
16134 echo "$as_me:16134: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16135 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16136 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16137   cf_cv_ncurses_pthreads=yes
16138 else
16139   cf_cv_ncurses_pthreads=no
16140 fi
16141
16142 if test "$cf_cv_ncurses_pthreads" = yes
16143 then
16144
16145 cf_add_libs="$LIBS"
16146 # reverse order
16147 cf_add_0lib=
16148 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16149 # filter duplicates
16150 for cf_add_1lib in $cf_add_0lib; do
16151         for cf_add_2lib in $cf_add_libs; do
16152                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16153                         cf_add_1lib=
16154                         break
16155                 fi
16156         done
16157         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16158 done
16159 LIBS="$cf_add_libs"
16160
16161 fi
16162
16163 case $cf_cv_screen in
16164 (ncurses*)
16165         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16166         ;;
16167 esac
16168
16169 echo "$as_me:16169: checking for X11 rgb file" >&5
16170 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16171
16172 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16173 if test "${with_x11_rgb+set}" = set; then
16174   withval="$with_x11_rgb"
16175   RGB_PATH=$withval
16176 else
16177   RGB_PATH=auto
16178 fi;
16179
16180 if test "x$RGB_PATH" = xauto
16181 then
16182         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16183         for cf_path in \
16184                 /opt/local/share/X11/rgb.txt \
16185                 /opt/X11/share/X11/rgb.txt \
16186                 /usr/share/X11/rgb.txt \
16187                 /usr/X11/share/X11/rgb.txt \
16188                 /usr/X11/lib/X11/rgb.txt \
16189                 /usr/lib/X11/rgb.txt \
16190                 /etc/X11/rgb.txt \
16191                 /usr/pkg/lib/X11/rgb.txt \
16192                 /usr/X11R7/lib/X11/rgb.txt \
16193                 /usr/X11R6/lib/X11/rgb.txt \
16194                 /usr/X11R5/lib/X11/rgb.txt \
16195                 /usr/X11R4/lib/X11/rgb.txt \
16196                 /usr/local/lib/X11/rgb.txt \
16197                 /usr/local/share/X11/rgb.txt \
16198                 /usr/lib64/X11/rgb.txt
16199         do
16200                 if test -f "$cf_path" ; then
16201                         RGB_PATH="$cf_path"
16202                         break
16203                 fi
16204         done
16205 else
16206         cf_path=$RGB_PATH
16207
16208 if test "x$prefix" != xNONE; then
16209         cf_path_syntax="$prefix"
16210 else
16211         cf_path_syntax="$ac_default_prefix"
16212 fi
16213
16214 case ".$cf_path" in
16215 (.\$\(*\)*|.\'*\'*)
16216         ;;
16217 (..|./*|.\\*)
16218         ;;
16219 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16220         ;;
16221 (.\$\{*prefix\}*|.\$\{*dir\}*)
16222         eval cf_path="$cf_path"
16223         case ".$cf_path" in
16224         (.NONE/*)
16225                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16226                 ;;
16227         esac
16228         ;;
16229 (.no|.NONE/*)
16230         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16231         ;;
16232 (*)
16233         { { echo "$as_me:16233: error: expected a pathname, not \"$cf_path\"" >&5
16234 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16235    { (exit 1); exit 1; }; }
16236         ;;
16237 esac
16238
16239 fi
16240
16241 echo "$as_me:16241: result: $RGB_PATH" >&5
16242 echo "${ECHO_T}$RGB_PATH" >&6
16243
16244 cat >>confdefs.h <<EOF
16245 #define RGB_PATH "$cf_path"
16246 EOF
16247
16248 no_x11_rgb=
16249 if test "$RGB_PATH" = no
16250 then
16251         no_x11_rgb="#"
16252 fi
16253
16254 cf_curses_headers=
16255
16256 case $cf_cv_screen in
16257 (pdcurses)
16258         cf_default_panel=no
16259         cf_default_form=no
16260         cf_default_menu=no
16261         cf_default_tinfo=no
16262         ;;
16263 (xcurses|bsdcurses)
16264         cf_default_panel=no
16265         cf_default_form=no
16266         cf_default_menu=no
16267         cf_default_tinfo=yes
16268         ;;
16269 (*)
16270         cf_default_panel=yes
16271         cf_default_form=yes
16272         cf_default_menu=yes
16273         cf_default_tinfo=yes
16274         case $cf_cv_screen in
16275         (ncurses*)
16276                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16277                 ;;
16278         esac
16279         ;;
16280 esac
16281
16282 echo "$as_me:16282: checking for desired basename for form library" >&5
16283 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16284
16285 # Check whether --with-form-libname or --without-form-libname was given.
16286 if test "${with_form_libname+set}" = set; then
16287   withval="$with_form_libname"
16288   with_lib_basename=$withval
16289 else
16290   with_lib_basename=form
16291 fi;
16292 FORM_NAME="$with_lib_basename"
16293
16294 case "x$FORM_NAME" in
16295 (x|xno|xnone|xyes)
16296         FORM_NAME=form
16297         ;;
16298 (*)
16299         ;;
16300 esac
16301
16302 echo "$as_me:16302: result: $FORM_NAME" >&5
16303 echo "${ECHO_T}$FORM_NAME" >&6
16304
16305 echo "$as_me:16305: checking for desired basename for menu library" >&5
16306 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16307
16308 # Check whether --with-menu-libname or --without-menu-libname was given.
16309 if test "${with_menu_libname+set}" = set; then
16310   withval="$with_menu_libname"
16311   with_lib_basename=$withval
16312 else
16313   with_lib_basename=menu
16314 fi;
16315 MENU_NAME="$with_lib_basename"
16316
16317 case "x$MENU_NAME" in
16318 (x|xno|xnone|xyes)
16319         MENU_NAME=menu
16320         ;;
16321 (*)
16322         ;;
16323 esac
16324
16325 echo "$as_me:16325: result: $MENU_NAME" >&5
16326 echo "${ECHO_T}$MENU_NAME" >&6
16327
16328 echo "$as_me:16328: checking for desired basename for panel library" >&5
16329 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16330
16331 # Check whether --with-panel-libname or --without-panel-libname was given.
16332 if test "${with_panel_libname+set}" = set; then
16333   withval="$with_panel_libname"
16334   with_lib_basename=$withval
16335 else
16336   with_lib_basename=panel
16337 fi;
16338 PANEL_NAME="$with_lib_basename"
16339
16340 case "x$PANEL_NAME" in
16341 (x|xno|xnone|xyes)
16342         PANEL_NAME=panel
16343         ;;
16344 (*)
16345         ;;
16346 esac
16347
16348 echo "$as_me:16348: result: $PANEL_NAME" >&5
16349 echo "${ECHO_T}$PANEL_NAME" >&6
16350
16351 echo "$as_me:16351: checking if you want to check for panel functions" >&5
16352 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16353
16354 # Check whether --enable-panel or --disable-panel was given.
16355 if test "${enable_panel+set}" = set; then
16356   enableval="$enable_panel"
16357   test "$enableval" != no && enableval=yes
16358         if test "$enableval" != "yes" ; then
16359     cf_enable_panel=no
16360         else
16361                 cf_enable_panel=$cf_default_panel
16362         fi
16363 else
16364   enableval=yes
16365         cf_enable_panel=$cf_default_panel
16366
16367 fi;
16368 echo "$as_me:16368: result: $cf_enable_panel" >&5
16369 echo "${ECHO_T}$cf_enable_panel" >&6
16370 if test $cf_enable_panel = yes
16371 then
16372
16373 cf_have_curses_lib=no
16374
16375 : ${NCURSES_CONFIG_PKG:=none}
16376 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16377         :
16378 elif test "x${PKG_CONFIG:=none}" != xnone; then
16379         echo "$as_me:16379: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16380 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16381         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16382                 echo "$as_me:16382: result: yes" >&5
16383 echo "${ECHO_T}yes" >&6
16384
16385                 echo "$as_me:16385: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16386 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16387
16388                 cf_save_CPPFLAGS="$CPPFLAGS"
16389                 cf_save_LIBS="$LIBS"
16390
16391 cf_fix_cppflags=no
16392 cf_new_cflags=
16393 cf_new_cppflags=
16394 cf_new_extra_cppflags=
16395
16396 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16397 do
16398 case "$cf_fix_cppflags" in
16399 (no)
16400         case "$cf_add_cflags" in
16401         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16402                 case "$cf_add_cflags" in
16403                 (-D*)
16404                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16405
16406                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16407                                 && test -z "${cf_tst_cflags}" \
16408                                 && cf_fix_cppflags=yes
16409
16410                         if test "$cf_fix_cppflags" = yes ; then
16411
16412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16414
16415                                 continue
16416                         elif test "${cf_tst_cflags}" = "\"'" ; then
16417
16418         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16419         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16420
16421                                 continue
16422                         fi
16423                         ;;
16424                 esac
16425                 case "$CPPFLAGS" in
16426                 (*$cf_add_cflags)
16427                         ;;
16428                 (*)
16429                         case "$cf_add_cflags" in
16430                         (-D*)
16431                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16432
16433 CPPFLAGS=`echo "$CPPFLAGS" | \
16434         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16435                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16436
16437                                 ;;
16438                         esac
16439
16440         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16441         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16442
16443                         ;;
16444                 esac
16445                 ;;
16446         (*)
16447
16448         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16449         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16450
16451                 ;;
16452         esac
16453         ;;
16454 (yes)
16455
16456         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16457         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16458
16459         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16460
16461         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16462                 && test -z "${cf_tst_cflags}" \
16463                 && cf_fix_cppflags=no
16464         ;;
16465 esac
16466 done
16467
16468 if test -n "$cf_new_cflags" ; then
16469
16470         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16471         CFLAGS="${CFLAGS}$cf_new_cflags"
16472
16473 fi
16474
16475 if test -n "$cf_new_cppflags" ; then
16476
16477         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16478         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16479
16480 fi
16481
16482 if test -n "$cf_new_extra_cppflags" ; then
16483
16484         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16485         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16486
16487 fi
16488
16489 cf_add_libs="$LIBS"
16490 # reverse order
16491 cf_add_0lib=
16492 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16493 # filter duplicates
16494 for cf_add_1lib in $cf_add_0lib; do
16495         for cf_add_2lib in $cf_add_libs; do
16496                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16497                         cf_add_1lib=
16498                         break
16499                 fi
16500         done
16501         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16502 done
16503 LIBS="$cf_add_libs"
16504
16505                 cat >"conftest.$ac_ext" <<_ACEOF
16506 #line 16506 "configure"
16507 #include "confdefs.h"
16508 #include <$PANEL_NAME.h>
16509 int
16510 main (void)
16511 {
16512 (void) new_panel ( 0 );
16513   ;
16514   return 0;
16515 }
16516 _ACEOF
16517 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16518 if { (eval echo "$as_me:16518: \"$ac_link\"") >&5
16519   (eval $ac_link) 2>&5
16520   ac_status=$?
16521   echo "$as_me:16521: \$? = $ac_status" >&5
16522   (exit "$ac_status"); } &&
16523          { ac_try='test -s "conftest$ac_exeext"'
16524   { (eval echo "$as_me:16524: \"$ac_try\"") >&5
16525   (eval $ac_try) 2>&5
16526   ac_status=$?
16527   echo "$as_me:16527: \$? = $ac_status" >&5
16528   (exit "$ac_status"); }; }; then
16529   if test "$cross_compiling" = yes; then
16530   cf_have_curses_lib=maybe
16531 else
16532   cat >"conftest.$ac_ext" <<_ACEOF
16533 #line 16533 "configure"
16534 #include "confdefs.h"
16535 #include <$PANEL_NAME.h>
16536                                 int main(void)
16537                                 { (void) new_panel ( 0 ); return 0; }
16538 _ACEOF
16539 rm -f "conftest$ac_exeext"
16540 if { (eval echo "$as_me:16540: \"$ac_link\"") >&5
16541   (eval $ac_link) 2>&5
16542   ac_status=$?
16543   echo "$as_me:16543: \$? = $ac_status" >&5
16544   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16545   { (eval echo "$as_me:16545: \"$ac_try\"") >&5
16546   (eval $ac_try) 2>&5
16547   ac_status=$?
16548   echo "$as_me:16548: \$? = $ac_status" >&5
16549   (exit "$ac_status"); }; }; then
16550   cf_have_curses_lib=yes
16551 else
16552   echo "$as_me: program exited with status $ac_status" >&5
16553 echo "$as_me: failed program was:" >&5
16554 cat "conftest.$ac_ext" >&5
16555 cf_have_curses_lib=no
16556 fi
16557 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16558 fi
16559 else
16560   echo "$as_me: failed program was:" >&5
16561 cat "conftest.$ac_ext" >&5
16562 cf_have_curses_lib=no
16563 fi
16564 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16565                 echo "$as_me:16565: result: $cf_have_curses_lib" >&5
16566 echo "${ECHO_T}$cf_have_curses_lib" >&6
16567                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16568                 if test "$cf_have_curses_lib" != "yes"
16569                 then
16570                         CPPFLAGS="$cf_save_CPPFLAGS"
16571                         LIBS="$cf_save_LIBS"
16572                 else
16573
16574 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16575
16576                         cat >>confdefs.h <<EOF
16577 #define $cf_upper 1
16578 EOF
16579
16580                 fi
16581         fi
16582 fi
16583 if test "$cf_have_curses_lib" = no; then
16584         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16585 echo "$as_me:16585: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16586 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16587 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16588   echo $ECHO_N "(cached) $ECHO_C" >&6
16589 else
16590   ac_check_lib_save_LIBS=$LIBS
16591 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16592 cat >"conftest.$ac_ext" <<_ACEOF
16593 #line 16593 "configure"
16594 #include "confdefs.h"
16595
16596 /* Override any gcc2 internal prototype to avoid an error.  */
16597 #ifdef __cplusplus
16598 extern "C"
16599 #endif
16600 /* We use char because int might match the return type of a gcc2
16601    builtin and then its argument prototype would still apply.  */
16602 char new_panel ();
16603 int
16604 main (void)
16605 {
16606 new_panel ();
16607   ;
16608   return 0;
16609 }
16610 _ACEOF
16611 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16612 if { (eval echo "$as_me:16612: \"$ac_link\"") >&5
16613   (eval $ac_link) 2>&5
16614   ac_status=$?
16615   echo "$as_me:16615: \$? = $ac_status" >&5
16616   (exit "$ac_status"); } &&
16617          { ac_try='test -s "conftest$ac_exeext"'
16618   { (eval echo "$as_me:16618: \"$ac_try\"") >&5
16619   (eval $ac_try) 2>&5
16620   ac_status=$?
16621   echo "$as_me:16621: \$? = $ac_status" >&5
16622   (exit "$ac_status"); }; }; then
16623   eval "$as_ac_Lib=yes"
16624 else
16625   echo "$as_me: failed program was:" >&5
16626 cat "conftest.$ac_ext" >&5
16627 eval "$as_ac_Lib=no"
16628 fi
16629 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16630 LIBS=$ac_check_lib_save_LIBS
16631 fi
16632 echo "$as_me:16632: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16633 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16634 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16635
16636 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16637
16638 cf_add_libs="$LIBS"
16639 # reverse order
16640 cf_add_0lib=
16641 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16642 # filter duplicates
16643 for cf_add_1lib in $cf_add_0lib; do
16644         for cf_add_2lib in $cf_add_libs; do
16645                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16646                         cf_add_1lib=
16647                         break
16648                 fi
16649         done
16650         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16651 done
16652 LIBS="$cf_add_libs"
16653
16654                 cat >>confdefs.h <<EOF
16655 #define $cf_upper 1
16656 EOF
16657
16658 fi
16659
16660 fi
16661
16662         cf_curses_headers="$cf_curses_headers panel.h"
16663 fi
16664
16665 echo "$as_me:16665: checking if you want to check for menu functions" >&5
16666 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16667
16668 # Check whether --enable-menu or --disable-menu was given.
16669 if test "${enable_menu+set}" = set; then
16670   enableval="$enable_menu"
16671   test "$enableval" != no && enableval=yes
16672         if test "$enableval" != "yes" ; then
16673     cf_enable_menu=no
16674         else
16675                 cf_enable_menu=$cf_default_menu
16676         fi
16677 else
16678   enableval=yes
16679         cf_enable_menu=$cf_default_menu
16680
16681 fi;
16682 echo "$as_me:16682: result: $cf_enable_menu" >&5
16683 echo "${ECHO_T}$cf_enable_menu" >&6
16684 if test $cf_enable_menu = yes
16685 then
16686         case $cf_cv_screen in
16687         (ncurses*)
16688                 ;;
16689         (curses*)
16690
16691 echo "$as_me:16691: checking for NetBSD menu.h" >&5
16692 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16693 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16694   echo $ECHO_N "(cached) $ECHO_C" >&6
16695 else
16696
16697 cat >"conftest.$ac_ext" <<_ACEOF
16698 #line 16698 "configure"
16699 #include "confdefs.h"
16700
16701 #include <${cf_cv_ncurses_header:-curses.h}>
16702 #include <menu.h>
16703
16704 int
16705 main (void)
16706 {
16707
16708         MENU *menu;
16709         int y = menu->max_item_width;
16710
16711   ;
16712   return 0;
16713 }
16714 _ACEOF
16715 rm -f "conftest.$ac_objext"
16716 if { (eval echo "$as_me:16716: \"$ac_compile\"") >&5
16717   (eval $ac_compile) 2>&5
16718   ac_status=$?
16719   echo "$as_me:16719: \$? = $ac_status" >&5
16720   (exit "$ac_status"); } &&
16721          { ac_try='test -s "conftest.$ac_objext"'
16722   { (eval echo "$as_me:16722: \"$ac_try\"") >&5
16723   (eval $ac_try) 2>&5
16724   ac_status=$?
16725   echo "$as_me:16725: \$? = $ac_status" >&5
16726   (exit "$ac_status"); }; }; then
16727   cf_cv_netbsd_menu_h=yes
16728
16729 else
16730   echo "$as_me: failed program was:" >&5
16731 cat "conftest.$ac_ext" >&5
16732 cf_cv_netbsd_menu_h=no
16733 fi
16734 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16735
16736 fi
16737 echo "$as_me:16737: result: $cf_cv_netbsd_menu_h" >&5
16738 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16739
16740 test "$cf_cv_netbsd_menu_h" = yes &&
16741 cat >>confdefs.h <<\EOF
16742 #define HAVE_NETBSD_MENU_H 1
16743 EOF
16744
16745                 ;;
16746         esac
16747
16748 cf_have_curses_lib=no
16749
16750 : ${NCURSES_CONFIG_PKG:=none}
16751 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16752         :
16753 elif test "x${PKG_CONFIG:=none}" != xnone; then
16754         echo "$as_me:16754: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16755 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16756         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
16757                 echo "$as_me:16757: result: yes" >&5
16758 echo "${ECHO_T}yes" >&6
16759
16760                 echo "$as_me:16760: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16761 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16762
16763                 cf_save_CPPFLAGS="$CPPFLAGS"
16764                 cf_save_LIBS="$LIBS"
16765
16766 cf_fix_cppflags=no
16767 cf_new_cflags=
16768 cf_new_cppflags=
16769 cf_new_extra_cppflags=
16770
16771 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
16772 do
16773 case "$cf_fix_cppflags" in
16774 (no)
16775         case "$cf_add_cflags" in
16776         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16777                 case "$cf_add_cflags" in
16778                 (-D*)
16779                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16780
16781                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16782                                 && test -z "${cf_tst_cflags}" \
16783                                 && cf_fix_cppflags=yes
16784
16785                         if test "$cf_fix_cppflags" = yes ; then
16786
16787         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16788         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16789
16790                                 continue
16791                         elif test "${cf_tst_cflags}" = "\"'" ; then
16792
16793         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16794         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16795
16796                                 continue
16797                         fi
16798                         ;;
16799                 esac
16800                 case "$CPPFLAGS" in
16801                 (*$cf_add_cflags)
16802                         ;;
16803                 (*)
16804                         case "$cf_add_cflags" in
16805                         (-D*)
16806                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16807
16808 CPPFLAGS=`echo "$CPPFLAGS" | \
16809         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16810                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16811
16812                                 ;;
16813                         esac
16814
16815         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16816         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16817
16818                         ;;
16819                 esac
16820                 ;;
16821         (*)
16822
16823         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16824         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16825
16826                 ;;
16827         esac
16828         ;;
16829 (yes)
16830
16831         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16832         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16833
16834         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16835
16836         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16837                 && test -z "${cf_tst_cflags}" \
16838                 && cf_fix_cppflags=no
16839         ;;
16840 esac
16841 done
16842
16843 if test -n "$cf_new_cflags" ; then
16844
16845         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16846         CFLAGS="${CFLAGS}$cf_new_cflags"
16847
16848 fi
16849
16850 if test -n "$cf_new_cppflags" ; then
16851
16852         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16853         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16854
16855 fi
16856
16857 if test -n "$cf_new_extra_cppflags" ; then
16858
16859         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16860         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16861
16862 fi
16863
16864 cf_add_libs="$LIBS"
16865 # reverse order
16866 cf_add_0lib=
16867 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16868 # filter duplicates
16869 for cf_add_1lib in $cf_add_0lib; do
16870         for cf_add_2lib in $cf_add_libs; do
16871                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16872                         cf_add_1lib=
16873                         break
16874                 fi
16875         done
16876         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16877 done
16878 LIBS="$cf_add_libs"
16879
16880                 cat >"conftest.$ac_ext" <<_ACEOF
16881 #line 16881 "configure"
16882 #include "confdefs.h"
16883 #include <$MENU_NAME.h>
16884 int
16885 main (void)
16886 {
16887 (void) menu_driver ( 0,0 );
16888   ;
16889   return 0;
16890 }
16891 _ACEOF
16892 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16893 if { (eval echo "$as_me:16893: \"$ac_link\"") >&5
16894   (eval $ac_link) 2>&5
16895   ac_status=$?
16896   echo "$as_me:16896: \$? = $ac_status" >&5
16897   (exit "$ac_status"); } &&
16898          { ac_try='test -s "conftest$ac_exeext"'
16899   { (eval echo "$as_me:16899: \"$ac_try\"") >&5
16900   (eval $ac_try) 2>&5
16901   ac_status=$?
16902   echo "$as_me:16902: \$? = $ac_status" >&5
16903   (exit "$ac_status"); }; }; then
16904   if test "$cross_compiling" = yes; then
16905   cf_have_curses_lib=maybe
16906 else
16907   cat >"conftest.$ac_ext" <<_ACEOF
16908 #line 16908 "configure"
16909 #include "confdefs.h"
16910 #include <$MENU_NAME.h>
16911                                 int main(void)
16912                                 { (void) menu_driver ( 0,0 ); return 0; }
16913 _ACEOF
16914 rm -f "conftest$ac_exeext"
16915 if { (eval echo "$as_me:16915: \"$ac_link\"") >&5
16916   (eval $ac_link) 2>&5
16917   ac_status=$?
16918   echo "$as_me:16918: \$? = $ac_status" >&5
16919   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16920   { (eval echo "$as_me:16920: \"$ac_try\"") >&5
16921   (eval $ac_try) 2>&5
16922   ac_status=$?
16923   echo "$as_me:16923: \$? = $ac_status" >&5
16924   (exit "$ac_status"); }; }; then
16925   cf_have_curses_lib=yes
16926 else
16927   echo "$as_me: program exited with status $ac_status" >&5
16928 echo "$as_me: failed program was:" >&5
16929 cat "conftest.$ac_ext" >&5
16930 cf_have_curses_lib=no
16931 fi
16932 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16933 fi
16934 else
16935   echo "$as_me: failed program was:" >&5
16936 cat "conftest.$ac_ext" >&5
16937 cf_have_curses_lib=no
16938 fi
16939 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16940                 echo "$as_me:16940: result: $cf_have_curses_lib" >&5
16941 echo "${ECHO_T}$cf_have_curses_lib" >&6
16942                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16943                 if test "$cf_have_curses_lib" != "yes"
16944                 then
16945                         CPPFLAGS="$cf_save_CPPFLAGS"
16946                         LIBS="$cf_save_LIBS"
16947                 else
16948
16949 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16950
16951                         cat >>confdefs.h <<EOF
16952 #define $cf_upper 1
16953 EOF
16954
16955                 fi
16956         fi
16957 fi
16958 if test "$cf_have_curses_lib" = no; then
16959         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16960 echo "$as_me:16960: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
16961 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16962 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16963   echo $ECHO_N "(cached) $ECHO_C" >&6
16964 else
16965   ac_check_lib_save_LIBS=$LIBS
16966 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
16967 cat >"conftest.$ac_ext" <<_ACEOF
16968 #line 16968 "configure"
16969 #include "confdefs.h"
16970
16971 /* Override any gcc2 internal prototype to avoid an error.  */
16972 #ifdef __cplusplus
16973 extern "C"
16974 #endif
16975 /* We use char because int might match the return type of a gcc2
16976    builtin and then its argument prototype would still apply.  */
16977 char menu_driver ();
16978 int
16979 main (void)
16980 {
16981 menu_driver ();
16982   ;
16983   return 0;
16984 }
16985 _ACEOF
16986 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16987 if { (eval echo "$as_me:16987: \"$ac_link\"") >&5
16988   (eval $ac_link) 2>&5
16989   ac_status=$?
16990   echo "$as_me:16990: \$? = $ac_status" >&5
16991   (exit "$ac_status"); } &&
16992          { ac_try='test -s "conftest$ac_exeext"'
16993   { (eval echo "$as_me:16993: \"$ac_try\"") >&5
16994   (eval $ac_try) 2>&5
16995   ac_status=$?
16996   echo "$as_me:16996: \$? = $ac_status" >&5
16997   (exit "$ac_status"); }; }; then
16998   eval "$as_ac_Lib=yes"
16999 else
17000   echo "$as_me: failed program was:" >&5
17001 cat "conftest.$ac_ext" >&5
17002 eval "$as_ac_Lib=no"
17003 fi
17004 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17005 LIBS=$ac_check_lib_save_LIBS
17006 fi
17007 echo "$as_me:17007: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17008 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17009 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17010
17011 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17012
17013 cf_add_libs="$LIBS"
17014 # reverse order
17015 cf_add_0lib=
17016 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17017 # filter duplicates
17018 for cf_add_1lib in $cf_add_0lib; do
17019         for cf_add_2lib in $cf_add_libs; do
17020                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17021                         cf_add_1lib=
17022                         break
17023                 fi
17024         done
17025         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17026 done
17027 LIBS="$cf_add_libs"
17028
17029                 cat >>confdefs.h <<EOF
17030 #define $cf_upper 1
17031 EOF
17032
17033 fi
17034
17035 fi
17036
17037         cf_curses_headers="$cf_curses_headers menu.h"
17038 fi
17039
17040 echo "$as_me:17040: checking if you want to check for form functions" >&5
17041 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17042
17043 # Check whether --enable-form or --disable-form was given.
17044 if test "${enable_form+set}" = set; then
17045   enableval="$enable_form"
17046   test "$enableval" != no && enableval=yes
17047         if test "$enableval" != "yes" ; then
17048     cf_enable_form=no
17049         else
17050                 cf_enable_form=$cf_default_form
17051         fi
17052 else
17053   enableval=yes
17054         cf_enable_form=$cf_default_form
17055
17056 fi;
17057 echo "$as_me:17057: result: $cf_enable_form" >&5
17058 echo "${ECHO_T}$cf_enable_form" >&6
17059 if test $cf_enable_form = yes
17060 then
17061         case $cf_cv_screen in
17062         (ncurses*)
17063                 ;;
17064         (curses*)
17065
17066 echo "$as_me:17066: checking for NetBSD form.h" >&5
17067 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17068 if test "${cf_cv_netbsd_form_h+set}" = set; then
17069   echo $ECHO_N "(cached) $ECHO_C" >&6
17070 else
17071
17072 cat >"conftest.$ac_ext" <<_ACEOF
17073 #line 17073 "configure"
17074 #include "confdefs.h"
17075
17076 #include <${cf_cv_ncurses_header:-curses.h}>
17077 #include <form.h>
17078
17079 int
17080 main (void)
17081 {
17082
17083         FORM *form;
17084         int y = current_field(form)->cursor_ypos;
17085         int x = current_field(form)->cursor_xpos;
17086
17087   ;
17088   return 0;
17089 }
17090 _ACEOF
17091 rm -f "conftest.$ac_objext"
17092 if { (eval echo "$as_me:17092: \"$ac_compile\"") >&5
17093   (eval $ac_compile) 2>&5
17094   ac_status=$?
17095   echo "$as_me:17095: \$? = $ac_status" >&5
17096   (exit "$ac_status"); } &&
17097          { ac_try='test -s "conftest.$ac_objext"'
17098   { (eval echo "$as_me:17098: \"$ac_try\"") >&5
17099   (eval $ac_try) 2>&5
17100   ac_status=$?
17101   echo "$as_me:17101: \$? = $ac_status" >&5
17102   (exit "$ac_status"); }; }; then
17103   cf_cv_netbsd_form_h=yes
17104
17105 else
17106   echo "$as_me: failed program was:" >&5
17107 cat "conftest.$ac_ext" >&5
17108 cf_cv_netbsd_form_h=no
17109 fi
17110 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17111
17112 fi
17113 echo "$as_me:17113: result: $cf_cv_netbsd_form_h" >&5
17114 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17115
17116 test "$cf_cv_netbsd_form_h" = yes &&
17117 cat >>confdefs.h <<\EOF
17118 #define HAVE_NETBSD_FORM_H 1
17119 EOF
17120
17121                 ;;
17122         esac
17123
17124 cf_have_curses_lib=no
17125
17126 : ${NCURSES_CONFIG_PKG:=none}
17127 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17128         :
17129 elif test "x${PKG_CONFIG:=none}" != xnone; then
17130         echo "$as_me:17130: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17131 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17132         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17133                 echo "$as_me:17133: result: yes" >&5
17134 echo "${ECHO_T}yes" >&6
17135
17136                 echo "$as_me:17136: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17137 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17138
17139                 cf_save_CPPFLAGS="$CPPFLAGS"
17140                 cf_save_LIBS="$LIBS"
17141
17142 cf_fix_cppflags=no
17143 cf_new_cflags=
17144 cf_new_cppflags=
17145 cf_new_extra_cppflags=
17146
17147 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17148 do
17149 case "$cf_fix_cppflags" in
17150 (no)
17151         case "$cf_add_cflags" in
17152         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17153                 case "$cf_add_cflags" in
17154                 (-D*)
17155                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17156
17157                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17158                                 && test -z "${cf_tst_cflags}" \
17159                                 && cf_fix_cppflags=yes
17160
17161                         if test "$cf_fix_cppflags" = yes ; then
17162
17163         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17164         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17165
17166                                 continue
17167                         elif test "${cf_tst_cflags}" = "\"'" ; then
17168
17169         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17170         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17171
17172                                 continue
17173                         fi
17174                         ;;
17175                 esac
17176                 case "$CPPFLAGS" in
17177                 (*$cf_add_cflags)
17178                         ;;
17179                 (*)
17180                         case "$cf_add_cflags" in
17181                         (-D*)
17182                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17183
17184 CPPFLAGS=`echo "$CPPFLAGS" | \
17185         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17186                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17187
17188                                 ;;
17189                         esac
17190
17191         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17192         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17193
17194                         ;;
17195                 esac
17196                 ;;
17197         (*)
17198
17199         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17200         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17201
17202                 ;;
17203         esac
17204         ;;
17205 (yes)
17206
17207         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17208         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17209
17210         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17211
17212         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17213                 && test -z "${cf_tst_cflags}" \
17214                 && cf_fix_cppflags=no
17215         ;;
17216 esac
17217 done
17218
17219 if test -n "$cf_new_cflags" ; then
17220
17221         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17222         CFLAGS="${CFLAGS}$cf_new_cflags"
17223
17224 fi
17225
17226 if test -n "$cf_new_cppflags" ; then
17227
17228         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17229         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17230
17231 fi
17232
17233 if test -n "$cf_new_extra_cppflags" ; then
17234
17235         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17236         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17237
17238 fi
17239
17240 cf_add_libs="$LIBS"
17241 # reverse order
17242 cf_add_0lib=
17243 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17244 # filter duplicates
17245 for cf_add_1lib in $cf_add_0lib; do
17246         for cf_add_2lib in $cf_add_libs; do
17247                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17248                         cf_add_1lib=
17249                         break
17250                 fi
17251         done
17252         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17253 done
17254 LIBS="$cf_add_libs"
17255
17256                 cat >"conftest.$ac_ext" <<_ACEOF
17257 #line 17257 "configure"
17258 #include "confdefs.h"
17259 #include <$FORM_NAME.h>
17260 int
17261 main (void)
17262 {
17263 (void) form_driver ( 0,0 );
17264   ;
17265   return 0;
17266 }
17267 _ACEOF
17268 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17269 if { (eval echo "$as_me:17269: \"$ac_link\"") >&5
17270   (eval $ac_link) 2>&5
17271   ac_status=$?
17272   echo "$as_me:17272: \$? = $ac_status" >&5
17273   (exit "$ac_status"); } &&
17274          { ac_try='test -s "conftest$ac_exeext"'
17275   { (eval echo "$as_me:17275: \"$ac_try\"") >&5
17276   (eval $ac_try) 2>&5
17277   ac_status=$?
17278   echo "$as_me:17278: \$? = $ac_status" >&5
17279   (exit "$ac_status"); }; }; then
17280   if test "$cross_compiling" = yes; then
17281   cf_have_curses_lib=maybe
17282 else
17283   cat >"conftest.$ac_ext" <<_ACEOF
17284 #line 17284 "configure"
17285 #include "confdefs.h"
17286 #include <$FORM_NAME.h>
17287                                 int main(void)
17288                                 { (void) form_driver ( 0,0 ); return 0; }
17289 _ACEOF
17290 rm -f "conftest$ac_exeext"
17291 if { (eval echo "$as_me:17291: \"$ac_link\"") >&5
17292   (eval $ac_link) 2>&5
17293   ac_status=$?
17294   echo "$as_me:17294: \$? = $ac_status" >&5
17295   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17296   { (eval echo "$as_me:17296: \"$ac_try\"") >&5
17297   (eval $ac_try) 2>&5
17298   ac_status=$?
17299   echo "$as_me:17299: \$? = $ac_status" >&5
17300   (exit "$ac_status"); }; }; then
17301   cf_have_curses_lib=yes
17302 else
17303   echo "$as_me: program exited with status $ac_status" >&5
17304 echo "$as_me: failed program was:" >&5
17305 cat "conftest.$ac_ext" >&5
17306 cf_have_curses_lib=no
17307 fi
17308 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17309 fi
17310 else
17311   echo "$as_me: failed program was:" >&5
17312 cat "conftest.$ac_ext" >&5
17313 cf_have_curses_lib=no
17314 fi
17315 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17316                 echo "$as_me:17316: result: $cf_have_curses_lib" >&5
17317 echo "${ECHO_T}$cf_have_curses_lib" >&6
17318                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17319                 if test "$cf_have_curses_lib" != "yes"
17320                 then
17321                         CPPFLAGS="$cf_save_CPPFLAGS"
17322                         LIBS="$cf_save_LIBS"
17323                 else
17324
17325 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17326
17327                         cat >>confdefs.h <<EOF
17328 #define $cf_upper 1
17329 EOF
17330
17331                 fi
17332         fi
17333 fi
17334 if test "$cf_have_curses_lib" = no; then
17335         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17336 echo "$as_me:17336: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17337 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17338 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17339   echo $ECHO_N "(cached) $ECHO_C" >&6
17340 else
17341   ac_check_lib_save_LIBS=$LIBS
17342 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17343 cat >"conftest.$ac_ext" <<_ACEOF
17344 #line 17344 "configure"
17345 #include "confdefs.h"
17346
17347 /* Override any gcc2 internal prototype to avoid an error.  */
17348 #ifdef __cplusplus
17349 extern "C"
17350 #endif
17351 /* We use char because int might match the return type of a gcc2
17352    builtin and then its argument prototype would still apply.  */
17353 char form_driver ();
17354 int
17355 main (void)
17356 {
17357 form_driver ();
17358   ;
17359   return 0;
17360 }
17361 _ACEOF
17362 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17363 if { (eval echo "$as_me:17363: \"$ac_link\"") >&5
17364   (eval $ac_link) 2>&5
17365   ac_status=$?
17366   echo "$as_me:17366: \$? = $ac_status" >&5
17367   (exit "$ac_status"); } &&
17368          { ac_try='test -s "conftest$ac_exeext"'
17369   { (eval echo "$as_me:17369: \"$ac_try\"") >&5
17370   (eval $ac_try) 2>&5
17371   ac_status=$?
17372   echo "$as_me:17372: \$? = $ac_status" >&5
17373   (exit "$ac_status"); }; }; then
17374   eval "$as_ac_Lib=yes"
17375 else
17376   echo "$as_me: failed program was:" >&5
17377 cat "conftest.$ac_ext" >&5
17378 eval "$as_ac_Lib=no"
17379 fi
17380 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17381 LIBS=$ac_check_lib_save_LIBS
17382 fi
17383 echo "$as_me:17383: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17384 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17385 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17386
17387 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17388
17389 cf_add_libs="$LIBS"
17390 # reverse order
17391 cf_add_0lib=
17392 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17393 # filter duplicates
17394 for cf_add_1lib in $cf_add_0lib; do
17395         for cf_add_2lib in $cf_add_libs; do
17396                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17397                         cf_add_1lib=
17398                         break
17399                 fi
17400         done
17401         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17402 done
17403 LIBS="$cf_add_libs"
17404
17405                 cat >>confdefs.h <<EOF
17406 #define $cf_upper 1
17407 EOF
17408
17409 fi
17410
17411 fi
17412
17413         cf_curses_headers="$cf_curses_headers form.h"
17414 fi
17415
17416 # look for curses-related headers
17417
17418 for ac_header in $cf_curses_headers
17419 do
17420 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17421 echo "$as_me:17421: checking for $ac_header" >&5
17422 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17423 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17424   echo $ECHO_N "(cached) $ECHO_C" >&6
17425 else
17426   cat >"conftest.$ac_ext" <<_ACEOF
17427 #line 17427 "configure"
17428 #include "confdefs.h"
17429 #include <$ac_header>
17430 _ACEOF
17431 if { (eval echo "$as_me:17431: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17432   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17433   ac_status=$?
17434   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17435   rm -f conftest.er1
17436   cat conftest.err >&5
17437   echo "$as_me:17437: \$? = $ac_status" >&5
17438   (exit "$ac_status"); } >/dev/null; then
17439   if test -s conftest.err; then
17440     ac_cpp_err=$ac_c_preproc_warn_flag
17441   else
17442     ac_cpp_err=
17443   fi
17444 else
17445   ac_cpp_err=yes
17446 fi
17447 if test -z "$ac_cpp_err"; then
17448   eval "$as_ac_Header=yes"
17449 else
17450   echo "$as_me: failed program was:" >&5
17451   cat "conftest.$ac_ext" >&5
17452   eval "$as_ac_Header=no"
17453 fi
17454 rm -f conftest.err "conftest.$ac_ext"
17455 fi
17456 echo "$as_me:17456: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17457 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17458 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17459   cat >>confdefs.h <<EOF
17460 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17461 EOF
17462
17463 fi
17464 done
17465
17466 echo "$as_me:17466: checking for ANSI C header files" >&5
17467 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17468 if test "${ac_cv_header_stdc+set}" = set; then
17469   echo $ECHO_N "(cached) $ECHO_C" >&6
17470 else
17471   cat >"conftest.$ac_ext" <<_ACEOF
17472 #line 17472 "configure"
17473 #include "confdefs.h"
17474 #include <stdlib.h>
17475 #include <stdarg.h>
17476 #include <string.h>
17477 #include <float.h>
17478
17479 _ACEOF
17480 if { (eval echo "$as_me:17480: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17481   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17482   ac_status=$?
17483   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17484   rm -f conftest.er1
17485   cat conftest.err >&5
17486   echo "$as_me:17486: \$? = $ac_status" >&5
17487   (exit "$ac_status"); } >/dev/null; then
17488   if test -s conftest.err; then
17489     ac_cpp_err=$ac_c_preproc_warn_flag
17490   else
17491     ac_cpp_err=
17492   fi
17493 else
17494   ac_cpp_err=yes
17495 fi
17496 if test -z "$ac_cpp_err"; then
17497   ac_cv_header_stdc=yes
17498 else
17499   echo "$as_me: failed program was:" >&5
17500   cat "conftest.$ac_ext" >&5
17501   ac_cv_header_stdc=no
17502 fi
17503 rm -f conftest.err "conftest.$ac_ext"
17504
17505 if test $ac_cv_header_stdc = yes; then
17506   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17507   cat >"conftest.$ac_ext" <<_ACEOF
17508 #line 17508 "configure"
17509 #include "confdefs.h"
17510 #include <string.h>
17511
17512 _ACEOF
17513 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17514   $EGREP "memchr" >/dev/null 2>&1; then
17515   :
17516 else
17517   ac_cv_header_stdc=no
17518 fi
17519 rm -rf conftest*
17520
17521 fi
17522
17523 if test $ac_cv_header_stdc = yes; then
17524   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17525   cat >"conftest.$ac_ext" <<_ACEOF
17526 #line 17526 "configure"
17527 #include "confdefs.h"
17528 #include <stdlib.h>
17529
17530 _ACEOF
17531 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17532   $EGREP "free" >/dev/null 2>&1; then
17533   :
17534 else
17535   ac_cv_header_stdc=no
17536 fi
17537 rm -rf conftest*
17538
17539 fi
17540
17541 if test $ac_cv_header_stdc = yes; then
17542   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17543   if test "$cross_compiling" = yes; then
17544   :
17545 else
17546   cat >"conftest.$ac_ext" <<_ACEOF
17547 #line 17547 "configure"
17548 #include "confdefs.h"
17549 #include <ctype.h>
17550 #if ((' ' & 0x0FF) == 0x020)
17551 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17552 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17553 #else
17554 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17555                      || ('j' <= (c) && (c) <= 'r') \
17556                      || ('s' <= (c) && (c) <= 'z'))
17557 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17558 #endif
17559
17560 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17561 int
17562 main (void)
17563 {
17564   int i;
17565   for (i = 0; i < 256; i++)
17566     if (XOR (islower (i), ISLOWER (i))
17567         || toupper (i) != TOUPPER (i))
17568       $ac_main_return(2);
17569   $ac_main_return (0);
17570 }
17571 _ACEOF
17572 rm -f "conftest$ac_exeext"
17573 if { (eval echo "$as_me:17573: \"$ac_link\"") >&5
17574   (eval $ac_link) 2>&5
17575   ac_status=$?
17576   echo "$as_me:17576: \$? = $ac_status" >&5
17577   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17578   { (eval echo "$as_me:17578: \"$ac_try\"") >&5
17579   (eval $ac_try) 2>&5
17580   ac_status=$?
17581   echo "$as_me:17581: \$? = $ac_status" >&5
17582   (exit "$ac_status"); }; }; then
17583   :
17584 else
17585   echo "$as_me: program exited with status $ac_status" >&5
17586 echo "$as_me: failed program was:" >&5
17587 cat "conftest.$ac_ext" >&5
17588 ac_cv_header_stdc=no
17589 fi
17590 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17591 fi
17592 fi
17593 fi
17594 echo "$as_me:17594: result: $ac_cv_header_stdc" >&5
17595 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17596 if test $ac_cv_header_stdc = yes; then
17597
17598 cat >>confdefs.h <<\EOF
17599 #define STDC_HEADERS 1
17600 EOF
17601
17602 fi
17603
17604 echo "$as_me:17604: checking whether time.h and sys/time.h may both be included" >&5
17605 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17606 if test "${ac_cv_header_time+set}" = set; then
17607   echo $ECHO_N "(cached) $ECHO_C" >&6
17608 else
17609   cat >"conftest.$ac_ext" <<_ACEOF
17610 #line 17610 "configure"
17611 #include "confdefs.h"
17612 #include <sys/types.h>
17613 #include <sys/time.h>
17614 #include <time.h>
17615
17616 int
17617 main (void)
17618 {
17619 if ((struct tm *) 0)
17620 return 0;
17621   ;
17622   return 0;
17623 }
17624 _ACEOF
17625 rm -f "conftest.$ac_objext"
17626 if { (eval echo "$as_me:17626: \"$ac_compile\"") >&5
17627   (eval $ac_compile) 2>&5
17628   ac_status=$?
17629   echo "$as_me:17629: \$? = $ac_status" >&5
17630   (exit "$ac_status"); } &&
17631          { ac_try='test -s "conftest.$ac_objext"'
17632   { (eval echo "$as_me:17632: \"$ac_try\"") >&5
17633   (eval $ac_try) 2>&5
17634   ac_status=$?
17635   echo "$as_me:17635: \$? = $ac_status" >&5
17636   (exit "$ac_status"); }; }; then
17637   ac_cv_header_time=yes
17638 else
17639   echo "$as_me: failed program was:" >&5
17640 cat "conftest.$ac_ext" >&5
17641 ac_cv_header_time=no
17642 fi
17643 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17644 fi
17645 echo "$as_me:17645: result: $ac_cv_header_time" >&5
17646 echo "${ECHO_T}$ac_cv_header_time" >&6
17647 if test $ac_cv_header_time = yes; then
17648
17649 cat >>confdefs.h <<\EOF
17650 #define TIME_WITH_SYS_TIME 1
17651 EOF
17652
17653 fi
17654
17655 for ac_header in \
17656 getopt.h \
17657 locale.h \
17658 math.h \
17659 stdarg.h \
17660 stdint.h \
17661 sys/ioctl.h \
17662 sys/select.h \
17663 sys/time.h \
17664 termios.h \
17665 unistd.h \
17666
17667 do
17668 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17669 echo "$as_me:17669: checking for $ac_header" >&5
17670 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17671 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17672   echo $ECHO_N "(cached) $ECHO_C" >&6
17673 else
17674   cat >"conftest.$ac_ext" <<_ACEOF
17675 #line 17675 "configure"
17676 #include "confdefs.h"
17677 #include <$ac_header>
17678 _ACEOF
17679 if { (eval echo "$as_me:17679: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17680   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17681   ac_status=$?
17682   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17683   rm -f conftest.er1
17684   cat conftest.err >&5
17685   echo "$as_me:17685: \$? = $ac_status" >&5
17686   (exit "$ac_status"); } >/dev/null; then
17687   if test -s conftest.err; then
17688     ac_cpp_err=$ac_c_preproc_warn_flag
17689   else
17690     ac_cpp_err=
17691   fi
17692 else
17693   ac_cpp_err=yes
17694 fi
17695 if test -z "$ac_cpp_err"; then
17696   eval "$as_ac_Header=yes"
17697 else
17698   echo "$as_me: failed program was:" >&5
17699   cat "conftest.$ac_ext" >&5
17700   eval "$as_ac_Header=no"
17701 fi
17702 rm -f conftest.err "conftest.$ac_ext"
17703 fi
17704 echo "$as_me:17704: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17705 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17706 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17707   cat >>confdefs.h <<EOF
17708 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17709 EOF
17710
17711 fi
17712 done
17713
17714 for ac_header in unistd.h getopt.h
17715 do
17716 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17717 echo "$as_me:17717: checking for $ac_header" >&5
17718 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17719 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17720   echo $ECHO_N "(cached) $ECHO_C" >&6
17721 else
17722   cat >"conftest.$ac_ext" <<_ACEOF
17723 #line 17723 "configure"
17724 #include "confdefs.h"
17725 #include <$ac_header>
17726 _ACEOF
17727 if { (eval echo "$as_me:17727: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17728   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17729   ac_status=$?
17730   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17731   rm -f conftest.er1
17732   cat conftest.err >&5
17733   echo "$as_me:17733: \$? = $ac_status" >&5
17734   (exit "$ac_status"); } >/dev/null; then
17735   if test -s conftest.err; then
17736     ac_cpp_err=$ac_c_preproc_warn_flag
17737   else
17738     ac_cpp_err=
17739   fi
17740 else
17741   ac_cpp_err=yes
17742 fi
17743 if test -z "$ac_cpp_err"; then
17744   eval "$as_ac_Header=yes"
17745 else
17746   echo "$as_me: failed program was:" >&5
17747   cat "conftest.$ac_ext" >&5
17748   eval "$as_ac_Header=no"
17749 fi
17750 rm -f conftest.err "conftest.$ac_ext"
17751 fi
17752 echo "$as_me:17752: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17753 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17754 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17755   cat >>confdefs.h <<EOF
17756 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17757 EOF
17758
17759 fi
17760 done
17761
17762 echo "$as_me:17762: checking for header declaring getopt variables" >&5
17763 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17764 if test "${cf_cv_getopt_header+set}" = set; then
17765   echo $ECHO_N "(cached) $ECHO_C" >&6
17766 else
17767
17768 cf_cv_getopt_header=none
17769 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17770 do
17771 cat >"conftest.$ac_ext" <<_ACEOF
17772 #line 17772 "configure"
17773 #include "confdefs.h"
17774
17775 #include <$cf_header>
17776 int
17777 main (void)
17778 {
17779 int x = optind; char *y = optarg
17780   ;
17781   return 0;
17782 }
17783 _ACEOF
17784 rm -f "conftest.$ac_objext"
17785 if { (eval echo "$as_me:17785: \"$ac_compile\"") >&5
17786   (eval $ac_compile) 2>&5
17787   ac_status=$?
17788   echo "$as_me:17788: \$? = $ac_status" >&5
17789   (exit "$ac_status"); } &&
17790          { ac_try='test -s "conftest.$ac_objext"'
17791   { (eval echo "$as_me:17791: \"$ac_try\"") >&5
17792   (eval $ac_try) 2>&5
17793   ac_status=$?
17794   echo "$as_me:17794: \$? = $ac_status" >&5
17795   (exit "$ac_status"); }; }; then
17796   cf_cv_getopt_header=$cf_header
17797  break
17798 else
17799   echo "$as_me: failed program was:" >&5
17800 cat "conftest.$ac_ext" >&5
17801 fi
17802 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17803 done
17804
17805 fi
17806 echo "$as_me:17806: result: $cf_cv_getopt_header" >&5
17807 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17808 if test "$cf_cv_getopt_header" != none ; then
17809
17810 cat >>confdefs.h <<\EOF
17811 #define HAVE_GETOPT_HEADER 1
17812 EOF
17813
17814 fi
17815 if test "$cf_cv_getopt_header" = getopt.h ; then
17816
17817 cat >>confdefs.h <<\EOF
17818 #define NEED_GETOPT_H 1
17819 EOF
17820
17821 fi
17822
17823 for ac_func in \
17824 getopt \
17825 gettimeofday \
17826 snprintf \
17827 strdup \
17828 strstr \
17829 tsearch \
17830
17831 do
17832 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17833 echo "$as_me:17833: checking for $ac_func" >&5
17834 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17835 if eval "test \"\${$as_ac_var+set}\" = set"; then
17836   echo $ECHO_N "(cached) $ECHO_C" >&6
17837 else
17838   cat >"conftest.$ac_ext" <<_ACEOF
17839 #line 17839 "configure"
17840 #include "confdefs.h"
17841 #define $ac_func autoconf_temporary
17842 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17843 #undef $ac_func
17844
17845 #ifdef __cplusplus
17846 extern "C"
17847 #endif
17848
17849 /* We use char because int might match the return type of a gcc2
17850    builtin and then its argument prototype would still apply.  */
17851 char $ac_func (void);
17852
17853 int
17854 main (void)
17855 {
17856
17857 /* The GNU C library defines stubs for functions which it implements
17858     to always fail with ENOSYS.  Some functions are actually named
17859     something starting with __ and the normal name is an alias.  */
17860 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17861 #error found stub for $ac_func
17862 #endif
17863
17864         return $ac_func ();
17865   ;
17866   return 0;
17867 }
17868 _ACEOF
17869 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17870 if { (eval echo "$as_me:17870: \"$ac_link\"") >&5
17871   (eval $ac_link) 2>&5
17872   ac_status=$?
17873   echo "$as_me:17873: \$? = $ac_status" >&5
17874   (exit "$ac_status"); } &&
17875          { ac_try='test -s "conftest$ac_exeext"'
17876   { (eval echo "$as_me:17876: \"$ac_try\"") >&5
17877   (eval $ac_try) 2>&5
17878   ac_status=$?
17879   echo "$as_me:17879: \$? = $ac_status" >&5
17880   (exit "$ac_status"); }; }; then
17881   eval "$as_ac_var=yes"
17882 else
17883   echo "$as_me: failed program was:" >&5
17884 cat "conftest.$ac_ext" >&5
17885 eval "$as_ac_var=no"
17886 fi
17887 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17888 fi
17889 echo "$as_me:17889: result: `eval echo '${'"$as_ac_var"'}'`" >&5
17890 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
17891 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
17892   cat >>confdefs.h <<EOF
17893 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17894 EOF
17895
17896 fi
17897 done
17898
17899 # use a compile-check to work with ncurses*-config and subdirectory includes
17900 echo "$as_me:17900: checking if we can use termcap.h" >&5
17901 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17902 if test "${cf_cv_have_termcap_h+set}" = set; then
17903   echo $ECHO_N "(cached) $ECHO_C" >&6
17904 else
17905
17906         cat >"conftest.$ac_ext" <<_ACEOF
17907 #line 17907 "configure"
17908 #include "confdefs.h"
17909
17910 #include <curses.h>
17911 #ifdef NCURSES_VERSION
17912 #undef NCURSES_VERSION
17913 #endif
17914 #include <termcap.h>
17915 #ifndef NCURSES_VERSION
17916 #error wrong header
17917 #endif
17918
17919 int
17920 main (void)
17921 {
17922 return 0;
17923   ;
17924   return 0;
17925 }
17926 _ACEOF
17927 rm -f "conftest.$ac_objext"
17928 if { (eval echo "$as_me:17928: \"$ac_compile\"") >&5
17929   (eval $ac_compile) 2>&5
17930   ac_status=$?
17931   echo "$as_me:17931: \$? = $ac_status" >&5
17932   (exit "$ac_status"); } &&
17933          { ac_try='test -s "conftest.$ac_objext"'
17934   { (eval echo "$as_me:17934: \"$ac_try\"") >&5
17935   (eval $ac_try) 2>&5
17936   ac_status=$?
17937   echo "$as_me:17937: \$? = $ac_status" >&5
17938   (exit "$ac_status"); }; }; then
17939   cf_cv_have_termcap_h=yes
17940 else
17941   echo "$as_me: failed program was:" >&5
17942 cat "conftest.$ac_ext" >&5
17943 cf_cv_have_termcap_h=no
17944 fi
17945 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17946 fi
17947 echo "$as_me:17947: result: $cf_cv_have_termcap_h" >&5
17948 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17949 if test "x$cf_cv_have_termcap_h" = xyes
17950 then
17951
17952 cat >>confdefs.h <<\EOF
17953 #define HAVE_TERMCAP_H 1
17954 EOF
17955
17956 else
17957 echo "$as_me:17957: checking if we can use ncurses/termcap.h" >&5
17958 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17959 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17960   echo $ECHO_N "(cached) $ECHO_C" >&6
17961 else
17962
17963         cat >"conftest.$ac_ext" <<_ACEOF
17964 #line 17964 "configure"
17965 #include "confdefs.h"
17966
17967 #include <ncurses/curses.h>
17968 #ifdef NCURSES_VERSION
17969 #undef NCURSES_VERSION
17970 #endif
17971 #include <ncurses/termcap.h>
17972 #ifndef NCURSES_VERSION
17973 #error wrong header
17974 #endif
17975
17976 int
17977 main (void)
17978 {
17979 return 0;
17980   ;
17981   return 0;
17982 }
17983 _ACEOF
17984 rm -f "conftest.$ac_objext"
17985 if { (eval echo "$as_me:17985: \"$ac_compile\"") >&5
17986   (eval $ac_compile) 2>&5
17987   ac_status=$?
17988   echo "$as_me:17988: \$? = $ac_status" >&5
17989   (exit "$ac_status"); } &&
17990          { ac_try='test -s "conftest.$ac_objext"'
17991   { (eval echo "$as_me:17991: \"$ac_try\"") >&5
17992   (eval $ac_try) 2>&5
17993   ac_status=$?
17994   echo "$as_me:17994: \$? = $ac_status" >&5
17995   (exit "$ac_status"); }; }; then
17996   cf_cv_have_ncurses_termcap_h=yes
17997 else
17998   echo "$as_me: failed program was:" >&5
17999 cat "conftest.$ac_ext" >&5
18000 cf_cv_have_ncurses_termcap_h=no
18001 fi
18002 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18003 fi
18004 echo "$as_me:18004: result: $cf_cv_have_ncurses_termcap_h" >&5
18005 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18006 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18007 cat >>confdefs.h <<\EOF
18008 #define HAVE_NCURSES_TERMCAP_H 1
18009 EOF
18010
18011 fi
18012
18013 if test "x$ac_cv_func_getopt" = xno; then
18014         { { echo "$as_me:18014: error: getopt is required for building programs" >&5
18015 echo "$as_me: error: getopt is required for building programs" >&2;}
18016    { (exit 1); exit 1; }; }
18017 fi
18018
18019 if test "$cf_enable_widec" = yes; then
18020
18021 for ac_func in \
18022 mblen \
18023 mbrlen \
18024 mbrtowc \
18025 mbsrtowcs \
18026 mbstowcs \
18027 mbtowc \
18028 wcsrtombs \
18029 wcstombs \
18030
18031 do
18032 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18033 echo "$as_me:18033: checking for $ac_func" >&5
18034 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18035 if eval "test \"\${$as_ac_var+set}\" = set"; then
18036   echo $ECHO_N "(cached) $ECHO_C" >&6
18037 else
18038   cat >"conftest.$ac_ext" <<_ACEOF
18039 #line 18039 "configure"
18040 #include "confdefs.h"
18041 #define $ac_func autoconf_temporary
18042 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18043 #undef $ac_func
18044
18045 #ifdef __cplusplus
18046 extern "C"
18047 #endif
18048
18049 /* We use char because int might match the return type of a gcc2
18050    builtin and then its argument prototype would still apply.  */
18051 char $ac_func (void);
18052
18053 int
18054 main (void)
18055 {
18056
18057 /* The GNU C library defines stubs for functions which it implements
18058     to always fail with ENOSYS.  Some functions are actually named
18059     something starting with __ and the normal name is an alias.  */
18060 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18061 #error found stub for $ac_func
18062 #endif
18063
18064         return $ac_func ();
18065   ;
18066   return 0;
18067 }
18068 _ACEOF
18069 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18070 if { (eval echo "$as_me:18070: \"$ac_link\"") >&5
18071   (eval $ac_link) 2>&5
18072   ac_status=$?
18073   echo "$as_me:18073: \$? = $ac_status" >&5
18074   (exit "$ac_status"); } &&
18075          { ac_try='test -s "conftest$ac_exeext"'
18076   { (eval echo "$as_me:18076: \"$ac_try\"") >&5
18077   (eval $ac_try) 2>&5
18078   ac_status=$?
18079   echo "$as_me:18079: \$? = $ac_status" >&5
18080   (exit "$ac_status"); }; }; then
18081   eval "$as_ac_var=yes"
18082 else
18083   echo "$as_me: failed program was:" >&5
18084 cat "conftest.$ac_ext" >&5
18085 eval "$as_ac_var=no"
18086 fi
18087 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18088 fi
18089 echo "$as_me:18089: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18090 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18091 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18092   cat >>confdefs.h <<EOF
18093 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18094 EOF
18095
18096 fi
18097 done
18098
18099 fi
18100
18101 echo "$as_me:18101: checking definition to turn on extended curses functions" >&5
18102 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18103 if test "${cf_cv_need_xopen_extension+set}" = set; then
18104   echo $ECHO_N "(cached) $ECHO_C" >&6
18105 else
18106
18107 cf_cv_need_xopen_extension=unknown
18108 cat >"conftest.$ac_ext" <<_ACEOF
18109 #line 18109 "configure"
18110 #include "confdefs.h"
18111
18112 #include <stdlib.h>
18113 #include <${cf_cv_ncurses_header:-curses.h}>
18114 int
18115 main (void)
18116 {
18117
18118 #if defined(NCURSES_VERSION_PATCH)
18119 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18120         make an error
18121 #endif
18122 #endif
18123 #ifdef NCURSES_VERSION
18124         cchar_t check;
18125         int check2 = curs_set((int)sizeof(check));
18126 #endif
18127         long x = winnstr(stdscr, "", 0);
18128         int x1, y1;
18129 #ifdef NCURSES_VERSION
18130         (void)check2;
18131 #endif
18132         getbegyx(stdscr, y1, x1);
18133         (void)x;
18134         (void)y1;
18135         (void)x1;
18136
18137   ;
18138   return 0;
18139 }
18140 _ACEOF
18141 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18142 if { (eval echo "$as_me:18142: \"$ac_link\"") >&5
18143   (eval $ac_link) 2>&5
18144   ac_status=$?
18145   echo "$as_me:18145: \$? = $ac_status" >&5
18146   (exit "$ac_status"); } &&
18147          { ac_try='test -s "conftest$ac_exeext"'
18148   { (eval echo "$as_me:18148: \"$ac_try\"") >&5
18149   (eval $ac_try) 2>&5
18150   ac_status=$?
18151   echo "$as_me:18151: \$? = $ac_status" >&5
18152   (exit "$ac_status"); }; }; then
18153   cf_cv_need_xopen_extension=none
18154 else
18155   echo "$as_me: failed program was:" >&5
18156 cat "conftest.$ac_ext" >&5
18157
18158         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18159         do
18160                 cat >"conftest.$ac_ext" <<_ACEOF
18161 #line 18161 "configure"
18162 #include "confdefs.h"
18163
18164 #define $cf_try_xopen_extension 1
18165 #include <stdlib.h>
18166 #include <${cf_cv_ncurses_header:-curses.h}>
18167 int
18168 main (void)
18169 {
18170
18171 #ifdef NCURSES_VERSION
18172                 cchar_t check;
18173                 int check2 = curs_set((int)sizeof(check));
18174 #endif
18175                 long x = winnstr(stdscr, "", 0);
18176                 int x1, y1;
18177                 getbegyx(stdscr, y1, x1);
18178 #ifdef NCURSES_VERSION
18179                 (void)check2;
18180 #endif
18181                 (void)x;
18182                 (void)y1;
18183                 (void)x1;
18184
18185   ;
18186   return 0;
18187 }
18188 _ACEOF
18189 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18190 if { (eval echo "$as_me:18190: \"$ac_link\"") >&5
18191   (eval $ac_link) 2>&5
18192   ac_status=$?
18193   echo "$as_me:18193: \$? = $ac_status" >&5
18194   (exit "$ac_status"); } &&
18195          { ac_try='test -s "conftest$ac_exeext"'
18196   { (eval echo "$as_me:18196: \"$ac_try\"") >&5
18197   (eval $ac_try) 2>&5
18198   ac_status=$?
18199   echo "$as_me:18199: \$? = $ac_status" >&5
18200   (exit "$ac_status"); }; }; then
18201   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18202 else
18203   echo "$as_me: failed program was:" >&5
18204 cat "conftest.$ac_ext" >&5
18205 fi
18206 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18207         done
18208
18209 fi
18210 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18211
18212 fi
18213 echo "$as_me:18213: result: $cf_cv_need_xopen_extension" >&5
18214 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18215
18216 case "$cf_cv_need_xopen_extension" in
18217 (*_*)
18218
18219         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18220         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18221
18222         ;;
18223 esac
18224
18225 echo "$as_me:18225: checking for term.h" >&5
18226 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18227 if test "${cf_cv_term_header+set}" = set; then
18228   echo $ECHO_N "(cached) $ECHO_C" >&6
18229 else
18230
18231 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18232 # for <term.h> if we do not find the variant.
18233
18234 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18235
18236 case "${cf_cv_ncurses_header:-curses.h}" in
18237 (*/*)
18238         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18239         cf_header_list="$cf_header_item $cf_header_list"
18240         ;;
18241 esac
18242
18243 for cf_header in $cf_header_list
18244 do
18245         cat >"conftest.$ac_ext" <<_ACEOF
18246 #line 18246 "configure"
18247 #include "confdefs.h"
18248
18249 #include <${cf_cv_ncurses_header:-curses.h}>
18250 #include <${cf_header}>
18251 int
18252 main (void)
18253 {
18254 WINDOW *x; (void)x
18255   ;
18256   return 0;
18257 }
18258 _ACEOF
18259 rm -f "conftest.$ac_objext"
18260 if { (eval echo "$as_me:18260: \"$ac_compile\"") >&5
18261   (eval $ac_compile) 2>&5
18262   ac_status=$?
18263   echo "$as_me:18263: \$? = $ac_status" >&5
18264   (exit "$ac_status"); } &&
18265          { ac_try='test -s "conftest.$ac_objext"'
18266   { (eval echo "$as_me:18266: \"$ac_try\"") >&5
18267   (eval $ac_try) 2>&5
18268   ac_status=$?
18269   echo "$as_me:18269: \$? = $ac_status" >&5
18270   (exit "$ac_status"); }; }; then
18271   cf_cv_term_header=$cf_header
18272          break
18273 else
18274   echo "$as_me: failed program was:" >&5
18275 cat "conftest.$ac_ext" >&5
18276 cf_cv_term_header=no
18277 fi
18278 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18279 done
18280
18281 case "$cf_cv_term_header" in
18282 (no)
18283         # If curses is ncurses, some packagers still mess it up by trying to make
18284         # us use GNU termcap.  This handles the most common case.
18285         for cf_header in ncurses/term.h ncursesw/term.h
18286         do
18287                 cat >"conftest.$ac_ext" <<_ACEOF
18288 #line 18288 "configure"
18289 #include "confdefs.h"
18290
18291 #include <${cf_cv_ncurses_header:-curses.h}>
18292 #ifdef NCURSES_VERSION
18293 #include <${cf_header}>
18294 #else
18295 make an error
18296 #endif
18297 int
18298 main (void)
18299 {
18300 WINDOW *x; (void)x
18301   ;
18302   return 0;
18303 }
18304 _ACEOF
18305 rm -f "conftest.$ac_objext"
18306 if { (eval echo "$as_me:18306: \"$ac_compile\"") >&5
18307   (eval $ac_compile) 2>&5
18308   ac_status=$?
18309   echo "$as_me:18309: \$? = $ac_status" >&5
18310   (exit "$ac_status"); } &&
18311          { ac_try='test -s "conftest.$ac_objext"'
18312   { (eval echo "$as_me:18312: \"$ac_try\"") >&5
18313   (eval $ac_try) 2>&5
18314   ac_status=$?
18315   echo "$as_me:18315: \$? = $ac_status" >&5
18316   (exit "$ac_status"); }; }; then
18317   cf_cv_term_header=$cf_header
18318                          break
18319 else
18320   echo "$as_me: failed program was:" >&5
18321 cat "conftest.$ac_ext" >&5
18322 cf_cv_term_header=no
18323 fi
18324 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18325         done
18326         ;;
18327 esac
18328
18329 fi
18330 echo "$as_me:18330: result: $cf_cv_term_header" >&5
18331 echo "${ECHO_T}$cf_cv_term_header" >&6
18332
18333 case "$cf_cv_term_header" in
18334 (term.h)
18335
18336 cat >>confdefs.h <<\EOF
18337 #define HAVE_TERM_H 1
18338 EOF
18339
18340         ;;
18341 (ncurses/term.h)
18342
18343 cat >>confdefs.h <<\EOF
18344 #define HAVE_NCURSES_TERM_H 1
18345 EOF
18346
18347         ;;
18348 (ncursesw/term.h)
18349
18350 cat >>confdefs.h <<\EOF
18351 #define HAVE_NCURSESW_TERM_H 1
18352 EOF
18353
18354         ;;
18355 esac
18356
18357 echo "$as_me:18357: checking for unctrl.h" >&5
18358 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18359 if test "${cf_cv_unctrl_header+set}" = set; then
18360   echo $ECHO_N "(cached) $ECHO_C" >&6
18361 else
18362
18363 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18364 # for <unctrl.h> if we do not find the variant.
18365
18366 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18367
18368 case "${cf_cv_ncurses_header:-curses.h}" in
18369 (*/*)
18370         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18371         cf_header_list="$cf_header_item $cf_header_list"
18372         ;;
18373 esac
18374
18375 for cf_header in $cf_header_list
18376 do
18377         cat >"conftest.$ac_ext" <<_ACEOF
18378 #line 18378 "configure"
18379 #include "confdefs.h"
18380
18381 #include <${cf_cv_ncurses_header:-curses.h}>
18382 #include <${cf_header}>
18383 int
18384 main (void)
18385 {
18386 WINDOW *x; (void)x
18387   ;
18388   return 0;
18389 }
18390 _ACEOF
18391 rm -f "conftest.$ac_objext"
18392 if { (eval echo "$as_me:18392: \"$ac_compile\"") >&5
18393   (eval $ac_compile) 2>&5
18394   ac_status=$?
18395   echo "$as_me:18395: \$? = $ac_status" >&5
18396   (exit "$ac_status"); } &&
18397          { ac_try='test -s "conftest.$ac_objext"'
18398   { (eval echo "$as_me:18398: \"$ac_try\"") >&5
18399   (eval $ac_try) 2>&5
18400   ac_status=$?
18401   echo "$as_me:18401: \$? = $ac_status" >&5
18402   (exit "$ac_status"); }; }; then
18403   cf_cv_unctrl_header=$cf_header
18404          break
18405 else
18406   echo "$as_me: failed program was:" >&5
18407 cat "conftest.$ac_ext" >&5
18408 cf_cv_unctrl_header=no
18409 fi
18410 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18411 done
18412
18413 fi
18414 echo "$as_me:18414: result: $cf_cv_unctrl_header" >&5
18415 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18416
18417 case "$cf_cv_unctrl_header" in
18418 (no)
18419         { echo "$as_me:18419: WARNING: unctrl.h header not found" >&5
18420 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18421         ;;
18422 esac
18423
18424 case "$cf_cv_unctrl_header" in
18425 (unctrl.h)
18426
18427 cat >>confdefs.h <<\EOF
18428 #define HAVE_UNCTRL_H 1
18429 EOF
18430
18431         ;;
18432 (ncurses/unctrl.h)
18433
18434 cat >>confdefs.h <<\EOF
18435 #define HAVE_NCURSES_UNCTRL_H 1
18436 EOF
18437
18438         ;;
18439 (ncursesw/unctrl.h)
18440
18441 cat >>confdefs.h <<\EOF
18442 #define HAVE_NCURSESW_UNCTRL_H 1
18443 EOF
18444
18445         ;;
18446 esac
18447
18448 for cf_func in \
18449 alloc_pair \
18450 assume_default_colors \
18451 chgat \
18452 color_content \
18453 color_set \
18454 copywin \
18455 delscreen \
18456 dupwin \
18457 exit_curses \
18458 exit_terminfo \
18459 filter \
18460 getbegx \
18461 getcurx \
18462 getmaxx \
18463 getnstr \
18464 getparx \
18465 getwin \
18466 halfdelay \
18467 init_extended_color \
18468 mvderwin \
18469 mvvline \
18470 mvwin \
18471 mvwvline \
18472 napms \
18473 newpad \
18474 putwin \
18475 reset_color_pairs \
18476 resize_term \
18477 resizeterm \
18478 restartterm \
18479 ripoffline \
18480 scr_dump \
18481 setupterm \
18482 slk_color \
18483 slk_init \
18484 termattrs \
18485 termname \
18486 tgetent \
18487 tigetnum \
18488 tigetstr \
18489 tputs_sp \
18490 typeahead \
18491 use_default_colors \
18492 use_env \
18493 use_extended_names \
18494 use_screen \
18495 use_window \
18496 vid_puts \
18497 vidputs \
18498 vsscanf \
18499 vw_printw \
18500 wchgat \
18501 winsdelln \
18502 winsstr \
18503 wresize \
18504 wsyncdown \
18505 _tracef \
18506
18507 do
18508
18509 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18510
18511         echo "$as_me:18511: checking for ${cf_func}" >&5
18512 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18513
18514 echo "${as_me:-configure}:18514: testing ${cf_func} ..." 1>&5
18515
18516         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18517   echo $ECHO_N "(cached) $ECHO_C" >&6
18518 else
18519
18520                 eval cf_result='$ac_cv_func_'$cf_func
18521                 if test ".$cf_result" != ".no"; then
18522                         cat >"conftest.$ac_ext" <<_ACEOF
18523 #line 18523 "configure"
18524 #include "confdefs.h"
18525
18526 #ifdef HAVE_XCURSES
18527 #include <xcurses.h>
18528 char * XCursesProgramName = "test";
18529 #else
18530 #include <${cf_cv_ncurses_header:-curses.h}>
18531 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18532 #include <ncursesw/term.h>
18533 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18534 #include <ncurses/term.h>
18535 #elif defined(HAVE_TERM_H)
18536 #include <term.h>
18537 #endif
18538 #endif
18539
18540 int
18541 main (void)
18542 {
18543
18544 #ifndef ${cf_func}
18545 long foo = (long)(&${cf_func});
18546 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18547 if (foo + 1234L > 5678L)
18548         ${cf_cv_main_return:-return}(foo != 0);
18549 #endif
18550
18551   ;
18552   return 0;
18553 }
18554 _ACEOF
18555 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18556 if { (eval echo "$as_me:18556: \"$ac_link\"") >&5
18557   (eval $ac_link) 2>&5
18558   ac_status=$?
18559   echo "$as_me:18559: \$? = $ac_status" >&5
18560   (exit "$ac_status"); } &&
18561          { ac_try='test -s "conftest$ac_exeext"'
18562   { (eval echo "$as_me:18562: \"$ac_try\"") >&5
18563   (eval $ac_try) 2>&5
18564   ac_status=$?
18565   echo "$as_me:18565: \$? = $ac_status" >&5
18566   (exit "$ac_status"); }; }; then
18567   cf_result=yes
18568 else
18569   echo "$as_me: failed program was:" >&5
18570 cat "conftest.$ac_ext" >&5
18571 cf_result=no
18572 fi
18573 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18574                 fi
18575                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18576
18577 fi
18578
18579         # use the computed/retrieved cache-value:
18580         eval 'cf_result=$cf_cv_func_'$cf_func
18581         echo "$as_me:18581: result: $cf_result" >&5
18582 echo "${ECHO_T}$cf_result" >&6
18583         if test "$cf_result" != no; then
18584                 cat >>confdefs.h <<EOF
18585 #define HAVE_${cf_tr_func} 1
18586 EOF
18587
18588         fi
18589 done
18590
18591 for cf_func in tputs
18592 do
18593
18594 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18595
18596         echo "$as_me:18596: checking for ${cf_func}" >&5
18597 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18598
18599 echo "${as_me:-configure}:18599: testing ${cf_func} ..." 1>&5
18600
18601         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18602   echo $ECHO_N "(cached) $ECHO_C" >&6
18603 else
18604
18605                 eval cf_result='$ac_cv_func_'$cf_func
18606                 if test ".$cf_result" != ".no"; then
18607                         cat >"conftest.$ac_ext" <<_ACEOF
18608 #line 18608 "configure"
18609 #include "confdefs.h"
18610
18611 #ifdef HAVE_XCURSES
18612 #include <xcurses.h>
18613 char * XCursesProgramName = "test";
18614 #else
18615 #include <${cf_cv_ncurses_header:-curses.h}>
18616 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18617 #include <ncursesw/term.h>
18618 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18619 #include <ncurses/term.h>
18620 #elif defined(HAVE_TERM_H)
18621 #include <term.h>
18622 #endif
18623 #endif
18624
18625 int
18626 main (void)
18627 {
18628
18629 #ifndef ${cf_func}
18630 long foo = (long)(&${cf_func});
18631 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18632 if (foo + 1234L > 5678L)
18633         ${cf_cv_main_return:-return}(foo != 0);
18634 #endif
18635
18636   ;
18637   return 0;
18638 }
18639 _ACEOF
18640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18641 if { (eval echo "$as_me:18641: \"$ac_link\"") >&5
18642   (eval $ac_link) 2>&5
18643   ac_status=$?
18644   echo "$as_me:18644: \$? = $ac_status" >&5
18645   (exit "$ac_status"); } &&
18646          { ac_try='test -s "conftest$ac_exeext"'
18647   { (eval echo "$as_me:18647: \"$ac_try\"") >&5
18648   (eval $ac_try) 2>&5
18649   ac_status=$?
18650   echo "$as_me:18650: \$? = $ac_status" >&5
18651   (exit "$ac_status"); }; }; then
18652   cf_result=yes
18653 else
18654   echo "$as_me: failed program was:" >&5
18655 cat "conftest.$ac_ext" >&5
18656 cf_result=no
18657 fi
18658 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18659                 fi
18660                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18661
18662 fi
18663
18664         # use the computed/retrieved cache-value:
18665         eval 'cf_result=$cf_cv_func_'$cf_func
18666         echo "$as_me:18666: result: $cf_result" >&5
18667 echo "${ECHO_T}$cf_result" >&6
18668         if test "$cf_result" != no; then
18669                 cat >>confdefs.h <<EOF
18670 #define HAVE_${cf_tr_func} 1
18671 EOF
18672
18673         fi
18674 done
18675
18676 if test "x$cf_cv_func_tputs" = xyes
18677 then
18678         cf_done=no
18679         for cf_arg in int char
18680         do
18681                 for cf_ret in int void
18682                 do
18683                         if test "$cf_ret" = void
18684                         then
18685                                 cf_return="/* nothing */"
18686                         else
18687                                 cf_return="return value"
18688                         fi
18689                         cat >"conftest.$ac_ext" <<_ACEOF
18690 #line 18690 "configure"
18691 #include "confdefs.h"
18692
18693 #include <${cf_cv_ncurses_header:-curses.h}>
18694 #include <$cf_cv_term_header>
18695
18696 static $cf_ret outc($cf_arg value) { $cf_return; }
18697
18698 int
18699 main (void)
18700 {
18701
18702         tputs("hello", 0, outc);
18703         ${cf_cv_main_return:-return}(0);
18704
18705   ;
18706   return 0;
18707 }
18708 _ACEOF
18709 rm -f "conftest.$ac_objext"
18710 if { (eval echo "$as_me:18710: \"$ac_compile\"") >&5
18711   (eval $ac_compile) 2>&5
18712   ac_status=$?
18713   echo "$as_me:18713: \$? = $ac_status" >&5
18714   (exit "$ac_status"); } &&
18715          { ac_try='test -s "conftest.$ac_objext"'
18716   { (eval echo "$as_me:18716: \"$ac_try\"") >&5
18717   (eval $ac_try) 2>&5
18718   ac_status=$?
18719   echo "$as_me:18719: \$? = $ac_status" >&5
18720   (exit "$ac_status"); }; }; then
18721
18722                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18723
18724 echo "${as_me:-configure}:18724: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18725
18726                 cat >>confdefs.h <<EOF
18727 #define TPUTS_ARG               $cf_arg
18728 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18729 #define TPUTS_RETURN(value)     $cf_return
18730 EOF
18731                 cf_done=yes
18732                 break
18733
18734 else
18735   echo "$as_me: failed program was:" >&5
18736 cat "conftest.$ac_ext" >&5
18737 fi
18738 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18739                 done
18740                 test "$cf_done" = yes && break
18741         done
18742 fi
18743
18744 echo "$as_me:18744: checking for ncurses extended functions" >&5
18745 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18746 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18747   echo $ECHO_N "(cached) $ECHO_C" >&6
18748 else
18749
18750 cat >"conftest.$ac_ext" <<_ACEOF
18751 #line 18751 "configure"
18752 #include "confdefs.h"
18753
18754 #include <${cf_cv_ncurses_header:-curses.h}>
18755 int
18756 main (void)
18757 {
18758
18759 int x = NCURSES_EXT_FUNCS
18760
18761   ;
18762   return 0;
18763 }
18764 _ACEOF
18765 rm -f "conftest.$ac_objext"
18766 if { (eval echo "$as_me:18766: \"$ac_compile\"") >&5
18767   (eval $ac_compile) 2>&5
18768   ac_status=$?
18769   echo "$as_me:18769: \$? = $ac_status" >&5
18770   (exit "$ac_status"); } &&
18771          { ac_try='test -s "conftest.$ac_objext"'
18772   { (eval echo "$as_me:18772: \"$ac_try\"") >&5
18773   (eval $ac_try) 2>&5
18774   ac_status=$?
18775   echo "$as_me:18775: \$? = $ac_status" >&5
18776   (exit "$ac_status"); }; }; then
18777   cf_cv_ncurses_ext_funcs=defined
18778 else
18779   echo "$as_me: failed program was:" >&5
18780 cat "conftest.$ac_ext" >&5
18781
18782 cat >"conftest.$ac_ext" <<_ACEOF
18783 #line 18783 "configure"
18784 #include "confdefs.h"
18785
18786 #include <${cf_cv_ncurses_header:-curses.h}>
18787 int
18788 main (void)
18789 {
18790
18791         (void) assume_default_colors (0, 0);
18792         (void) curses_version ();
18793         (void) define_key (0, 0);
18794         (void) is_term_resized (0, 0);
18795         (void) key_defined (0);
18796         (void) keybound (0, 0);
18797         (void) keyok (0, 0);
18798         (void) resize_term (0, 0);
18799         (void) resizeterm (0, 0);
18800         (void) use_default_colors ();
18801         (void) use_extended_names (0);
18802         (void) wresize (0, 0, 0);
18803   ;
18804   return 0;
18805 }
18806 _ACEOF
18807 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18808 if { (eval echo "$as_me:18808: \"$ac_link\"") >&5
18809   (eval $ac_link) 2>&5
18810   ac_status=$?
18811   echo "$as_me:18811: \$? = $ac_status" >&5
18812   (exit "$ac_status"); } &&
18813          { ac_try='test -s "conftest$ac_exeext"'
18814   { (eval echo "$as_me:18814: \"$ac_try\"") >&5
18815   (eval $ac_try) 2>&5
18816   ac_status=$?
18817   echo "$as_me:18817: \$? = $ac_status" >&5
18818   (exit "$ac_status"); }; }; then
18819   cf_cv_ncurses_ext_funcs=yes
18820 else
18821   echo "$as_me: failed program was:" >&5
18822 cat "conftest.$ac_ext" >&5
18823 cf_cv_ncurses_ext_funcs=no
18824 fi
18825 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18826
18827 fi
18828 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18829
18830 fi
18831 echo "$as_me:18831: result: $cf_cv_ncurses_ext_funcs" >&5
18832 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18833 test "$cf_cv_ncurses_ext_funcs" = yes &&
18834 cat >>confdefs.h <<\EOF
18835 #define NCURSES_EXT_FUNCS 1
18836 EOF
18837
18838 if test "$cf_enable_widec" = yes
18839 then
18840         # workaround for systems with ncurses before 20111029, due to change of
18841         # feature test macro from _XPG5 to _XOPEN_SOURCE
18842         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18843         then
18844                 cf_define_xpg5=no
18845                 echo "$as_me:18845: checking if _XPG5 should be defined to enable wide-characters" >&5
18846 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18847
18848                 cat >"conftest.$ac_ext" <<_ACEOF
18849 #line 18849 "configure"
18850 #include "confdefs.h"
18851
18852 #include <${cf_cv_ncurses_header:-curses.h}>
18853 int
18854 main (void)
18855 {
18856 int x = _XPG5
18857   ;
18858   return 0;
18859 }
18860 _ACEOF
18861 rm -f "conftest.$ac_objext"
18862 if { (eval echo "$as_me:18862: \"$ac_compile\"") >&5
18863   (eval $ac_compile) 2>&5
18864   ac_status=$?
18865   echo "$as_me:18865: \$? = $ac_status" >&5
18866   (exit "$ac_status"); } &&
18867          { ac_try='test -s "conftest.$ac_objext"'
18868   { (eval echo "$as_me:18868: \"$ac_try\"") >&5
18869   (eval $ac_try) 2>&5
18870   ac_status=$?
18871   echo "$as_me:18871: \$? = $ac_status" >&5
18872   (exit "$ac_status"); }; }; then
18873   :
18874 else
18875   echo "$as_me: failed program was:" >&5
18876 cat "conftest.$ac_ext" >&5
18877 cf_save_cppflags="$CPPFLAGS"
18878                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18879                          cat >"conftest.$ac_ext" <<_ACEOF
18880 #line 18880 "configure"
18881 #include "confdefs.h"
18882
18883 #include <${cf_cv_ncurses_header:-curses.h}>
18884 int
18885 main (void)
18886 {
18887 int x = _XPG5
18888   ;
18889   return 0;
18890 }
18891 _ACEOF
18892 rm -f "conftest.$ac_objext"
18893 if { (eval echo "$as_me:18893: \"$ac_compile\"") >&5
18894   (eval $ac_compile) 2>&5
18895   ac_status=$?
18896   echo "$as_me:18896: \$? = $ac_status" >&5
18897   (exit "$ac_status"); } &&
18898          { ac_try='test -s "conftest.$ac_objext"'
18899   { (eval echo "$as_me:18899: \"$ac_try\"") >&5
18900   (eval $ac_try) 2>&5
18901   ac_status=$?
18902   echo "$as_me:18902: \$? = $ac_status" >&5
18903   (exit "$ac_status"); }; }; then
18904   cf_define_xpg5=yes
18905 else
18906   echo "$as_me: failed program was:" >&5
18907 cat "conftest.$ac_ext" >&5
18908 fi
18909 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18910                          CPPFLAGS="$cf_save_cppflags"
18911 fi
18912 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18913                 echo "$as_me:18913: result: $cf_define_xpg5" >&5
18914 echo "${ECHO_T}$cf_define_xpg5" >&6
18915
18916                 if test "$cf_define_xpg5" = yes
18917                 then
18918                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18919                 fi
18920         fi
18921
18922         echo "$as_me:18922: checking for wide-character functions" >&5
18923 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18924 if test "${cf_cv_widechar_funcs+set}" = set; then
18925   echo $ECHO_N "(cached) $ECHO_C" >&6
18926 else
18927
18928         cat >"conftest.$ac_ext" <<_ACEOF
18929 #line 18929 "configure"
18930 #include "confdefs.h"
18931
18932 #include <${cf_cv_ncurses_header:-curses.h}>
18933 int
18934 main (void)
18935 {
18936
18937                 static wchar_t src_wchar[2];
18938                 static cchar_t dst_cchar;
18939                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18940
18941   ;
18942   return 0;
18943 }
18944 _ACEOF
18945 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18946 if { (eval echo "$as_me:18946: \"$ac_link\"") >&5
18947   (eval $ac_link) 2>&5
18948   ac_status=$?
18949   echo "$as_me:18949: \$? = $ac_status" >&5
18950   (exit "$ac_status"); } &&
18951          { ac_try='test -s "conftest$ac_exeext"'
18952   { (eval echo "$as_me:18952: \"$ac_try\"") >&5
18953   (eval $ac_try) 2>&5
18954   ac_status=$?
18955   echo "$as_me:18955: \$? = $ac_status" >&5
18956   (exit "$ac_status"); }; }; then
18957   cf_cv_widechar_funcs=yes
18958 else
18959   echo "$as_me: failed program was:" >&5
18960 cat "conftest.$ac_ext" >&5
18961 cf_cv_widechar_funcs=no
18962 fi
18963 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18964
18965 fi
18966 echo "$as_me:18966: result: $cf_cv_widechar_funcs" >&5
18967 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18968         if test "$cf_cv_widechar_funcs" != no ; then
18969
18970 cat >>confdefs.h <<\EOF
18971 #define USE_WIDEC_SUPPORT 1
18972 EOF
18973
18974         else
18975                 cat >>confdefs.h <<\EOF
18976 #define USE_WIDEC_SUPPORT 0
18977 EOF
18978
18979         fi
18980 else
18981         cat >>confdefs.h <<\EOF
18982 #define USE_WIDEC_SUPPORT 0
18983 EOF
18984
18985 fi
18986
18987 echo "$as_me:18987: checking if $cf_cv_screen library uses pthreads" >&5
18988 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18989 if test "${cf_cv_use_pthreads+set}" = set; then
18990   echo $ECHO_N "(cached) $ECHO_C" >&6
18991 else
18992
18993 cat >"conftest.$ac_ext" <<_ACEOF
18994 #line 18994 "configure"
18995 #include "confdefs.h"
18996
18997 #include <${cf_cv_ncurses_header:-curses.h}>
18998 extern void _nc_init_pthreads(void);
18999
19000 int
19001 main (void)
19002 {
19003
19004         initscr();
19005         _nc_init_pthreads();
19006
19007   ;
19008   return 0;
19009 }
19010 _ACEOF
19011 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19012 if { (eval echo "$as_me:19012: \"$ac_link\"") >&5
19013   (eval $ac_link) 2>&5
19014   ac_status=$?
19015   echo "$as_me:19015: \$? = $ac_status" >&5
19016   (exit "$ac_status"); } &&
19017          { ac_try='test -s "conftest$ac_exeext"'
19018   { (eval echo "$as_me:19018: \"$ac_try\"") >&5
19019   (eval $ac_try) 2>&5
19020   ac_status=$?
19021   echo "$as_me:19021: \$? = $ac_status" >&5
19022   (exit "$ac_status"); }; }; then
19023   cf_cv_use_pthreads=yes
19024 else
19025   echo "$as_me: failed program was:" >&5
19026 cat "conftest.$ac_ext" >&5
19027 cf_cv_use_pthreads=no
19028 fi
19029 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19030
19031 fi
19032 echo "$as_me:19032: result: $cf_cv_use_pthreads" >&5
19033 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19034 test $cf_cv_use_pthreads = yes &&
19035 cat >>confdefs.h <<\EOF
19036 #define USE_PTHREADS 1
19037 EOF
19038
19039 echo "$as_me:19039: checking if sys/time.h works with sys/select.h" >&5
19040 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19041 if test "${cf_cv_sys_time_select+set}" = set; then
19042   echo $ECHO_N "(cached) $ECHO_C" >&6
19043 else
19044
19045 cat >"conftest.$ac_ext" <<_ACEOF
19046 #line 19046 "configure"
19047 #include "confdefs.h"
19048
19049 #include <sys/types.h>
19050 #ifdef HAVE_SYS_TIME_H
19051 #include <sys/time.h>
19052 #endif
19053 #ifdef HAVE_SYS_SELECT_H
19054 #include <sys/select.h>
19055 #endif
19056
19057 int
19058 main (void)
19059 {
19060
19061   ;
19062   return 0;
19063 }
19064 _ACEOF
19065 rm -f "conftest.$ac_objext"
19066 if { (eval echo "$as_me:19066: \"$ac_compile\"") >&5
19067   (eval $ac_compile) 2>&5
19068   ac_status=$?
19069   echo "$as_me:19069: \$? = $ac_status" >&5
19070   (exit "$ac_status"); } &&
19071          { ac_try='test -s "conftest.$ac_objext"'
19072   { (eval echo "$as_me:19072: \"$ac_try\"") >&5
19073   (eval $ac_try) 2>&5
19074   ac_status=$?
19075   echo "$as_me:19075: \$? = $ac_status" >&5
19076   (exit "$ac_status"); }; }; then
19077   cf_cv_sys_time_select=yes
19078 else
19079   echo "$as_me: failed program was:" >&5
19080 cat "conftest.$ac_ext" >&5
19081 cf_cv_sys_time_select=no
19082 fi
19083 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19084
19085 fi
19086
19087 echo "$as_me:19087: result: $cf_cv_sys_time_select" >&5
19088 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19089 test "$cf_cv_sys_time_select" = yes &&
19090 cat >>confdefs.h <<\EOF
19091 #define HAVE_SYS_TIME_SELECT 1
19092 EOF
19093
19094 # special check for test/ditto.c
19095
19096 echo "$as_me:19096: checking for openpty in -lutil" >&5
19097 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19098 if test "${ac_cv_lib_util_openpty+set}" = set; then
19099   echo $ECHO_N "(cached) $ECHO_C" >&6
19100 else
19101   ac_check_lib_save_LIBS=$LIBS
19102 LIBS="-lutil  $LIBS"
19103 cat >"conftest.$ac_ext" <<_ACEOF
19104 #line 19104 "configure"
19105 #include "confdefs.h"
19106
19107 /* Override any gcc2 internal prototype to avoid an error.  */
19108 #ifdef __cplusplus
19109 extern "C"
19110 #endif
19111 /* We use char because int might match the return type of a gcc2
19112    builtin and then its argument prototype would still apply.  */
19113 char openpty ();
19114 int
19115 main (void)
19116 {
19117 openpty ();
19118   ;
19119   return 0;
19120 }
19121 _ACEOF
19122 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19123 if { (eval echo "$as_me:19123: \"$ac_link\"") >&5
19124   (eval $ac_link) 2>&5
19125   ac_status=$?
19126   echo "$as_me:19126: \$? = $ac_status" >&5
19127   (exit "$ac_status"); } &&
19128          { ac_try='test -s "conftest$ac_exeext"'
19129   { (eval echo "$as_me:19129: \"$ac_try\"") >&5
19130   (eval $ac_try) 2>&5
19131   ac_status=$?
19132   echo "$as_me:19132: \$? = $ac_status" >&5
19133   (exit "$ac_status"); }; }; then
19134   ac_cv_lib_util_openpty=yes
19135 else
19136   echo "$as_me: failed program was:" >&5
19137 cat "conftest.$ac_ext" >&5
19138 ac_cv_lib_util_openpty=no
19139 fi
19140 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19141 LIBS=$ac_check_lib_save_LIBS
19142 fi
19143 echo "$as_me:19143: result: $ac_cv_lib_util_openpty" >&5
19144 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19145 if test "$ac_cv_lib_util_openpty" = yes; then
19146   cf_cv_lib_util=yes
19147 else
19148   cf_cv_lib_util=no
19149 fi
19150
19151 echo "$as_me:19151: checking for openpty header" >&5
19152 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19153 if test "${cf_cv_func_openpty+set}" = set; then
19154   echo $ECHO_N "(cached) $ECHO_C" >&6
19155 else
19156
19157         cf_save_LIBS="$LIBS"
19158         test "$cf_cv_lib_util" = yes && {
19159 cf_add_libs="$LIBS"
19160 # reverse order
19161 cf_add_0lib=
19162 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19163 # filter duplicates
19164 for cf_add_1lib in $cf_add_0lib; do
19165         for cf_add_2lib in $cf_add_libs; do
19166                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19167                         cf_add_1lib=
19168                         break
19169                 fi
19170         done
19171         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19172 done
19173 LIBS="$cf_add_libs"
19174  }
19175         for cf_header in pty.h libutil.h util.h
19176         do
19177         cat >"conftest.$ac_ext" <<_ACEOF
19178 #line 19178 "configure"
19179 #include "confdefs.h"
19180
19181 #include <$cf_header>
19182
19183 int
19184 main (void)
19185 {
19186
19187         int x = openpty((int *)0, (int *)0, (char *)0,
19188                                    (struct termios *)0, (struct winsize *)0);
19189
19190   ;
19191   return 0;
19192 }
19193 _ACEOF
19194 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19195 if { (eval echo "$as_me:19195: \"$ac_link\"") >&5
19196   (eval $ac_link) 2>&5
19197   ac_status=$?
19198   echo "$as_me:19198: \$? = $ac_status" >&5
19199   (exit "$ac_status"); } &&
19200          { ac_try='test -s "conftest$ac_exeext"'
19201   { (eval echo "$as_me:19201: \"$ac_try\"") >&5
19202   (eval $ac_try) 2>&5
19203   ac_status=$?
19204   echo "$as_me:19204: \$? = $ac_status" >&5
19205   (exit "$ac_status"); }; }; then
19206
19207                 cf_cv_func_openpty=$cf_header
19208                 break
19209
19210 else
19211   echo "$as_me: failed program was:" >&5
19212 cat "conftest.$ac_ext" >&5
19213
19214                 cf_cv_func_openpty=no
19215
19216 fi
19217 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19218         done
19219         LIBS="$cf_save_LIBS"
19220
19221 fi
19222 echo "$as_me:19222: result: $cf_cv_func_openpty" >&5
19223 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19224
19225 if test "$cf_cv_func_openpty" != no ; then
19226
19227 cat >>confdefs.h <<EOF
19228 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19229 EOF
19230
19231 cat >>confdefs.h <<\EOF
19232 #define USE_XTERM_PTY 1
19233 EOF
19234
19235         if test "x$cf_cv_lib_util" = xyes ; then
19236
19237 cf_add_libs="$TEST_LIBS"
19238 # reverse order
19239 cf_add_0lib=
19240 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19241 # filter duplicates
19242 for cf_add_1lib in $cf_add_0lib; do
19243         for cf_add_2lib in $cf_add_libs; do
19244                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19245                         cf_add_1lib=
19246                         break
19247                 fi
19248         done
19249         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19250 done
19251 TEST_LIBS="$cf_add_libs"
19252
19253         fi
19254 fi
19255
19256 echo "$as_me:19256: checking for function curses_version" >&5
19257 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19258 if test "${cf_cv_func_curses_version+set}" = set; then
19259   echo $ECHO_N "(cached) $ECHO_C" >&6
19260 else
19261
19262 if test "$cross_compiling" = yes; then
19263   cf_cv_func_curses_version=unknown
19264 else
19265   cat >"conftest.$ac_ext" <<_ACEOF
19266 #line 19266 "configure"
19267 #include "confdefs.h"
19268
19269 #include <${cf_cv_ncurses_header:-curses.h}>
19270 int main(void)
19271 {
19272         char temp[1024];
19273         sprintf(temp, "%s\\n", curses_version());
19274         ${cf_cv_main_return:-return}(0);
19275 }
19276
19277 _ACEOF
19278 rm -f "conftest$ac_exeext"
19279 if { (eval echo "$as_me:19279: \"$ac_link\"") >&5
19280   (eval $ac_link) 2>&5
19281   ac_status=$?
19282   echo "$as_me:19282: \$? = $ac_status" >&5
19283   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19284   { (eval echo "$as_me:19284: \"$ac_try\"") >&5
19285   (eval $ac_try) 2>&5
19286   ac_status=$?
19287   echo "$as_me:19287: \$? = $ac_status" >&5
19288   (exit "$ac_status"); }; }; then
19289   cf_cv_func_curses_version=yes
19290
19291 else
19292   echo "$as_me: program exited with status $ac_status" >&5
19293 echo "$as_me: failed program was:" >&5
19294 cat "conftest.$ac_ext" >&5
19295 cf_cv_func_curses_version=no
19296
19297 fi
19298 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19299 fi
19300 rm -f core
19301 fi
19302 echo "$as_me:19302: result: $cf_cv_func_curses_version" >&5
19303 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19304 test "$cf_cv_func_curses_version" = yes &&
19305 cat >>confdefs.h <<\EOF
19306 #define HAVE_CURSES_VERSION 1
19307 EOF
19308
19309 echo "$as_me:19309: checking for alternate character set array" >&5
19310 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19311 if test "${cf_cv_curses_acs_map+set}" = set; then
19312   echo $ECHO_N "(cached) $ECHO_C" >&6
19313 else
19314
19315 cf_cv_curses_acs_map=unknown
19316 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19317 do
19318 cat >"conftest.$ac_ext" <<_ACEOF
19319 #line 19319 "configure"
19320 #include "confdefs.h"
19321
19322 #include <${cf_cv_ncurses_header:-curses.h}>
19323
19324 int
19325 main (void)
19326 {
19327
19328 ${name}['k'] = ACS_PLUS
19329
19330   ;
19331   return 0;
19332 }
19333 _ACEOF
19334 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19335 if { (eval echo "$as_me:19335: \"$ac_link\"") >&5
19336   (eval $ac_link) 2>&5
19337   ac_status=$?
19338   echo "$as_me:19338: \$? = $ac_status" >&5
19339   (exit "$ac_status"); } &&
19340          { ac_try='test -s "conftest$ac_exeext"'
19341   { (eval echo "$as_me:19341: \"$ac_try\"") >&5
19342   (eval $ac_try) 2>&5
19343   ac_status=$?
19344   echo "$as_me:19344: \$? = $ac_status" >&5
19345   (exit "$ac_status"); }; }; then
19346   cf_cv_curses_acs_map=$name; break
19347 else
19348   echo "$as_me: failed program was:" >&5
19349 cat "conftest.$ac_ext" >&5
19350 fi
19351 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19352 done
19353
19354 fi
19355 echo "$as_me:19355: result: $cf_cv_curses_acs_map" >&5
19356 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19357
19358 test "$cf_cv_curses_acs_map" != unknown &&
19359 cat >>confdefs.h <<EOF
19360 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19361 EOF
19362
19363 if test "$cf_enable_widec" = yes; then
19364
19365 echo "$as_me:19365: checking for wide alternate character set array" >&5
19366 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19367 if test "${cf_cv_curses_wacs_map+set}" = set; then
19368   echo $ECHO_N "(cached) $ECHO_C" >&6
19369 else
19370
19371         cf_cv_curses_wacs_map=unknown
19372         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19373         do
19374         cat >"conftest.$ac_ext" <<_ACEOF
19375 #line 19375 "configure"
19376 #include "confdefs.h"
19377
19378 #ifndef _XOPEN_SOURCE_EXTENDED
19379 #define _XOPEN_SOURCE_EXTENDED
19380 #endif
19381 #include <${cf_cv_ncurses_header:-curses.h}>
19382 int
19383 main (void)
19384 {
19385 void *foo = &(${name}['k']); (void)foo
19386   ;
19387   return 0;
19388 }
19389 _ACEOF
19390 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19391 if { (eval echo "$as_me:19391: \"$ac_link\"") >&5
19392   (eval $ac_link) 2>&5
19393   ac_status=$?
19394   echo "$as_me:19394: \$? = $ac_status" >&5
19395   (exit "$ac_status"); } &&
19396          { ac_try='test -s "conftest$ac_exeext"'
19397   { (eval echo "$as_me:19397: \"$ac_try\"") >&5
19398   (eval $ac_try) 2>&5
19399   ac_status=$?
19400   echo "$as_me:19400: \$? = $ac_status" >&5
19401   (exit "$ac_status"); }; }; then
19402   cf_cv_curses_wacs_map=$name
19403          break
19404 else
19405   echo "$as_me: failed program was:" >&5
19406 cat "conftest.$ac_ext" >&5
19407 fi
19408 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19409         done
19410 fi
19411 echo "$as_me:19411: result: $cf_cv_curses_wacs_map" >&5
19412 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19413
19414 test "$cf_cv_curses_wacs_map" != unknown &&
19415 cat >>confdefs.h <<EOF
19416 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19417 EOF
19418
19419 echo "$as_me:19419: checking for wide alternate character constants" >&5
19420 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19421 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19422   echo $ECHO_N "(cached) $ECHO_C" >&6
19423 else
19424
19425 cf_cv_curses_wacs_symbols=no
19426 if test "$cf_cv_curses_wacs_map" != unknown
19427 then
19428         cat >"conftest.$ac_ext" <<_ACEOF
19429 #line 19429 "configure"
19430 #include "confdefs.h"
19431
19432 #ifndef _XOPEN_SOURCE_EXTENDED
19433 #define _XOPEN_SOURCE_EXTENDED
19434 #endif
19435 #include <${cf_cv_ncurses_header:-curses.h}>
19436 int
19437 main (void)
19438 {
19439 cchar_t *foo = WACS_PLUS;
19440          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
19441   ;
19442   return 0;
19443 }
19444 _ACEOF
19445 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19446 if { (eval echo "$as_me:19446: \"$ac_link\"") >&5
19447   (eval $ac_link) 2>&5
19448   ac_status=$?
19449   echo "$as_me:19449: \$? = $ac_status" >&5
19450   (exit "$ac_status"); } &&
19451          { ac_try='test -s "conftest$ac_exeext"'
19452   { (eval echo "$as_me:19452: \"$ac_try\"") >&5
19453   (eval $ac_try) 2>&5
19454   ac_status=$?
19455   echo "$as_me:19455: \$? = $ac_status" >&5
19456   (exit "$ac_status"); }; }; then
19457   cf_cv_curses_wacs_symbols=yes
19458 else
19459   echo "$as_me: failed program was:" >&5
19460 cat "conftest.$ac_ext" >&5
19461 fi
19462 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19463 else
19464         cat >"conftest.$ac_ext" <<_ACEOF
19465 #line 19465 "configure"
19466 #include "confdefs.h"
19467
19468 #ifndef _XOPEN_SOURCE_EXTENDED
19469 #define _XOPEN_SOURCE_EXTENDED
19470 #endif
19471 #include <${cf_cv_ncurses_header:-curses.h}>
19472 int
19473 main (void)
19474 {
19475 cchar_t *foo = WACS_PLUS; (void)foo
19476   ;
19477   return 0;
19478 }
19479 _ACEOF
19480 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19481 if { (eval echo "$as_me:19481: \"$ac_link\"") >&5
19482   (eval $ac_link) 2>&5
19483   ac_status=$?
19484   echo "$as_me:19484: \$? = $ac_status" >&5
19485   (exit "$ac_status"); } &&
19486          { ac_try='test -s "conftest$ac_exeext"'
19487   { (eval echo "$as_me:19487: \"$ac_try\"") >&5
19488   (eval $ac_try) 2>&5
19489   ac_status=$?
19490   echo "$as_me:19490: \$? = $ac_status" >&5
19491   (exit "$ac_status"); }; }; then
19492   cf_cv_curses_wacs_symbols=yes
19493 else
19494   echo "$as_me: failed program was:" >&5
19495 cat "conftest.$ac_ext" >&5
19496 fi
19497 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19498 fi
19499
19500 fi
19501 echo "$as_me:19501: result: $cf_cv_curses_wacs_symbols" >&5
19502 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19503
19504 test "$cf_cv_curses_wacs_symbols" != no &&
19505 cat >>confdefs.h <<\EOF
19506 #define CURSES_WACS_SYMBOLS 1
19507 EOF
19508
19509 fi
19510
19511 echo "$as_me:19511: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19512 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19513 cat >"conftest.$ac_ext" <<_ACEOF
19514 #line 19514 "configure"
19515 #include "confdefs.h"
19516
19517 #ifndef _XOPEN_SOURCE_EXTENDED
19518 #define _XOPEN_SOURCE_EXTENDED
19519 #endif
19520 #include <${cf_cv_ncurses_header:-curses.h}>
19521 int
19522 main (void)
19523 {
19524
19525 attr_t foo
19526
19527   ;
19528   return 0;
19529 }
19530 _ACEOF
19531 rm -f "conftest.$ac_objext"
19532 if { (eval echo "$as_me:19532: \"$ac_compile\"") >&5
19533   (eval $ac_compile) 2>&5
19534   ac_status=$?
19535   echo "$as_me:19535: \$? = $ac_status" >&5
19536   (exit "$ac_status"); } &&
19537          { ac_try='test -s "conftest.$ac_objext"'
19538   { (eval echo "$as_me:19538: \"$ac_try\"") >&5
19539   (eval $ac_try) 2>&5
19540   ac_status=$?
19541   echo "$as_me:19541: \$? = $ac_status" >&5
19542   (exit "$ac_status"); }; }; then
19543   cf_result=yes
19544 else
19545   echo "$as_me: failed program was:" >&5
19546 cat "conftest.$ac_ext" >&5
19547 cf_result=no
19548 fi
19549 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19550 echo "$as_me:19550: result: $cf_result" >&5
19551 echo "${ECHO_T}$cf_result" >&6
19552 if test "$cf_result" = yes ; then
19553
19554 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19555
19556 cat >>confdefs.h <<EOF
19557 #define $cf_result 1
19558 EOF
19559
19560 else
19561
19562 cat >>confdefs.h <<EOF
19563 #define attr_t long
19564 EOF
19565
19566 fi
19567
19568 if test "$cf_enable_widec" = yes; then
19569
19570 # This is needed on Tru64 5.0 to declare mbstate_t
19571 echo "$as_me:19571: checking if we must include wchar.h to declare mbstate_t" >&5
19572 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19573 if test "${cf_cv_mbstate_t+set}" = set; then
19574   echo $ECHO_N "(cached) $ECHO_C" >&6
19575 else
19576
19577 cat >"conftest.$ac_ext" <<_ACEOF
19578 #line 19578 "configure"
19579 #include "confdefs.h"
19580
19581 #include <stdlib.h>
19582 #include <stdarg.h>
19583 #include <stdio.h>
19584 #ifdef HAVE_LIBUTF8_H
19585 #include <libutf8.h>
19586 #endif
19587 int
19588 main (void)
19589 {
19590 mbstate_t state
19591   ;
19592   return 0;
19593 }
19594 _ACEOF
19595 rm -f "conftest.$ac_objext"
19596 if { (eval echo "$as_me:19596: \"$ac_compile\"") >&5
19597   (eval $ac_compile) 2>&5
19598   ac_status=$?
19599   echo "$as_me:19599: \$? = $ac_status" >&5
19600   (exit "$ac_status"); } &&
19601          { ac_try='test -s "conftest.$ac_objext"'
19602   { (eval echo "$as_me:19602: \"$ac_try\"") >&5
19603   (eval $ac_try) 2>&5
19604   ac_status=$?
19605   echo "$as_me:19605: \$? = $ac_status" >&5
19606   (exit "$ac_status"); }; }; then
19607   cf_cv_mbstate_t=no
19608 else
19609   echo "$as_me: failed program was:" >&5
19610 cat "conftest.$ac_ext" >&5
19611 cat >"conftest.$ac_ext" <<_ACEOF
19612 #line 19612 "configure"
19613 #include "confdefs.h"
19614
19615 #include <stdlib.h>
19616 #include <stdarg.h>
19617 #include <stdio.h>
19618 #include <wchar.h>
19619 #ifdef HAVE_LIBUTF8_H
19620 #include <libutf8.h>
19621 #endif
19622 int
19623 main (void)
19624 {
19625 mbstate_t value
19626   ;
19627   return 0;
19628 }
19629 _ACEOF
19630 rm -f "conftest.$ac_objext"
19631 if { (eval echo "$as_me:19631: \"$ac_compile\"") >&5
19632   (eval $ac_compile) 2>&5
19633   ac_status=$?
19634   echo "$as_me:19634: \$? = $ac_status" >&5
19635   (exit "$ac_status"); } &&
19636          { ac_try='test -s "conftest.$ac_objext"'
19637   { (eval echo "$as_me:19637: \"$ac_try\"") >&5
19638   (eval $ac_try) 2>&5
19639   ac_status=$?
19640   echo "$as_me:19640: \$? = $ac_status" >&5
19641   (exit "$ac_status"); }; }; then
19642   cf_cv_mbstate_t=yes
19643 else
19644   echo "$as_me: failed program was:" >&5
19645 cat "conftest.$ac_ext" >&5
19646 cf_cv_mbstate_t=unknown
19647 fi
19648 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19649 fi
19650 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19651 fi
19652 echo "$as_me:19652: result: $cf_cv_mbstate_t" >&5
19653 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19654
19655 if test "$cf_cv_mbstate_t" = yes ; then
19656
19657 cat >>confdefs.h <<\EOF
19658 #define NEED_WCHAR_H 1
19659 EOF
19660
19661         NEED_WCHAR_H=1
19662 fi
19663
19664 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19665 if test "$cf_cv_mbstate_t" = unknown ; then
19666         NCURSES_MBSTATE_T=1
19667 fi
19668
19669 # if we find mbstate_t in either place, use substitution to provide a fallback.
19670 if test "$cf_cv_mbstate_t" != unknown ; then
19671         NCURSES_OK_MBSTATE_T=1
19672 fi
19673
19674 # This is needed on Tru64 5.0 to declare wchar_t
19675 echo "$as_me:19675: checking if we must include wchar.h to declare wchar_t" >&5
19676 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19677 if test "${cf_cv_wchar_t+set}" = set; then
19678   echo $ECHO_N "(cached) $ECHO_C" >&6
19679 else
19680
19681 cat >"conftest.$ac_ext" <<_ACEOF
19682 #line 19682 "configure"
19683 #include "confdefs.h"
19684
19685 #include <stdlib.h>
19686 #include <stdarg.h>
19687 #include <stdio.h>
19688 #ifdef HAVE_LIBUTF8_H
19689 #include <libutf8.h>
19690 #endif
19691 int
19692 main (void)
19693 {
19694 wchar_t state
19695   ;
19696   return 0;
19697 }
19698 _ACEOF
19699 rm -f "conftest.$ac_objext"
19700 if { (eval echo "$as_me:19700: \"$ac_compile\"") >&5
19701   (eval $ac_compile) 2>&5
19702   ac_status=$?
19703   echo "$as_me:19703: \$? = $ac_status" >&5
19704   (exit "$ac_status"); } &&
19705          { ac_try='test -s "conftest.$ac_objext"'
19706   { (eval echo "$as_me:19706: \"$ac_try\"") >&5
19707   (eval $ac_try) 2>&5
19708   ac_status=$?
19709   echo "$as_me:19709: \$? = $ac_status" >&5
19710   (exit "$ac_status"); }; }; then
19711   cf_cv_wchar_t=no
19712 else
19713   echo "$as_me: failed program was:" >&5
19714 cat "conftest.$ac_ext" >&5
19715 cat >"conftest.$ac_ext" <<_ACEOF
19716 #line 19716 "configure"
19717 #include "confdefs.h"
19718
19719 #include <stdlib.h>
19720 #include <stdarg.h>
19721 #include <stdio.h>
19722 #include <wchar.h>
19723 #ifdef HAVE_LIBUTF8_H
19724 #include <libutf8.h>
19725 #endif
19726 int
19727 main (void)
19728 {
19729 wchar_t value
19730   ;
19731   return 0;
19732 }
19733 _ACEOF
19734 rm -f "conftest.$ac_objext"
19735 if { (eval echo "$as_me:19735: \"$ac_compile\"") >&5
19736   (eval $ac_compile) 2>&5
19737   ac_status=$?
19738   echo "$as_me:19738: \$? = $ac_status" >&5
19739   (exit "$ac_status"); } &&
19740          { ac_try='test -s "conftest.$ac_objext"'
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   cf_cv_wchar_t=yes
19747 else
19748   echo "$as_me: failed program was:" >&5
19749 cat "conftest.$ac_ext" >&5
19750 cf_cv_wchar_t=unknown
19751 fi
19752 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19753 fi
19754 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19755 fi
19756 echo "$as_me:19756: result: $cf_cv_wchar_t" >&5
19757 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19758
19759 if test "$cf_cv_wchar_t" = yes ; then
19760
19761 cat >>confdefs.h <<\EOF
19762 #define NEED_WCHAR_H 1
19763 EOF
19764
19765         NEED_WCHAR_H=1
19766 fi
19767
19768 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19769 if test "$cf_cv_wchar_t" = unknown ; then
19770         NCURSES_WCHAR_T=1
19771 fi
19772
19773 # if we find wchar_t in either place, use substitution to provide a fallback.
19774 if test "$cf_cv_wchar_t" != unknown ; then
19775         NCURSES_OK_WCHAR_T=1
19776 fi
19777
19778 # This is needed on Tru64 5.0 to declare wint_t
19779 echo "$as_me:19779: checking if we must include wchar.h to declare wint_t" >&5
19780 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19781 if test "${cf_cv_wint_t+set}" = set; then
19782   echo $ECHO_N "(cached) $ECHO_C" >&6
19783 else
19784
19785 cat >"conftest.$ac_ext" <<_ACEOF
19786 #line 19786 "configure"
19787 #include "confdefs.h"
19788
19789 #include <stdlib.h>
19790 #include <stdarg.h>
19791 #include <stdio.h>
19792 #ifdef HAVE_LIBUTF8_H
19793 #include <libutf8.h>
19794 #endif
19795 int
19796 main (void)
19797 {
19798 wint_t state
19799   ;
19800   return 0;
19801 }
19802 _ACEOF
19803 rm -f "conftest.$ac_objext"
19804 if { (eval echo "$as_me:19804: \"$ac_compile\"") >&5
19805   (eval $ac_compile) 2>&5
19806   ac_status=$?
19807   echo "$as_me:19807: \$? = $ac_status" >&5
19808   (exit "$ac_status"); } &&
19809          { ac_try='test -s "conftest.$ac_objext"'
19810   { (eval echo "$as_me:19810: \"$ac_try\"") >&5
19811   (eval $ac_try) 2>&5
19812   ac_status=$?
19813   echo "$as_me:19813: \$? = $ac_status" >&5
19814   (exit "$ac_status"); }; }; then
19815   cf_cv_wint_t=no
19816 else
19817   echo "$as_me: failed program was:" >&5
19818 cat "conftest.$ac_ext" >&5
19819 cat >"conftest.$ac_ext" <<_ACEOF
19820 #line 19820 "configure"
19821 #include "confdefs.h"
19822
19823 #include <stdlib.h>
19824 #include <stdarg.h>
19825 #include <stdio.h>
19826 #include <wchar.h>
19827 #ifdef HAVE_LIBUTF8_H
19828 #include <libutf8.h>
19829 #endif
19830 int
19831 main (void)
19832 {
19833 wint_t value
19834   ;
19835   return 0;
19836 }
19837 _ACEOF
19838 rm -f "conftest.$ac_objext"
19839 if { (eval echo "$as_me:19839: \"$ac_compile\"") >&5
19840   (eval $ac_compile) 2>&5
19841   ac_status=$?
19842   echo "$as_me:19842: \$? = $ac_status" >&5
19843   (exit "$ac_status"); } &&
19844          { ac_try='test -s "conftest.$ac_objext"'
19845   { (eval echo "$as_me:19845: \"$ac_try\"") >&5
19846   (eval $ac_try) 2>&5
19847   ac_status=$?
19848   echo "$as_me:19848: \$? = $ac_status" >&5
19849   (exit "$ac_status"); }; }; then
19850   cf_cv_wint_t=yes
19851 else
19852   echo "$as_me: failed program was:" >&5
19853 cat "conftest.$ac_ext" >&5
19854 cf_cv_wint_t=unknown
19855 fi
19856 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19857 fi
19858 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19859 fi
19860 echo "$as_me:19860: result: $cf_cv_wint_t" >&5
19861 echo "${ECHO_T}$cf_cv_wint_t" >&6
19862
19863 if test "$cf_cv_wint_t" = yes ; then
19864
19865 cat >>confdefs.h <<\EOF
19866 #define NEED_WCHAR_H 1
19867 EOF
19868
19869         NEED_WCHAR_H=1
19870 fi
19871
19872 # if we do not find wint_t in either place, use substitution to provide a fallback.
19873 if test "$cf_cv_wint_t" = unknown ; then
19874         NCURSES_WINT_T=1
19875 fi
19876
19877 # if we find wint_t in either place, use substitution to provide a fallback.
19878 if test "$cf_cv_wint_t" != unknown ; then
19879         NCURSES_OK_WINT_T=1
19880 fi
19881
19882         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19883
19884 echo "$as_me:19884: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19885 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19886 cat >"conftest.$ac_ext" <<_ACEOF
19887 #line 19887 "configure"
19888 #include "confdefs.h"
19889
19890 #ifndef _XOPEN_SOURCE_EXTENDED
19891 #define _XOPEN_SOURCE_EXTENDED
19892 #endif
19893 #include <${cf_cv_ncurses_header:-curses.h}>
19894 int
19895 main (void)
19896 {
19897
19898 mbstate_t foo
19899
19900   ;
19901   return 0;
19902 }
19903 _ACEOF
19904 rm -f "conftest.$ac_objext"
19905 if { (eval echo "$as_me:19905: \"$ac_compile\"") >&5
19906   (eval $ac_compile) 2>&5
19907   ac_status=$?
19908   echo "$as_me:19908: \$? = $ac_status" >&5
19909   (exit "$ac_status"); } &&
19910          { ac_try='test -s "conftest.$ac_objext"'
19911   { (eval echo "$as_me:19911: \"$ac_try\"") >&5
19912   (eval $ac_try) 2>&5
19913   ac_status=$?
19914   echo "$as_me:19914: \$? = $ac_status" >&5
19915   (exit "$ac_status"); }; }; then
19916   cf_result=yes
19917 else
19918   echo "$as_me: failed program was:" >&5
19919 cat "conftest.$ac_ext" >&5
19920 cf_result=no
19921 fi
19922 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19923 echo "$as_me:19923: result: $cf_result" >&5
19924 echo "${ECHO_T}$cf_result" >&6
19925 if test "$cf_result" = yes ; then
19926
19927 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19928
19929 cat >>confdefs.h <<EOF
19930 #define $cf_result 1
19931 EOF
19932
19933 else
19934
19935 cat >>confdefs.h <<EOF
19936 #define mbstate_t long
19937 EOF
19938
19939 fi
19940
19941         fi
19942
19943         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19944
19945 echo "$as_me:19945: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19946 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19947 cat >"conftest.$ac_ext" <<_ACEOF
19948 #line 19948 "configure"
19949 #include "confdefs.h"
19950
19951 #ifndef _XOPEN_SOURCE_EXTENDED
19952 #define _XOPEN_SOURCE_EXTENDED
19953 #endif
19954 #include <${cf_cv_ncurses_header:-curses.h}>
19955 int
19956 main (void)
19957 {
19958
19959 wchar_t foo
19960
19961   ;
19962   return 0;
19963 }
19964 _ACEOF
19965 rm -f "conftest.$ac_objext"
19966 if { (eval echo "$as_me:19966: \"$ac_compile\"") >&5
19967   (eval $ac_compile) 2>&5
19968   ac_status=$?
19969   echo "$as_me:19969: \$? = $ac_status" >&5
19970   (exit "$ac_status"); } &&
19971          { ac_try='test -s "conftest.$ac_objext"'
19972   { (eval echo "$as_me:19972: \"$ac_try\"") >&5
19973   (eval $ac_try) 2>&5
19974   ac_status=$?
19975   echo "$as_me:19975: \$? = $ac_status" >&5
19976   (exit "$ac_status"); }; }; then
19977   cf_result=yes
19978 else
19979   echo "$as_me: failed program was:" >&5
19980 cat "conftest.$ac_ext" >&5
19981 cf_result=no
19982 fi
19983 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19984 echo "$as_me:19984: result: $cf_result" >&5
19985 echo "${ECHO_T}$cf_result" >&6
19986 if test "$cf_result" = yes ; then
19987
19988 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19989
19990 cat >>confdefs.h <<EOF
19991 #define $cf_result 1
19992 EOF
19993
19994 else
19995
19996 cat >>confdefs.h <<EOF
19997 #define wchar_t long
19998 EOF
19999
20000 fi
20001
20002         fi
20003
20004         if test "$NCURSES_OK_WINT_T" = 0 ; then
20005
20006 echo "$as_me:20006: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20007 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20008 cat >"conftest.$ac_ext" <<_ACEOF
20009 #line 20009 "configure"
20010 #include "confdefs.h"
20011
20012 #ifndef _XOPEN_SOURCE_EXTENDED
20013 #define _XOPEN_SOURCE_EXTENDED
20014 #endif
20015 #include <${cf_cv_ncurses_header:-curses.h}>
20016 int
20017 main (void)
20018 {
20019
20020 wint_t foo
20021
20022   ;
20023   return 0;
20024 }
20025 _ACEOF
20026 rm -f "conftest.$ac_objext"
20027 if { (eval echo "$as_me:20027: \"$ac_compile\"") >&5
20028   (eval $ac_compile) 2>&5
20029   ac_status=$?
20030   echo "$as_me:20030: \$? = $ac_status" >&5
20031   (exit "$ac_status"); } &&
20032          { ac_try='test -s "conftest.$ac_objext"'
20033   { (eval echo "$as_me:20033: \"$ac_try\"") >&5
20034   (eval $ac_try) 2>&5
20035   ac_status=$?
20036   echo "$as_me:20036: \$? = $ac_status" >&5
20037   (exit "$ac_status"); }; }; then
20038   cf_result=yes
20039 else
20040   echo "$as_me: failed program was:" >&5
20041 cat "conftest.$ac_ext" >&5
20042 cf_result=no
20043 fi
20044 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20045 echo "$as_me:20045: result: $cf_result" >&5
20046 echo "${ECHO_T}$cf_result" >&6
20047 if test "$cf_result" = yes ; then
20048
20049 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20050
20051 cat >>confdefs.h <<EOF
20052 #define $cf_result 1
20053 EOF
20054
20055 else
20056
20057 cat >>confdefs.h <<EOF
20058 #define wint_t long
20059 EOF
20060
20061 fi
20062
20063         fi
20064 fi
20065
20066 for cf_data in \
20067 TABSIZE \
20068 curscr \
20069 ospeed \
20070 boolnames \
20071 boolfnames \
20072 ttytype
20073 do
20074 echo "$as_me:20074: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20075 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20076
20077 cat >"conftest.$ac_ext" <<_ACEOF
20078 #line 20078 "configure"
20079 #include "confdefs.h"
20080
20081 #ifdef HAVE_XCURSES
20082 #include <xcurses.h>
20083 char * XCursesProgramName = "test";
20084 #else
20085 #include <${cf_cv_ncurses_header:-curses.h}>
20086 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20087 #include <ncursesw/term.h>
20088 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20089 #include <ncurses/term.h>
20090 #elif defined(HAVE_TERM_H)
20091 #include <term.h>
20092 #endif
20093 #endif
20094
20095 int
20096 main (void)
20097 {
20098
20099 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20100         const void *foo = (const void *)($cf_data);
20101 #else
20102         const void *foo = &($cf_data);
20103 #endif
20104         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20105
20106   ;
20107   return 0;
20108 }
20109 _ACEOF
20110 rm -f "conftest.$ac_objext"
20111 if { (eval echo "$as_me:20111: \"$ac_compile\"") >&5
20112   (eval $ac_compile) 2>&5
20113   ac_status=$?
20114   echo "$as_me:20114: \$? = $ac_status" >&5
20115   (exit "$ac_status"); } &&
20116          { ac_try='test -s "conftest.$ac_objext"'
20117   { (eval echo "$as_me:20117: \"$ac_try\"") >&5
20118   (eval $ac_try) 2>&5
20119   ac_status=$?
20120   echo "$as_me:20120: \$? = $ac_status" >&5
20121   (exit "$ac_status"); }; }; then
20122   cf_result=yes
20123
20124 else
20125   echo "$as_me: failed program was:" >&5
20126 cat "conftest.$ac_ext" >&5
20127 cf_result=no
20128 fi
20129 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20130 echo "$as_me:20130: result: $cf_result" >&5
20131 echo "${ECHO_T}$cf_result" >&6
20132
20133 if test "$cf_result" = yes ; then
20134
20135 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20136
20137         cat >>confdefs.h <<EOF
20138 #define $cf_result 1
20139 EOF
20140
20141 else
20142         echo "$as_me:20142: checking for data $cf_data in library" >&5
20143 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20144         # BSD linkers insist on making weak linkage, but resolve at runtime.
20145         if test "$cross_compiling" = yes; then
20146
20147         # cross-compiling
20148         cat >"conftest.$ac_ext" <<_ACEOF
20149 #line 20149 "configure"
20150 #include "confdefs.h"
20151
20152 #ifdef HAVE_XCURSES
20153 #include <xcurses.h>
20154 char * XCursesProgramName = "test";
20155 #else
20156 #include <${cf_cv_ncurses_header:-curses.h}>
20157 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20158 #include <ncursesw/term.h>
20159 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20160 #include <ncurses/term.h>
20161 #elif defined(HAVE_TERM_H)
20162 #include <term.h>
20163 #endif
20164 #endif
20165
20166 extern char $cf_data;
20167 int
20168 main (void)
20169 {
20170
20171         do {
20172
20173 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20174         const void *foo = (const void *)($cf_data);
20175 #else
20176         const void *foo = &($cf_data);
20177 #endif
20178         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20179
20180                 ${cf_cv_main_return:-return}(foo == 0);
20181         } while (0)
20182
20183   ;
20184   return 0;
20185 }
20186 _ACEOF
20187 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20188 if { (eval echo "$as_me:20188: \"$ac_link\"") >&5
20189   (eval $ac_link) 2>&5
20190   ac_status=$?
20191   echo "$as_me:20191: \$? = $ac_status" >&5
20192   (exit "$ac_status"); } &&
20193          { ac_try='test -s "conftest$ac_exeext"'
20194   { (eval echo "$as_me:20194: \"$ac_try\"") >&5
20195   (eval $ac_try) 2>&5
20196   ac_status=$?
20197   echo "$as_me:20197: \$? = $ac_status" >&5
20198   (exit "$ac_status"); }; }; then
20199   cf_result=yes
20200 else
20201   echo "$as_me: failed program was:" >&5
20202 cat "conftest.$ac_ext" >&5
20203 cf_result=no
20204 fi
20205 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20206
20207 else
20208   cat >"conftest.$ac_ext" <<_ACEOF
20209 #line 20209 "configure"
20210 #include "confdefs.h"
20211
20212 #ifdef HAVE_XCURSES
20213 #include <xcurses.h>
20214 char * XCursesProgramName = "test";
20215 #else
20216 #include <${cf_cv_ncurses_header:-curses.h}>
20217 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20218 #include <ncursesw/term.h>
20219 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20220 #include <ncurses/term.h>
20221 #elif defined(HAVE_TERM_H)
20222 #include <term.h>
20223 #endif
20224 #endif
20225
20226 extern char $cf_data;
20227 int main(void)
20228 {
20229
20230 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20231         const void *foo = (const void *)($cf_data);
20232 #else
20233         const void *foo = &($cf_data);
20234 #endif
20235         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20236
20237         ${cf_cv_main_return:-return}(foo == 0);
20238 }
20239 _ACEOF
20240 rm -f "conftest$ac_exeext"
20241 if { (eval echo "$as_me:20241: \"$ac_link\"") >&5
20242   (eval $ac_link) 2>&5
20243   ac_status=$?
20244   echo "$as_me:20244: \$? = $ac_status" >&5
20245   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
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_result=yes
20252
20253 else
20254   echo "$as_me: program exited with status $ac_status" >&5
20255 echo "$as_me: failed program was:" >&5
20256 cat "conftest.$ac_ext" >&5
20257 cf_result=no
20258 fi
20259 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20260 fi
20261         echo "$as_me:20261: result: $cf_result" >&5
20262 echo "${ECHO_T}$cf_result" >&6
20263         if test "$cf_result" = yes ; then
20264
20265 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20266
20267                 cat >>confdefs.h <<EOF
20268 #define $cf_result 1
20269 EOF
20270
20271                 # do not exit loop here, since we prefer system's declarations
20272         fi
20273 fi
20274 done
20275
20276 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20277 then
20278         echo "$as_me:20278: checking for X" >&5
20279 echo $ECHO_N "checking for X... $ECHO_C" >&6
20280
20281 # Check whether --with-x or --without-x was given.
20282 if test "${with_x+set}" = set; then
20283   withval="$with_x"
20284
20285 fi;
20286 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20287 if test "x$with_x" = xno; then
20288   # The user explicitly disabled X.
20289   have_x=disabled
20290 else
20291   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20292     # Both variables are already set.
20293     have_x=yes
20294   else
20295     if test "${ac_cv_have_x+set}" = set; then
20296   echo $ECHO_N "(cached) $ECHO_C" >&6
20297 else
20298   # One or both of the vars are not set, and there is no cached value.
20299 ac_x_includes=no ac_x_libraries=no
20300 rm -fr conftest.dir
20301 if mkdir conftest.dir; then
20302   cd conftest.dir
20303   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20304   cat >Imakefile <<'EOF'
20305 acfindx:
20306         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20307 EOF
20308   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20309     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20310     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20311     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20312     for ac_extension in a so sl dylib dll; do
20313       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20314          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20315         ac_im_usrlibdir=$ac_im_libdir; break
20316       fi
20317     done
20318     # Screen out bogus values from the imake configuration.  They are
20319     # bogus both because they are the default anyway, and because
20320     # using them would break gcc on systems where it needs fixed includes.
20321     case $ac_im_incroot in
20322         /usr/include) ;;
20323         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20324     esac
20325     case $ac_im_usrlibdir in
20326         /usr/lib | /lib) ;;
20327         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20328     esac
20329   fi
20330   cd ..
20331   rm -fr conftest.dir
20332 fi
20333
20334 # Standard set of common directories for X headers.
20335 # Check X11 before X11Rn because it is often a symlink to the current release.
20336 ac_x_header_dirs='
20337 /usr/X11/include
20338 /usr/X11R7/include
20339 /usr/X11R6/include
20340 /usr/X11R5/include
20341 /usr/X11R4/include
20342
20343 /opt/local/include
20344 /opt/X11/include
20345
20346 /usr/include/X11
20347 /usr/include/X11R7
20348 /usr/include/X11R6
20349 /usr/include/X11R5
20350 /usr/include/X11R4
20351
20352 /usr/local/X11/include
20353 /usr/local/X11R7/include
20354 /usr/local/X11R6/include
20355 /usr/local/X11R5/include
20356 /usr/local/X11R4/include
20357
20358 /usr/local/include/X11
20359 /usr/local/include/X11R7
20360 /usr/local/include/X11R6
20361 /usr/local/include/X11R5
20362 /usr/local/include/X11R4
20363
20364 /usr/X386/include
20365 /usr/x386/include
20366 /usr/XFree86/include/X11
20367
20368 /usr/include
20369 /usr/local/include
20370 /usr/unsupported/include
20371 /usr/athena/include
20372 /usr/local/x11r5/include
20373 /usr/lpp/Xamples/include
20374
20375 /usr/openwin/include
20376 /usr/openwin/share/include'
20377
20378 if test "$ac_x_includes" = no; then
20379   # Guess where to find include files, by looking for Intrinsic.h.
20380   # First, try using that file with no special directory specified.
20381   cat >"conftest.$ac_ext" <<_ACEOF
20382 #line 20382 "configure"
20383 #include "confdefs.h"
20384 #include <X11/Intrinsic.h>
20385 _ACEOF
20386 if { (eval echo "$as_me:20386: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20387   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20388   ac_status=$?
20389   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20390   rm -f conftest.er1
20391   cat conftest.err >&5
20392   echo "$as_me:20392: \$? = $ac_status" >&5
20393   (exit "$ac_status"); } >/dev/null; then
20394   if test -s conftest.err; then
20395     ac_cpp_err=$ac_c_preproc_warn_flag
20396   else
20397     ac_cpp_err=
20398   fi
20399 else
20400   ac_cpp_err=yes
20401 fi
20402 if test -z "$ac_cpp_err"; then
20403   # We can compile using X headers with no special include directory.
20404 ac_x_includes=
20405 else
20406   echo "$as_me: failed program was:" >&5
20407   cat "conftest.$ac_ext" >&5
20408   for ac_dir in $ac_x_header_dirs; do
20409   if test -r "$ac_dir/X11/Intrinsic.h"; then
20410     ac_x_includes=$ac_dir
20411     break
20412   fi
20413 done
20414 fi
20415 rm -f conftest.err "conftest.$ac_ext"
20416 fi # $ac_x_includes = no
20417
20418 if test "$ac_x_libraries" = no; then
20419   # Check for the libraries.
20420   # See if we find them without any special options.
20421   # Don't add to $LIBS permanently.
20422   ac_save_LIBS=$LIBS
20423   LIBS="-lXt $LIBS"
20424   cat >"conftest.$ac_ext" <<_ACEOF
20425 #line 20425 "configure"
20426 #include "confdefs.h"
20427 #include <X11/Intrinsic.h>
20428 int
20429 main (void)
20430 {
20431 XtMalloc (0)
20432   ;
20433   return 0;
20434 }
20435 _ACEOF
20436 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20437 if { (eval echo "$as_me:20437: \"$ac_link\"") >&5
20438   (eval $ac_link) 2>&5
20439   ac_status=$?
20440   echo "$as_me:20440: \$? = $ac_status" >&5
20441   (exit "$ac_status"); } &&
20442          { ac_try='test -s "conftest$ac_exeext"'
20443   { (eval echo "$as_me:20443: \"$ac_try\"") >&5
20444   (eval $ac_try) 2>&5
20445   ac_status=$?
20446   echo "$as_me:20446: \$? = $ac_status" >&5
20447   (exit "$ac_status"); }; }; then
20448   LIBS=$ac_save_LIBS
20449 # We can link X programs with no special library path.
20450 ac_x_libraries=
20451 else
20452   echo "$as_me: failed program was:" >&5
20453 cat "conftest.$ac_ext" >&5
20454 LIBS=$ac_save_LIBS
20455 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20456 do
20457   # Don't even attempt the hair of trying to link an X program!
20458   for ac_extension in a so sl dylib dll; do
20459     if test -r "$ac_dir/libXt.$ac_extension"; then
20460       ac_x_libraries=$ac_dir
20461       break 2
20462     fi
20463   done
20464 done
20465 fi
20466 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20467 fi # $ac_x_libraries = no
20468
20469 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20470   # Didn't find X anywhere.  Cache the known absence of X.
20471   ac_cv_have_x="have_x=no"
20472 else
20473   # Record where we found X for the cache.
20474   ac_cv_have_x="have_x=yes \
20475                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20476 fi
20477 fi
20478
20479   fi
20480   eval "$ac_cv_have_x"
20481 fi # $with_x != no
20482
20483 if test "$have_x" != yes; then
20484   echo "$as_me:20484: result: $have_x" >&5
20485 echo "${ECHO_T}$have_x" >&6
20486   no_x=yes
20487 else
20488   # If each of the values was on the command line, it overrides each guess.
20489   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20490   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20491   # Update the cache value to reflect the command line values.
20492   ac_cv_have_x="have_x=yes \
20493                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20494   echo "$as_me:20494: result: libraries $x_libraries, headers $x_includes" >&5
20495 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20496 fi
20497
20498         if test "$no_x" = yes; then
20499   # Not all programs may use this symbol, but it does not hurt to define it.
20500
20501 cat >>confdefs.h <<\EOF
20502 #define X_DISPLAY_MISSING 1
20503 EOF
20504
20505   X_CFLAGS=
20506   X_PRE_LIBS=
20507   X_LIBS=
20508   X_EXTRA_LIBS=
20509 else
20510   if test -n "$x_includes"; then
20511     X_CFLAGS="$X_CFLAGS -I$x_includes"
20512   fi
20513
20514   # It would also be nice to do this for all -L options, not just this one.
20515   if test -n "$x_libraries"; then
20516     X_LIBS="$X_LIBS -L$x_libraries"
20517     # For Solaris; some versions of Sun CC require a space after -R and
20518     # others require no space.  Words are not sufficient . . . .
20519     case `(uname -sr) 2>/dev/null` in
20520     "SunOS 5"*)
20521       echo "$as_me:20521: checking whether -R must be followed by a space" >&5
20522 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20523       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20524       cat >"conftest.$ac_ext" <<_ACEOF
20525 #line 20525 "configure"
20526 #include "confdefs.h"
20527
20528 int
20529 main (void)
20530 {
20531
20532   ;
20533   return 0;
20534 }
20535 _ACEOF
20536 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20537 if { (eval echo "$as_me:20537: \"$ac_link\"") >&5
20538   (eval $ac_link) 2>&5
20539   ac_status=$?
20540   echo "$as_me:20540: \$? = $ac_status" >&5
20541   (exit "$ac_status"); } &&
20542          { ac_try='test -s "conftest$ac_exeext"'
20543   { (eval echo "$as_me:20543: \"$ac_try\"") >&5
20544   (eval $ac_try) 2>&5
20545   ac_status=$?
20546   echo "$as_me:20546: \$? = $ac_status" >&5
20547   (exit "$ac_status"); }; }; then
20548   ac_R_nospace=yes
20549 else
20550   echo "$as_me: failed program was:" >&5
20551 cat "conftest.$ac_ext" >&5
20552 ac_R_nospace=no
20553 fi
20554 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20555       if test $ac_R_nospace = yes; then
20556         echo "$as_me:20556: result: no" >&5
20557 echo "${ECHO_T}no" >&6
20558         X_LIBS="$X_LIBS -R$x_libraries"
20559       else
20560         LIBS="$ac_xsave_LIBS -R $x_libraries"
20561         cat >"conftest.$ac_ext" <<_ACEOF
20562 #line 20562 "configure"
20563 #include "confdefs.h"
20564
20565 int
20566 main (void)
20567 {
20568
20569   ;
20570   return 0;
20571 }
20572 _ACEOF
20573 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20574 if { (eval echo "$as_me:20574: \"$ac_link\"") >&5
20575   (eval $ac_link) 2>&5
20576   ac_status=$?
20577   echo "$as_me:20577: \$? = $ac_status" >&5
20578   (exit "$ac_status"); } &&
20579          { ac_try='test -s "conftest$ac_exeext"'
20580   { (eval echo "$as_me:20580: \"$ac_try\"") >&5
20581   (eval $ac_try) 2>&5
20582   ac_status=$?
20583   echo "$as_me:20583: \$? = $ac_status" >&5
20584   (exit "$ac_status"); }; }; then
20585   ac_R_space=yes
20586 else
20587   echo "$as_me: failed program was:" >&5
20588 cat "conftest.$ac_ext" >&5
20589 ac_R_space=no
20590 fi
20591 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20592         if test $ac_R_space = yes; then
20593           echo "$as_me:20593: result: yes" >&5
20594 echo "${ECHO_T}yes" >&6
20595           X_LIBS="$X_LIBS -R $x_libraries"
20596         else
20597           echo "$as_me:20597: result: neither works" >&5
20598 echo "${ECHO_T}neither works" >&6
20599         fi
20600       fi
20601       LIBS=$ac_xsave_LIBS
20602     esac
20603   fi
20604
20605   # Check for system-dependent libraries X programs must link with.
20606   # Do this before checking for the system-independent R6 libraries
20607   # (-lICE), since we may need -lsocket or whatever for X linking.
20608
20609   if test "$ISC" = yes; then
20610     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20611   else
20612     # Martyn Johnson says this is needed for Ultrix, if the X
20613     # libraries were built with DECnet support.  And Karl Berry says
20614     # the Alpha needs dnet_stub (dnet does not exist).
20615     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20616     cat >"conftest.$ac_ext" <<_ACEOF
20617 #line 20617 "configure"
20618 #include "confdefs.h"
20619
20620 /* Override any gcc2 internal prototype to avoid an error.  */
20621 #ifdef __cplusplus
20622 extern "C"
20623 #endif
20624 /* We use char because int might match the return type of a gcc2
20625    builtin and then its argument prototype would still apply.  */
20626 char XOpenDisplay ();
20627 int
20628 main (void)
20629 {
20630 XOpenDisplay ();
20631   ;
20632   return 0;
20633 }
20634 _ACEOF
20635 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20636 if { (eval echo "$as_me:20636: \"$ac_link\"") >&5
20637   (eval $ac_link) 2>&5
20638   ac_status=$?
20639   echo "$as_me:20639: \$? = $ac_status" >&5
20640   (exit "$ac_status"); } &&
20641          { ac_try='test -s "conftest$ac_exeext"'
20642   { (eval echo "$as_me:20642: \"$ac_try\"") >&5
20643   (eval $ac_try) 2>&5
20644   ac_status=$?
20645   echo "$as_me:20645: \$? = $ac_status" >&5
20646   (exit "$ac_status"); }; }; then
20647   :
20648 else
20649   echo "$as_me: failed program was:" >&5
20650 cat "conftest.$ac_ext" >&5
20651 echo "$as_me:20651: checking for dnet_ntoa in -ldnet" >&5
20652 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20653 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20654   echo $ECHO_N "(cached) $ECHO_C" >&6
20655 else
20656   ac_check_lib_save_LIBS=$LIBS
20657 LIBS="-ldnet  $LIBS"
20658 cat >"conftest.$ac_ext" <<_ACEOF
20659 #line 20659 "configure"
20660 #include "confdefs.h"
20661
20662 /* Override any gcc2 internal prototype to avoid an error.  */
20663 #ifdef __cplusplus
20664 extern "C"
20665 #endif
20666 /* We use char because int might match the return type of a gcc2
20667    builtin and then its argument prototype would still apply.  */
20668 char dnet_ntoa ();
20669 int
20670 main (void)
20671 {
20672 dnet_ntoa ();
20673   ;
20674   return 0;
20675 }
20676 _ACEOF
20677 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20678 if { (eval echo "$as_me:20678: \"$ac_link\"") >&5
20679   (eval $ac_link) 2>&5
20680   ac_status=$?
20681   echo "$as_me:20681: \$? = $ac_status" >&5
20682   (exit "$ac_status"); } &&
20683          { ac_try='test -s "conftest$ac_exeext"'
20684   { (eval echo "$as_me:20684: \"$ac_try\"") >&5
20685   (eval $ac_try) 2>&5
20686   ac_status=$?
20687   echo "$as_me:20687: \$? = $ac_status" >&5
20688   (exit "$ac_status"); }; }; then
20689   ac_cv_lib_dnet_dnet_ntoa=yes
20690 else
20691   echo "$as_me: failed program was:" >&5
20692 cat "conftest.$ac_ext" >&5
20693 ac_cv_lib_dnet_dnet_ntoa=no
20694 fi
20695 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20696 LIBS=$ac_check_lib_save_LIBS
20697 fi
20698 echo "$as_me:20698: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20699 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20700 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
20701   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20702 fi
20703
20704     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20705       echo "$as_me:20705: checking for dnet_ntoa in -ldnet_stub" >&5
20706 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20707 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20708   echo $ECHO_N "(cached) $ECHO_C" >&6
20709 else
20710   ac_check_lib_save_LIBS=$LIBS
20711 LIBS="-ldnet_stub  $LIBS"
20712 cat >"conftest.$ac_ext" <<_ACEOF
20713 #line 20713 "configure"
20714 #include "confdefs.h"
20715
20716 /* Override any gcc2 internal prototype to avoid an error.  */
20717 #ifdef __cplusplus
20718 extern "C"
20719 #endif
20720 /* We use char because int might match the return type of a gcc2
20721    builtin and then its argument prototype would still apply.  */
20722 char dnet_ntoa ();
20723 int
20724 main (void)
20725 {
20726 dnet_ntoa ();
20727   ;
20728   return 0;
20729 }
20730 _ACEOF
20731 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20732 if { (eval echo "$as_me:20732: \"$ac_link\"") >&5
20733   (eval $ac_link) 2>&5
20734   ac_status=$?
20735   echo "$as_me:20735: \$? = $ac_status" >&5
20736   (exit "$ac_status"); } &&
20737          { ac_try='test -s "conftest$ac_exeext"'
20738   { (eval echo "$as_me:20738: \"$ac_try\"") >&5
20739   (eval $ac_try) 2>&5
20740   ac_status=$?
20741   echo "$as_me:20741: \$? = $ac_status" >&5
20742   (exit "$ac_status"); }; }; then
20743   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20744 else
20745   echo "$as_me: failed program was:" >&5
20746 cat "conftest.$ac_ext" >&5
20747 ac_cv_lib_dnet_stub_dnet_ntoa=no
20748 fi
20749 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20750 LIBS=$ac_check_lib_save_LIBS
20751 fi
20752 echo "$as_me:20752: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20753 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20754 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
20755   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20756 fi
20757
20758     fi
20759 fi
20760 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20761     LIBS="$ac_xsave_LIBS"
20762
20763     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20764     # to get the SysV transport functions.
20765     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20766     # needs -lnsl.
20767     # The nsl library prevents programs from opening the X display
20768     # on Irix 5.2, according to T.E. Dickey.
20769     # The functions gethostbyname, getservbyname, and inet_addr are
20770     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20771     echo "$as_me:20771: checking for gethostbyname" >&5
20772 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20773 if test "${ac_cv_func_gethostbyname+set}" = set; then
20774   echo $ECHO_N "(cached) $ECHO_C" >&6
20775 else
20776   cat >"conftest.$ac_ext" <<_ACEOF
20777 #line 20777 "configure"
20778 #include "confdefs.h"
20779 #define gethostbyname autoconf_temporary
20780 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20781 #undef gethostbyname
20782
20783 #ifdef __cplusplus
20784 extern "C"
20785 #endif
20786
20787 /* We use char because int might match the return type of a gcc2
20788    builtin and then its argument prototype would still apply.  */
20789 char gethostbyname (void);
20790
20791 int
20792 main (void)
20793 {
20794
20795 /* The GNU C library defines stubs for functions which it implements
20796     to always fail with ENOSYS.  Some functions are actually named
20797     something starting with __ and the normal name is an alias.  */
20798 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20799 #error found stub for gethostbyname
20800 #endif
20801
20802         return gethostbyname ();
20803   ;
20804   return 0;
20805 }
20806 _ACEOF
20807 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20808 if { (eval echo "$as_me:20808: \"$ac_link\"") >&5
20809   (eval $ac_link) 2>&5
20810   ac_status=$?
20811   echo "$as_me:20811: \$? = $ac_status" >&5
20812   (exit "$ac_status"); } &&
20813          { ac_try='test -s "conftest$ac_exeext"'
20814   { (eval echo "$as_me:20814: \"$ac_try\"") >&5
20815   (eval $ac_try) 2>&5
20816   ac_status=$?
20817   echo "$as_me:20817: \$? = $ac_status" >&5
20818   (exit "$ac_status"); }; }; then
20819   ac_cv_func_gethostbyname=yes
20820 else
20821   echo "$as_me: failed program was:" >&5
20822 cat "conftest.$ac_ext" >&5
20823 ac_cv_func_gethostbyname=no
20824 fi
20825 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20826 fi
20827 echo "$as_me:20827: result: $ac_cv_func_gethostbyname" >&5
20828 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20829
20830     if test $ac_cv_func_gethostbyname = no; then
20831       echo "$as_me:20831: checking for gethostbyname in -lnsl" >&5
20832 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20833 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20834   echo $ECHO_N "(cached) $ECHO_C" >&6
20835 else
20836   ac_check_lib_save_LIBS=$LIBS
20837 LIBS="-lnsl  $LIBS"
20838 cat >"conftest.$ac_ext" <<_ACEOF
20839 #line 20839 "configure"
20840 #include "confdefs.h"
20841
20842 /* Override any gcc2 internal prototype to avoid an error.  */
20843 #ifdef __cplusplus
20844 extern "C"
20845 #endif
20846 /* We use char because int might match the return type of a gcc2
20847    builtin and then its argument prototype would still apply.  */
20848 char gethostbyname ();
20849 int
20850 main (void)
20851 {
20852 gethostbyname ();
20853   ;
20854   return 0;
20855 }
20856 _ACEOF
20857 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20858 if { (eval echo "$as_me:20858: \"$ac_link\"") >&5
20859   (eval $ac_link) 2>&5
20860   ac_status=$?
20861   echo "$as_me:20861: \$? = $ac_status" >&5
20862   (exit "$ac_status"); } &&
20863          { ac_try='test -s "conftest$ac_exeext"'
20864   { (eval echo "$as_me:20864: \"$ac_try\"") >&5
20865   (eval $ac_try) 2>&5
20866   ac_status=$?
20867   echo "$as_me:20867: \$? = $ac_status" >&5
20868   (exit "$ac_status"); }; }; then
20869   ac_cv_lib_nsl_gethostbyname=yes
20870 else
20871   echo "$as_me: failed program was:" >&5
20872 cat "conftest.$ac_ext" >&5
20873 ac_cv_lib_nsl_gethostbyname=no
20874 fi
20875 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20876 LIBS=$ac_check_lib_save_LIBS
20877 fi
20878 echo "$as_me:20878: result: $ac_cv_lib_nsl_gethostbyname" >&5
20879 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
20880 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
20881   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
20882 fi
20883
20884       if test $ac_cv_lib_nsl_gethostbyname = no; then
20885         echo "$as_me:20885: checking for gethostbyname in -lbsd" >&5
20886 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
20887 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
20888   echo $ECHO_N "(cached) $ECHO_C" >&6
20889 else
20890   ac_check_lib_save_LIBS=$LIBS
20891 LIBS="-lbsd  $LIBS"
20892 cat >"conftest.$ac_ext" <<_ACEOF
20893 #line 20893 "configure"
20894 #include "confdefs.h"
20895
20896 /* Override any gcc2 internal prototype to avoid an error.  */
20897 #ifdef __cplusplus
20898 extern "C"
20899 #endif
20900 /* We use char because int might match the return type of a gcc2
20901    builtin and then its argument prototype would still apply.  */
20902 char gethostbyname ();
20903 int
20904 main (void)
20905 {
20906 gethostbyname ();
20907   ;
20908   return 0;
20909 }
20910 _ACEOF
20911 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20912 if { (eval echo "$as_me:20912: \"$ac_link\"") >&5
20913   (eval $ac_link) 2>&5
20914   ac_status=$?
20915   echo "$as_me:20915: \$? = $ac_status" >&5
20916   (exit "$ac_status"); } &&
20917          { ac_try='test -s "conftest$ac_exeext"'
20918   { (eval echo "$as_me:20918: \"$ac_try\"") >&5
20919   (eval $ac_try) 2>&5
20920   ac_status=$?
20921   echo "$as_me:20921: \$? = $ac_status" >&5
20922   (exit "$ac_status"); }; }; then
20923   ac_cv_lib_bsd_gethostbyname=yes
20924 else
20925   echo "$as_me: failed program was:" >&5
20926 cat "conftest.$ac_ext" >&5
20927 ac_cv_lib_bsd_gethostbyname=no
20928 fi
20929 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20930 LIBS=$ac_check_lib_save_LIBS
20931 fi
20932 echo "$as_me:20932: result: $ac_cv_lib_bsd_gethostbyname" >&5
20933 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
20934 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
20935   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
20936 fi
20937
20938       fi
20939     fi
20940
20941     # lieder@skyler.mavd.honeywell.com says without -lsocket,
20942     # socket/setsockopt and other routines are undefined under SCO ODT
20943     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
20944     # on later versions), says Simon Leinen: it contains gethostby*
20945     # variants that don't use the nameserver (or something).  -lsocket
20946     # must be given before -lnsl if both are needed.  We assume that
20947     # if connect needs -lnsl, so does gethostbyname.
20948     echo "$as_me:20948: checking for connect" >&5
20949 echo $ECHO_N "checking for connect... $ECHO_C" >&6
20950 if test "${ac_cv_func_connect+set}" = set; then
20951   echo $ECHO_N "(cached) $ECHO_C" >&6
20952 else
20953   cat >"conftest.$ac_ext" <<_ACEOF
20954 #line 20954 "configure"
20955 #include "confdefs.h"
20956 #define connect autoconf_temporary
20957 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20958 #undef connect
20959
20960 #ifdef __cplusplus
20961 extern "C"
20962 #endif
20963
20964 /* We use char because int might match the return type of a gcc2
20965    builtin and then its argument prototype would still apply.  */
20966 char connect (void);
20967
20968 int
20969 main (void)
20970 {
20971
20972 /* The GNU C library defines stubs for functions which it implements
20973     to always fail with ENOSYS.  Some functions are actually named
20974     something starting with __ and the normal name is an alias.  */
20975 #if defined (__stub_connect) || defined (__stub___connect)
20976 #error found stub for connect
20977 #endif
20978
20979         return connect ();
20980   ;
20981   return 0;
20982 }
20983 _ACEOF
20984 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20985 if { (eval echo "$as_me:20985: \"$ac_link\"") >&5
20986   (eval $ac_link) 2>&5
20987   ac_status=$?
20988   echo "$as_me:20988: \$? = $ac_status" >&5
20989   (exit "$ac_status"); } &&
20990          { ac_try='test -s "conftest$ac_exeext"'
20991   { (eval echo "$as_me:20991: \"$ac_try\"") >&5
20992   (eval $ac_try) 2>&5
20993   ac_status=$?
20994   echo "$as_me:20994: \$? = $ac_status" >&5
20995   (exit "$ac_status"); }; }; then
20996   ac_cv_func_connect=yes
20997 else
20998   echo "$as_me: failed program was:" >&5
20999 cat "conftest.$ac_ext" >&5
21000 ac_cv_func_connect=no
21001 fi
21002 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21003 fi
21004 echo "$as_me:21004: result: $ac_cv_func_connect" >&5
21005 echo "${ECHO_T}$ac_cv_func_connect" >&6
21006
21007     if test $ac_cv_func_connect = no; then
21008       echo "$as_me:21008: checking for connect in -lsocket" >&5
21009 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21010 if test "${ac_cv_lib_socket_connect+set}" = set; then
21011   echo $ECHO_N "(cached) $ECHO_C" >&6
21012 else
21013   ac_check_lib_save_LIBS=$LIBS
21014 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21015 cat >"conftest.$ac_ext" <<_ACEOF
21016 #line 21016 "configure"
21017 #include "confdefs.h"
21018
21019 /* Override any gcc2 internal prototype to avoid an error.  */
21020 #ifdef __cplusplus
21021 extern "C"
21022 #endif
21023 /* We use char because int might match the return type of a gcc2
21024    builtin and then its argument prototype would still apply.  */
21025 char connect ();
21026 int
21027 main (void)
21028 {
21029 connect ();
21030   ;
21031   return 0;
21032 }
21033 _ACEOF
21034 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21035 if { (eval echo "$as_me:21035: \"$ac_link\"") >&5
21036   (eval $ac_link) 2>&5
21037   ac_status=$?
21038   echo "$as_me:21038: \$? = $ac_status" >&5
21039   (exit "$ac_status"); } &&
21040          { ac_try='test -s "conftest$ac_exeext"'
21041   { (eval echo "$as_me:21041: \"$ac_try\"") >&5
21042   (eval $ac_try) 2>&5
21043   ac_status=$?
21044   echo "$as_me:21044: \$? = $ac_status" >&5
21045   (exit "$ac_status"); }; }; then
21046   ac_cv_lib_socket_connect=yes
21047 else
21048   echo "$as_me: failed program was:" >&5
21049 cat "conftest.$ac_ext" >&5
21050 ac_cv_lib_socket_connect=no
21051 fi
21052 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21053 LIBS=$ac_check_lib_save_LIBS
21054 fi
21055 echo "$as_me:21055: result: $ac_cv_lib_socket_connect" >&5
21056 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21057 if test "$ac_cv_lib_socket_connect" = yes; then
21058   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21059 fi
21060
21061     fi
21062
21063     # Guillermo Gomez says -lposix is necessary on A/UX.
21064     echo "$as_me:21064: checking for remove" >&5
21065 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21066 if test "${ac_cv_func_remove+set}" = set; then
21067   echo $ECHO_N "(cached) $ECHO_C" >&6
21068 else
21069   cat >"conftest.$ac_ext" <<_ACEOF
21070 #line 21070 "configure"
21071 #include "confdefs.h"
21072 #define remove autoconf_temporary
21073 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21074 #undef remove
21075
21076 #ifdef __cplusplus
21077 extern "C"
21078 #endif
21079
21080 /* We use char because int might match the return type of a gcc2
21081    builtin and then its argument prototype would still apply.  */
21082 char remove (void);
21083
21084 int
21085 main (void)
21086 {
21087
21088 /* The GNU C library defines stubs for functions which it implements
21089     to always fail with ENOSYS.  Some functions are actually named
21090     something starting with __ and the normal name is an alias.  */
21091 #if defined (__stub_remove) || defined (__stub___remove)
21092 #error found stub for remove
21093 #endif
21094
21095         return remove ();
21096   ;
21097   return 0;
21098 }
21099 _ACEOF
21100 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21101 if { (eval echo "$as_me:21101: \"$ac_link\"") >&5
21102   (eval $ac_link) 2>&5
21103   ac_status=$?
21104   echo "$as_me:21104: \$? = $ac_status" >&5
21105   (exit "$ac_status"); } &&
21106          { ac_try='test -s "conftest$ac_exeext"'
21107   { (eval echo "$as_me:21107: \"$ac_try\"") >&5
21108   (eval $ac_try) 2>&5
21109   ac_status=$?
21110   echo "$as_me:21110: \$? = $ac_status" >&5
21111   (exit "$ac_status"); }; }; then
21112   ac_cv_func_remove=yes
21113 else
21114   echo "$as_me: failed program was:" >&5
21115 cat "conftest.$ac_ext" >&5
21116 ac_cv_func_remove=no
21117 fi
21118 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21119 fi
21120 echo "$as_me:21120: result: $ac_cv_func_remove" >&5
21121 echo "${ECHO_T}$ac_cv_func_remove" >&6
21122
21123     if test $ac_cv_func_remove = no; then
21124       echo "$as_me:21124: checking for remove in -lposix" >&5
21125 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21126 if test "${ac_cv_lib_posix_remove+set}" = set; then
21127   echo $ECHO_N "(cached) $ECHO_C" >&6
21128 else
21129   ac_check_lib_save_LIBS=$LIBS
21130 LIBS="-lposix  $LIBS"
21131 cat >"conftest.$ac_ext" <<_ACEOF
21132 #line 21132 "configure"
21133 #include "confdefs.h"
21134
21135 /* Override any gcc2 internal prototype to avoid an error.  */
21136 #ifdef __cplusplus
21137 extern "C"
21138 #endif
21139 /* We use char because int might match the return type of a gcc2
21140    builtin and then its argument prototype would still apply.  */
21141 char remove ();
21142 int
21143 main (void)
21144 {
21145 remove ();
21146   ;
21147   return 0;
21148 }
21149 _ACEOF
21150 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21151 if { (eval echo "$as_me:21151: \"$ac_link\"") >&5
21152   (eval $ac_link) 2>&5
21153   ac_status=$?
21154   echo "$as_me:21154: \$? = $ac_status" >&5
21155   (exit "$ac_status"); } &&
21156          { ac_try='test -s "conftest$ac_exeext"'
21157   { (eval echo "$as_me:21157: \"$ac_try\"") >&5
21158   (eval $ac_try) 2>&5
21159   ac_status=$?
21160   echo "$as_me:21160: \$? = $ac_status" >&5
21161   (exit "$ac_status"); }; }; then
21162   ac_cv_lib_posix_remove=yes
21163 else
21164   echo "$as_me: failed program was:" >&5
21165 cat "conftest.$ac_ext" >&5
21166 ac_cv_lib_posix_remove=no
21167 fi
21168 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21169 LIBS=$ac_check_lib_save_LIBS
21170 fi
21171 echo "$as_me:21171: result: $ac_cv_lib_posix_remove" >&5
21172 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21173 if test "$ac_cv_lib_posix_remove" = yes; then
21174   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21175 fi
21176
21177     fi
21178
21179     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21180     echo "$as_me:21180: checking for shmat" >&5
21181 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21182 if test "${ac_cv_func_shmat+set}" = set; then
21183   echo $ECHO_N "(cached) $ECHO_C" >&6
21184 else
21185   cat >"conftest.$ac_ext" <<_ACEOF
21186 #line 21186 "configure"
21187 #include "confdefs.h"
21188 #define shmat autoconf_temporary
21189 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21190 #undef shmat
21191
21192 #ifdef __cplusplus
21193 extern "C"
21194 #endif
21195
21196 /* We use char because int might match the return type of a gcc2
21197    builtin and then its argument prototype would still apply.  */
21198 char shmat (void);
21199
21200 int
21201 main (void)
21202 {
21203
21204 /* The GNU C library defines stubs for functions which it implements
21205     to always fail with ENOSYS.  Some functions are actually named
21206     something starting with __ and the normal name is an alias.  */
21207 #if defined (__stub_shmat) || defined (__stub___shmat)
21208 #error found stub for shmat
21209 #endif
21210
21211         return shmat ();
21212   ;
21213   return 0;
21214 }
21215 _ACEOF
21216 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21217 if { (eval echo "$as_me:21217: \"$ac_link\"") >&5
21218   (eval $ac_link) 2>&5
21219   ac_status=$?
21220   echo "$as_me:21220: \$? = $ac_status" >&5
21221   (exit "$ac_status"); } &&
21222          { ac_try='test -s "conftest$ac_exeext"'
21223   { (eval echo "$as_me:21223: \"$ac_try\"") >&5
21224   (eval $ac_try) 2>&5
21225   ac_status=$?
21226   echo "$as_me:21226: \$? = $ac_status" >&5
21227   (exit "$ac_status"); }; }; then
21228   ac_cv_func_shmat=yes
21229 else
21230   echo "$as_me: failed program was:" >&5
21231 cat "conftest.$ac_ext" >&5
21232 ac_cv_func_shmat=no
21233 fi
21234 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21235 fi
21236 echo "$as_me:21236: result: $ac_cv_func_shmat" >&5
21237 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21238
21239     if test $ac_cv_func_shmat = no; then
21240       echo "$as_me:21240: checking for shmat in -lipc" >&5
21241 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21242 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21243   echo $ECHO_N "(cached) $ECHO_C" >&6
21244 else
21245   ac_check_lib_save_LIBS=$LIBS
21246 LIBS="-lipc  $LIBS"
21247 cat >"conftest.$ac_ext" <<_ACEOF
21248 #line 21248 "configure"
21249 #include "confdefs.h"
21250
21251 /* Override any gcc2 internal prototype to avoid an error.  */
21252 #ifdef __cplusplus
21253 extern "C"
21254 #endif
21255 /* We use char because int might match the return type of a gcc2
21256    builtin and then its argument prototype would still apply.  */
21257 char shmat ();
21258 int
21259 main (void)
21260 {
21261 shmat ();
21262   ;
21263   return 0;
21264 }
21265 _ACEOF
21266 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21267 if { (eval echo "$as_me:21267: \"$ac_link\"") >&5
21268   (eval $ac_link) 2>&5
21269   ac_status=$?
21270   echo "$as_me:21270: \$? = $ac_status" >&5
21271   (exit "$ac_status"); } &&
21272          { ac_try='test -s "conftest$ac_exeext"'
21273   { (eval echo "$as_me:21273: \"$ac_try\"") >&5
21274   (eval $ac_try) 2>&5
21275   ac_status=$?
21276   echo "$as_me:21276: \$? = $ac_status" >&5
21277   (exit "$ac_status"); }; }; then
21278   ac_cv_lib_ipc_shmat=yes
21279 else
21280   echo "$as_me: failed program was:" >&5
21281 cat "conftest.$ac_ext" >&5
21282 ac_cv_lib_ipc_shmat=no
21283 fi
21284 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21285 LIBS=$ac_check_lib_save_LIBS
21286 fi
21287 echo "$as_me:21287: result: $ac_cv_lib_ipc_shmat" >&5
21288 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21289 if test "$ac_cv_lib_ipc_shmat" = yes; then
21290   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21291 fi
21292
21293     fi
21294   fi
21295
21296   # Check for libraries that X11R6 Xt/Xaw programs need.
21297   ac_save_LDFLAGS=$LDFLAGS
21298   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21299   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21300   # check for ICE first), but we must link in the order -lSM -lICE or
21301   # we get undefined symbols.  So assume we have SM if we have ICE.
21302   # These have to be linked with before -lX11, unlike the other
21303   # libraries we check for below, so use a different variable.
21304   # John Interrante, Karl Berry
21305   echo "$as_me:21305: checking for IceConnectionNumber in -lICE" >&5
21306 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21307 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21308   echo $ECHO_N "(cached) $ECHO_C" >&6
21309 else
21310   ac_check_lib_save_LIBS=$LIBS
21311 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21312 cat >"conftest.$ac_ext" <<_ACEOF
21313 #line 21313 "configure"
21314 #include "confdefs.h"
21315
21316 /* Override any gcc2 internal prototype to avoid an error.  */
21317 #ifdef __cplusplus
21318 extern "C"
21319 #endif
21320 /* We use char because int might match the return type of a gcc2
21321    builtin and then its argument prototype would still apply.  */
21322 char IceConnectionNumber ();
21323 int
21324 main (void)
21325 {
21326 IceConnectionNumber ();
21327   ;
21328   return 0;
21329 }
21330 _ACEOF
21331 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21332 if { (eval echo "$as_me:21332: \"$ac_link\"") >&5
21333   (eval $ac_link) 2>&5
21334   ac_status=$?
21335   echo "$as_me:21335: \$? = $ac_status" >&5
21336   (exit "$ac_status"); } &&
21337          { ac_try='test -s "conftest$ac_exeext"'
21338   { (eval echo "$as_me:21338: \"$ac_try\"") >&5
21339   (eval $ac_try) 2>&5
21340   ac_status=$?
21341   echo "$as_me:21341: \$? = $ac_status" >&5
21342   (exit "$ac_status"); }; }; then
21343   ac_cv_lib_ICE_IceConnectionNumber=yes
21344 else
21345   echo "$as_me: failed program was:" >&5
21346 cat "conftest.$ac_ext" >&5
21347 ac_cv_lib_ICE_IceConnectionNumber=no
21348 fi
21349 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21350 LIBS=$ac_check_lib_save_LIBS
21351 fi
21352 echo "$as_me:21352: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21353 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21354 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21355   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21356 fi
21357
21358   LDFLAGS=$ac_save_LDFLAGS
21359
21360 fi
21361
21362 fi
21363
21364 if test "$GCC" = yes || test "$GXX" = yes
21365 then
21366
21367 if test "$GCC" = yes || test "$GXX" = yes
21368 then
21369         case $CFLAGS in
21370         (*-Werror=*)
21371                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21372
21373 echo "${as_me:-configure}:21373: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21374
21375                 cf_temp_flags=
21376                 for cf_temp_scan in $CFLAGS
21377                 do
21378                         case "x$cf_temp_scan" in
21379                         (x-Werror=*)
21380
21381         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21382         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21383
21384                                 ;;
21385                         (*)
21386
21387         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21388         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21389
21390                                 ;;
21391                         esac
21392                 done
21393                 CFLAGS="$cf_temp_flags"
21394                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21395
21396 echo "${as_me:-configure}:21396: testing ... fixed $CFLAGS ..." 1>&5
21397
21398                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21399
21400 echo "${as_me:-configure}:21400: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21401
21402                 ;;
21403         esac
21404 fi
21405
21406 if test "$GCC" = yes || test "$GXX" = yes
21407 then
21408         case $CPPFLAGS in
21409         (*-Werror=*)
21410                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21411
21412 echo "${as_me:-configure}:21412: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21413
21414                 cf_temp_flags=
21415                 for cf_temp_scan in $CPPFLAGS
21416                 do
21417                         case "x$cf_temp_scan" in
21418                         (x-Werror=*)
21419
21420         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21421         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21422
21423                                 ;;
21424                         (*)
21425
21426         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21427         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21428
21429                                 ;;
21430                         esac
21431                 done
21432                 CPPFLAGS="$cf_temp_flags"
21433                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21434
21435 echo "${as_me:-configure}:21435: testing ... fixed $CPPFLAGS ..." 1>&5
21436
21437                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21438
21439 echo "${as_me:-configure}:21439: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21440
21441                 ;;
21442         esac
21443 fi
21444
21445 if test "$GCC" = yes || test "$GXX" = yes
21446 then
21447         case $LDFLAGS in
21448         (*-Werror=*)
21449                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21450
21451 echo "${as_me:-configure}:21451: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21452
21453                 cf_temp_flags=
21454                 for cf_temp_scan in $LDFLAGS
21455                 do
21456                         case "x$cf_temp_scan" in
21457                         (x-Werror=*)
21458
21459         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21460         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21461
21462                                 ;;
21463                         (*)
21464
21465         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21466         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21467
21468                                 ;;
21469                         esac
21470                 done
21471                 LDFLAGS="$cf_temp_flags"
21472                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21473
21474 echo "${as_me:-configure}:21474: testing ... fixed $LDFLAGS ..." 1>&5
21475
21476                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21477
21478 echo "${as_me:-configure}:21478: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21479
21480                 ;;
21481         esac
21482 fi
21483
21484 echo "$as_me:21484: checking if you want to turn on gcc warnings" >&5
21485 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21486
21487 # Check whether --enable-warnings or --disable-warnings was given.
21488 if test "${enable_warnings+set}" = set; then
21489   enableval="$enable_warnings"
21490   test "$enableval" != yes && enableval=no
21491         if test "$enableval" != "no" ; then
21492     enable_warnings=yes
21493         else
21494                 enable_warnings=no
21495         fi
21496 else
21497   enableval=no
21498         enable_warnings=no
21499
21500 fi;
21501 echo "$as_me:21501: result: $enable_warnings" >&5
21502 echo "${ECHO_T}$enable_warnings" >&6
21503 if test "$enable_warnings" = "yes"
21504 then
21505
21506 if test "$GCC" = yes || test "$GXX" = yes
21507 then
21508 cat > conftest.i <<EOF
21509 #ifndef GCC_PRINTF
21510 #define GCC_PRINTF 0
21511 #endif
21512 #ifndef GCC_SCANF
21513 #define GCC_SCANF 0
21514 #endif
21515 #ifndef GCC_NORETURN
21516 #define GCC_NORETURN /* nothing */
21517 #endif
21518 #ifndef GCC_UNUSED
21519 #define GCC_UNUSED /* nothing */
21520 #endif
21521 EOF
21522 if test "$GCC" = yes
21523 then
21524         { echo "$as_me:21524: checking for $CC __attribute__ directives..." >&5
21525 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21526 cat > "conftest.$ac_ext" <<EOF
21527 #line 21527 "${as_me:-configure}"
21528 #include "confdefs.h"
21529 #include "conftest.h"
21530 #include "conftest.i"
21531 #if     GCC_PRINTF
21532 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21533 #else
21534 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21535 #endif
21536 #if     GCC_SCANF
21537 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21538 #else
21539 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21540 #endif
21541 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21542 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
21543 extern void foo(void) GCC_NORETURN;
21544 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21545 EOF
21546         cf_printf_attribute=no
21547         cf_scanf_attribute=no
21548         for cf_attribute in scanf printf unused noreturn
21549         do
21550
21551 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21552
21553                 cf_directive="__attribute__(($cf_attribute))"
21554                 echo "checking for $CC $cf_directive" 1>&5
21555
21556                 case "$cf_attribute" in
21557                 (printf)
21558                         cf_printf_attribute=yes
21559                         cat >conftest.h <<EOF
21560 #define GCC_$cf_ATTRIBUTE 1
21561 EOF
21562                         ;;
21563                 (scanf)
21564                         cf_scanf_attribute=yes
21565                         cat >conftest.h <<EOF
21566 #define GCC_$cf_ATTRIBUTE 1
21567 EOF
21568                         ;;
21569                 (*)
21570                         cat >conftest.h <<EOF
21571 #define GCC_$cf_ATTRIBUTE $cf_directive
21572 EOF
21573                         ;;
21574                 esac
21575
21576                 if { (eval echo "$as_me:21576: \"$ac_compile\"") >&5
21577   (eval $ac_compile) 2>&5
21578   ac_status=$?
21579   echo "$as_me:21579: \$? = $ac_status" >&5
21580   (exit "$ac_status"); }; then
21581                         test -n "$verbose" && echo "$as_me:21581: result: ... $cf_attribute" >&5
21582 echo "${ECHO_T}... $cf_attribute" >&6
21583                         cat conftest.h >>confdefs.h
21584                         case "$cf_attribute" in
21585                         (noreturn)
21586
21587 cat >>confdefs.h <<EOF
21588 #define GCC_NORETURN $cf_directive
21589 EOF
21590
21591                                 ;;
21592                         (printf)
21593                                 cf_value='/* nothing */'
21594                                 if test "$cf_printf_attribute" != no ; then
21595                                         cf_value='__attribute__((format(printf,fmt,var)))'
21596
21597 cat >>confdefs.h <<\EOF
21598 #define GCC_PRINTF 1
21599 EOF
21600
21601                                 fi
21602
21603 cat >>confdefs.h <<EOF
21604 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21605 EOF
21606
21607                                 ;;
21608                         (scanf)
21609                                 cf_value='/* nothing */'
21610                                 if test "$cf_scanf_attribute" != no ; then
21611                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21612
21613 cat >>confdefs.h <<\EOF
21614 #define GCC_SCANF 1
21615 EOF
21616
21617                                 fi
21618
21619 cat >>confdefs.h <<EOF
21620 #define GCC_SCANFLIKE(fmt,var) $cf_value
21621 EOF
21622
21623                                 ;;
21624                         (unused)
21625
21626 cat >>confdefs.h <<EOF
21627 #define GCC_UNUSED $cf_directive
21628 EOF
21629
21630                                 ;;
21631                         esac
21632                 fi
21633         done
21634 else
21635         ${FGREP-fgrep} define conftest.i >>confdefs.h
21636 fi
21637 rm -rf ./conftest*
21638 fi
21639
21640 if test "x$have_x" = xyes; then
21641
21642 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21643 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21644 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21645 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21646 for cf_X_CFLAGS in $X_CFLAGS
21647 do
21648         case "x$cf_X_CFLAGS" in
21649         x-[IUD]*)
21650                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21651                 ;;
21652         *)
21653                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21654                 ;;
21655         esac
21656 done
21657
21658 cat >"conftest.$ac_ext" <<_ACEOF
21659 #line 21659 "configure"
21660 #include "confdefs.h"
21661
21662 #include <stdlib.h>
21663 #include <X11/Intrinsic.h>
21664
21665 int
21666 main (void)
21667 {
21668 String foo = malloc(1); (void)foo
21669   ;
21670   return 0;
21671 }
21672 _ACEOF
21673 rm -f "conftest.$ac_objext"
21674 if { (eval echo "$as_me:21674: \"$ac_compile\"") >&5
21675   (eval $ac_compile) 2>&5
21676   ac_status=$?
21677   echo "$as_me:21677: \$? = $ac_status" >&5
21678   (exit "$ac_status"); } &&
21679          { ac_try='test -s "conftest.$ac_objext"'
21680   { (eval echo "$as_me:21680: \"$ac_try\"") >&5
21681   (eval $ac_try) 2>&5
21682   ac_status=$?
21683   echo "$as_me:21683: \$? = $ac_status" >&5
21684   (exit "$ac_status"); }; }; then
21685
21686 echo "$as_me:21686: checking for X11/Xt const-feature" >&5
21687 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21688 if test "${cf_cv_const_x_string+set}" = set; then
21689   echo $ECHO_N "(cached) $ECHO_C" >&6
21690 else
21691
21692         cat >"conftest.$ac_ext" <<_ACEOF
21693 #line 21693 "configure"
21694 #include "confdefs.h"
21695
21696 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21697 #undef  XTSTRINGDEFINES /* X11R5 and later */
21698 #include <stdlib.h>
21699 #include <X11/Intrinsic.h>
21700
21701 int
21702 main (void)
21703 {
21704 String foo = malloc(1); *foo = 0
21705   ;
21706   return 0;
21707 }
21708 _ACEOF
21709 rm -f "conftest.$ac_objext"
21710 if { (eval echo "$as_me:21710: \"$ac_compile\"") >&5
21711   (eval $ac_compile) 2>&5
21712   ac_status=$?
21713   echo "$as_me:21713: \$? = $ac_status" >&5
21714   (exit "$ac_status"); } &&
21715          { ac_try='test -s "conftest.$ac_objext"'
21716   { (eval echo "$as_me:21716: \"$ac_try\"") >&5
21717   (eval $ac_try) 2>&5
21718   ac_status=$?
21719   echo "$as_me:21719: \$? = $ac_status" >&5
21720   (exit "$ac_status"); }; }; then
21721
21722                         cf_cv_const_x_string=no
21723
21724 else
21725   echo "$as_me: failed program was:" >&5
21726 cat "conftest.$ac_ext" >&5
21727
21728                         cf_cv_const_x_string=yes
21729
21730 fi
21731 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21732
21733 fi
21734 echo "$as_me:21734: result: $cf_cv_const_x_string" >&5
21735 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21736
21737 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21738 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21739 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21740
21741 case "$cf_cv_const_x_string" in
21742 (no)
21743
21744         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21745         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21746
21747         ;;
21748 (*)
21749
21750         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21751         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21752
21753         ;;
21754 esac
21755
21756 else
21757   echo "$as_me: failed program was:" >&5
21758 cat "conftest.$ac_ext" >&5
21759 fi
21760 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21761  fi
21762 cat > "conftest.$ac_ext" <<EOF
21763 #line 21763 "${as_me:-configure}"
21764 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21765 EOF
21766 if test "$INTEL_COMPILER" = yes
21767 then
21768 # The "-wdXXX" options suppress warnings:
21769 # remark #1419: external declaration in primary source file
21770 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21771 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21772 # remark #193: zero used for undefined preprocessing identifier
21773 # remark #593: variable "curs_sb_left_arrow" was set but never used
21774 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21775 # remark #869: parameter "tw" was never referenced
21776 # remark #981: operands are evaluated in unspecified order
21777 # warning #279: controlling expression is constant
21778
21779         { echo "$as_me:21779: checking for $CC warning options..." >&5
21780 echo "$as_me: checking for $CC warning options..." >&6;}
21781         cf_save_CFLAGS="$CFLAGS"
21782         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21783         for cf_opt in \
21784                 wd1419 \
21785                 wd1683 \
21786                 wd1684 \
21787                 wd193 \
21788                 wd593 \
21789                 wd279 \
21790                 wd810 \
21791                 wd869 \
21792                 wd981
21793         do
21794                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21795                 if { (eval echo "$as_me:21795: \"$ac_compile\"") >&5
21796   (eval $ac_compile) 2>&5
21797   ac_status=$?
21798   echo "$as_me:21798: \$? = $ac_status" >&5
21799   (exit "$ac_status"); }; then
21800                         test -n "$verbose" && echo "$as_me:21800: result: ... -$cf_opt" >&5
21801 echo "${ECHO_T}... -$cf_opt" >&6
21802                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21803                 fi
21804         done
21805         CFLAGS="$cf_save_CFLAGS"
21806 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21807 then
21808         { echo "$as_me:21808: checking for $CC warning options..." >&5
21809 echo "$as_me: checking for $CC warning options..." >&6;}
21810         cf_save_CFLAGS="$CFLAGS"
21811         cf_warn_CONST=""
21812         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21813         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21814         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21815         for cf_opt in W Wall \
21816                 Wbad-function-cast \
21817                 Wcast-align \
21818                 Wcast-qual \
21819                 Wdeclaration-after-statement \
21820                 Wextra \
21821                 Winline \
21822                 Wmissing-declarations \
21823                 Wmissing-prototypes \
21824                 Wnested-externs \
21825                 Wpointer-arith \
21826                 Wshadow \
21827                 Wstrict-prototypes \
21828                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21829         do
21830                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21831                 if { (eval echo "$as_me:21831: \"$ac_compile\"") >&5
21832   (eval $ac_compile) 2>&5
21833   ac_status=$?
21834   echo "$as_me:21834: \$? = $ac_status" >&5
21835   (exit "$ac_status"); }; then
21836                         test -n "$verbose" && echo "$as_me:21836: result: ... -$cf_opt" >&5
21837 echo "${ECHO_T}... -$cf_opt" >&6
21838                         case "$cf_opt" in
21839                         (Winline)
21840                                 case "$GCC_VERSION" in
21841                                 ([34].*)
21842                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21843
21844 echo "${as_me:-configure}:21844: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21845
21846                                         continue;;
21847                                 esac
21848                                 ;;
21849                         (Wpointer-arith)
21850                                 case "$GCC_VERSION" in
21851                                 ([12].*)
21852                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21853
21854 echo "${as_me:-configure}:21854: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21855
21856                                         continue;;
21857                                 esac
21858                                 ;;
21859                         esac
21860                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21861                 fi
21862         done
21863         CFLAGS="$cf_save_CFLAGS"
21864 fi
21865 rm -rf ./conftest*
21866
21867 fi
21868
21869 fi
21870
21871 echo "$as_me:21871: checking if you want to use dmalloc for testing" >&5
21872 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
21873
21874 # Check whether --with-dmalloc or --without-dmalloc was given.
21875 if test "${with_dmalloc+set}" = set; then
21876   withval="$with_dmalloc"
21877
21878 cat >>confdefs.h <<EOF
21879 #define USE_DMALLOC 1
21880 EOF
21881
21882         : "${with_cflags:=-g}"
21883         : "${enable_leaks:=no}"
21884          with_dmalloc=yes
21885 else
21886   with_dmalloc=
21887 fi;
21888 echo "$as_me:21888: result: ${with_dmalloc:-no}" >&5
21889 echo "${ECHO_T}${with_dmalloc:-no}" >&6
21890
21891 case ".$with_cflags" in
21892 (.*-g*)
21893         case .$CFLAGS in
21894         (.*-g*)
21895                 ;;
21896         (*)
21897
21898 cf_fix_cppflags=no
21899 cf_new_cflags=
21900 cf_new_cppflags=
21901 cf_new_extra_cppflags=
21902
21903 for cf_add_cflags in -g
21904 do
21905 case "$cf_fix_cppflags" in
21906 (no)
21907         case "$cf_add_cflags" in
21908         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21909                 case "$cf_add_cflags" in
21910                 (-D*)
21911                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21912
21913                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21914                                 && test -z "${cf_tst_cflags}" \
21915                                 && cf_fix_cppflags=yes
21916
21917                         if test "$cf_fix_cppflags" = yes ; then
21918
21919         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21920         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21921
21922                                 continue
21923                         elif test "${cf_tst_cflags}" = "\"'" ; then
21924
21925         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21926         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21927
21928                                 continue
21929                         fi
21930                         ;;
21931                 esac
21932                 case "$CPPFLAGS" in
21933                 (*$cf_add_cflags)
21934                         ;;
21935                 (*)
21936                         case "$cf_add_cflags" in
21937                         (-D*)
21938                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21939
21940 CPPFLAGS=`echo "$CPPFLAGS" | \
21941         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21942                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
21943
21944                                 ;;
21945                         esac
21946
21947         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
21948         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
21949
21950                         ;;
21951                 esac
21952                 ;;
21953         (*)
21954
21955         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
21956         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
21957
21958                 ;;
21959         esac
21960         ;;
21961 (yes)
21962
21963         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21964         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21965
21966         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
21967
21968         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21969                 && test -z "${cf_tst_cflags}" \
21970                 && cf_fix_cppflags=no
21971         ;;
21972 esac
21973 done
21974
21975 if test -n "$cf_new_cflags" ; then
21976
21977         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
21978         CFLAGS="${CFLAGS}$cf_new_cflags"
21979
21980 fi
21981
21982 if test -n "$cf_new_cppflags" ; then
21983
21984         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21985         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
21986
21987 fi
21988
21989 if test -n "$cf_new_extra_cppflags" ; then
21990
21991         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
21992         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
21993
21994 fi
21995
21996                 ;;
21997         esac
21998         ;;
21999 esac
22000
22001 if test "$with_dmalloc" = yes ; then
22002         echo "$as_me:22002: checking for dmalloc.h" >&5
22003 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22004 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22005   echo $ECHO_N "(cached) $ECHO_C" >&6
22006 else
22007   cat >"conftest.$ac_ext" <<_ACEOF
22008 #line 22008 "configure"
22009 #include "confdefs.h"
22010 #include <dmalloc.h>
22011 _ACEOF
22012 if { (eval echo "$as_me:22012: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22013   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22014   ac_status=$?
22015   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22016   rm -f conftest.er1
22017   cat conftest.err >&5
22018   echo "$as_me:22018: \$? = $ac_status" >&5
22019   (exit "$ac_status"); } >/dev/null; then
22020   if test -s conftest.err; then
22021     ac_cpp_err=$ac_c_preproc_warn_flag
22022   else
22023     ac_cpp_err=
22024   fi
22025 else
22026   ac_cpp_err=yes
22027 fi
22028 if test -z "$ac_cpp_err"; then
22029   ac_cv_header_dmalloc_h=yes
22030 else
22031   echo "$as_me: failed program was:" >&5
22032   cat "conftest.$ac_ext" >&5
22033   ac_cv_header_dmalloc_h=no
22034 fi
22035 rm -f conftest.err "conftest.$ac_ext"
22036 fi
22037 echo "$as_me:22037: result: $ac_cv_header_dmalloc_h" >&5
22038 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22039 if test "$ac_cv_header_dmalloc_h" = yes; then
22040
22041 echo "$as_me:22041: checking for dmalloc_debug in -ldmalloc" >&5
22042 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22043 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22044   echo $ECHO_N "(cached) $ECHO_C" >&6
22045 else
22046   ac_check_lib_save_LIBS=$LIBS
22047 LIBS="-ldmalloc  $LIBS"
22048 cat >"conftest.$ac_ext" <<_ACEOF
22049 #line 22049 "configure"
22050 #include "confdefs.h"
22051
22052 /* Override any gcc2 internal prototype to avoid an error.  */
22053 #ifdef __cplusplus
22054 extern "C"
22055 #endif
22056 /* We use char because int might match the return type of a gcc2
22057    builtin and then its argument prototype would still apply.  */
22058 char dmalloc_debug ();
22059 int
22060 main (void)
22061 {
22062 dmalloc_debug ();
22063   ;
22064   return 0;
22065 }
22066 _ACEOF
22067 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22068 if { (eval echo "$as_me:22068: \"$ac_link\"") >&5
22069   (eval $ac_link) 2>&5
22070   ac_status=$?
22071   echo "$as_me:22071: \$? = $ac_status" >&5
22072   (exit "$ac_status"); } &&
22073          { ac_try='test -s "conftest$ac_exeext"'
22074   { (eval echo "$as_me:22074: \"$ac_try\"") >&5
22075   (eval $ac_try) 2>&5
22076   ac_status=$?
22077   echo "$as_me:22077: \$? = $ac_status" >&5
22078   (exit "$ac_status"); }; }; then
22079   ac_cv_lib_dmalloc_dmalloc_debug=yes
22080 else
22081   echo "$as_me: failed program was:" >&5
22082 cat "conftest.$ac_ext" >&5
22083 ac_cv_lib_dmalloc_dmalloc_debug=no
22084 fi
22085 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22086 LIBS=$ac_check_lib_save_LIBS
22087 fi
22088 echo "$as_me:22088: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22089 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22090 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22091   cat >>confdefs.h <<EOF
22092 #define HAVE_LIBDMALLOC 1
22093 EOF
22094
22095   LIBS="-ldmalloc $LIBS"
22096
22097 fi
22098
22099 fi
22100
22101 fi
22102
22103 echo "$as_me:22103: checking if you want to use dbmalloc for testing" >&5
22104 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22105
22106 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22107 if test "${with_dbmalloc+set}" = set; then
22108   withval="$with_dbmalloc"
22109
22110 cat >>confdefs.h <<EOF
22111 #define USE_DBMALLOC 1
22112 EOF
22113
22114         : "${with_cflags:=-g}"
22115         : "${enable_leaks:=no}"
22116          with_dbmalloc=yes
22117 else
22118   with_dbmalloc=
22119 fi;
22120 echo "$as_me:22120: result: ${with_dbmalloc:-no}" >&5
22121 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22122
22123 case ".$with_cflags" in
22124 (.*-g*)
22125         case .$CFLAGS in
22126         (.*-g*)
22127                 ;;
22128         (*)
22129
22130 cf_fix_cppflags=no
22131 cf_new_cflags=
22132 cf_new_cppflags=
22133 cf_new_extra_cppflags=
22134
22135 for cf_add_cflags in -g
22136 do
22137 case "$cf_fix_cppflags" in
22138 (no)
22139         case "$cf_add_cflags" in
22140         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22141                 case "$cf_add_cflags" in
22142                 (-D*)
22143                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22144
22145                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22146                                 && test -z "${cf_tst_cflags}" \
22147                                 && cf_fix_cppflags=yes
22148
22149                         if test "$cf_fix_cppflags" = yes ; then
22150
22151         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22152         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22153
22154                                 continue
22155                         elif test "${cf_tst_cflags}" = "\"'" ; then
22156
22157         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22158         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22159
22160                                 continue
22161                         fi
22162                         ;;
22163                 esac
22164                 case "$CPPFLAGS" in
22165                 (*$cf_add_cflags)
22166                         ;;
22167                 (*)
22168                         case "$cf_add_cflags" in
22169                         (-D*)
22170                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22171
22172 CPPFLAGS=`echo "$CPPFLAGS" | \
22173         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22174                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22175
22176                                 ;;
22177                         esac
22178
22179         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22180         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22181
22182                         ;;
22183                 esac
22184                 ;;
22185         (*)
22186
22187         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22188         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22189
22190                 ;;
22191         esac
22192         ;;
22193 (yes)
22194
22195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22197
22198         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22199
22200         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22201                 && test -z "${cf_tst_cflags}" \
22202                 && cf_fix_cppflags=no
22203         ;;
22204 esac
22205 done
22206
22207 if test -n "$cf_new_cflags" ; then
22208
22209         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22210         CFLAGS="${CFLAGS}$cf_new_cflags"
22211
22212 fi
22213
22214 if test -n "$cf_new_cppflags" ; then
22215
22216         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22217         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22218
22219 fi
22220
22221 if test -n "$cf_new_extra_cppflags" ; then
22222
22223         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22224         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22225
22226 fi
22227
22228                 ;;
22229         esac
22230         ;;
22231 esac
22232
22233 if test "$with_dbmalloc" = yes ; then
22234         echo "$as_me:22234: checking for dbmalloc.h" >&5
22235 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22236 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22237   echo $ECHO_N "(cached) $ECHO_C" >&6
22238 else
22239   cat >"conftest.$ac_ext" <<_ACEOF
22240 #line 22240 "configure"
22241 #include "confdefs.h"
22242 #include <dbmalloc.h>
22243 _ACEOF
22244 if { (eval echo "$as_me:22244: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22245   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22246   ac_status=$?
22247   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22248   rm -f conftest.er1
22249   cat conftest.err >&5
22250   echo "$as_me:22250: \$? = $ac_status" >&5
22251   (exit "$ac_status"); } >/dev/null; then
22252   if test -s conftest.err; then
22253     ac_cpp_err=$ac_c_preproc_warn_flag
22254   else
22255     ac_cpp_err=
22256   fi
22257 else
22258   ac_cpp_err=yes
22259 fi
22260 if test -z "$ac_cpp_err"; then
22261   ac_cv_header_dbmalloc_h=yes
22262 else
22263   echo "$as_me: failed program was:" >&5
22264   cat "conftest.$ac_ext" >&5
22265   ac_cv_header_dbmalloc_h=no
22266 fi
22267 rm -f conftest.err "conftest.$ac_ext"
22268 fi
22269 echo "$as_me:22269: result: $ac_cv_header_dbmalloc_h" >&5
22270 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22271 if test "$ac_cv_header_dbmalloc_h" = yes; then
22272
22273 echo "$as_me:22273: checking for debug_malloc in -ldbmalloc" >&5
22274 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22275 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22276   echo $ECHO_N "(cached) $ECHO_C" >&6
22277 else
22278   ac_check_lib_save_LIBS=$LIBS
22279 LIBS="-ldbmalloc  $LIBS"
22280 cat >"conftest.$ac_ext" <<_ACEOF
22281 #line 22281 "configure"
22282 #include "confdefs.h"
22283
22284 /* Override any gcc2 internal prototype to avoid an error.  */
22285 #ifdef __cplusplus
22286 extern "C"
22287 #endif
22288 /* We use char because int might match the return type of a gcc2
22289    builtin and then its argument prototype would still apply.  */
22290 char debug_malloc ();
22291 int
22292 main (void)
22293 {
22294 debug_malloc ();
22295   ;
22296   return 0;
22297 }
22298 _ACEOF
22299 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22300 if { (eval echo "$as_me:22300: \"$ac_link\"") >&5
22301   (eval $ac_link) 2>&5
22302   ac_status=$?
22303   echo "$as_me:22303: \$? = $ac_status" >&5
22304   (exit "$ac_status"); } &&
22305          { ac_try='test -s "conftest$ac_exeext"'
22306   { (eval echo "$as_me:22306: \"$ac_try\"") >&5
22307   (eval $ac_try) 2>&5
22308   ac_status=$?
22309   echo "$as_me:22309: \$? = $ac_status" >&5
22310   (exit "$ac_status"); }; }; then
22311   ac_cv_lib_dbmalloc_debug_malloc=yes
22312 else
22313   echo "$as_me: failed program was:" >&5
22314 cat "conftest.$ac_ext" >&5
22315 ac_cv_lib_dbmalloc_debug_malloc=no
22316 fi
22317 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22318 LIBS=$ac_check_lib_save_LIBS
22319 fi
22320 echo "$as_me:22320: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22321 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22322 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22323   cat >>confdefs.h <<EOF
22324 #define HAVE_LIBDBMALLOC 1
22325 EOF
22326
22327   LIBS="-ldbmalloc $LIBS"
22328
22329 fi
22330
22331 fi
22332
22333 fi
22334
22335 echo "$as_me:22335: checking if you want to use valgrind for testing" >&5
22336 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22337
22338 # Check whether --with-valgrind or --without-valgrind was given.
22339 if test "${with_valgrind+set}" = set; then
22340   withval="$with_valgrind"
22341
22342 cat >>confdefs.h <<EOF
22343 #define USE_VALGRIND 1
22344 EOF
22345
22346         : "${with_cflags:=-g}"
22347         : "${enable_leaks:=no}"
22348          with_valgrind=yes
22349 else
22350   with_valgrind=
22351 fi;
22352 echo "$as_me:22352: result: ${with_valgrind:-no}" >&5
22353 echo "${ECHO_T}${with_valgrind:-no}" >&6
22354
22355 case ".$with_cflags" in
22356 (.*-g*)
22357         case .$CFLAGS in
22358         (.*-g*)
22359                 ;;
22360         (*)
22361
22362 cf_fix_cppflags=no
22363 cf_new_cflags=
22364 cf_new_cppflags=
22365 cf_new_extra_cppflags=
22366
22367 for cf_add_cflags in -g
22368 do
22369 case "$cf_fix_cppflags" in
22370 (no)
22371         case "$cf_add_cflags" in
22372         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22373                 case "$cf_add_cflags" in
22374                 (-D*)
22375                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22376
22377                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22378                                 && test -z "${cf_tst_cflags}" \
22379                                 && cf_fix_cppflags=yes
22380
22381                         if test "$cf_fix_cppflags" = yes ; then
22382
22383         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22384         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22385
22386                                 continue
22387                         elif test "${cf_tst_cflags}" = "\"'" ; then
22388
22389         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22390         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22391
22392                                 continue
22393                         fi
22394                         ;;
22395                 esac
22396                 case "$CPPFLAGS" in
22397                 (*$cf_add_cflags)
22398                         ;;
22399                 (*)
22400                         case "$cf_add_cflags" in
22401                         (-D*)
22402                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22403
22404 CPPFLAGS=`echo "$CPPFLAGS" | \
22405         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22406                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22407
22408                                 ;;
22409                         esac
22410
22411         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22412         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22413
22414                         ;;
22415                 esac
22416                 ;;
22417         (*)
22418
22419         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22420         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22421
22422                 ;;
22423         esac
22424         ;;
22425 (yes)
22426
22427         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22428         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22429
22430         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22431
22432         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22433                 && test -z "${cf_tst_cflags}" \
22434                 && cf_fix_cppflags=no
22435         ;;
22436 esac
22437 done
22438
22439 if test -n "$cf_new_cflags" ; then
22440
22441         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22442         CFLAGS="${CFLAGS}$cf_new_cflags"
22443
22444 fi
22445
22446 if test -n "$cf_new_cppflags" ; then
22447
22448         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22449         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22450
22451 fi
22452
22453 if test -n "$cf_new_extra_cppflags" ; then
22454
22455         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22456         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22457
22458 fi
22459
22460                 ;;
22461         esac
22462         ;;
22463 esac
22464
22465 echo "$as_me:22465: checking if you want to perform memory-leak testing" >&5
22466 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22467
22468 # Check whether --enable-leaks or --disable-leaks was given.
22469 if test "${enable_leaks+set}" = set; then
22470   enableval="$enable_leaks"
22471   enable_leaks=no
22472 else
22473   enable_leaks=yes
22474 fi;
22475 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22476 echo "$as_me:22476: result: $with_no_leaks" >&5
22477 echo "${ECHO_T}$with_no_leaks" >&6
22478
22479 if test "$enable_leaks" = no ; then
22480
22481 cat >>confdefs.h <<\EOF
22482 #define NO_LEAKS 1
22483 EOF
22484
22485 cat >>confdefs.h <<\EOF
22486 #define YY_NO_LEAKS 1
22487 EOF
22488
22489 fi
22490
22491 LD_RPATH_OPT=
22492 if test "x$cf_cv_enable_rpath" != xno
22493 then
22494         echo "$as_me:22494: checking for an rpath option" >&5
22495 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22496         case "$cf_cv_system_name" in
22497         (irix*)
22498                 if test "$GCC" = yes; then
22499                         LD_RPATH_OPT="-Wl,-rpath,"
22500                 else
22501                         LD_RPATH_OPT="-rpath "
22502                 fi
22503                 ;;
22504         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22505                 LD_RPATH_OPT="-Wl,-rpath,"
22506                 ;;
22507         (openbsd[2-9].*|mirbsd*)
22508                 LD_RPATH_OPT="-Wl,-rpath,"
22509                 ;;
22510         (dragonfly*)
22511                 LD_RPATH_OPT="-rpath "
22512                 ;;
22513         (netbsd*)
22514                 LD_RPATH_OPT="-Wl,-rpath,"
22515                 ;;
22516         (osf*|mls+*)
22517                 LD_RPATH_OPT="-rpath "
22518                 ;;
22519         (solaris2*)
22520                 LD_RPATH_OPT="-R"
22521                 ;;
22522         (*)
22523                 ;;
22524         esac
22525         echo "$as_me:22525: result: $LD_RPATH_OPT" >&5
22526 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22527
22528         case "x$LD_RPATH_OPT" in
22529         (x-R*)
22530                 echo "$as_me:22530: checking if we need a space after rpath option" >&5
22531 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22532                 cf_save_LIBS="$LIBS"
22533
22534 cf_add_libs="$LIBS"
22535 # reverse order
22536 cf_add_0lib=
22537 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22538 # filter duplicates
22539 for cf_add_1lib in $cf_add_0lib; do
22540         for cf_add_2lib in $cf_add_libs; do
22541                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22542                         cf_add_1lib=
22543                         break
22544                 fi
22545         done
22546         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22547 done
22548 LIBS="$cf_add_libs"
22549
22550                 cat >"conftest.$ac_ext" <<_ACEOF
22551 #line 22551 "configure"
22552 #include "confdefs.h"
22553
22554 int
22555 main (void)
22556 {
22557
22558   ;
22559   return 0;
22560 }
22561 _ACEOF
22562 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22563 if { (eval echo "$as_me:22563: \"$ac_link\"") >&5
22564   (eval $ac_link) 2>&5
22565   ac_status=$?
22566   echo "$as_me:22566: \$? = $ac_status" >&5
22567   (exit "$ac_status"); } &&
22568          { ac_try='test -s "conftest$ac_exeext"'
22569   { (eval echo "$as_me:22569: \"$ac_try\"") >&5
22570   (eval $ac_try) 2>&5
22571   ac_status=$?
22572   echo "$as_me:22572: \$? = $ac_status" >&5
22573   (exit "$ac_status"); }; }; then
22574   cf_rpath_space=no
22575 else
22576   echo "$as_me: failed program was:" >&5
22577 cat "conftest.$ac_ext" >&5
22578 cf_rpath_space=yes
22579 fi
22580 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22581                 LIBS="$cf_save_LIBS"
22582                 echo "$as_me:22582: result: $cf_rpath_space" >&5
22583 echo "${ECHO_T}$cf_rpath_space" >&6
22584                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22585                 ;;
22586         esac
22587 fi
22588
22589 echo "$as_me:22589: checking if rpath-hack should be disabled" >&5
22590 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22591
22592 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22593 if test "${enable_rpath_hack+set}" = set; then
22594   enableval="$enable_rpath_hack"
22595   test "$enableval" != no && enableval=yes
22596         if test "$enableval" != "yes" ; then
22597     enable_rpath_hack=no
22598         else
22599                 enable_rpath_hack=yes
22600         fi
22601 else
22602   enableval=yes
22603         enable_rpath_hack=yes
22604
22605 fi;
22606 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
22607 echo "$as_me:22607: result: $cf_disable_rpath_hack" >&5
22608 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22609
22610 if test "$enable_rpath_hack" = yes ; then
22611
22612 echo "$as_me:22612: checking for updated LDFLAGS" >&5
22613 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22614 if test -n "$LD_RPATH_OPT" ; then
22615         echo "$as_me:22615: result: maybe" >&5
22616 echo "${ECHO_T}maybe" >&6
22617
22618         for ac_prog in ldd
22619 do
22620   # Extract the first word of "$ac_prog", so it can be a program name with args.
22621 set dummy $ac_prog; ac_word=$2
22622 echo "$as_me:22622: checking for $ac_word" >&5
22623 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22624 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22625   echo $ECHO_N "(cached) $ECHO_C" >&6
22626 else
22627   if test -n "$cf_ldd_prog"; then
22628   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22629 else
22630   ac_save_IFS=$IFS; IFS=$ac_path_separator
22631 ac_dummy="$PATH"
22632 for ac_dir in $ac_dummy; do
22633   IFS=$ac_save_IFS
22634   test -z "$ac_dir" && ac_dir=.
22635   $as_executable_p "$ac_dir/$ac_word" || continue
22636 ac_cv_prog_cf_ldd_prog="$ac_prog"
22637 echo "$as_me:22637: found $ac_dir/$ac_word" >&5
22638 break
22639 done
22640
22641 fi
22642 fi
22643 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22644 if test -n "$cf_ldd_prog"; then
22645   echo "$as_me:22645: result: $cf_ldd_prog" >&5
22646 echo "${ECHO_T}$cf_ldd_prog" >&6
22647 else
22648   echo "$as_me:22648: result: no" >&5
22649 echo "${ECHO_T}no" >&6
22650 fi
22651
22652   test -n "$cf_ldd_prog" && break
22653 done
22654 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22655
22656         cf_rpath_list="/usr/lib /lib"
22657         if test "$cf_ldd_prog" != no
22658         then
22659                 cf_rpath_oops=
22660
22661 cat >"conftest.$ac_ext" <<_ACEOF
22662 #line 22662 "configure"
22663 #include "confdefs.h"
22664 #include <stdio.h>
22665 int
22666 main (void)
22667 {
22668 printf("Hello");
22669   ;
22670   return 0;
22671 }
22672 _ACEOF
22673 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22674 if { (eval echo "$as_me:22674: \"$ac_link\"") >&5
22675   (eval $ac_link) 2>&5
22676   ac_status=$?
22677   echo "$as_me:22677: \$? = $ac_status" >&5
22678   (exit "$ac_status"); } &&
22679          { ac_try='test -s "conftest$ac_exeext"'
22680   { (eval echo "$as_me:22680: \"$ac_try\"") >&5
22681   (eval $ac_try) 2>&5
22682   ac_status=$?
22683   echo "$as_me:22683: \$? = $ac_status" >&5
22684   (exit "$ac_status"); }; }; then
22685   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22686                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22687 else
22688   echo "$as_me: failed program was:" >&5
22689 cat "conftest.$ac_ext" >&5
22690 fi
22691 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22692
22693                 # If we passed the link-test, but get a "not found" on a given library,
22694                 # this could be due to inept reconfiguration of gcc to make it only
22695                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22696                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22697                 # /usr/local libraries.
22698                 if test -n "$cf_rpath_oops"
22699                 then
22700                         for cf_rpath_src in $cf_rpath_oops
22701                         do
22702                                 for cf_rpath_dir in \
22703                                         /usr/local \
22704                                         /usr/pkg \
22705                                         /opt/sfw
22706                                 do
22707                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
22708                                         then
22709                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22710
22711 echo "${as_me:-configure}:22711: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22712
22713                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22714                                                 break
22715                                         fi
22716                                 done
22717                         done
22718                 fi
22719         fi
22720
22721         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22722
22723 echo "${as_me:-configure}:22723: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22724
22725 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22726
22727 echo "${as_me:-configure}:22727: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22728
22729 cf_rpath_dst=
22730 for cf_rpath_src in $LDFLAGS
22731 do
22732         case "$cf_rpath_src" in
22733         (-L*)
22734
22735                 # check if this refers to a directory which we will ignore
22736                 cf_rpath_skip=no
22737                 if test -n "$cf_rpath_list"
22738                 then
22739                         for cf_rpath_item in $cf_rpath_list
22740                         do
22741                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22742                                 then
22743                                         cf_rpath_skip=yes
22744                                         break
22745                                 fi
22746                         done
22747                 fi
22748
22749                 if test "$cf_rpath_skip" = no
22750                 then
22751                         # transform the option
22752                         if test "$LD_RPATH_OPT" = "-R " ; then
22753                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22754                         else
22755                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22756                         fi
22757
22758                         # if we have not already added this, add it now
22759                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22760                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22761                         then
22762                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22763
22764 echo "${as_me:-configure}:22764: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22765
22766                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22767                         fi
22768                 fi
22769                 ;;
22770         esac
22771         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22772 done
22773 LDFLAGS=$cf_rpath_dst
22774
22775 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22776
22777 echo "${as_me:-configure}:22777: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22778
22779 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22780
22781 echo "${as_me:-configure}:22781: testing ...checking LIBS $LIBS ..." 1>&5
22782
22783 cf_rpath_dst=
22784 for cf_rpath_src in $LIBS
22785 do
22786         case "$cf_rpath_src" in
22787         (-L*)
22788
22789                 # check if this refers to a directory which we will ignore
22790                 cf_rpath_skip=no
22791                 if test -n "$cf_rpath_list"
22792                 then
22793                         for cf_rpath_item in $cf_rpath_list
22794                         do
22795                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22796                                 then
22797                                         cf_rpath_skip=yes
22798                                         break
22799                                 fi
22800                         done
22801                 fi
22802
22803                 if test "$cf_rpath_skip" = no
22804                 then
22805                         # transform the option
22806                         if test "$LD_RPATH_OPT" = "-R " ; then
22807                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22808                         else
22809                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22810                         fi
22811
22812                         # if we have not already added this, add it now
22813                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22814                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22815                         then
22816                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22817
22818 echo "${as_me:-configure}:22818: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22819
22820                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22821                         fi
22822                 fi
22823                 ;;
22824         esac
22825         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22826 done
22827 LIBS=$cf_rpath_dst
22828
22829 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22830
22831 echo "${as_me:-configure}:22831: testing ...checked LIBS $LIBS ..." 1>&5
22832
22833         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22834
22835 echo "${as_me:-configure}:22835: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22836
22837 else
22838         echo "$as_me:22838: result: no" >&5
22839 echo "${ECHO_T}no" >&6
22840 fi
22841
22842 fi
22843
22844 TEST_ARGS="$LIBS"
22845 LIBS=
22846
22847 ac_config_files="$ac_config_files Makefile"
22848 ac_config_commands="$ac_config_commands default"
22849 cat >confcache <<\_ACEOF
22850 # This file is a shell script that caches the results of configure
22851 # tests run on this system so they can be shared between configure
22852 # scripts and configure runs, see configure's option --config-cache.
22853 # It is not useful on other systems.  If it contains results you don't
22854 # want to keep, you may remove or edit it.
22855 #
22856 # config.status only pays attention to the cache file if you give it
22857 # the --recheck option to rerun configure.
22858 #
22859 # `ac_cv_env_foo' variables (set or unset) will be overriden when
22860 # loading this file, other *unset* `ac_cv_foo' will be assigned the
22861 # following values.
22862
22863 _ACEOF
22864
22865 # The following way of writing the cache mishandles newlines in values,
22866 # but we know of no workaround that is simple, portable, and efficient.
22867 # So, don't put newlines in cache variables' values.
22868 # Ultrix sh set writes to stderr and can't be redirected directly,
22869 # and sets the high bit in the cache file unless we assign to the vars.
22870 {
22871   (set) 2>&1 |
22872     case `(ac_space=' '; set | grep ac_space) 2>&1` in
22873     *ac_space=\ *)
22874       # `set' does not quote correctly, so add quotes (double-quote
22875       # substitution turns \\\\ into \\, and sed turns \\ into \).
22876       sed -n \
22877         "s/'/'\\\\''/g;
22878           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
22879       ;;
22880     *)
22881       # `set' quotes correctly as required by POSIX, so do not add quotes.
22882       sed -n \
22883         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
22884       ;;
22885     esac;
22886 } |
22887   sed '
22888      t clear
22889      : clear
22890      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
22891      t end
22892      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
22893      : end' >>confcache
22894 if cmp -s $cache_file confcache; then :; else
22895   if test -w $cache_file; then
22896     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
22897     cat confcache >$cache_file
22898   else
22899     echo "not updating unwritable cache $cache_file"
22900   fi
22901 fi
22902 rm -f confcache
22903
22904 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22905 # Let make expand exec_prefix.
22906 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22907
22908 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22909 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22910 # trailing colons and then remove the whole line if VPATH becomes empty
22911 # (actually we leave an empty line to preserve line numbers).
22912 if test "x$srcdir" = x.; then
22913   ac_vpsub='/^[         ]*VPATH[        ]*=/{
22914 s/:*\$(srcdir):*/:/;
22915 s/:*\${srcdir}:*/:/;
22916 s/:*@srcdir@:*/:/;
22917 s/^\([^=]*=[    ]*\):*/\1/;
22918 s/:*$//;
22919 s/^[^=]*=[      ]*$//;
22920 }'
22921 fi
22922
22923 DEFS=-DHAVE_CONFIG_H
22924
22925 : "${CONFIG_STATUS=./config.status}"
22926 ac_clean_files_save=$ac_clean_files
22927 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
22928 { echo "$as_me:22928: creating $CONFIG_STATUS" >&5
22929 echo "$as_me: creating $CONFIG_STATUS" >&6;}
22930 cat >"$CONFIG_STATUS" <<_ACEOF
22931 #! $SHELL
22932 # Generated automatically by configure.
22933 # Run this file to recreate the current configuration.
22934 # Compiler output produced by configure, useful for debugging
22935 # configure, is in config.log if it exists.
22936
22937 debug=false
22938 SHELL=\${CONFIG_SHELL-$SHELL}
22939 ac_cs_invocation="\$0 \$@"
22940
22941 CLICOLOR_FORCE= GREP_OPTIONS=
22942 unset CLICOLOR_FORCE GREP_OPTIONS
22943 _ACEOF
22944
22945 cat >>"$CONFIG_STATUS" <<\_ACEOF
22946 # Be Bourne compatible
22947 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
22948   emulate sh
22949   NULLCMD=:
22950 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
22951   set -o posix
22952 fi
22953
22954 # Name of the executable.
22955 as_me=`echo "$0" |sed 's,.*[\\/],,'`
22956
22957 if expr a : '\(a\)' >/dev/null 2>&1; then
22958   as_expr=expr
22959 else
22960   as_expr=false
22961 fi
22962
22963 rm -f conf$$ conf$$.exe conf$$.file
22964 echo >conf$$.file
22965 if ln -s conf$$.file conf$$ 2>/dev/null; then
22966   # We could just check for DJGPP; but this test a) works b) is more generic
22967   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
22968   if test -f conf$$.exe; then
22969     # Don't use ln at all; we don't have any links
22970     as_ln_s='cp -p'
22971   else
22972     as_ln_s='ln -s'
22973   fi
22974 elif ln conf$$.file conf$$ 2>/dev/null; then
22975   as_ln_s=ln
22976 else
22977   as_ln_s='cp -p'
22978 fi
22979 rm -f conf$$ conf$$.exe conf$$.file
22980
22981 as_executable_p="test -f"
22982
22983 # Support unset when possible.
22984 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
22985   as_unset="unset"
22986 else
22987   as_unset="false"
22988 fi
22989
22990 # NLS nuisances.
22991 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
22992 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
22993 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
22994 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
22995 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
22996 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
22997 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
22998 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
22999
23000 # IFS
23001 # We need space, tab and new line, in precisely that order.
23002 as_nl='
23003 '
23004 IFS="   $as_nl"
23005
23006 # CDPATH.
23007 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23008
23009 exec 6>&1
23010
23011 _ACEOF
23012
23013 # Files that config.status was made for.
23014 if test -n "$ac_config_files"; then
23015   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23016 fi
23017
23018 if test -n "$ac_config_headers"; then
23019   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23020 fi
23021
23022 if test -n "$ac_config_links"; then
23023   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23024 fi
23025
23026 if test -n "$ac_config_commands"; then
23027   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23028 fi
23029
23030 cat >>"$CONFIG_STATUS" <<\EOF
23031
23032 ac_cs_usage="\
23033 \`$as_me' instantiates files from templates according to the
23034 current configuration.
23035
23036 Usage: $0 [OPTIONS] [FILE]...
23037
23038   -h, --help       print this help, then exit
23039   -V, --version    print version number, then exit
23040   -d, --debug      don't remove temporary files
23041       --recheck    update $as_me by reconfiguring in the same conditions
23042   --file=FILE[:TEMPLATE]
23043                    instantiate the configuration file FILE
23044   --header=FILE[:TEMPLATE]
23045                    instantiate the configuration header FILE
23046
23047 Configuration files:
23048 $config_files
23049
23050 Configuration headers:
23051 $config_headers
23052
23053 Configuration commands:
23054 $config_commands
23055
23056 Report bugs to <dickey@invisible-island.net>."
23057 EOF
23058
23059 cat >>"$CONFIG_STATUS" <<EOF
23060 ac_cs_version="\\
23061 config.status
23062 configured by $0, generated by GNU Autoconf 2.52.20210105,
23063   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23064
23065 Copyright 2003-2020,2021        Thomas E. Dickey
23066 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23067 Free Software Foundation, Inc.
23068 This config.status script is free software; the Free Software Foundation
23069 gives unlimited permission to copy, distribute and modify it."
23070 srcdir="$srcdir"
23071 INSTALL="$INSTALL"
23072 EOF
23073
23074 cat >>"$CONFIG_STATUS" <<\EOF
23075 # If no file are specified by the user, then we need to provide default
23076 # value.  By we need to know if files were specified by the user.
23077 ac_need_defaults=:
23078 while test $# != 0
23079 do
23080   case $1 in
23081   --*=*)
23082     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23083     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23084     shift
23085     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23086     shift
23087     ;;
23088   -*);;
23089   *) # This is not an option, so the user has probably given explicit
23090      # arguments.
23091      ac_need_defaults=false;;
23092   esac
23093
23094   case $1 in
23095   # Handling of the options.
23096 EOF
23097 cat >>"$CONFIG_STATUS" <<EOF
23098   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23099     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23100     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23101 EOF
23102 cat >>"$CONFIG_STATUS" <<\EOF
23103   --version | --vers* | -V )
23104     echo "$ac_cs_version"; exit 0 ;;
23105   --he | --h)
23106     # Conflict between --help and --header
23107     { { echo "$as_me:23107: error: ambiguous option: $1
23108 Try \`$0 --help' for more information." >&5
23109 echo "$as_me: error: ambiguous option: $1
23110 Try \`$0 --help' for more information." >&2;}
23111    { (exit 1); exit 1; }; };;
23112   --help | --hel | -h )
23113     echo "$ac_cs_usage"; exit 0 ;;
23114   --debug | --d* | -d )
23115     debug=: ;;
23116   --file | --fil | --fi | --f )
23117     shift
23118     CONFIG_FILES="$CONFIG_FILES $1"
23119     ac_need_defaults=false;;
23120   --header | --heade | --head | --hea )
23121     shift
23122     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23123     ac_need_defaults=false;;
23124
23125   # This is an error.
23126   -*) { { echo "$as_me:23126: error: unrecognized option: $1
23127 Try \`$0 --help' for more information." >&5
23128 echo "$as_me: error: unrecognized option: $1
23129 Try \`$0 --help' for more information." >&2;}
23130    { (exit 1); exit 1; }; } ;;
23131
23132   *) ac_config_targets="$ac_config_targets $1" ;;
23133
23134   esac
23135   shift
23136 done
23137
23138 exec 5>>config.log
23139 cat >&5 << _ACEOF
23140
23141 ## ----------------------- ##
23142 ## Running config.status.  ##
23143 ## ----------------------- ##
23144
23145 This file was extended by $as_me 2.52.20210105, executed with
23146   CONFIG_FILES    = $CONFIG_FILES
23147   CONFIG_HEADERS  = $CONFIG_HEADERS
23148   CONFIG_LINKS    = $CONFIG_LINKS
23149   CONFIG_COMMANDS = $CONFIG_COMMANDS
23150   > "$ac_cs_invocation"
23151 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23152
23153 _ACEOF
23154 EOF
23155
23156 cat >>"$CONFIG_STATUS" <<EOF
23157 #
23158 # INIT-COMMANDS section.
23159 #
23160
23161 AWK="$AWK"
23162 ECHO_CC="$ECHO_CC"
23163 ECHO_LD="$ECHO_LD"
23164 SHOW_CC="$SHOW_LD"
23165
23166 EOF
23167
23168 cat >>"$CONFIG_STATUS" <<\EOF
23169 for ac_config_target in $ac_config_targets
23170 do
23171   case "$ac_config_target" in
23172   # Handling of arguments.
23173   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23174   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23175   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23176   *) { { echo "$as_me:23176: error: invalid argument: $ac_config_target" >&5
23177 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23178    { (exit 1); exit 1; }; };;
23179   esac
23180 done
23181
23182 # If the user did not use the arguments to specify the items to instantiate,
23183 # then the envvar interface is used.  Set only those that are not.
23184 # We use the long form for the default assignment because of an extremely
23185 # bizarre bug on SunOS 4.1.3.
23186 if "$ac_need_defaults"; then
23187   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23188   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23189   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23190 fi
23191
23192 # Create a temporary directory, and hook for its removal unless debugging.
23193 $debug ||
23194 {
23195   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23196   trap '{ (exit 1); exit 1; }' 1 2 13 15
23197 }
23198
23199 # Create a (secure) tmp directory for tmp files.
23200 : ${TMPDIR=/tmp}
23201 {
23202   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23203   test -n "$tmp" && test -d "$tmp"
23204 }  ||
23205 {
23206   tmp=$TMPDIR/cs$$-$RANDOM
23207   (umask 077 && mkdir $tmp)
23208 } ||
23209 {
23210    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23211    { (exit 1); exit 1; }
23212 }
23213
23214 EOF
23215
23216 cat >>"$CONFIG_STATUS" <<EOF
23217
23218 #
23219 # CONFIG_FILES section.
23220 #
23221
23222 # No need to generate the scripts if there are no CONFIG_FILES.
23223 # This happens for instance when ./config.status config.h
23224 if test -n "\$CONFIG_FILES"; then
23225   # Protect against being on the right side of a sed subst in config.status.
23226   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23227    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23228 s,@SHELL@,$SHELL,;t t
23229 s,@exec_prefix@,$exec_prefix,;t t
23230 s,@prefix@,$prefix,;t t
23231 s,@program_transform_name@,$program_transform_name,;t t
23232 s,@bindir@,$bindir,;t t
23233 s,@sbindir@,$sbindir,;t t
23234 s,@libexecdir@,$libexecdir,;t t
23235 s,@datarootdir@,$datarootdir,;t t
23236 s,@datadir@,$datadir,;t t
23237 s,@sysconfdir@,$sysconfdir,;t t
23238 s,@sharedstatedir@,$sharedstatedir,;t t
23239 s,@localstatedir@,$localstatedir,;t t
23240 s,@runstatedir@,$runstatedir,;t t
23241 s,@libdir@,$libdir,;t t
23242 s,@includedir@,$includedir,;t t
23243 s,@oldincludedir@,$oldincludedir,;t t
23244 s,@infodir@,$infodir,;t t
23245 s,@mandir@,$mandir,;t t
23246 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23247 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23248 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23249 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23250 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23251 s,@build_alias@,$build_alias,;t t
23252 s,@host_alias@,$host_alias,;t t
23253 s,@target_alias@,$target_alias,;t t
23254 s,@ECHO_C@,$ECHO_C,;t t
23255 s,@ECHO_N@,$ECHO_N,;t t
23256 s,@ECHO_T@,$ECHO_T,;t t
23257 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23258 s,@DEFS@,$DEFS,;t t
23259 s,@LIBS@,$LIBS,;t t
23260 s,@build@,$build,;t t
23261 s,@build_cpu@,$build_cpu,;t t
23262 s,@build_vendor@,$build_vendor,;t t
23263 s,@build_os@,$build_os,;t t
23264 s,@host@,$host,;t t
23265 s,@host_cpu@,$host_cpu,;t t
23266 s,@host_vendor@,$host_vendor,;t t
23267 s,@host_os@,$host_os,;t t
23268 s,@SET_MAKE@,$SET_MAKE,;t t
23269 s,@CC@,$CC,;t t
23270 s,@CFLAGS@,$CFLAGS,;t t
23271 s,@LDFLAGS@,$LDFLAGS,;t t
23272 s,@CPPFLAGS@,$CPPFLAGS,;t t
23273 s,@ac_ct_CC@,$ac_ct_CC,;t t
23274 s,@EXEEXT@,$EXEEXT,;t t
23275 s,@OBJEXT@,$OBJEXT,;t t
23276 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23277 s,@CPP@,$CPP,;t t
23278 s,@GREP@,$GREP,;t t
23279 s,@EGREP@,$EGREP,;t t
23280 s,@AWK@,$AWK,;t t
23281 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23282 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23283 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23284 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23285 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23286 s,@LINT@,$LINT,;t t
23287 s,@LINT_OPTS@,$LINT_OPTS,;t t
23288 s,@CTAGS@,$CTAGS,;t t
23289 s,@ETAGS@,$ETAGS,;t t
23290 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23291 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23292 s,@MATH_LIB@,$MATH_LIB,;t t
23293 s,@top_builddir@,$top_builddir,;t t
23294 s,@CC_G_OPT@,$CC_G_OPT,;t t
23295 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23296 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23297 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23298 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23299 s,@LD@,$LD,;t t
23300 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23301 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23302 s,@LD_MODEL@,$LD_MODEL,;t t
23303 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23304 s,@LIBTOOL@,$LIBTOOL,;t t
23305 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23306 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23307 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23308 s,@LIB_LINK@,$LIB_LINK,;t t
23309 s,@LINK_TESTS@,$LINK_TESTS,;t t
23310 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23311 s,@PACKAGE@,$PACKAGE,;t t
23312 s,@PTHREAD@,$PTHREAD,;t t
23313 s,@TEST_ARGS@,$TEST_ARGS,;t t
23314 s,@TEST_DEPS@,$TEST_DEPS,;t t
23315 s,@TEST_LIBS@,$TEST_LIBS,;t t
23316 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23317 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23318 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23319 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23320 s,@includesubdir@,$includesubdir,;t t
23321 s,@FGREP@,$FGREP,;t t
23322 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23323 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23324 s,@ECHO_LT@,$ECHO_LT,;t t
23325 s,@ECHO_LD@,$ECHO_LD,;t t
23326 s,@RULE_CC@,$RULE_CC,;t t
23327 s,@SHOW_CC@,$SHOW_CC,;t t
23328 s,@ECHO_CC@,$ECHO_CC,;t t
23329 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23330 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23331 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23332 s,@X_CFLAGS@,$X_CFLAGS,;t t
23333 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23334 s,@X_LIBS@,$X_LIBS,;t t
23335 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23336 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23337 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23338 s,@RGB_PATH@,$RGB_PATH,;t t
23339 s,@no_x11_rgb@,$no_x11_rgb,;t t
23340 s,@FORM_NAME@,$FORM_NAME,;t t
23341 s,@MENU_NAME@,$MENU_NAME,;t t
23342 s,@PANEL_NAME@,$PANEL_NAME,;t t
23343 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23344 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23345 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23346 CEOF
23347
23348 EOF
23349
23350   cat >>"$CONFIG_STATUS" <<\EOF
23351   # Split the substitutions into bite-sized pieces for seds with
23352   # small command number limits, like on Digital OSF/1 and HP-UX.
23353   ac_max_sed_lines=48
23354   ac_sed_frag=1 # Number of current file.
23355   ac_beg=1 # First line for current file.
23356   ac_end=$ac_max_sed_lines # Line after last line for current file.
23357   ac_more_lines=:
23358   ac_sed_cmds=
23359   while "$ac_more_lines"; do
23360     if test "$ac_beg" -gt 1; then
23361       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23362     else
23363       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23364     fi
23365     if test ! -s $tmp/subs.frag; then
23366       ac_more_lines=false
23367     else
23368       # The purpose of the label and of the branching condition is to
23369       # speed up the sed processing (if there are no `@' at all, there
23370       # is no need to browse any of the substitutions).
23371       # These are the two extra sed commands mentioned above.
23372       (echo ':t
23373   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23374       # It is possible to make a multiline substitution using escaped newlines.
23375       # Ensure that we do not split the substitution between script fragments.
23376       ac_BEG=$ac_end
23377       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23378       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23379       if test -s $tmp/subs.next; then
23380         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23381         if test ! -s $tmp/subs.edit; then
23382           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23383           if test ! -s $tmp/subs.edit; then
23384             if test "$ac_beg" -gt 1; then
23385               ac_end=`expr "$ac_end" - 1`
23386               continue
23387             fi
23388           fi
23389         fi
23390       fi
23391
23392       if test -z "$ac_sed_cmds"; then
23393         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23394       else
23395         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23396       fi
23397       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23398       ac_beg=$ac_end
23399       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23400     fi
23401   done
23402   if test -z "$ac_sed_cmds"; then
23403     ac_sed_cmds=cat
23404   fi
23405 fi # test -n "$CONFIG_FILES"
23406
23407 EOF
23408 cat >>"$CONFIG_STATUS" <<\EOF
23409 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23410   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23411   case "$ac_file" in
23412   - | *:- | *:-:* ) # input from stdin
23413         cat >$tmp/stdin
23414         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23415         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23416   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23417         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23418   * )   ac_file_in=$ac_file.in ;;
23419   esac
23420
23421   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23422   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23423          X"$ac_file" : 'X\(//\)[^/]' \| \
23424          X"$ac_file" : 'X\(//\)$' \| \
23425          X"$ac_file" : 'X\(/\)' \| \
23426          .     : '\(.\)' 2>/dev/null ||
23427 echo X"$ac_file" |
23428     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23429           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23430           /^X\(\/\/\)$/{ s//\1/; q; }
23431           /^X\(\/\).*/{ s//\1/; q; }
23432           s/.*/./; q'`
23433   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23434     { case "$ac_dir" in
23435   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23436   *)                      as_incr_dir=.;;
23437 esac
23438 as_dummy="$ac_dir"
23439 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23440   case $as_mkdir_dir in
23441     # Skip DOS drivespec
23442     ?:) as_incr_dir=$as_mkdir_dir ;;
23443     *)
23444       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23445       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23446     ;;
23447   esac
23448 done; }
23449
23450     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23451     # A "../" for each directory in $ac_dir_suffix.
23452     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23453   else
23454     ac_dir_suffix= ac_dots=
23455   fi
23456
23457   case "$srcdir" in
23458   .)  ac_srcdir=.
23459       if test -z "$ac_dots"; then
23460          ac_top_srcdir=.
23461       else
23462          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
23463       fi ;;
23464   [\\/]* | ?:[\\/]* )
23465       ac_srcdir="$srcdir$ac_dir_suffix";
23466       ac_top_srcdir="$srcdir" ;;
23467   *) # Relative path.
23468     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
23469     ac_top_srcdir="$ac_dots$srcdir" ;;
23470   esac
23471
23472   case $INSTALL in
23473   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23474   *) ac_INSTALL=$ac_dots$INSTALL ;;
23475   esac
23476
23477   if test x"$ac_file" != x-; then
23478     { echo "$as_me:23478: creating $ac_file" >&5
23479 echo "$as_me: creating $ac_file" >&6;}
23480     rm -f "$ac_file"
23481   fi
23482   # Let's still pretend it is `configure' which instantiates (i.e., don't
23483   # use $as_me), people would be surprised to read:
23484   #    /* config.h.  Generated automatically by config.status.  */
23485   configure_input="Generated automatically from `echo $ac_file_in |
23486                                                  sed 's,.*/,,'` by configure."
23487
23488   # First look for the input files in the build tree, otherwise in the
23489   # src tree.
23490   ac_file_inputs=`IFS=:
23491     for f in $ac_file_in; do
23492       case $f in
23493       -) echo $tmp/stdin ;;
23494       [\\/$]*)
23495          # Absolute (can't be DOS-style, as IFS=:)
23496          test -f "$f" || { { echo "$as_me:23496: error: cannot find input file: $f" >&5
23497 echo "$as_me: error: cannot find input file: $f" >&2;}
23498    { (exit 1); exit 1; }; }
23499          echo $f;;
23500       *) # Relative
23501          if test -f "$f"; then
23502            # Build tree
23503            echo $f
23504          elif test -f "$srcdir/$f"; then
23505            # Source tree
23506            echo "$srcdir/$f"
23507          else
23508            # /dev/null tree
23509            { { echo "$as_me:23509: error: cannot find input file: $f" >&5
23510 echo "$as_me: error: cannot find input file: $f" >&2;}
23511    { (exit 1); exit 1; }; }
23512          fi;;
23513       esac
23514     done` || { (exit 1); exit 1; }
23515 EOF
23516 cat >>"$CONFIG_STATUS" <<\EOF
23517   ac_warn_datarootdir=no
23518   if test x"$ac_file" != x-; then
23519     for ac_item in $ac_file_inputs
23520     do
23521       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
23522       if test -n "$ac_seen"; then
23523         ac_used=`grep '@datarootdir@' "$ac_item"`
23524         if test -z "$ac_used"; then
23525           { echo "$as_me:23525: WARNING: datarootdir was used implicitly but not set:
23526 $ac_seen" >&5
23527 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23528 $ac_seen" >&2;}
23529           ac_warn_datarootdir=yes
23530         fi
23531       fi
23532       ac_seen=`grep '${datarootdir}' "$ac_item"`
23533       if test -n "$ac_seen"; then
23534         { echo "$as_me:23534: WARNING: datarootdir was used explicitly but not set:
23535 $ac_seen" >&5
23536 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23537 $ac_seen" >&2;}
23538         ac_warn_datarootdir=yes
23539       fi
23540     done
23541   fi
23542
23543 if test "x$ac_warn_datarootdir" = xyes; then
23544   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23545 fi
23546
23547 EOF
23548 cat >>"$CONFIG_STATUS" <<EOF
23549   sed "$ac_vpsub
23550 $extrasub
23551 EOF
23552 cat >>"$CONFIG_STATUS" <<\EOF
23553 :t
23554 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23555 s,@configure_input@,$configure_input,;t t
23556 s,@srcdir@,$ac_srcdir,;t t
23557 s,@top_srcdir@,$ac_top_srcdir,;t t
23558 s,@INSTALL@,$ac_INSTALL,;t t
23559 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23560   rm -f $tmp/stdin
23561   if test x"$ac_file" != x-; then
23562     cp "$tmp/out" "$ac_file"
23563
23564     for ac_name in prefix exec_prefix datarootdir
23565     do
23566         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
23567         if test -n "$ac_seen"; then
23568             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
23569             if test -z "$ac_init"; then
23570               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23571               { echo "$as_me:23571: WARNING: Variable $ac_name is used but was not set:
23572 $ac_seen" >&5
23573 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23574 $ac_seen" >&2;}
23575             fi
23576         fi
23577     done
23578     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
23579     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
23580     if test -s $tmp/out; then
23581       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23582       { echo "$as_me:23582: WARNING: Some variables may not be substituted:
23583 $ac_seen" >&5
23584 echo "$as_me: WARNING: Some variables may not be substituted:
23585 $ac_seen" >&2;}
23586     fi
23587   else
23588     cat $tmp/out
23589   fi
23590   rm -f $tmp/out
23591
23592 done
23593 EOF
23594 cat >>"$CONFIG_STATUS" <<\EOF
23595
23596 #
23597 # CONFIG_HEADER section.
23598 #
23599
23600 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23601 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23602 #
23603 # ac_d sets the value in "#define NAME VALUE" lines.
23604 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23605 ac_dB='[        ].*$,\1#\2'
23606 ac_dC=' '
23607 ac_dD=',;t'
23608 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23609 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23610 ac_iB='\([      ]\),\1#\2define\3'
23611 ac_iC=' '
23612 ac_iD='\4,;t'
23613 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23614 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23615 ac_uB='$,\1#\2define\3'
23616 ac_uC=' '
23617 ac_uD=',;t'
23618
23619 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23620   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23621   case "$ac_file" in
23622   - | *:- | *:-:* ) # input from stdin
23623         cat >$tmp/stdin
23624         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23625         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23626   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23627         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23628   * )   ac_file_in=$ac_file.in ;;
23629   esac
23630
23631   test x"$ac_file" != x- && { echo "$as_me:23631: creating $ac_file" >&5
23632 echo "$as_me: creating $ac_file" >&6;}
23633
23634   # First look for the input files in the build tree, otherwise in the
23635   # src tree.
23636   ac_file_inputs=`IFS=:
23637     for f in $ac_file_in; do
23638       case $f in
23639       -) echo $tmp/stdin ;;
23640       [\\/$]*)
23641          # Absolute (can't be DOS-style, as IFS=:)
23642          test -f "$f" || { { echo "$as_me:23642: error: cannot find input file: $f" >&5
23643 echo "$as_me: error: cannot find input file: $f" >&2;}
23644    { (exit 1); exit 1; }; }
23645          echo $f;;
23646       *) # Relative
23647          if test -f "$f"; then
23648            # Build tree
23649            echo $f
23650          elif test -f "$srcdir/$f"; then
23651            # Source tree
23652            echo "$srcdir/$f"
23653          else
23654            # /dev/null tree
23655            { { echo "$as_me:23655: error: cannot find input file: $f" >&5
23656 echo "$as_me: error: cannot find input file: $f" >&2;}
23657    { (exit 1); exit 1; }; }
23658          fi;;
23659       esac
23660     done` || { (exit 1); exit 1; }
23661   # Remove the trailing spaces.
23662   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23663
23664 EOF
23665
23666 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23667 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23668 # be either 'cat' or 'sort'.
23669 cat confdefs.h | uniq >conftest.vals
23670
23671 # Break up conftest.vals because some shells have a limit on
23672 # the size of here documents, and old seds have small limits too.
23673
23674 rm -f conftest.tail
23675 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
23676 while grep . conftest.vals >/dev/null
23677 do
23678   # Write chunks of a limited-size here document to conftest.frag.
23679   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
23680   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
23681   echo 'CEOF' >> "$CONFIG_STATUS"
23682   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
23683   rm -f conftest.vals
23684   mv conftest.tail conftest.vals
23685 done
23686 rm -f conftest.vals
23687
23688 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23689 # marker @DEFS@.
23690 echo '  cat >> conftest.edit <<CEOF
23691 /@DEFS@/r conftest.frag
23692 /@DEFS@/d
23693 CEOF
23694 sed -f conftest.edit $tmp/in > $tmp/out
23695 rm -f $tmp/in
23696 mv $tmp/out $tmp/in
23697 rm -f conftest.edit conftest.frag
23698 ' >> "$CONFIG_STATUS"
23699
23700 cat >>"$CONFIG_STATUS" <<\EOF
23701   # Let's still pretend it is `configure' which instantiates (i.e., don't
23702   # use $as_me), people would be surprised to read:
23703   #    /* config.h.  Generated automatically by config.status.  */
23704   if test x"$ac_file" = x-; then
23705     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23706   else
23707     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23708   fi
23709   cat $tmp/in >>$tmp/config.h
23710   rm -f $tmp/in
23711   if test x"$ac_file" != x-; then
23712     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
23713       { echo "$as_me:23713: $ac_file is unchanged" >&5
23714 echo "$as_me: $ac_file is unchanged" >&6;}
23715     else
23716       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23717          X"$ac_file" : 'X\(//\)[^/]' \| \
23718          X"$ac_file" : 'X\(//\)$' \| \
23719          X"$ac_file" : 'X\(/\)' \| \
23720          .     : '\(.\)' 2>/dev/null ||
23721 echo X"$ac_file" |
23722     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23723           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23724           /^X\(\/\/\)$/{ s//\1/; q; }
23725           /^X\(\/\).*/{ s//\1/; q; }
23726           s/.*/./; q'`
23727       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23728         { case "$ac_dir" in
23729   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23730   *)                      as_incr_dir=.;;
23731 esac
23732 as_dummy="$ac_dir"
23733 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23734   case $as_mkdir_dir in
23735     # Skip DOS drivespec
23736     ?:) as_incr_dir=$as_mkdir_dir ;;
23737     *)
23738       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23739       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23740     ;;
23741   esac
23742 done; }
23743
23744       fi
23745       rm -f "$ac_file"
23746       mv "$tmp/config.h" "$ac_file"
23747     fi
23748   else
23749     cat $tmp/config.h
23750     rm -f $tmp/config.h
23751   fi
23752 done
23753 EOF
23754 cat >>"$CONFIG_STATUS" <<\EOF
23755 #
23756 # CONFIG_COMMANDS section.
23757 #
23758 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23759   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23760   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23761
23762   case "$ac_dest" in
23763     default )
23764
23765 for cf_dir in .
23766 do
23767         if test ! -d "$srcdir/$cf_dir" ; then
23768                 continue
23769         elif test -f "$srcdir/$cf_dir/programs" ; then
23770                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
23771         fi
23772 done
23773
23774         cat >>Makefile <<TEST_EOF
23775
23776 # These rules are generated so we do not rely on suffix rules, which do not
23777 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23778 # some, and the '\$x' confuses others).
23779 TEST_EOF
23780
23781 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23782 for N in $LIST
23783 do
23784         cat >>Makefile <<TEST_EOF
23785
23786 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23787         \$(srcdir)/test.priv.h \\
23788         ncurses_cfg.h
23789         $SHOW_CC
23790         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23791 TEST_EOF
23792 done
23793
23794 if test -f ../config.guess && test -f ../config.sub
23795 then
23796         cat >>Makefile <<TEST_EOF
23797
23798 # if we used CF_INHERIT for getting these files, we can remove them
23799 distclean::
23800         rm -f config.guess config.sub
23801 TEST_EOF
23802 fi
23803  ;;
23804   esac
23805 done
23806 EOF
23807
23808 cat >>"$CONFIG_STATUS" <<\EOF
23809
23810 { (exit 0); exit 0; }
23811 EOF
23812 chmod +x "$CONFIG_STATUS"
23813 ac_clean_files=$ac_clean_files_save
23814
23815 # configure is writing to config.log, and then calls config.status.
23816 # config.status does its own redirection, appending to config.log.
23817 # Unfortunately, on DOS this fails, as config.log is still kept open
23818 # by configure, so config.status won't be able to write to it; its
23819 # output is simply discarded.  So we exec the FD to /dev/null,
23820 # effectively closing config.log, so it can be properly (re)opened and
23821 # appended to by config.status.  When coming back to configure, we
23822 # need to make the FD available again.
23823 if test "$no_create" != yes; then
23824   ac_cs_success=:
23825   exec 5>/dev/null
23826   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
23827   exec 5>>config.log
23828   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23829   # would make configure fail if this is the last instruction.
23830   "$ac_cs_success" || { (exit 1); exit 1; }
23831 fi
23832