]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.4 - patch 20230225
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20230114.
4 #
5 # Copyright 2003-2022,2023      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 # Factoring default headers for most tests.
111 ac_includes_default="\
112 #include <stdio.h>
113 #if HAVE_SYS_TYPES_H
114 # include <sys/types.h>
115 #endif
116 #if HAVE_SYS_STAT_H
117 # include <sys/stat.h>
118 #endif
119 #if STDC_HEADERS
120 # include <stdlib.h>
121 # include <stddef.h>
122 #else
123 # if HAVE_STDLIB_H
124 #  include <stdlib.h>
125 # endif
126 #endif
127 #if HAVE_STRING_H
128 # if !STDC_HEADERS && HAVE_MEMORY_H
129 #  include <memory.h>
130 # endif
131 # include <string.h>
132 #endif
133 #if HAVE_STRINGS_H
134 # include <strings.h>
135 #endif
136 #if HAVE_INTTYPES_H
137 # include <inttypes.h>
138 #else
139 # if HAVE_STDINT_H
140 #  include <stdint.h>
141 # endif
142 #endif
143 #if HAVE_UNISTD_H
144 # include <unistd.h>
145 #endif"
146
147 # Initialize some variables set by options.
148 ac_init_help=
149 ac_init_version=false
150 # The variables have the same names as the options, with
151 # dashes changed to underlines.
152 cache_file=/dev/null
153 exec_prefix=NONE
154 no_create=
155 no_recursion=
156 prefix=NONE
157 program_prefix=NONE
158 program_suffix=NONE
159 program_transform_name=s,x,x,
160 silent=
161 site=
162 srcdir=
163 verbose=
164 x_includes=NONE
165 x_libraries=NONE
166
167 # Installation directory options.
168 # These are left unexpanded so users can "make install exec_prefix=/foo"
169 # and all the variables that are supposed to be based on exec_prefix
170 # by default will actually change.
171 # Use braces instead of parens because sh, perl, etc. also accept them.
172 bindir='${exec_prefix}/bin'
173 sbindir='${exec_prefix}/sbin'
174 libexecdir='${exec_prefix}/libexec'
175 datarootdir='${prefix}/share'
176 datadir='${datarootdir}'
177 sysconfdir='${prefix}/etc'
178 sharedstatedir='${prefix}/com'
179 localstatedir='${prefix}/var'
180 runstatedir='${localstatedir}/run'
181 libdir='${exec_prefix}/lib'
182 includedir='${prefix}/include'
183 oldincludedir='/usr/include'
184 infodir='${datarootdir}/info'
185 mandir='${datarootdir}/man'
186
187 # Identity of this package.
188 PACKAGE_NAME=
189 PACKAGE_TARNAME=
190 PACKAGE_VERSION=
191 PACKAGE_STRING=
192 PACKAGE_BUGREPORT=
193
194 ac_prev=
195 for ac_option
196 do
197   # If the previous option needs an argument, assign it.
198   if test -n "$ac_prev"; then
199     eval "$ac_prev=\$ac_option"
200     ac_prev=
201     continue
202   fi
203
204   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
205
206   # Accept the important Cygnus configure options, so we can diagnose typos.
207
208   case "$ac_option" in
209
210   -bindir | --bindir | --bindi | --bind | --bin | --bi)
211     ac_prev=bindir ;;
212   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
213     bindir=$ac_optarg ;;
214
215   -build | --build | --buil | --bui | --bu)
216     ac_prev=build_alias ;;
217   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
218     build_alias=$ac_optarg ;;
219
220   -cache-file | --cache-file | --cache-fil | --cache-fi \
221   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
222     ac_prev=cache_file ;;
223   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
224   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
225     cache_file=$ac_optarg ;;
226
227   --config-cache | -C)
228     cache_file=config.cache ;;
229
230   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
231     ac_prev=datadir ;;
232   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
233   | --da=*)
234     datadir=$ac_optarg ;;
235
236   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
237   | --dataroo | --dataro | --datar)
238     ac_prev=datarootdir ;;
239   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
240   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
241     datarootdir=$ac_optarg ;;
242
243   -disable-* | --disable-*)
244     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
245     # Reject names that are not valid shell variable names.
246     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
247       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
248    { (exit 1); exit 1; }; }
249     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
250     eval "enable_$ac_feature=no" ;;
251
252   -enable-* | --enable-*)
253     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
254     # Reject names that are not valid shell variable names.
255     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
256       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
257    { (exit 1); exit 1; }; }
258     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
259     case "$ac_option" in
260       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
261       *) ac_optarg=yes ;;
262     esac
263     eval "enable_$ac_feature='$ac_optarg'" ;;
264
265   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
266   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
267   | --exec | --exe | --ex)
268     ac_prev=exec_prefix ;;
269   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
270   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
271   | --exec=* | --exe=* | --ex=*)
272     exec_prefix=$ac_optarg ;;
273
274   -gas | --gas | --ga | --g)
275     # Obsolete; use --with-gas.
276     with_gas=yes ;;
277
278   -help | --help | --hel | --he | -h)
279     ac_init_help=long ;;
280   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
281     ac_init_help=recursive ;;
282   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
283     ac_init_help=short ;;
284
285   -host | --host | --hos | --ho)
286     ac_prev=host_alias ;;
287   -host=* | --host=* | --hos=* | --ho=*)
288     host_alias=$ac_optarg ;;
289
290   -includedir | --includedir | --includedi | --included | --include \
291   | --includ | --inclu | --incl | --inc)
292     ac_prev=includedir ;;
293   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
294   | --includ=* | --inclu=* | --incl=* | --inc=*)
295     includedir=$ac_optarg ;;
296
297   -infodir | --infodir | --infodi | --infod | --info | --inf)
298     ac_prev=infodir ;;
299   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
300     infodir=$ac_optarg ;;
301
302   -libdir | --libdir | --libdi | --libd)
303     ac_prev=libdir ;;
304   -libdir=* | --libdir=* | --libdi=* | --libd=*)
305     libdir=$ac_optarg ;;
306
307   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
308   | --libexe | --libex | --libe)
309     ac_prev=libexecdir ;;
310   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
311   | --libexe=* | --libex=* | --libe=*)
312     libexecdir=$ac_optarg ;;
313
314   -localstatedir | --localstatedir | --localstatedi | --localstated \
315   | --localstate | --localstat | --localsta | --localst \
316   | --locals | --local | --loca | --loc | --lo)
317     ac_prev=localstatedir ;;
318   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
319   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
320   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
321     localstatedir=$ac_optarg ;;
322
323   -runstatedir | --runstatedir | --runstatedi | --runstated \
324   | --runstate | --runstat | --runsta | --runst \
325   | --runs | --run | --ru)
326     ac_prev=runstatedir ;;
327   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
328   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
329   | --runs=* | --run=* | --ru=*)
330     runstatedir=$ac_optarg ;;
331
332   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
333     ac_prev=mandir ;;
334   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
335     mandir=$ac_optarg ;;
336
337   -nfp | --nfp | --nf)
338     # Obsolete; use --without-fp.
339     with_fp=no ;;
340
341   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
342   | --no-cr | --no-c)
343     no_create=yes ;;
344
345   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
346   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
347     no_recursion=yes ;;
348
349   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
350   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
351   | --oldin | --oldi | --old | --ol | --o)
352     ac_prev=oldincludedir ;;
353   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
354   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
355   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
356     oldincludedir=$ac_optarg ;;
357
358   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
359     ac_prev=prefix ;;
360   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
361     prefix=$ac_optarg ;;
362
363   -program-prefix | --program-prefix | --program-prefi | --program-pref \
364   | --program-pre | --program-pr | --program-p)
365     ac_prev=program_prefix ;;
366   -program-prefix=* | --program-prefix=* | --program-prefi=* \
367   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
368     program_prefix=$ac_optarg ;;
369
370   -program-suffix | --program-suffix | --program-suffi | --program-suff \
371   | --program-suf | --program-su | --program-s)
372     ac_prev=program_suffix ;;
373   -program-suffix=* | --program-suffix=* | --program-suffi=* \
374   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
375     program_suffix=$ac_optarg ;;
376
377   -program-transform-name | --program-transform-name \
378   | --program-transform-nam | --program-transform-na \
379   | --program-transform-n | --program-transform- \
380   | --program-transform | --program-transfor \
381   | --program-transfo | --program-transf \
382   | --program-trans | --program-tran \
383   | --progr-tra | --program-tr | --program-t)
384     ac_prev=program_transform_name ;;
385   -program-transform-name=* | --program-transform-name=* \
386   | --program-transform-nam=* | --program-transform-na=* \
387   | --program-transform-n=* | --program-transform-=* \
388   | --program-transform=* | --program-transfor=* \
389   | --program-transfo=* | --program-transf=* \
390   | --program-trans=* | --program-tran=* \
391   | --progr-tra=* | --program-tr=* | --program-t=*)
392     program_transform_name=$ac_optarg ;;
393
394   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
395   | -silent | --silent | --silen | --sile | --sil)
396     silent=yes ;;
397
398   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
399     ac_prev=sbindir ;;
400   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
401   | --sbi=* | --sb=*)
402     sbindir=$ac_optarg ;;
403
404   -sharedstatedir | --sharedstatedir | --sharedstatedi \
405   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
406   | --sharedst | --shareds | --shared | --share | --shar \
407   | --sha | --sh)
408     ac_prev=sharedstatedir ;;
409   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
410   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
411   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
412   | --sha=* | --sh=*)
413     sharedstatedir=$ac_optarg ;;
414
415   -site | --site | --sit)
416     ac_prev=site ;;
417   -site=* | --site=* | --sit=*)
418     site=$ac_optarg ;;
419
420   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
421     ac_prev=srcdir ;;
422   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
423     srcdir=$ac_optarg ;;
424
425   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
426   | --syscon | --sysco | --sysc | --sys | --sy)
427     ac_prev=sysconfdir ;;
428   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
429   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
430     sysconfdir=$ac_optarg ;;
431
432   -target | --target | --targe | --targ | --tar | --ta | --t)
433     ac_prev=target_alias ;;
434   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
435     target_alias=$ac_optarg ;;
436
437   -v | -verbose | --verbose | --verbos | --verbo | --verb)
438     verbose=yes ;;
439
440   -version | --version | --versio | --versi | --vers | -V)
441     ac_init_version=: ;;
442
443   -with-* | --with-*)
444     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
445     # Reject names that are not valid shell variable names.
446     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
447       { echo "$as_me: error: invalid package name: $ac_package" >&2
448    { (exit 1); exit 1; }; }
449     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
450     case "$ac_option" in
451       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
452       *) ac_optarg=yes ;;
453     esac
454     eval "with_$ac_package='$ac_optarg'" ;;
455
456   -without-* | --without-*)
457     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
458     # Reject names that are not valid shell variable names.
459     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
460       { echo "$as_me: error: invalid package name: $ac_package" >&2
461    { (exit 1); exit 1; }; }
462     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
463     eval "with_$ac_package=no" ;;
464
465   --x)
466     # Obsolete; use --with-x.
467     with_x=yes ;;
468
469   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
470   | --x-incl | --x-inc | --x-in | --x-i)
471     ac_prev=x_includes ;;
472   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
473   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
474     x_includes=$ac_optarg ;;
475
476   -x-libraries | --x-libraries | --x-librarie | --x-librari \
477   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
478     ac_prev=x_libraries ;;
479   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
480   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
481     x_libraries=$ac_optarg ;;
482
483   -*) { echo "$as_me: error: unrecognized option: $ac_option
484 Try \`$0 --help' for more information." >&2
485    { (exit 1); exit 1; }; }
486     ;;
487
488   *=*)
489     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
490     # Reject names that are not valid shell variable names.
491     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
492       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
493    { (exit 1); exit 1; }; }
494     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
495     eval "$ac_envvar='$ac_optarg'"
496     export "$ac_envvar" ;;
497
498   *)
499     # FIXME: should be removed in autoconf 3.0.
500     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
501     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
502       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
503     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
504     ;;
505
506   esac
507 done
508
509 if test -n "$ac_prev"; then
510   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
511   { echo "$as_me: error: missing argument to $ac_option" >&2
512    { (exit 1); exit 1; }; }
513 fi
514
515 # Be sure to have absolute paths.
516 for ac_var in exec_prefix prefix
517 do
518   eval ac_val=$`echo "$ac_var"`
519   case "$ac_val" in
520     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
521     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
522    { (exit 1); exit 1; }; };;
523   esac
524 done
525
526 # Be sure to have absolute paths.
527 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
528               localstatedir libdir includedir oldincludedir infodir mandir
529 do
530   eval ac_val=$`echo "$ac_var"`
531   case "$ac_val" in
532     [\\/$]* | ?:[\\/]* ) ;;
533     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
534    { (exit 1); exit 1; }; };;
535   esac
536 done
537
538 # There might be people who depend on the old broken behavior: `$host'
539 # used to hold the argument of --host etc.
540 build=$build_alias
541 host=$host_alias
542 target=$target_alias
543
544 # FIXME: should be removed in autoconf 3.0.
545 if test "x$host_alias" != x; then
546   if test "x$build_alias" = x; then
547     cross_compiling=maybe
548     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
549     If a cross compiler is detected then cross compile mode will be used." >&2
550   elif test "x$build_alias" != "x$host_alias"; then
551     cross_compiling=yes
552   fi
553 fi
554
555 ac_tool_prefix=
556 test -n "$host_alias" && ac_tool_prefix=$host_alias-
557
558 test "$silent" = yes && exec 6>/dev/null
559
560 # Find the source files, if location was not specified.
561 if test -z "$srcdir"; then
562   ac_srcdir_defaulted=yes
563   # Try the directory containing this script, then its parent.
564   ac_prog=$0
565   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
566   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
567   srcdir=$ac_confdir
568   if test ! -r "$srcdir/$ac_unique_file"; then
569     srcdir=..
570   fi
571 else
572   ac_srcdir_defaulted=no
573 fi
574 if test ! -r "$srcdir/$ac_unique_file"; then
575   if test "$ac_srcdir_defaulted" = yes; then
576     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
577    { (exit 1); exit 1; }; }
578   else
579     { echo "$as_me: error: cannot find sources in $srcdir" >&2
580    { (exit 1); exit 1; }; }
581   fi
582 fi
583 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
584 ac_env_build_alias_set=${build_alias+set}
585 ac_env_build_alias_value=$build_alias
586 ac_cv_env_build_alias_set=${build_alias+set}
587 ac_cv_env_build_alias_value=$build_alias
588 ac_env_host_alias_set=${host_alias+set}
589 ac_env_host_alias_value=$host_alias
590 ac_cv_env_host_alias_set=${host_alias+set}
591 ac_cv_env_host_alias_value=$host_alias
592 ac_env_target_alias_set=${target_alias+set}
593 ac_env_target_alias_value=$target_alias
594 ac_cv_env_target_alias_set=${target_alias+set}
595 ac_cv_env_target_alias_value=$target_alias
596 ac_env_CC_set=${CC+set}
597 ac_env_CC_value=$CC
598 ac_cv_env_CC_set=${CC+set}
599 ac_cv_env_CC_value=$CC
600 ac_env_CFLAGS_set=${CFLAGS+set}
601 ac_env_CFLAGS_value=$CFLAGS
602 ac_cv_env_CFLAGS_set=${CFLAGS+set}
603 ac_cv_env_CFLAGS_value=$CFLAGS
604 ac_env_LDFLAGS_set=${LDFLAGS+set}
605 ac_env_LDFLAGS_value=$LDFLAGS
606 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
607 ac_cv_env_LDFLAGS_value=$LDFLAGS
608 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
609 ac_env_CPPFLAGS_value=$CPPFLAGS
610 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
611 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
612 ac_env_CPP_set=${CPP+set}
613 ac_env_CPP_value=$CPP
614 ac_cv_env_CPP_set=${CPP+set}
615 ac_cv_env_CPP_value=$CPP
616
617 #
618 # Report the --help message.
619 #
620 if test "$ac_init_help" = "long"; then
621   # Omit some internal or obsolete options to make the list less imposing.
622   # This message is too long to be a string in the A/UX 3.1 sh.
623   cat <<EOF
624 \`configure' configures this package to adapt to many kinds of systems.
625
626 Usage: $0 [OPTION]... [VAR=VALUE]...
627
628 To assign environment variables (e.g., CC, CFLAGS...), specify them as
629 VAR=VALUE.  See below for descriptions of some of the useful variables.
630
631 Defaults for the options are specified in brackets.
632
633 Configuration:
634   -h, --help              display this help and exit
635       --help=short        display options specific to this package
636       --help=recursive    display the short help of all the included packages
637   -V, --version           display version information and exit
638   -q, --quiet, --silent   do not print \`checking...' messages
639       --cache-file=FILE   cache test results in FILE [disabled]
640   -C, --config-cache      alias for \`--cache-file=config.cache'
641   -n, --no-create         do not create output files
642       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
643
644 EOF
645
646   cat <<EOF
647 Installation directories:
648   --prefix=PREFIX         install architecture-independent files in PREFIX
649                           [$ac_default_prefix]
650   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
651                           [PREFIX]
652
653 By default, \`make install' will install all the files in
654 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
655 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
656 for instance \`--prefix=\$HOME'.
657
658 For better control, use the options below.
659
660 Fine tuning of the installation directories:
661   --bindir=DIR            user executables [EPREFIX/bin]
662   --sbindir=DIR           system admin executables [EPREFIX/sbin]
663   --libexecdir=DIR        program executables [EPREFIX/libexec]
664   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
665   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
666   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
667   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
668   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
669   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
670   --libdir=DIR            object code libraries [EPREFIX/lib]
671   --includedir=DIR        C header files [PREFIX/include]
672   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
673   --infodir=DIR           info documentation [DATAROOTDIR/info]
674   --mandir=DIR            man documentation [DATAROOTDIR/man]
675 EOF
676
677   cat <<\EOF
678
679 Program names:
680   --program-prefix=PREFIX            prepend PREFIX to installed program names
681   --program-suffix=SUFFIX            append SUFFIX to installed program names
682   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
683
684 X features:
685   --x-includes=DIR    X include files are in DIR
686   --x-libraries=DIR   X library files are in DIR
687
688 System types:
689   --build=BUILD           configure for building on BUILD [guessed]
690   --host=HOST       build programs to run on HOST [BUILD]
691 EOF
692 fi
693
694 if test -n "$ac_init_help"; then
695
696   cat <<\EOF
697
698 Optional Features:
699   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
700   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
701
702 Optional Packages:
703   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
704   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
705
706 General Options:
707   --disable-stripping     do not strip (debug info) installed executables
708   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
709   --enable-string-hacks   work around bogus compiler/loader warnings
710   --with-pkg-config{=path} enable/disable use of pkg-config
711   --disable-echo          do not display "compiling" commands
712 Curses Version-dependent Options:
713   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
714   --disable-widec         disable checks for wide-character functions
715   --with-curses-dir=DIR   directory in which (n)curses is installed
716   --with-screen=XXX       use specified curses-libraries
717   --with-ncursesw         use wide ncurses-libraries
718   --with-ncurses          use ncurses-libraries
719   --with-pdcurses         compile/link with pdcurses X11 library
720   --with-curses-colr      compile/link with HPUX 10.x color-curses
721   --with-curses-5lib      compile/link with SunOS 5lib curses
722   --with-Xaw3d            link with Xaw 3d library
723   --with-Xaw3dxft         link with Xaw 3d xft library
724   --with-neXtaw           link with neXT Athena library
725   --with-XawPlus          link with Athena-Plus library
726   --with-x                use the X Window System
727   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
728   --with-form-libname=XXX override form basename of library
729   --with-menu-libname=XXX override menu basename of library
730   --with-panel-libname=XXX override panel basename of library
731   --disable-panel         disable checks for panel functions
732   --disable-menu          disable checks for menu functions
733   --disable-form          disable checks for form functions
734 Testing/development Options:
735   --enable-warnings       test: turn on gcc compiler warnings
736   --with-dmalloc          test: use Gray Watson's dmalloc library
737   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
738   --with-valgrind         test: use valgrind
739   --disable-leaks         test: free permanent memory, analyze leaks
740   --disable-rpath-hack    don't add rpath options for additional libraries
741
742 Some influential environment variables:
743   CC          C compiler command
744   CFLAGS      C compiler flags
745   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
746               nonstandard directory <lib dir>
747   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
748               headers in a nonstandard directory <include dir>
749   CPP         C preprocessor
750
751 Use these variables to override the choices made by `configure' or to help
752 it to find libraries and programs with nonstandard names/locations.
753
754 EOF
755 fi
756
757 if test "$ac_init_help" = "recursive"; then
758   # If there are subdirs, report their specific --help.
759   ac_popdir=`pwd`
760   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
761     cd "$ac_subdir"
762     # A "../" for each directory in /$ac_subdir.
763     ac_dots=`echo "$ac_subdir" |
764              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
765
766     case "$srcdir" in
767     .) # No --srcdir option.  We are building in place.
768       ac_sub_srcdir="$srcdir" ;;
769     [\\/]* | ?:[\\/]* ) # Absolute path.
770       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
771     *) # Relative path.
772       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
773     esac
774
775     # Check for guested configure; otherwise get Cygnus style configure.
776     if test -f "$ac_sub_srcdir/configure.gnu"; then
777       echo
778       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
779     elif test -f "$ac_sub_srcdir/configure"; then
780       echo
781       $SHELL "$ac_sub_srcdir/configure" --help=recursive
782     elif test -f "$ac_sub_srcdir/configure.ac" ||
783            test -f "$ac_sub_srcdir/configure.in"; then
784       echo
785       "$ac_configure" --help
786     else
787       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
788     fi
789     cd "$ac_popdir"
790   done
791 fi
792
793 test -n "$ac_init_help" && exit 0
794 if "$ac_init_version"; then
795   cat <<\EOF
796
797 Copyright 2003-2022,2023        Thomas E. Dickey
798 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
799 Free Software Foundation, Inc.
800 This configure script is free software; the Free Software Foundation
801 gives unlimited permission to copy, distribute and modify it.
802 EOF
803   exit 0
804 fi
805 exec 5>config.log
806 cat >&5 <<EOF
807 This file contains any messages produced by compilers while
808 running configure, to aid debugging if configure makes a mistake.
809
810 It was created by $as_me, which was
811 generated by GNU Autoconf 2.52.20230114.  Invocation command line was
812
813   $ $0 $@
814
815 EOF
816 {
817 cat <<_ASUNAME
818 ## ---------- ##
819 ## Platform.  ##
820 ## ---------- ##
821
822 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
823 uname -m = `(uname -m) 2>/dev/null || echo unknown`
824 uname -r = `(uname -r) 2>/dev/null || echo unknown`
825 uname -s = `(uname -s) 2>/dev/null || echo unknown`
826 uname -v = `(uname -v) 2>/dev/null || echo unknown`
827
828 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
829 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
830
831 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
832 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
833 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
834 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
835 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
836 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
837 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
838
839 PATH = $PATH
840
841 _ASUNAME
842 } >&5
843
844 cat >&5 <<EOF
845 ## ------------ ##
846 ## Core tests.  ##
847 ## ------------ ##
848
849 EOF
850
851 # Keep a trace of the command line.
852 # Strip out --no-create and --no-recursion so they do not pile up.
853 # Also quote any args containing shell meta-characters.
854 ac_configure_args=
855 ac_sep=
856 for ac_arg
857 do
858   case "$ac_arg" in
859   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
860   | --no-cr | --no-c) ;;
861   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
862   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
863   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
864     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
865     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
866     ac_sep=" " ;;
867   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
868      ac_sep=" " ;;
869   esac
870   # Get rid of the leading space.
871 done
872
873 # When interrupted or exit'd, cleanup temporary files, and complete
874 # config.log.  We remove comments because anyway the quotes in there
875 # would cause problems or look ugly.
876 trap 'exit_status=$?
877   # Save into config.log some information that might help in debugging.
878   echo >&5
879   echo "## ----------------- ##" >&5
880   echo "## Cache variables.  ##" >&5
881   echo "## ----------------- ##" >&5
882   echo >&5
883   # The following way of writing the cache mishandles newlines in values,
884 {
885   (set) 2>&1 |
886     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
887     *ac_space=\ *)
888       sed -n \
889         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
890           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
891       ;;
892     *)
893       sed -n \
894         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
895       ;;
896     esac;
897 } >&5
898   sed "/^$/d" confdefs.h >conftest.log
899   if test -s conftest.log; then
900     echo >&5
901     echo "## ------------ ##" >&5
902     echo "## confdefs.h.  ##" >&5
903     echo "## ------------ ##" >&5
904     echo >&5
905     cat conftest.log >&5
906   fi
907   (echo; echo) >&5
908   test "$ac_signal" != 0 &&
909     echo "$as_me: caught signal $ac_signal" >&5
910   echo "$as_me: exit $exit_status" >&5
911   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
912     exit $exit_status
913      ' 0
914 for ac_signal in 1 2 13 15; do
915   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
916 done
917 ac_signal=0
918
919 # confdefs.h avoids OS command line length limits that DEFS can exceed.
920 rm -rf conftest* confdefs.h
921 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
922 echo >confdefs.h
923
924 # Let the site file select an alternate cache file if it wants to.
925 # Prefer explicitly selected file to automatically selected ones.
926 if test -z "$CONFIG_SITE"; then
927   if test "x$prefix" != xNONE; then
928     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
929   else
930     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
931   fi
932 fi
933 for ac_site_file in $CONFIG_SITE; do
934   if test -r "$ac_site_file"; then
935     { echo "$as_me:935: loading site script $ac_site_file" >&5
936 echo "$as_me: loading site script $ac_site_file" >&6;}
937     cat "$ac_site_file" >&5
938     . "$ac_site_file"
939   fi
940 done
941
942 if test -r "$cache_file"; then
943   # Some versions of bash will fail to source /dev/null (special
944   # files actually), so we avoid doing that.
945   if test -f "$cache_file"; then
946     { echo "$as_me:946: loading cache $cache_file" >&5
947 echo "$as_me: loading cache $cache_file" >&6;}
948     case $cache_file in
949       [\\/]* | ?:[\\/]* ) . $cache_file;;
950       *)                      . ./$cache_file;;
951     esac
952   fi
953 else
954   { echo "$as_me:954: creating cache $cache_file" >&5
955 echo "$as_me: creating cache $cache_file" >&6;}
956   >$cache_file
957 fi
958
959 # Check that the precious variables saved in the cache have kept the same
960 # value.
961 ac_cache_corrupted=false
962 for ac_var in `(set) 2>&1 |
963                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
964   eval ac_old_set=\$ac_cv_env_${ac_var}_set
965   eval ac_new_set=\$ac_env_${ac_var}_set
966   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
967   eval ac_new_val="\$ac_env_${ac_var}_value"
968   case "$ac_old_set,$ac_new_set" in
969     set,)
970       { echo "$as_me:970: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
971 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
972       ac_cache_corrupted=: ;;
973     ,set)
974       { echo "$as_me:974: error: \`$ac_var' was not set in the previous run" >&5
975 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
976       ac_cache_corrupted=: ;;
977     ,);;
978     *)
979       if test "x$ac_old_val" != "x$ac_new_val"; then
980         { echo "$as_me:980: error: \`$ac_var' has changed since the previous run:" >&5
981 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
982         { echo "$as_me:982:   former value:  $ac_old_val" >&5
983 echo "$as_me:   former value:  $ac_old_val" >&2;}
984         { echo "$as_me:984:   current value: $ac_new_val" >&5
985 echo "$as_me:   current value: $ac_new_val" >&2;}
986         ac_cache_corrupted=:
987       fi;;
988   esac
989   # Pass precious variables to config.status.  It doesn't matter if
990   # we pass some twice (in addition to the command line arguments).
991   if test "$ac_new_set" = set; then
992     case "$ac_new_val" in
993     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
994       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
995       ac_configure_args="$ac_configure_args '$ac_arg'"
996       ;;
997     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
998        ;;
999     esac
1000   fi
1001 done
1002 if "$ac_cache_corrupted"; then
1003   { echo "$as_me:1003: error: changes in the environment can compromise the build" >&5
1004 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1005   { { echo "$as_me:1005: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1006 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1007    { (exit 1); exit 1; }; }
1008 fi
1009
1010 ac_ext=c
1011 ac_cpp='$CPP $CPPFLAGS'
1012 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1013 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1014 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1015 ac_main_return="return"
1016
1017 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1018   *c*,-n*) ECHO_N=
1019            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1020            ECHO_T='     '
1021            ;;
1022   *c*,*  ) ECHO_N=-n
1023            ECHO_C=
1024            ECHO_T=
1025            ;;
1026   *)       ECHO_N=
1027            ECHO_C='\c'
1028            ECHO_T=
1029            ;;
1030 esac
1031 echo "#! $SHELL" >conftest.sh
1032 echo  "exit 0"   >>conftest.sh
1033 chmod +x conftest.sh
1034 if { (echo "$as_me:1034: PATH=\".;.\"; conftest.sh") >&5
1035   (PATH=".;."; conftest.sh) 2>&5
1036   ac_status=$?
1037   echo "$as_me:1037: \$? = $ac_status" >&5
1038   (exit "$ac_status"); }; then
1039   ac_path_separator=';'
1040 else
1041   ac_path_separator=:
1042 fi
1043 PATH_SEPARATOR="$ac_path_separator"
1044 rm -f conftest.sh
1045
1046 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1047
1048 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1049
1050 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1051
1052 ac_aux_dir=
1053 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1054   if test -f "$ac_dir/install-sh"; then
1055     ac_aux_dir=$ac_dir
1056     ac_install_sh="$ac_aux_dir/install-sh -c"
1057     break
1058   elif test -f "$ac_dir/install.sh"; then
1059     ac_aux_dir=$ac_dir
1060     ac_install_sh="$ac_aux_dir/install.sh -c"
1061     break
1062   elif test -f "$ac_dir/shtool"; then
1063     ac_aux_dir=$ac_dir
1064     ac_install_sh="$ac_aux_dir/shtool install -c"
1065     break
1066   fi
1067 done
1068 if test -z "$ac_aux_dir"; then
1069   { { echo "$as_me:1069: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1070 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1071    { (exit 1); exit 1; }; }
1072 fi
1073 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1074 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1075 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1076
1077 # Make sure we can run config.sub.
1078 $ac_config_sub sun4 >/dev/null 2>&1 ||
1079   { { echo "$as_me:1079: error: cannot run $ac_config_sub" >&5
1080 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1081    { (exit 1); exit 1; }; }
1082
1083 echo "$as_me:1083: checking build system type" >&5
1084 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1085 if test "${ac_cv_build+set}" = set; then
1086   echo $ECHO_N "(cached) $ECHO_C" >&6
1087 else
1088   ac_cv_build_alias=$build_alias
1089 test -z "$ac_cv_build_alias" &&
1090   ac_cv_build_alias=`$ac_config_guess`
1091 test -z "$ac_cv_build_alias" &&
1092   { { echo "$as_me:1092: error: cannot guess build type; you must specify one" >&5
1093 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1094    { (exit 1); exit 1; }; }
1095 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1096   { { echo "$as_me:1096: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1097 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1098    { (exit 1); exit 1; }; }
1099
1100 fi
1101 echo "$as_me:1101: result: $ac_cv_build" >&5
1102 echo "${ECHO_T}$ac_cv_build" >&6
1103 build=$ac_cv_build
1104 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1105 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1106 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1107
1108 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1109         echo "$as_me:1109: checking host system type" >&5
1110 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1111 if test "${ac_cv_host+set}" = set; then
1112   echo $ECHO_N "(cached) $ECHO_C" >&6
1113 else
1114   ac_cv_host_alias=$host_alias
1115 test -z "$ac_cv_host_alias" &&
1116   ac_cv_host_alias=$ac_cv_build_alias
1117 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1118   { { echo "$as_me:1118: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1119 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1120    { (exit 1); exit 1; }; }
1121
1122 fi
1123 echo "$as_me:1123: result: $ac_cv_host" >&5
1124 echo "${ECHO_T}$ac_cv_host" >&6
1125 host=$ac_cv_host
1126 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1127 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1128 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1129
1130         system_name="$host_os"
1131 else
1132         system_name="`(uname -s -r) 2>/dev/null`"
1133         if test -z "$system_name" ; then
1134                 system_name="`(hostname) 2>/dev/null`"
1135         fi
1136 fi
1137 test -n "$system_name" &&
1138 cat >>confdefs.h <<EOF
1139 #define SYSTEM_NAME "$system_name"
1140 EOF
1141
1142 if test "${cf_cv_system_name+set}" = set; then
1143   echo $ECHO_N "(cached) $ECHO_C" >&6
1144 else
1145   cf_cv_system_name="$system_name"
1146 fi
1147
1148 test -z "$system_name" && system_name="$cf_cv_system_name"
1149 test -n "$cf_cv_system_name" && echo "$as_me:1149: result: Configuring for $cf_cv_system_name" >&5
1150 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1151
1152 if test ".$system_name" != ".$cf_cv_system_name" ; then
1153         echo "$as_me:1153: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1154 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1155         { { echo "$as_me:1155: error: \"Please remove config.cache and try again.\"" >&5
1156 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1157    { (exit 1); exit 1; }; }
1158 fi
1159
1160 test "$program_prefix" != NONE &&
1161   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1162 # Use a double $ so make ignores it.
1163 test "$program_suffix" != NONE &&
1164   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1165 # Double any \ or $.  echo might interpret backslashes.
1166 # By default was `s,x,x', remove it if useless.
1167 cat <<\_ACEOF >conftest.sed
1168 s/[\\$]/&&/g;s/;s,x,x,$//
1169 _ACEOF
1170 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1171 rm conftest.sed
1172
1173 echo "$as_me:1173: checking whether ${MAKE-make} sets \${MAKE}" >&5
1174 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1175 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1176 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1177   echo $ECHO_N "(cached) $ECHO_C" >&6
1178 else
1179   cat >conftest.make <<\EOF
1180 all:
1181         @echo 'ac_maketemp="${MAKE}"'
1182 EOF
1183 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1184 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1185 if test -n "$ac_maketemp"; then
1186   eval ac_cv_prog_make_${ac_make}_set=yes
1187 else
1188   eval ac_cv_prog_make_${ac_make}_set=no
1189 fi
1190 rm -f conftest.make
1191 fi
1192 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1193   echo "$as_me:1193: result: yes" >&5
1194 echo "${ECHO_T}yes" >&6
1195   SET_MAKE=
1196 else
1197   echo "$as_me:1197: result: no" >&5
1198 echo "${ECHO_T}no" >&6
1199   SET_MAKE="MAKE=${MAKE-make}"
1200 fi
1201
1202 ac_ext=c
1203 ac_cpp='$CPP $CPPFLAGS'
1204 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1205 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1206 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1207 ac_main_return="return"
1208 if test -n "$ac_tool_prefix"; then
1209   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1210 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1211 echo "$as_me:1211: checking for $ac_word" >&5
1212 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1213 if test "${ac_cv_prog_CC+set}" = set; then
1214   echo $ECHO_N "(cached) $ECHO_C" >&6
1215 else
1216   if test -n "$CC"; then
1217   ac_cv_prog_CC="$CC" # Let the user override the test.
1218 else
1219   ac_save_IFS=$IFS; IFS=$ac_path_separator
1220 ac_dummy="$PATH"
1221 for ac_dir in $ac_dummy; do
1222   IFS=$ac_save_IFS
1223   test -z "$ac_dir" && ac_dir=.
1224   $as_executable_p "$ac_dir/$ac_word" || continue
1225 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1226 echo "$as_me:1226: found $ac_dir/$ac_word" >&5
1227 break
1228 done
1229
1230 fi
1231 fi
1232 CC=$ac_cv_prog_CC
1233 if test -n "$CC"; then
1234   echo "$as_me:1234: result: $CC" >&5
1235 echo "${ECHO_T}$CC" >&6
1236 else
1237   echo "$as_me:1237: result: no" >&5
1238 echo "${ECHO_T}no" >&6
1239 fi
1240
1241 fi
1242 if test -z "$ac_cv_prog_CC"; then
1243   ac_ct_CC=$CC
1244   # Extract the first word of "gcc", so it can be a program name with args.
1245 set dummy gcc; ac_word=$2
1246 echo "$as_me:1246: checking for $ac_word" >&5
1247 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1248 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1249   echo $ECHO_N "(cached) $ECHO_C" >&6
1250 else
1251   if test -n "$ac_ct_CC"; then
1252   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1253 else
1254   ac_save_IFS=$IFS; IFS=$ac_path_separator
1255 ac_dummy="$PATH"
1256 for ac_dir in $ac_dummy; do
1257   IFS=$ac_save_IFS
1258   test -z "$ac_dir" && ac_dir=.
1259   $as_executable_p "$ac_dir/$ac_word" || continue
1260 ac_cv_prog_ac_ct_CC="gcc"
1261 echo "$as_me:1261: found $ac_dir/$ac_word" >&5
1262 break
1263 done
1264
1265 fi
1266 fi
1267 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1268 if test -n "$ac_ct_CC"; then
1269   echo "$as_me:1269: result: $ac_ct_CC" >&5
1270 echo "${ECHO_T}$ac_ct_CC" >&6
1271 else
1272   echo "$as_me:1272: result: no" >&5
1273 echo "${ECHO_T}no" >&6
1274 fi
1275
1276   CC=$ac_ct_CC
1277 else
1278   CC="$ac_cv_prog_CC"
1279 fi
1280
1281 if test -z "$CC"; then
1282   if test -n "$ac_tool_prefix"; then
1283   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1284 set dummy ${ac_tool_prefix}cc; ac_word=$2
1285 echo "$as_me:1285: checking for $ac_word" >&5
1286 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1287 if test "${ac_cv_prog_CC+set}" = set; then
1288   echo $ECHO_N "(cached) $ECHO_C" >&6
1289 else
1290   if test -n "$CC"; then
1291   ac_cv_prog_CC="$CC" # Let the user override the test.
1292 else
1293   ac_save_IFS=$IFS; IFS=$ac_path_separator
1294 ac_dummy="$PATH"
1295 for ac_dir in $ac_dummy; do
1296   IFS=$ac_save_IFS
1297   test -z "$ac_dir" && ac_dir=.
1298   $as_executable_p "$ac_dir/$ac_word" || continue
1299 ac_cv_prog_CC="${ac_tool_prefix}cc"
1300 echo "$as_me:1300: found $ac_dir/$ac_word" >&5
1301 break
1302 done
1303
1304 fi
1305 fi
1306 CC=$ac_cv_prog_CC
1307 if test -n "$CC"; then
1308   echo "$as_me:1308: result: $CC" >&5
1309 echo "${ECHO_T}$CC" >&6
1310 else
1311   echo "$as_me:1311: result: no" >&5
1312 echo "${ECHO_T}no" >&6
1313 fi
1314
1315 fi
1316 if test -z "$ac_cv_prog_CC"; then
1317   ac_ct_CC=$CC
1318   # Extract the first word of "cc", so it can be a program name with args.
1319 set dummy cc; ac_word=$2
1320 echo "$as_me:1320: checking for $ac_word" >&5
1321 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1322 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1323   echo $ECHO_N "(cached) $ECHO_C" >&6
1324 else
1325   if test -n "$ac_ct_CC"; then
1326   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1327 else
1328   ac_save_IFS=$IFS; IFS=$ac_path_separator
1329 ac_dummy="$PATH"
1330 for ac_dir in $ac_dummy; do
1331   IFS=$ac_save_IFS
1332   test -z "$ac_dir" && ac_dir=.
1333   $as_executable_p "$ac_dir/$ac_word" || continue
1334 ac_cv_prog_ac_ct_CC="cc"
1335 echo "$as_me:1335: found $ac_dir/$ac_word" >&5
1336 break
1337 done
1338
1339 fi
1340 fi
1341 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1342 if test -n "$ac_ct_CC"; then
1343   echo "$as_me:1343: result: $ac_ct_CC" >&5
1344 echo "${ECHO_T}$ac_ct_CC" >&6
1345 else
1346   echo "$as_me:1346: result: no" >&5
1347 echo "${ECHO_T}no" >&6
1348 fi
1349
1350   CC=$ac_ct_CC
1351 else
1352   CC="$ac_cv_prog_CC"
1353 fi
1354
1355 fi
1356 if test -z "$CC"; then
1357   # Extract the first word of "cc", so it can be a program name with args.
1358 set dummy cc; ac_word=$2
1359 echo "$as_me:1359: checking for $ac_word" >&5
1360 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1361 if test "${ac_cv_prog_CC+set}" = set; then
1362   echo $ECHO_N "(cached) $ECHO_C" >&6
1363 else
1364   if test -n "$CC"; then
1365   ac_cv_prog_CC="$CC" # Let the user override the test.
1366 else
1367   ac_prog_rejected=no
1368   ac_save_IFS=$IFS; IFS=$ac_path_separator
1369 ac_dummy="$PATH"
1370 for ac_dir in $ac_dummy; do
1371   IFS=$ac_save_IFS
1372   test -z "$ac_dir" && ac_dir=.
1373   $as_executable_p "$ac_dir/$ac_word" || continue
1374 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1375   ac_prog_rejected=yes
1376   continue
1377 fi
1378 ac_cv_prog_CC="cc"
1379 echo "$as_me:1379: found $ac_dir/$ac_word" >&5
1380 break
1381 done
1382
1383 if test "$ac_prog_rejected" = yes; then
1384   # We found a bogon in the path, so make sure we never use it.
1385   set dummy $ac_cv_prog_CC
1386   shift
1387   if test $# != 0; then
1388     # We chose a different compiler from the bogus one.
1389     # However, it has the same basename, so the bogon will be chosen
1390     # first if we set CC to just the basename; use the full file name.
1391     shift
1392     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1393     shift
1394     ac_cv_prog_CC="$@"
1395   fi
1396 fi
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 fi
1409 if test -z "$CC"; then
1410   if test -n "$ac_tool_prefix"; then
1411   for ac_prog in cl
1412   do
1413     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1414 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1415 echo "$as_me:1415: checking for $ac_word" >&5
1416 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1417 if test "${ac_cv_prog_CC+set}" = set; then
1418   echo $ECHO_N "(cached) $ECHO_C" >&6
1419 else
1420   if test -n "$CC"; then
1421   ac_cv_prog_CC="$CC" # Let the user override the test.
1422 else
1423   ac_save_IFS=$IFS; IFS=$ac_path_separator
1424 ac_dummy="$PATH"
1425 for ac_dir in $ac_dummy; do
1426   IFS=$ac_save_IFS
1427   test -z "$ac_dir" && ac_dir=.
1428   $as_executable_p "$ac_dir/$ac_word" || continue
1429 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1430 echo "$as_me:1430: found $ac_dir/$ac_word" >&5
1431 break
1432 done
1433
1434 fi
1435 fi
1436 CC=$ac_cv_prog_CC
1437 if test -n "$CC"; then
1438   echo "$as_me:1438: result: $CC" >&5
1439 echo "${ECHO_T}$CC" >&6
1440 else
1441   echo "$as_me:1441: result: no" >&5
1442 echo "${ECHO_T}no" >&6
1443 fi
1444
1445     test -n "$CC" && break
1446   done
1447 fi
1448 if test -z "$CC"; then
1449   ac_ct_CC=$CC
1450   for ac_prog in cl
1451 do
1452   # Extract the first word of "$ac_prog", so it can be a program name with args.
1453 set dummy $ac_prog; ac_word=$2
1454 echo "$as_me:1454: checking for $ac_word" >&5
1455 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1456 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1457   echo $ECHO_N "(cached) $ECHO_C" >&6
1458 else
1459   if test -n "$ac_ct_CC"; then
1460   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1461 else
1462   ac_save_IFS=$IFS; IFS=$ac_path_separator
1463 ac_dummy="$PATH"
1464 for ac_dir in $ac_dummy; do
1465   IFS=$ac_save_IFS
1466   test -z "$ac_dir" && ac_dir=.
1467   $as_executable_p "$ac_dir/$ac_word" || continue
1468 ac_cv_prog_ac_ct_CC="$ac_prog"
1469 echo "$as_me:1469: found $ac_dir/$ac_word" >&5
1470 break
1471 done
1472
1473 fi
1474 fi
1475 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1476 if test -n "$ac_ct_CC"; then
1477   echo "$as_me:1477: result: $ac_ct_CC" >&5
1478 echo "${ECHO_T}$ac_ct_CC" >&6
1479 else
1480   echo "$as_me:1480: result: no" >&5
1481 echo "${ECHO_T}no" >&6
1482 fi
1483
1484   test -n "$ac_ct_CC" && break
1485 done
1486
1487   CC=$ac_ct_CC
1488 fi
1489
1490 fi
1491
1492 test -z "$CC" && { { echo "$as_me:1492: error: no acceptable cc found in \$PATH" >&5
1493 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1494    { (exit 1); exit 1; }; }
1495
1496 # Provide some information about the compiler.
1497 echo "$as_me:1497:" \
1498      "checking for C compiler version" >&5
1499 ac_compiler=`set X $ac_compile; echo "$2"`
1500 { (eval echo "$as_me:1500: \"$ac_compiler --version </dev/null >&5\"") >&5
1501   (eval $ac_compiler --version </dev/null >&5) 2>&5
1502   ac_status=$?
1503   echo "$as_me:1503: \$? = $ac_status" >&5
1504   (exit "$ac_status"); }
1505 { (eval echo "$as_me:1505: \"$ac_compiler -v </dev/null >&5\"") >&5
1506   (eval $ac_compiler -v </dev/null >&5) 2>&5
1507   ac_status=$?
1508   echo "$as_me:1508: \$? = $ac_status" >&5
1509   (exit "$ac_status"); }
1510 { (eval echo "$as_me:1510: \"$ac_compiler -V </dev/null >&5\"") >&5
1511   (eval $ac_compiler -V </dev/null >&5) 2>&5
1512   ac_status=$?
1513   echo "$as_me:1513: \$? = $ac_status" >&5
1514   (exit "$ac_status"); }
1515
1516 cat >"conftest.$ac_ext" <<_ACEOF
1517 #line 1517 "configure"
1518 #include "confdefs.h"
1519
1520 int
1521 main (void)
1522 {
1523
1524   ;
1525   return 0;
1526 }
1527 _ACEOF
1528 ac_clean_files_save=$ac_clean_files
1529 ac_clean_files="$ac_clean_files a.out a.exe"
1530 # Try to create an executable without -o first, disregard a.out.
1531 # It will help us diagnose broken compilers, and finding out an intuition
1532 # of exeext.
1533 echo "$as_me:1533: checking for C compiler default output" >&5
1534 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1535 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1536 if { (eval echo "$as_me:1536: \"$ac_link_default\"") >&5
1537   (eval $ac_link_default) 2>&5
1538   ac_status=$?
1539   echo "$as_me:1539: \$? = $ac_status" >&5
1540   (exit "$ac_status"); }; then
1541   # Find the output, starting from the most likely.  This scheme is
1542 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1543 # resort.
1544 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1545                 ls a.out conftest 2>/dev/null;
1546                 ls a.* conftest.* 2>/dev/null`; do
1547   case $ac_file in
1548     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1549     a.out ) # We found the default executable, but exeext='' is most
1550             # certainly right.
1551             break;;
1552     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1553           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1554           export ac_cv_exeext
1555           break;;
1556     * ) break;;
1557   esac
1558 done
1559 else
1560   echo "$as_me: failed program was:" >&5
1561 cat "conftest.$ac_ext" >&5
1562 { { echo "$as_me:1562: error: C compiler cannot create executables" >&5
1563 echo "$as_me: error: C compiler cannot create executables" >&2;}
1564    { (exit 77); exit 77; }; }
1565 fi
1566
1567 ac_exeext=$ac_cv_exeext
1568 echo "$as_me:1568: result: $ac_file" >&5
1569 echo "${ECHO_T}$ac_file" >&6
1570
1571 # Check the compiler produces executables we can run.  If not, either
1572 # the compiler is broken, or we cross compile.
1573 echo "$as_me:1573: checking whether the C compiler works" >&5
1574 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1575 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1576 # If not cross compiling, check that we can run a simple program.
1577 if test "$cross_compiling" != yes; then
1578   if { ac_try='./$ac_file'
1579   { (eval echo "$as_me:1579: \"$ac_try\"") >&5
1580   (eval $ac_try) 2>&5
1581   ac_status=$?
1582   echo "$as_me:1582: \$? = $ac_status" >&5
1583   (exit "$ac_status"); }; }; then
1584     cross_compiling=no
1585   else
1586     if test "$cross_compiling" = maybe; then
1587         cross_compiling=yes
1588     else
1589         { { echo "$as_me:1589: error: cannot run C compiled programs.
1590 If you meant to cross compile, use \`--host'." >&5
1591 echo "$as_me: error: cannot run C compiled programs.
1592 If you meant to cross compile, use \`--host'." >&2;}
1593    { (exit 1); exit 1; }; }
1594     fi
1595   fi
1596 fi
1597 echo "$as_me:1597: result: yes" >&5
1598 echo "${ECHO_T}yes" >&6
1599
1600 rm -f a.out a.exe "conftest$ac_cv_exeext"
1601 ac_clean_files=$ac_clean_files_save
1602 # Check the compiler produces executables we can run.  If not, either
1603 # the compiler is broken, or we cross compile.
1604 echo "$as_me:1604: checking whether we are cross compiling" >&5
1605 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1606 echo "$as_me:1606: result: $cross_compiling" >&5
1607 echo "${ECHO_T}$cross_compiling" >&6
1608
1609 echo "$as_me:1609: checking for executable suffix" >&5
1610 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1611 if { (eval echo "$as_me:1611: \"$ac_link\"") >&5
1612   (eval $ac_link) 2>&5
1613   ac_status=$?
1614   echo "$as_me:1614: \$? = $ac_status" >&5
1615   (exit "$ac_status"); }; then
1616   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1617 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1618 # work properly (i.e., refer to `conftest.exe'), while it won't with
1619 # `rm'.
1620 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1621   case $ac_file in
1622     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1623     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1624           export ac_cv_exeext
1625           break;;
1626     * ) break;;
1627   esac
1628 done
1629 else
1630   { { echo "$as_me:1630: error: cannot compute EXEEXT: cannot compile and link" >&5
1631 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1632    { (exit 1); exit 1; }; }
1633 fi
1634
1635 rm -f "conftest$ac_cv_exeext"
1636 echo "$as_me:1636: result: $ac_cv_exeext" >&5
1637 echo "${ECHO_T}$ac_cv_exeext" >&6
1638
1639 rm -f "conftest.$ac_ext"
1640 EXEEXT=$ac_cv_exeext
1641 ac_exeext=$EXEEXT
1642 echo "$as_me:1642: checking for object suffix" >&5
1643 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1644 if test "${ac_cv_objext+set}" = set; then
1645   echo $ECHO_N "(cached) $ECHO_C" >&6
1646 else
1647   cat >"conftest.$ac_ext" <<_ACEOF
1648 #line 1648 "configure"
1649 #include "confdefs.h"
1650
1651 int
1652 main (void)
1653 {
1654
1655   ;
1656   return 0;
1657 }
1658 _ACEOF
1659 rm -f conftest.o conftest.obj
1660 if { (eval echo "$as_me:1660: \"$ac_compile\"") >&5
1661   (eval $ac_compile) 2>&5
1662   ac_status=$?
1663   echo "$as_me:1663: \$? = $ac_status" >&5
1664   (exit "$ac_status"); }; then
1665   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1666   case $ac_file in
1667     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1668     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1669        break;;
1670   esac
1671 done
1672 else
1673   echo "$as_me: failed program was:" >&5
1674 cat "conftest.$ac_ext" >&5
1675 { { echo "$as_me:1675: error: cannot compute OBJEXT: cannot compile" >&5
1676 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1677    { (exit 1); exit 1; }; }
1678 fi
1679
1680 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1681 fi
1682 echo "$as_me:1682: result: $ac_cv_objext" >&5
1683 echo "${ECHO_T}$ac_cv_objext" >&6
1684 OBJEXT=$ac_cv_objext
1685 ac_objext=$OBJEXT
1686 echo "$as_me:1686: checking whether we are using the GNU C compiler" >&5
1687 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1688 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1689   echo $ECHO_N "(cached) $ECHO_C" >&6
1690 else
1691   cat >"conftest.$ac_ext" <<_ACEOF
1692 #line 1692 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main (void)
1697 {
1698 #ifndef __GNUC__
1699        choke me
1700 #endif
1701
1702   ;
1703   return 0;
1704 }
1705 _ACEOF
1706 rm -f "conftest.$ac_objext"
1707 if { (eval echo "$as_me:1707: \"$ac_compile\"") >&5
1708   (eval $ac_compile) 2>&5
1709   ac_status=$?
1710   echo "$as_me:1710: \$? = $ac_status" >&5
1711   (exit "$ac_status"); } &&
1712          { ac_try='test -s "conftest.$ac_objext"'
1713   { (eval echo "$as_me:1713: \"$ac_try\"") >&5
1714   (eval $ac_try) 2>&5
1715   ac_status=$?
1716   echo "$as_me:1716: \$? = $ac_status" >&5
1717   (exit "$ac_status"); }; }; then
1718   ac_compiler_gnu=yes
1719 else
1720   echo "$as_me: failed program was:" >&5
1721 cat "conftest.$ac_ext" >&5
1722 ac_compiler_gnu=no
1723 fi
1724 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1725 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1726
1727 fi
1728 echo "$as_me:1728: result: $ac_cv_c_compiler_gnu" >&5
1729 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1730 GCC=`test $ac_compiler_gnu = yes && echo yes`
1731 ac_test_CFLAGS=${CFLAGS+set}
1732 ac_save_CFLAGS=$CFLAGS
1733 CFLAGS="-g"
1734 echo "$as_me:1734: checking whether $CC accepts -g" >&5
1735 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1736 if test "${ac_cv_prog_cc_g+set}" = set; then
1737   echo $ECHO_N "(cached) $ECHO_C" >&6
1738 else
1739   cat >"conftest.$ac_ext" <<_ACEOF
1740 #line 1740 "configure"
1741 #include "confdefs.h"
1742
1743 int
1744 main (void)
1745 {
1746
1747   ;
1748   return 0;
1749 }
1750 _ACEOF
1751 rm -f "conftest.$ac_objext"
1752 if { (eval echo "$as_me:1752: \"$ac_compile\"") >&5
1753   (eval $ac_compile) 2>&5
1754   ac_status=$?
1755   echo "$as_me:1755: \$? = $ac_status" >&5
1756   (exit "$ac_status"); } &&
1757          { ac_try='test -s "conftest.$ac_objext"'
1758   { (eval echo "$as_me:1758: \"$ac_try\"") >&5
1759   (eval $ac_try) 2>&5
1760   ac_status=$?
1761   echo "$as_me:1761: \$? = $ac_status" >&5
1762   (exit "$ac_status"); }; }; then
1763   ac_cv_prog_cc_g=yes
1764 else
1765   echo "$as_me: failed program was:" >&5
1766 cat "conftest.$ac_ext" >&5
1767 ac_cv_prog_cc_g=no
1768 fi
1769 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1770 fi
1771 echo "$as_me:1771: result: $ac_cv_prog_cc_g" >&5
1772 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1773 if test "$ac_test_CFLAGS" = set; then
1774   CFLAGS=$ac_save_CFLAGS
1775 elif test $ac_cv_prog_cc_g = yes; then
1776   if test "$GCC" = yes; then
1777     CFLAGS="-g -O2"
1778   else
1779     CFLAGS="-g"
1780   fi
1781 else
1782   if test "$GCC" = yes; then
1783     CFLAGS="-O2"
1784   else
1785     CFLAGS=
1786   fi
1787 fi
1788 # Some people use a C++ compiler to compile C.  Since we use `exit',
1789 # in C++ we need to declare it.  In case someone uses the same compiler
1790 # for both compiling C and C++ we need to have the C++ compiler decide
1791 # the declaration of exit, since it's the most demanding environment.
1792 cat >"conftest.$ac_ext" <<_ACEOF
1793 #ifndef __cplusplus
1794   choke me
1795 #endif
1796 _ACEOF
1797 rm -f "conftest.$ac_objext"
1798 if { (eval echo "$as_me:1798: \"$ac_compile\"") >&5
1799   (eval $ac_compile) 2>&5
1800   ac_status=$?
1801   echo "$as_me:1801: \$? = $ac_status" >&5
1802   (exit "$ac_status"); } &&
1803          { ac_try='test -s "conftest.$ac_objext"'
1804   { (eval echo "$as_me:1804: \"$ac_try\"") >&5
1805   (eval $ac_try) 2>&5
1806   ac_status=$?
1807   echo "$as_me:1807: \$? = $ac_status" >&5
1808   (exit "$ac_status"); }; }; then
1809   for ac_declaration in \
1810    ''\
1811    '#include <stdlib.h>' \
1812    'extern "C" void std::exit (int) throw (); using std::exit;' \
1813    'extern "C" void std::exit (int); using std::exit;' \
1814    'extern "C" void exit (int) throw ();' \
1815    'extern "C" void exit (int);' \
1816    'void exit (int);'
1817 do
1818   cat >"conftest.$ac_ext" <<_ACEOF
1819 #line 1819 "configure"
1820 #include "confdefs.h"
1821 #include <stdlib.h>
1822 $ac_declaration
1823 int
1824 main (void)
1825 {
1826 exit (42);
1827   ;
1828   return 0;
1829 }
1830 _ACEOF
1831 rm -f "conftest.$ac_objext"
1832 if { (eval echo "$as_me:1832: \"$ac_compile\"") >&5
1833   (eval $ac_compile) 2>&5
1834   ac_status=$?
1835   echo "$as_me:1835: \$? = $ac_status" >&5
1836   (exit "$ac_status"); } &&
1837          { ac_try='test -s "conftest.$ac_objext"'
1838   { (eval echo "$as_me:1838: \"$ac_try\"") >&5
1839   (eval $ac_try) 2>&5
1840   ac_status=$?
1841   echo "$as_me:1841: \$? = $ac_status" >&5
1842   (exit "$ac_status"); }; }; then
1843   :
1844 else
1845   echo "$as_me: failed program was:" >&5
1846 cat "conftest.$ac_ext" >&5
1847 continue
1848 fi
1849 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1850   cat >"conftest.$ac_ext" <<_ACEOF
1851 #line 1851 "configure"
1852 #include "confdefs.h"
1853 $ac_declaration
1854 int
1855 main (void)
1856 {
1857 exit (42);
1858   ;
1859   return 0;
1860 }
1861 _ACEOF
1862 rm -f "conftest.$ac_objext"
1863 if { (eval echo "$as_me:1863: \"$ac_compile\"") >&5
1864   (eval $ac_compile) 2>&5
1865   ac_status=$?
1866   echo "$as_me:1866: \$? = $ac_status" >&5
1867   (exit "$ac_status"); } &&
1868          { ac_try='test -s "conftest.$ac_objext"'
1869   { (eval echo "$as_me:1869: \"$ac_try\"") >&5
1870   (eval $ac_try) 2>&5
1871   ac_status=$?
1872   echo "$as_me:1872: \$? = $ac_status" >&5
1873   (exit "$ac_status"); }; }; then
1874   break
1875 else
1876   echo "$as_me: failed program was:" >&5
1877 cat "conftest.$ac_ext" >&5
1878 fi
1879 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1880 done
1881 rm -rf conftest*
1882 if test -n "$ac_declaration"; then
1883   echo '#ifdef __cplusplus' >>confdefs.h
1884   echo "$ac_declaration"    >>confdefs.h
1885   echo '#endif'             >>confdefs.h
1886 fi
1887
1888 else
1889   echo "$as_me: failed program was:" >&5
1890 cat "conftest.$ac_ext" >&5
1891 fi
1892 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1893 ac_ext=c
1894 ac_cpp='$CPP $CPPFLAGS'
1895 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1896 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1897 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1898 ac_main_return="return"
1899
1900 GCC_VERSION=none
1901 if test "$GCC" = yes ; then
1902         echo "$as_me:1902: checking version of $CC" >&5
1903 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1904         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.].*//'`"
1905         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1906         echo "$as_me:1906: result: $GCC_VERSION" >&5
1907 echo "${ECHO_T}$GCC_VERSION" >&6
1908 fi
1909
1910 INTEL_COMPILER=no
1911
1912 if test "$GCC" = yes ; then
1913         case "$host_os" in
1914         (linux*|gnu*)
1915                 echo "$as_me:1915: checking if this is really Intel C compiler" >&5
1916 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1917                 cf_save_CFLAGS="$CFLAGS"
1918                 CFLAGS="$CFLAGS -no-gcc"
1919                 cat >"conftest.$ac_ext" <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __INTEL_COMPILER
1928 #else
1929 #error __INTEL_COMPILER is not defined
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f "conftest.$ac_objext"
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit "$ac_status"); } &&
1942          { ac_try='test -s "conftest.$ac_objext"'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit "$ac_status"); }; }; then
1948   INTEL_COMPILER=yes
1949 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1950
1951 else
1952   echo "$as_me: failed program was:" >&5
1953 cat "conftest.$ac_ext" >&5
1954 fi
1955 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1956                 CFLAGS="$cf_save_CFLAGS"
1957                 echo "$as_me:1957: result: $INTEL_COMPILER" >&5
1958 echo "${ECHO_T}$INTEL_COMPILER" >&6
1959                 ;;
1960         esac
1961 fi
1962
1963 CLANG_COMPILER=no
1964
1965 if test "$GCC" = yes ; then
1966         echo "$as_me:1966: checking if this is really Clang C compiler" >&5
1967 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1968         cf_save_CFLAGS="$CFLAGS"
1969         cat >"conftest.$ac_ext" <<_ACEOF
1970 #line 1970 "configure"
1971 #include "confdefs.h"
1972
1973 int
1974 main (void)
1975 {
1976
1977 #ifdef __clang__
1978 #else
1979 #error __clang__ is not defined
1980 #endif
1981
1982   ;
1983   return 0;
1984 }
1985 _ACEOF
1986 rm -f "conftest.$ac_objext"
1987 if { (eval echo "$as_me:1987: \"$ac_compile\"") >&5
1988   (eval $ac_compile) 2>&5
1989   ac_status=$?
1990   echo "$as_me:1990: \$? = $ac_status" >&5
1991   (exit "$ac_status"); } &&
1992          { ac_try='test -s "conftest.$ac_objext"'
1993   { (eval echo "$as_me:1993: \"$ac_try\"") >&5
1994   (eval $ac_try) 2>&5
1995   ac_status=$?
1996   echo "$as_me:1996: \$? = $ac_status" >&5
1997   (exit "$ac_status"); }; }; then
1998   CLANG_COMPILER=yes
1999
2000 else
2001   echo "$as_me: failed program was:" >&5
2002 cat "conftest.$ac_ext" >&5
2003 fi
2004 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2005         CFLAGS="$cf_save_CFLAGS"
2006         echo "$as_me:2006: result: $CLANG_COMPILER" >&5
2007 echo "${ECHO_T}$CLANG_COMPILER" >&6
2008 fi
2009
2010 CLANG_VERSION=none
2011
2012 if test "x$CLANG_COMPILER" = "xyes" ; then
2013         case "$CC" in
2014         (c[1-9][0-9]|*/c[1-9][0-9])
2015                 { echo "$as_me:2015: WARNING: replacing broken compiler alias $CC" >&5
2016 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
2017                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
2018                 CC=clang
2019                 ;;
2020         esac
2021
2022         echo "$as_me:2022: checking version of $CC" >&5
2023 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
2024         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.].*//'`"
2025         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
2026         echo "$as_me:2026: result: $CLANG_VERSION" >&5
2027 echo "${ECHO_T}$CLANG_VERSION" >&6
2028
2029         for cf_clang_opt in \
2030                 -Qunused-arguments \
2031                 -Wno-error=implicit-function-declaration
2032         do
2033                 echo "$as_me:2033: checking if option $cf_clang_opt works" >&5
2034 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
2035                 cf_save_CFLAGS="$CFLAGS"
2036                 CFLAGS="$CFLAGS $cf_clang_opt"
2037                 cat >"conftest.$ac_ext" <<_ACEOF
2038 #line 2038 "configure"
2039 #include "confdefs.h"
2040
2041                         #include <stdio.h>
2042 int
2043 main (void)
2044 {
2045
2046                         printf("hello!\\n");
2047   ;
2048   return 0;
2049 }
2050 _ACEOF
2051 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2052 if { (eval echo "$as_me:2052: \"$ac_link\"") >&5
2053   (eval $ac_link) 2>&5
2054   ac_status=$?
2055   echo "$as_me:2055: \$? = $ac_status" >&5
2056   (exit "$ac_status"); } &&
2057          { ac_try='test -s "conftest$ac_exeext"'
2058   { (eval echo "$as_me:2058: \"$ac_try\"") >&5
2059   (eval $ac_try) 2>&5
2060   ac_status=$?
2061   echo "$as_me:2061: \$? = $ac_status" >&5
2062   (exit "$ac_status"); }; }; then
2063
2064                         cf_clang_optok=yes
2065 else
2066   echo "$as_me: failed program was:" >&5
2067 cat "conftest.$ac_ext" >&5
2068
2069                         cf_clang_optok=no
2070 fi
2071 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2072                 echo "$as_me:2072: result: $cf_clang_optok" >&5
2073 echo "${ECHO_T}$cf_clang_optok" >&6
2074                 CFLAGS="$cf_save_CFLAGS"
2075                 if test "$cf_clang_optok" = yes; then
2076                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2077
2078 echo "${as_me:-configure}:2078: testing adding option $cf_clang_opt ..." 1>&5
2079
2080         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2081         CFLAGS="${CFLAGS}$cf_clang_opt"
2082
2083                 fi
2084         done
2085 fi
2086
2087 echo "$as_me:2087: checking for $CC option to accept ANSI C" >&5
2088 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2089 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2090   echo $ECHO_N "(cached) $ECHO_C" >&6
2091 else
2092   ac_cv_prog_cc_stdc=no
2093 ac_save_CC=$CC
2094 cat >"conftest.$ac_ext" <<_ACEOF
2095 #line 2095 "configure"
2096 #include "confdefs.h"
2097 #include <stdarg.h>
2098 #include <stdio.h>
2099 #include <sys/types.h>
2100 #include <sys/stat.h>
2101 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2102 struct buf { int x; };
2103 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2104 static char *e (char **p, int i)
2105 {
2106   return p[i];
2107 }
2108 static char *f (char * (*g) (char **, int), char **p, ...)
2109 {
2110   char *s;
2111   va_list v;
2112   va_start (v,p);
2113   s = g (p, va_arg (v,int));
2114   va_end (v);
2115   return s;
2116 }
2117 int test (int i, double x);
2118 struct s1 {int (*f) (int a);};
2119 struct s2 {int (*f) (double a);};
2120 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2121 int argc;
2122 char **argv;
2123 int
2124 main (void)
2125 {
2126 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2127   ;
2128   return 0;
2129 }
2130 _ACEOF
2131 # Don't try gcc -ansi; that turns off useful extensions and
2132 # breaks some systems' header files.
2133 # AIX                   -qlanglvl=ansi
2134 # Ultrix and OSF/1      -std1
2135 # HP-UX 10.20 and later -Ae
2136 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2137 # SVR4                  -Xc -D__EXTENSIONS__
2138 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2139 do
2140   CC="$ac_save_CC $ac_arg"
2141   rm -f "conftest.$ac_objext"
2142 if { (eval echo "$as_me:2142: \"$ac_compile\"") >&5
2143   (eval $ac_compile) 2>&5
2144   ac_status=$?
2145   echo "$as_me:2145: \$? = $ac_status" >&5
2146   (exit "$ac_status"); } &&
2147          { ac_try='test -s "conftest.$ac_objext"'
2148   { (eval echo "$as_me:2148: \"$ac_try\"") >&5
2149   (eval $ac_try) 2>&5
2150   ac_status=$?
2151   echo "$as_me:2151: \$? = $ac_status" >&5
2152   (exit "$ac_status"); }; }; then
2153   ac_cv_prog_cc_stdc=$ac_arg
2154 break
2155 else
2156   echo "$as_me: failed program was:" >&5
2157 cat "conftest.$ac_ext" >&5
2158 fi
2159 rm -f "conftest.$ac_objext"
2160 done
2161 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2162 CC=$ac_save_CC
2163
2164 fi
2165
2166 case "x$ac_cv_prog_cc_stdc" in
2167   x|xno)
2168     echo "$as_me:2168: result: none needed" >&5
2169 echo "${ECHO_T}none needed" >&6 ;;
2170   *)
2171     echo "$as_me:2171: result: $ac_cv_prog_cc_stdc" >&5
2172 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2173     CC="$CC $ac_cv_prog_cc_stdc" ;;
2174 esac
2175
2176 # This should have been defined by AC_PROG_CC
2177 : "${CC:=cc}"
2178
2179 echo "$as_me:2179: checking \$CFLAGS variable" >&5
2180 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2181 case "x$CFLAGS" in
2182 (*-[IUD]*)
2183         echo "$as_me:2183: result: broken" >&5
2184 echo "${ECHO_T}broken" >&6
2185         { echo "$as_me:2185: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2186 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2187         cf_flags="$CFLAGS"
2188         CFLAGS=
2189         for cf_arg in $cf_flags
2190         do
2191
2192 cf_fix_cppflags=no
2193 cf_new_cflags=
2194 cf_new_cppflags=
2195 cf_new_extra_cppflags=
2196
2197 for cf_add_cflags in $cf_arg
2198 do
2199 case "$cf_fix_cppflags" in
2200 (no)
2201         case "$cf_add_cflags" in
2202         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2203                 case "$cf_add_cflags" in
2204                 (-D*)
2205                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2206
2207                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2208                                 && test -z "${cf_tst_cflags}" \
2209                                 && cf_fix_cppflags=yes
2210
2211                         if test "$cf_fix_cppflags" = yes ; then
2212
2213         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2214         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2215
2216                                 continue
2217                         elif test "${cf_tst_cflags}" = "\"'" ; then
2218
2219         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2220         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2221
2222                                 continue
2223                         fi
2224                         ;;
2225                 esac
2226                 case "$CPPFLAGS" in
2227                 (*$cf_add_cflags)
2228                         ;;
2229                 (*)
2230                         case "$cf_add_cflags" in
2231                         (-D*)
2232                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2233
2234 CPPFLAGS=`echo "$CPPFLAGS" | \
2235         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2236                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2237
2238                                 ;;
2239                         esac
2240
2241         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2242         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2243
2244                         ;;
2245                 esac
2246                 ;;
2247         (*)
2248
2249         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2250         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2251
2252                 ;;
2253         esac
2254         ;;
2255 (yes)
2256
2257         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2258         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2259
2260         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2261
2262         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2263                 && test -z "${cf_tst_cflags}" \
2264                 && cf_fix_cppflags=no
2265         ;;
2266 esac
2267 done
2268
2269 if test -n "$cf_new_cflags" ; then
2270
2271         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2272         CFLAGS="${CFLAGS}$cf_new_cflags"
2273
2274 fi
2275
2276 if test -n "$cf_new_cppflags" ; then
2277
2278         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2279         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2280
2281 fi
2282
2283 if test -n "$cf_new_extra_cppflags" ; then
2284
2285         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2286         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2287
2288 fi
2289
2290         done
2291         ;;
2292 (*)
2293         echo "$as_me:2293: result: ok" >&5
2294 echo "${ECHO_T}ok" >&6
2295         ;;
2296 esac
2297
2298 echo "$as_me:2298: checking \$CC variable" >&5
2299 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2300 case "$CC" in
2301 (*[\ \  ]-*)
2302         echo "$as_me:2302: result: broken" >&5
2303 echo "${ECHO_T}broken" >&6
2304         { echo "$as_me:2304: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2305 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2306         # humor him...
2307         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2308         cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"`
2309         CC="$cf_prog"
2310         for cf_arg in $cf_flags
2311         do
2312                 case "x$cf_arg" in
2313                 (x-[IUDfgOW]*)
2314
2315 cf_fix_cppflags=no
2316 cf_new_cflags=
2317 cf_new_cppflags=
2318 cf_new_extra_cppflags=
2319
2320 for cf_add_cflags in $cf_arg
2321 do
2322 case "$cf_fix_cppflags" in
2323 (no)
2324         case "$cf_add_cflags" in
2325         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2326                 case "$cf_add_cflags" in
2327                 (-D*)
2328                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2329
2330                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2331                                 && test -z "${cf_tst_cflags}" \
2332                                 && cf_fix_cppflags=yes
2333
2334                         if test "$cf_fix_cppflags" = yes ; then
2335
2336         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2337         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2338
2339                                 continue
2340                         elif test "${cf_tst_cflags}" = "\"'" ; then
2341
2342         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2343         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2344
2345                                 continue
2346                         fi
2347                         ;;
2348                 esac
2349                 case "$CPPFLAGS" in
2350                 (*$cf_add_cflags)
2351                         ;;
2352                 (*)
2353                         case "$cf_add_cflags" in
2354                         (-D*)
2355                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2356
2357 CPPFLAGS=`echo "$CPPFLAGS" | \
2358         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2359                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2360
2361                                 ;;
2362                         esac
2363
2364         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2365         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2366
2367                         ;;
2368                 esac
2369                 ;;
2370         (*)
2371
2372         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2373         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2374
2375                 ;;
2376         esac
2377         ;;
2378 (yes)
2379
2380         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2381         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2382
2383         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2384
2385         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2386                 && test -z "${cf_tst_cflags}" \
2387                 && cf_fix_cppflags=no
2388         ;;
2389 esac
2390 done
2391
2392 if test -n "$cf_new_cflags" ; then
2393
2394         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2395         CFLAGS="${CFLAGS}$cf_new_cflags"
2396
2397 fi
2398
2399 if test -n "$cf_new_cppflags" ; then
2400
2401         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2402         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2403
2404 fi
2405
2406 if test -n "$cf_new_extra_cppflags" ; then
2407
2408         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2409         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2410
2411 fi
2412
2413                         ;;
2414                 (*)
2415                         CC="$CC $cf_arg"
2416                         ;;
2417                 esac
2418         done
2419         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2420
2421 echo "${as_me:-configure}:2421: testing resulting CC: '$CC' ..." 1>&5
2422
2423         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2424
2425 echo "${as_me:-configure}:2425: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2426
2427         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2428
2429 echo "${as_me:-configure}:2429: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2430
2431         ;;
2432 (*)
2433         echo "$as_me:2433: result: ok" >&5
2434 echo "${ECHO_T}ok" >&6
2435         ;;
2436 esac
2437
2438 echo "$as_me:2438: checking for inline" >&5
2439 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2440 if test "${ac_cv_c_inline+set}" = set; then
2441   echo $ECHO_N "(cached) $ECHO_C" >&6
2442 else
2443   ac_cv_c_inline=no
2444 for ac_kw in inline __inline__ __inline; do
2445   cat >"conftest.$ac_ext" <<_ACEOF
2446 #line 2446 "configure"
2447 #include "confdefs.h"
2448 #ifndef __cplusplus
2449 static $ac_kw int static_foo () {return 0; }
2450 $ac_kw int foo () {return 0; }
2451 #endif
2452
2453 _ACEOF
2454 rm -f "conftest.$ac_objext"
2455 if { (eval echo "$as_me:2455: \"$ac_compile\"") >&5
2456   (eval $ac_compile) 2>&5
2457   ac_status=$?
2458   echo "$as_me:2458: \$? = $ac_status" >&5
2459   (exit "$ac_status"); } &&
2460          { ac_try='test -s "conftest.$ac_objext"'
2461   { (eval echo "$as_me:2461: \"$ac_try\"") >&5
2462   (eval $ac_try) 2>&5
2463   ac_status=$?
2464   echo "$as_me:2464: \$? = $ac_status" >&5
2465   (exit "$ac_status"); }; }; then
2466   ac_cv_c_inline=$ac_kw; break
2467 else
2468   echo "$as_me: failed program was:" >&5
2469 cat "conftest.$ac_ext" >&5
2470 fi
2471 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2472 done
2473
2474 fi
2475 echo "$as_me:2475: result: $ac_cv_c_inline" >&5
2476 echo "${ECHO_T}$ac_cv_c_inline" >&6
2477 case $ac_cv_c_inline in
2478   inline | yes) ;;
2479   no)
2480 cat >>confdefs.h <<\EOF
2481 #define inline
2482 EOF
2483  ;;
2484   *)  cat >>confdefs.h <<EOF
2485 #define inline $ac_cv_c_inline
2486 EOF
2487  ;;
2488 esac
2489
2490 for ac_prog in ggrep grep
2491 do
2492   # Extract the first word of "$ac_prog", so it can be a program name with args.
2493 set dummy $ac_prog; ac_word=$2
2494 echo "$as_me:2494: checking for $ac_word" >&5
2495 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2496 if test "${ac_cv_prog_GREP+set}" = set; then
2497   echo $ECHO_N "(cached) $ECHO_C" >&6
2498 else
2499   if test -n "$GREP"; then
2500   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2501 else
2502   ac_save_IFS=$IFS; IFS=$ac_path_separator
2503 ac_dummy="$PATH"
2504 for ac_dir in $ac_dummy; do
2505   IFS=$ac_save_IFS
2506   test -z "$ac_dir" && ac_dir=.
2507   $as_executable_p "$ac_dir/$ac_word" || continue
2508 ac_cv_prog_GREP="$ac_prog"
2509 echo "$as_me:2509: found $ac_dir/$ac_word" >&5
2510 break
2511 done
2512
2513 fi
2514 fi
2515 GREP=$ac_cv_prog_GREP
2516 if test -n "$GREP"; then
2517   echo "$as_me:2517: result: $GREP" >&5
2518 echo "${ECHO_T}$GREP" >&6
2519 else
2520   echo "$as_me:2520: result: no" >&5
2521 echo "${ECHO_T}no" >&6
2522 fi
2523
2524   test -n "$GREP" && break
2525 done
2526 test -n "$GREP" || GREP=": "
2527
2528 echo "$as_me:2528: checking for egrep" >&5
2529 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2530 if test "${ac_cv_path_EGREP+set}" = set; then
2531   echo $ECHO_N "(cached) $ECHO_C" >&6
2532 else
2533   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2534    then ac_cv_path_EGREP="$GREP -E"
2535    else
2536      for ac_prog in gegrep egrep
2537 do
2538   # Extract the first word of "$ac_prog", so it can be a program name with args.
2539 set dummy $ac_prog; ac_word=$2
2540 echo "$as_me:2540: checking for $ac_word" >&5
2541 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2542 if test "${ac_cv_path_EGREP+set}" = set; then
2543   echo $ECHO_N "(cached) $ECHO_C" >&6
2544 else
2545   case $EGREP in
2546   [\\/]* | ?:[\\/]*)
2547   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2548   ;;
2549   *)
2550   ac_save_IFS=$IFS; IFS=$ac_path_separator
2551 ac_dummy="$PATH"
2552 for ac_dir in $ac_dummy; do
2553   IFS=$ac_save_IFS
2554   test -z "$ac_dir" && ac_dir=.
2555   if $as_executable_p "$ac_dir/$ac_word"; then
2556    ac_cv_path_EGREP="$ac_dir/$ac_word"
2557    echo "$as_me:2557: found $ac_dir/$ac_word" >&5
2558    break
2559 fi
2560 done
2561
2562   ;;
2563 esac
2564 fi
2565 EGREP=$ac_cv_path_EGREP
2566
2567 if test -n "$EGREP"; then
2568   echo "$as_me:2568: result: $EGREP" >&5
2569 echo "${ECHO_T}$EGREP" >&6
2570 else
2571   echo "$as_me:2571: result: no" >&5
2572 echo "${ECHO_T}no" >&6
2573 fi
2574
2575   test -n "$EGREP" && break
2576 done
2577 test -n "$EGREP" || EGREP=": "
2578
2579      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2579: error: cannot find workable egrep" >&5
2580 echo "$as_me: error: cannot find workable egrep" >&2;}
2581    { (exit 1); exit 1; }; }
2582    fi
2583 fi
2584 echo "$as_me:2584: result: $ac_cv_path_EGREP" >&5
2585 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2586  EGREP="$ac_cv_path_EGREP"
2587
2588 ac_ext=c
2589 ac_cpp='$CPP $CPPFLAGS'
2590 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2591 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2592 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2593 ac_main_return="return"
2594 echo "$as_me:2594: checking how to run the C preprocessor" >&5
2595 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2596 # On Suns, sometimes $CPP names a directory.
2597 if test -n "$CPP" && test -d "$CPP"; then
2598   CPP=
2599 fi
2600 if test -z "$CPP"; then
2601   if test "${ac_cv_prog_CPP+set}" = set; then
2602   echo $ECHO_N "(cached) $ECHO_C" >&6
2603 else
2604       # Double quotes because CPP needs to be expanded
2605     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2606     do
2607       ac_preproc_ok=false
2608 for ac_c_preproc_warn_flag in '' yes
2609 do
2610   # Use a header file that comes with gcc, so configuring glibc
2611   # with a fresh cross-compiler works.
2612   # On the NeXT, cc -E runs the code through the compiler's parser,
2613   # not just through cpp. "Syntax error" is here to catch this case.
2614   cat >"conftest.$ac_ext" <<_ACEOF
2615 #line 2615 "configure"
2616 #include "confdefs.h"
2617 #include <assert.h>
2618                      Syntax error
2619 _ACEOF
2620 if { (eval echo "$as_me:2620: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2621   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2622   ac_status=$?
2623   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2624   rm -f conftest.er1
2625   cat conftest.err >&5
2626   echo "$as_me:2626: \$? = $ac_status" >&5
2627   (exit "$ac_status"); } >/dev/null; then
2628   if test -s conftest.err; then
2629     ac_cpp_err=$ac_c_preproc_warn_flag
2630   else
2631     ac_cpp_err=
2632   fi
2633 else
2634   ac_cpp_err=yes
2635 fi
2636 if test -z "$ac_cpp_err"; then
2637   :
2638 else
2639   echo "$as_me: failed program was:" >&5
2640   cat "conftest.$ac_ext" >&5
2641   # Broken: fails on valid input.
2642 continue
2643 fi
2644 rm -f conftest.err "conftest.$ac_ext"
2645
2646   # OK, works on sane cases.  Now check whether non-existent headers
2647   # can be detected and how.
2648   cat >"conftest.$ac_ext" <<_ACEOF
2649 #line 2649 "configure"
2650 #include "confdefs.h"
2651 #include <ac_nonexistent.h>
2652 _ACEOF
2653 if { (eval echo "$as_me:2653: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2654   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2655   ac_status=$?
2656   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2657   rm -f conftest.er1
2658   cat conftest.err >&5
2659   echo "$as_me:2659: \$? = $ac_status" >&5
2660   (exit "$ac_status"); } >/dev/null; then
2661   if test -s conftest.err; then
2662     ac_cpp_err=$ac_c_preproc_warn_flag
2663   else
2664     ac_cpp_err=
2665   fi
2666 else
2667   ac_cpp_err=yes
2668 fi
2669 if test -z "$ac_cpp_err"; then
2670   # Broken: success on invalid input.
2671 continue
2672 else
2673   echo "$as_me: failed program was:" >&5
2674   cat "conftest.$ac_ext" >&5
2675   # Passes both tests.
2676 ac_preproc_ok=:
2677 break
2678 fi
2679 rm -f conftest.err "conftest.$ac_ext"
2680
2681 done
2682 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2683 rm -f conftest.err "conftest.$ac_ext"
2684 if $ac_preproc_ok; then
2685   break
2686 fi
2687
2688     done
2689     ac_cv_prog_CPP=$CPP
2690
2691 fi
2692   CPP=$ac_cv_prog_CPP
2693 else
2694   ac_cv_prog_CPP=$CPP
2695 fi
2696 echo "$as_me:2696: result: $CPP" >&5
2697 echo "${ECHO_T}$CPP" >&6
2698 ac_preproc_ok=false
2699 for ac_c_preproc_warn_flag in '' yes
2700 do
2701   # Use a header file that comes with gcc, so configuring glibc
2702   # with a fresh cross-compiler works.
2703   # On the NeXT, cc -E runs the code through the compiler's parser,
2704   # not just through cpp. "Syntax error" is here to catch this case.
2705   cat >"conftest.$ac_ext" <<_ACEOF
2706 #line 2706 "configure"
2707 #include "confdefs.h"
2708 #include <assert.h>
2709                      Syntax error
2710 _ACEOF
2711 if { (eval echo "$as_me:2711: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2712   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2713   ac_status=$?
2714   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2715   rm -f conftest.er1
2716   cat conftest.err >&5
2717   echo "$as_me:2717: \$? = $ac_status" >&5
2718   (exit "$ac_status"); } >/dev/null; then
2719   if test -s conftest.err; then
2720     ac_cpp_err=$ac_c_preproc_warn_flag
2721   else
2722     ac_cpp_err=
2723   fi
2724 else
2725   ac_cpp_err=yes
2726 fi
2727 if test -z "$ac_cpp_err"; then
2728   :
2729 else
2730   echo "$as_me: failed program was:" >&5
2731   cat "conftest.$ac_ext" >&5
2732   # Broken: fails on valid input.
2733 continue
2734 fi
2735 rm -f conftest.err "conftest.$ac_ext"
2736
2737   # OK, works on sane cases.  Now check whether non-existent headers
2738   # can be detected and how.
2739   cat >"conftest.$ac_ext" <<_ACEOF
2740 #line 2740 "configure"
2741 #include "confdefs.h"
2742 #include <ac_nonexistent.h>
2743 _ACEOF
2744 if { (eval echo "$as_me:2744: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2745   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2746   ac_status=$?
2747   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2748   rm -f conftest.er1
2749   cat conftest.err >&5
2750   echo "$as_me:2750: \$? = $ac_status" >&5
2751   (exit "$ac_status"); } >/dev/null; then
2752   if test -s conftest.err; then
2753     ac_cpp_err=$ac_c_preproc_warn_flag
2754   else
2755     ac_cpp_err=
2756   fi
2757 else
2758   ac_cpp_err=yes
2759 fi
2760 if test -z "$ac_cpp_err"; then
2761   # Broken: success on invalid input.
2762 continue
2763 else
2764   echo "$as_me: failed program was:" >&5
2765   cat "conftest.$ac_ext" >&5
2766   # Passes both tests.
2767 ac_preproc_ok=:
2768 break
2769 fi
2770 rm -f conftest.err "conftest.$ac_ext"
2771
2772 done
2773 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2774 rm -f conftest.err "conftest.$ac_ext"
2775 if $ac_preproc_ok; then
2776   :
2777 else
2778   { { echo "$as_me:2778: error: C preprocessor \"$CPP\" fails sanity check" >&5
2779 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2780    { (exit 1); exit 1; }; }
2781 fi
2782
2783 ac_ext=c
2784 ac_cpp='$CPP $CPPFLAGS'
2785 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2786 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2787 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2788 ac_main_return="return"
2789
2790 for ac_prog in mawk gawk nawk awk
2791 do
2792   # Extract the first word of "$ac_prog", so it can be a program name with args.
2793 set dummy $ac_prog; ac_word=$2
2794 echo "$as_me:2794: checking for $ac_word" >&5
2795 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2796 if test "${ac_cv_prog_AWK+set}" = set; then
2797   echo $ECHO_N "(cached) $ECHO_C" >&6
2798 else
2799   if test -n "$AWK"; then
2800   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2801 else
2802   ac_save_IFS=$IFS; IFS=$ac_path_separator
2803 ac_dummy="$PATH"
2804 for ac_dir in $ac_dummy; do
2805   IFS=$ac_save_IFS
2806   test -z "$ac_dir" && ac_dir=.
2807   $as_executable_p "$ac_dir/$ac_word" || continue
2808 ac_cv_prog_AWK="$ac_prog"
2809 echo "$as_me:2809: found $ac_dir/$ac_word" >&5
2810 break
2811 done
2812
2813 fi
2814 fi
2815 AWK=$ac_cv_prog_AWK
2816 if test -n "$AWK"; then
2817   echo "$as_me:2817: result: $AWK" >&5
2818 echo "${ECHO_T}$AWK" >&6
2819 else
2820   echo "$as_me:2820: result: no" >&5
2821 echo "${ECHO_T}no" >&6
2822 fi
2823
2824   test -n "$AWK" && break
2825 done
2826
2827 # Find a good install program.  We prefer a C program (faster),
2828 # so one script is as good as another.  But avoid the broken or
2829 # incompatible versions:
2830 # SysV /etc/install, /usr/sbin/install
2831 # SunOS /usr/etc/install
2832 # IRIX /sbin/install
2833 # AIX /bin/install
2834 # AmigaOS /C/install, which installs bootblocks on floppy discs
2835 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2836 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2837 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2838 # ./install, which can be erroneously created by make from ./install.sh.
2839 echo "$as_me:2839: checking for a BSD compatible install" >&5
2840 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2841 if test -z "$INSTALL"; then
2842 if test "${ac_cv_path_install+set}" = set; then
2843   echo $ECHO_N "(cached) $ECHO_C" >&6
2844 else
2845     ac_save_IFS=$IFS; IFS=$ac_path_separator
2846   for ac_dir in $PATH; do
2847     IFS=$ac_save_IFS
2848     # Account for people who put trailing slashes in PATH elements.
2849     case $ac_dir/ in
2850     / | ./ | .// | /cC/* \
2851     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2852     | /usr/ucb/* ) ;;
2853     *)
2854       # OSF1 and SCO ODT 3.0 have their own names for install.
2855       # Don't use installbsd from OSF since it installs stuff as root
2856       # by default.
2857       for ac_prog in ginstall scoinst install; do
2858         if $as_executable_p "$ac_dir/$ac_prog"; then
2859           if test $ac_prog = install &&
2860             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2861             # AIX install.  It has an incompatible calling convention.
2862             :
2863           elif test $ac_prog = install &&
2864             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2865             # program-specific install script used by HP pwplus--don't use.
2866             :
2867           else
2868             ac_cv_path_install="$ac_dir/$ac_prog -c"
2869             break 2
2870           fi
2871         fi
2872       done
2873       ;;
2874     esac
2875   done
2876
2877 fi
2878   if test "${ac_cv_path_install+set}" = set; then
2879     INSTALL=$ac_cv_path_install
2880   else
2881     # As a last resort, use the slow shell script.  We don't cache a
2882     # path for INSTALL within a source directory, because that will
2883     # break other packages using the cache if that directory is
2884     # removed, or if the path is relative.
2885     INSTALL=$ac_install_sh
2886   fi
2887 fi
2888 echo "$as_me:2888: result: $INSTALL" >&5
2889 echo "${ECHO_T}$INSTALL" >&6
2890
2891 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2892 # It thinks the first close brace ends the variable substitution.
2893 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2894
2895 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2896
2897 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2898
2899 case $INSTALL in
2900 (/*)
2901         ;;
2902 (*)
2903         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2904         test -z "$cf_dir" && cf_dir=.
2905         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2906         ;;
2907 esac
2908
2909 echo "$as_me:2909: checking if you want to install stripped executables" >&5
2910 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2911
2912 # Check whether --enable-stripping or --disable-stripping was given.
2913 if test "${enable_stripping+set}" = set; then
2914   enableval="$enable_stripping"
2915   test "$enableval" != no && enableval=yes
2916         if test "$enableval" != "yes" ; then
2917     enable_stripping=no
2918         else
2919                 enable_stripping=yes
2920         fi
2921 else
2922   enableval=yes
2923         enable_stripping=yes
2924
2925 fi;
2926 echo "$as_me:2926: result: $enable_stripping" >&5
2927 echo "${ECHO_T}$enable_stripping" >&6
2928
2929 if test "$enable_stripping" = yes
2930 then
2931         INSTALL_OPT_S="-s"
2932 else
2933         INSTALL_OPT_S=
2934 fi
2935
2936 : "${INSTALL:=install}"
2937 echo "$as_me:2937: checking if install accepts -p option" >&5
2938 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2939 if test "${cf_cv_install_p+set}" = set; then
2940   echo $ECHO_N "(cached) $ECHO_C" >&6
2941 else
2942
2943         rm -rf ./conftest*
2944         date >conftest.in
2945         mkdir conftest.out
2946         sleep 3
2947         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2948         then
2949                 if test -f conftest.out/conftest.in
2950                 then
2951                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2952                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2953                         if test -s conftest.err
2954                         then
2955                                 cf_cv_install_p=no
2956                         else
2957                                 cf_cv_install_p=yes
2958                         fi
2959                 else
2960                         cf_cv_install_p=no
2961                 fi
2962         else
2963                 cf_cv_install_p=no
2964         fi
2965         rm -rf ./conftest*
2966
2967 fi
2968 echo "$as_me:2968: result: $cf_cv_install_p" >&5
2969 echo "${ECHO_T}$cf_cv_install_p" >&6
2970
2971 echo "$as_me:2971: checking if install needs to be told about ownership" >&5
2972 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2973 case `$ac_config_guess` in
2974 (*minix)
2975         with_install_o=yes
2976         ;;
2977 (*)
2978         with_install_o=no
2979         ;;
2980 esac
2981
2982 echo "$as_me:2982: result: $with_install_o" >&5
2983 echo "${ECHO_T}$with_install_o" >&6
2984 if test "x$with_install_o" = xyes
2985 then
2986         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'`"
2987 else
2988         INSTALL_OPT_O=
2989 fi
2990
2991 for ac_prog in lint cppcheck splint
2992 do
2993   # Extract the first word of "$ac_prog", so it can be a program name with args.
2994 set dummy $ac_prog; ac_word=$2
2995 echo "$as_me:2995: checking for $ac_word" >&5
2996 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2997 if test "${ac_cv_prog_LINT+set}" = set; then
2998   echo $ECHO_N "(cached) $ECHO_C" >&6
2999 else
3000   if test -n "$LINT"; then
3001   ac_cv_prog_LINT="$LINT" # Let the user override the test.
3002 else
3003   ac_save_IFS=$IFS; IFS=$ac_path_separator
3004 ac_dummy="$PATH"
3005 for ac_dir in $ac_dummy; do
3006   IFS=$ac_save_IFS
3007   test -z "$ac_dir" && ac_dir=.
3008   $as_executable_p "$ac_dir/$ac_word" || continue
3009 ac_cv_prog_LINT="$ac_prog"
3010 echo "$as_me:3010: found $ac_dir/$ac_word" >&5
3011 break
3012 done
3013
3014 fi
3015 fi
3016 LINT=$ac_cv_prog_LINT
3017 if test -n "$LINT"; then
3018   echo "$as_me:3018: result: $LINT" >&5
3019 echo "${ECHO_T}$LINT" >&6
3020 else
3021   echo "$as_me:3021: result: no" >&5
3022 echo "${ECHO_T}no" >&6
3023 fi
3024
3025   test -n "$LINT" && break
3026 done
3027
3028 case "x$LINT" in
3029 (xcppcheck|x*/cppcheck)
3030         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
3031         ;;
3032 esac
3033
3034 echo "$as_me:3034: checking for \".PHONY\" make-support" >&5
3035 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3036 if test "${cf_cv_make_PHONY+set}" = set; then
3037   echo $ECHO_N "(cached) $ECHO_C" >&6
3038 else
3039
3040         rm -rf conftest*
3041         (
3042                 mkdir conftest || exit 1
3043                 cd conftest
3044                 cat >makefile <<'CF_EOF'
3045 .PHONY: always
3046 DATA=0
3047 always: always.out
3048         @echo "** making $@ $(DATA)"
3049 once: once.out
3050         @echo "** making $@ $(DATA)"
3051 always.out:
3052         @echo "** making $@ $(DATA)"
3053         echo $(DATA) > $@
3054 once.out:
3055         @echo "** making $@ $(DATA)"
3056         echo $(DATA) > $@
3057 CF_EOF
3058                 for cf_data in 1 2 3
3059                 do
3060                         ${MAKE:-make} always DATA=$cf_data
3061                         ${MAKE:-make} once   DATA=$cf_data
3062                         ${MAKE:-make} -t always once
3063                         if test -f always ; then
3064                                 echo "no (case 1)" > ../conftest.tmp
3065                         elif test ! -f always.out ; then
3066                                 echo "no (case 2)" > ../conftest.tmp
3067                         elif test ! -f once.out ; then
3068                                 echo "no (case 3)" > ../conftest.tmp
3069                         elif ! cmp -s always.out once.out ; then
3070                                 echo "no (case 4)" > ../conftest.tmp
3071                                 diff always.out once.out
3072                         else
3073                                 cf_check="`cat always.out`"
3074                                 if test "x$cf_check" != "x$cf_data" ; then
3075                                         echo "no (case 5)" > ../conftest.tmp
3076                                 else
3077                                         echo yes > ../conftest.tmp
3078                                         rm -f ./*.out
3079                                         continue
3080                                 fi
3081                         fi
3082                         break
3083                 done
3084         ) >&5 2>&1
3085         cf_cv_make_PHONY="`cat conftest.tmp`"
3086         rm -rf conftest*
3087
3088 fi
3089 echo "$as_me:3089: result: $cf_cv_make_PHONY" >&5
3090 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3091 MAKE_NO_PHONY="#"
3092 MAKE_PHONY="#"
3093 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3094 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3095
3096 echo "$as_me:3096: checking if filesystem supports mixed-case filenames" >&5
3097 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3098 if test "${cf_cv_mixedcase+set}" = set; then
3099   echo $ECHO_N "(cached) $ECHO_C" >&6
3100 else
3101
3102 if test "$cross_compiling" = yes ; then
3103         case "$target_alias" in
3104         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3105                 cf_cv_mixedcase=no
3106                 ;;
3107         (*)
3108                 cf_cv_mixedcase=yes
3109                 ;;
3110         esac
3111 else
3112         rm -f conftest CONFTEST
3113         echo test >conftest
3114         if test -f CONFTEST ; then
3115                 cf_cv_mixedcase=no
3116         else
3117                 cf_cv_mixedcase=yes
3118         fi
3119         rm -f conftest CONFTEST
3120 fi
3121
3122 fi
3123 echo "$as_me:3123: result: $cf_cv_mixedcase" >&5
3124 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3125 test "$cf_cv_mixedcase" = yes &&
3126 cat >>confdefs.h <<\EOF
3127 #define MIXEDCASE_FILENAMES 1
3128 EOF
3129
3130 for ac_prog in exctags ctags
3131 do
3132   # Extract the first word of "$ac_prog", so it can be a program name with args.
3133 set dummy $ac_prog; ac_word=$2
3134 echo "$as_me:3134: checking for $ac_word" >&5
3135 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3136 if test "${ac_cv_prog_CTAGS+set}" = set; then
3137   echo $ECHO_N "(cached) $ECHO_C" >&6
3138 else
3139   if test -n "$CTAGS"; then
3140   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3141 else
3142   ac_save_IFS=$IFS; IFS=$ac_path_separator
3143 ac_dummy="$PATH"
3144 for ac_dir in $ac_dummy; do
3145   IFS=$ac_save_IFS
3146   test -z "$ac_dir" && ac_dir=.
3147   $as_executable_p "$ac_dir/$ac_word" || continue
3148 ac_cv_prog_CTAGS="$ac_prog"
3149 echo "$as_me:3149: found $ac_dir/$ac_word" >&5
3150 break
3151 done
3152
3153 fi
3154 fi
3155 CTAGS=$ac_cv_prog_CTAGS
3156 if test -n "$CTAGS"; then
3157   echo "$as_me:3157: result: $CTAGS" >&5
3158 echo "${ECHO_T}$CTAGS" >&6
3159 else
3160   echo "$as_me:3160: result: no" >&5
3161 echo "${ECHO_T}no" >&6
3162 fi
3163
3164   test -n "$CTAGS" && break
3165 done
3166
3167 for ac_prog in exetags etags
3168 do
3169   # Extract the first word of "$ac_prog", so it can be a program name with args.
3170 set dummy $ac_prog; ac_word=$2
3171 echo "$as_me:3171: checking for $ac_word" >&5
3172 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3173 if test "${ac_cv_prog_ETAGS+set}" = set; then
3174   echo $ECHO_N "(cached) $ECHO_C" >&6
3175 else
3176   if test -n "$ETAGS"; then
3177   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3178 else
3179   ac_save_IFS=$IFS; IFS=$ac_path_separator
3180 ac_dummy="$PATH"
3181 for ac_dir in $ac_dummy; do
3182   IFS=$ac_save_IFS
3183   test -z "$ac_dir" && ac_dir=.
3184   $as_executable_p "$ac_dir/$ac_word" || continue
3185 ac_cv_prog_ETAGS="$ac_prog"
3186 echo "$as_me:3186: found $ac_dir/$ac_word" >&5
3187 break
3188 done
3189
3190 fi
3191 fi
3192 ETAGS=$ac_cv_prog_ETAGS
3193 if test -n "$ETAGS"; then
3194   echo "$as_me:3194: result: $ETAGS" >&5
3195 echo "${ECHO_T}$ETAGS" >&6
3196 else
3197   echo "$as_me:3197: result: no" >&5
3198 echo "${ECHO_T}no" >&6
3199 fi
3200
3201   test -n "$ETAGS" && break
3202 done
3203
3204 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3205 set dummy ${CTAGS:-ctags}; ac_word=$2
3206 echo "$as_me:3206: checking for $ac_word" >&5
3207 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3208 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3209   echo $ECHO_N "(cached) $ECHO_C" >&6
3210 else
3211   if test -n "$MAKE_LOWER_TAGS"; then
3212   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3213 else
3214   ac_save_IFS=$IFS; IFS=$ac_path_separator
3215 ac_dummy="$PATH"
3216 for ac_dir in $ac_dummy; do
3217   IFS=$ac_save_IFS
3218   test -z "$ac_dir" && ac_dir=.
3219   $as_executable_p "$ac_dir/$ac_word" || continue
3220 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3221 echo "$as_me:3221: found $ac_dir/$ac_word" >&5
3222 break
3223 done
3224
3225   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3226 fi
3227 fi
3228 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3229 if test -n "$MAKE_LOWER_TAGS"; then
3230   echo "$as_me:3230: result: $MAKE_LOWER_TAGS" >&5
3231 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3232 else
3233   echo "$as_me:3233: result: no" >&5
3234 echo "${ECHO_T}no" >&6
3235 fi
3236
3237 if test "$cf_cv_mixedcase" = yes ; then
3238         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3239 set dummy ${ETAGS:-etags}; ac_word=$2
3240 echo "$as_me:3240: checking for $ac_word" >&5
3241 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3242 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3243   echo $ECHO_N "(cached) $ECHO_C" >&6
3244 else
3245   if test -n "$MAKE_UPPER_TAGS"; then
3246   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3247 else
3248   ac_save_IFS=$IFS; IFS=$ac_path_separator
3249 ac_dummy="$PATH"
3250 for ac_dir in $ac_dummy; do
3251   IFS=$ac_save_IFS
3252   test -z "$ac_dir" && ac_dir=.
3253   $as_executable_p "$ac_dir/$ac_word" || continue
3254 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3255 echo "$as_me:3255: found $ac_dir/$ac_word" >&5
3256 break
3257 done
3258
3259   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3260 fi
3261 fi
3262 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3263 if test -n "$MAKE_UPPER_TAGS"; then
3264   echo "$as_me:3264: result: $MAKE_UPPER_TAGS" >&5
3265 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3266 else
3267   echo "$as_me:3267: result: no" >&5
3268 echo "${ECHO_T}no" >&6
3269 fi
3270
3271 else
3272         MAKE_UPPER_TAGS=no
3273 fi
3274
3275 if test "$MAKE_UPPER_TAGS" = yes ; then
3276         MAKE_UPPER_TAGS=
3277 else
3278         MAKE_UPPER_TAGS="#"
3279 fi
3280
3281 if test "$MAKE_LOWER_TAGS" = yes ; then
3282         MAKE_LOWER_TAGS=
3283 else
3284         MAKE_LOWER_TAGS="#"
3285 fi
3286
3287 echo "$as_me:3287: checking if -lm needed for math functions" >&5
3288 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3289 if test "${cf_cv_need_libm+set}" = set; then
3290   echo $ECHO_N "(cached) $ECHO_C" >&6
3291 else
3292
3293         cat >"conftest.$ac_ext" <<_ACEOF
3294 #line 3294 "configure"
3295 #include "confdefs.h"
3296
3297                 #include <stdio.h>
3298                 #include <stdlib.h>
3299                 #include <math.h>
3300
3301 int
3302 main (void)
3303 {
3304 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3305   ;
3306   return 0;
3307 }
3308 _ACEOF
3309 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3310 if { (eval echo "$as_me:3310: \"$ac_link\"") >&5
3311   (eval $ac_link) 2>&5
3312   ac_status=$?
3313   echo "$as_me:3313: \$? = $ac_status" >&5
3314   (exit "$ac_status"); } &&
3315          { ac_try='test -s "conftest$ac_exeext"'
3316   { (eval echo "$as_me:3316: \"$ac_try\"") >&5
3317   (eval $ac_try) 2>&5
3318   ac_status=$?
3319   echo "$as_me:3319: \$? = $ac_status" >&5
3320   (exit "$ac_status"); }; }; then
3321   cf_cv_need_libm=no
3322 else
3323   echo "$as_me: failed program was:" >&5
3324 cat "conftest.$ac_ext" >&5
3325 cf_cv_need_libm=yes
3326 fi
3327 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3328 fi
3329 echo "$as_me:3329: result: $cf_cv_need_libm" >&5
3330 echo "${ECHO_T}$cf_cv_need_libm" >&6
3331
3332 if test "$cf_cv_need_libm" = yes
3333 then
3334
3335         cf_save_LIBS="$LIBS"
3336         LIBS="$LIBS -lm"
3337         echo "$as_me:3337: checking if -lm is available for math functions" >&5
3338 echo $ECHO_N "checking if -lm is available for math functions... $ECHO_C" >&6
3339 if test "${cf_cv_have_libm+set}" = set; then
3340   echo $ECHO_N "(cached) $ECHO_C" >&6
3341 else
3342
3343         cat >"conftest.$ac_ext" <<_ACEOF
3344 #line 3344 "configure"
3345 #include "confdefs.h"
3346
3347                 #include <stdio.h>
3348                 #include <stdlib.h>
3349                 #include <math.h>
3350
3351 int
3352 main (void)
3353 {
3354 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3355   ;
3356   return 0;
3357 }
3358 _ACEOF
3359 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3360 if { (eval echo "$as_me:3360: \"$ac_link\"") >&5
3361   (eval $ac_link) 2>&5
3362   ac_status=$?
3363   echo "$as_me:3363: \$? = $ac_status" >&5
3364   (exit "$ac_status"); } &&
3365          { ac_try='test -s "conftest$ac_exeext"'
3366   { (eval echo "$as_me:3366: \"$ac_try\"") >&5
3367   (eval $ac_try) 2>&5
3368   ac_status=$?
3369   echo "$as_me:3369: \$? = $ac_status" >&5
3370   (exit "$ac_status"); }; }; then
3371   cf_cv_have_libm=yes
3372 else
3373   echo "$as_me: failed program was:" >&5
3374 cat "conftest.$ac_ext" >&5
3375 cf_cv_have_libm=no
3376 fi
3377 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3378 fi
3379 echo "$as_me:3379: result: $cf_cv_have_libm" >&5
3380 echo "${ECHO_T}$cf_cv_have_libm" >&6
3381         LIBS="$cf_save_LIBS"
3382
3383         if test "$cf_cv_have_libm" = yes
3384         then
3385                 MATH_LIB=-lm
3386         fi
3387 else
3388         cf_cv_have_libm=yes
3389 fi
3390
3391 if test "$cf_cv_have_libm" = yes
3392 then
3393
3394 cat >>confdefs.h <<\EOF
3395 #define HAVE_MATH_FUNCS 1
3396 EOF
3397
3398 fi
3399
3400 top_builddir=`pwd`
3401
3402 CC_G_OPT="-g"
3403 CC_SHARED_OPTS=unknown
3404 CPPFLAGS="$CPPFLAGS"
3405 DFT_DEP_SUFFIX=""
3406 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3407 DFT_UPR_MODEL="NORMAL"
3408 LD="ld"
3409 LDFLAGS_SHARED=""
3410 LDFLAGS_STATIC=""
3411 LD_MODEL=""
3412 LD_SHARED_OPTS=""
3413 LIBTOOL=""
3414 LIBTOOL_OPTS=""
3415 LIB_CLEAN=""
3416 LIB_COMPILE=""
3417 LIB_LINK='${CC}'
3418 LINK_TESTS=""
3419 LOCAL_LDFLAGS=""
3420 PACKAGE="ncurses-examples"
3421 PTHREAD="-lm"
3422 TEST_ARGS=""
3423 TEST_DEPS=""
3424 TEST_LIBS=""
3425 TINFO_LDFLAGS=''
3426 TINFO_LIBS='$(LIBS_CURSES)'
3427 cf_cv_abi_version=""
3428 cf_cv_rel_version=""
3429 includesubdir=""
3430
3431 cf_cv_screen=curses
3432 cf_cv_libtype=
3433
3434 echo "$as_me:3434: checking for fgrep" >&5
3435 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3436 if test "${ac_cv_path_FGREP+set}" = set; then
3437   echo $ECHO_N "(cached) $ECHO_C" >&6
3438 else
3439   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3440    then ac_cv_path_FGREP="$GREP -F"
3441    else
3442      for ac_prog in gfgrep fgrep
3443 do
3444   # Extract the first word of "$ac_prog", so it can be a program name with args.
3445 set dummy $ac_prog; ac_word=$2
3446 echo "$as_me:3446: checking for $ac_word" >&5
3447 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3448 if test "${ac_cv_path_FGREP+set}" = set; then
3449   echo $ECHO_N "(cached) $ECHO_C" >&6
3450 else
3451   case $FGREP in
3452   [\\/]* | ?:[\\/]*)
3453   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3454   ;;
3455   *)
3456   ac_save_IFS=$IFS; IFS=$ac_path_separator
3457 ac_dummy="$PATH"
3458 for ac_dir in $ac_dummy; do
3459   IFS=$ac_save_IFS
3460   test -z "$ac_dir" && ac_dir=.
3461   if $as_executable_p "$ac_dir/$ac_word"; then
3462    ac_cv_path_FGREP="$ac_dir/$ac_word"
3463    echo "$as_me:3463: found $ac_dir/$ac_word" >&5
3464    break
3465 fi
3466 done
3467
3468   ;;
3469 esac
3470 fi
3471 FGREP=$ac_cv_path_FGREP
3472
3473 if test -n "$FGREP"; then
3474   echo "$as_me:3474: result: $FGREP" >&5
3475 echo "${ECHO_T}$FGREP" >&6
3476 else
3477   echo "$as_me:3477: result: no" >&5
3478 echo "${ECHO_T}no" >&6
3479 fi
3480
3481   test -n "$FGREP" && break
3482 done
3483 test -n "$FGREP" || FGREP=": "
3484
3485      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3485: error: cannot find workable fgrep" >&5
3486 echo "$as_me: error: cannot find workable fgrep" >&2;}
3487    { (exit 1); exit 1; }; }
3488    fi
3489 fi
3490 echo "$as_me:3490: result: $ac_cv_path_FGREP" >&5
3491 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3492  FGREP="$ac_cv_path_FGREP"
3493
3494 echo "$as_me:3494: checking if you want to use C11 _Noreturn feature" >&5
3495 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3496
3497 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3498 if test "${enable_stdnoreturn+set}" = set; then
3499   enableval="$enable_stdnoreturn"
3500   test "$enableval" != yes && enableval=no
3501         if test "$enableval" != "no" ; then
3502     enable_stdnoreturn=yes
3503         else
3504                 enable_stdnoreturn=no
3505         fi
3506 else
3507   enableval=no
3508         enable_stdnoreturn=no
3509
3510 fi;
3511 echo "$as_me:3511: result: $enable_stdnoreturn" >&5
3512 echo "${ECHO_T}$enable_stdnoreturn" >&6
3513
3514 if test $enable_stdnoreturn = yes; then
3515 echo "$as_me:3515: checking for C11 _Noreturn feature" >&5
3516 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3517 if test "${cf_cv_c11_noreturn+set}" = set; then
3518   echo $ECHO_N "(cached) $ECHO_C" >&6
3519 else
3520   cat >"conftest.$ac_ext" <<_ACEOF
3521 #line 3521 "configure"
3522 #include "confdefs.h"
3523
3524 $ac_includes_default
3525 #include <stdnoreturn.h>
3526 static _Noreturn void giveup(void) { exit(0); }
3527
3528 int
3529 main (void)
3530 {
3531 if (feof(stdin)) giveup()
3532   ;
3533   return 0;
3534 }
3535 _ACEOF
3536 rm -f "conftest.$ac_objext"
3537 if { (eval echo "$as_me:3537: \"$ac_compile\"") >&5
3538   (eval $ac_compile) 2>&5
3539   ac_status=$?
3540   echo "$as_me:3540: \$? = $ac_status" >&5
3541   (exit "$ac_status"); } &&
3542          { ac_try='test -s "conftest.$ac_objext"'
3543   { (eval echo "$as_me:3543: \"$ac_try\"") >&5
3544   (eval $ac_try) 2>&5
3545   ac_status=$?
3546   echo "$as_me:3546: \$? = $ac_status" >&5
3547   (exit "$ac_status"); }; }; then
3548   cf_cv_c11_noreturn=yes
3549 else
3550   echo "$as_me: failed program was:" >&5
3551 cat "conftest.$ac_ext" >&5
3552 cf_cv_c11_noreturn=no
3553 fi
3554 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3555
3556 fi
3557 echo "$as_me:3557: result: $cf_cv_c11_noreturn" >&5
3558 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3559 else
3560         cf_cv_c11_noreturn=no,
3561 fi
3562
3563 if test "$cf_cv_c11_noreturn" = yes; then
3564
3565 cat >>confdefs.h <<\EOF
3566 #define HAVE_STDNORETURN_H 1
3567 EOF
3568
3569 cat >>confdefs.h <<EOF
3570 #define STDC_NORETURN _Noreturn
3571 EOF
3572
3573         HAVE_STDNORETURN_H=1
3574 else
3575         HAVE_STDNORETURN_H=0
3576 fi
3577
3578 if test "$GCC" = yes || test "$GXX" = yes
3579 then
3580 cat > conftest.i <<EOF
3581 #ifndef GCC_PRINTF
3582 #define GCC_PRINTF 0
3583 #endif
3584 #ifndef GCC_SCANF
3585 #define GCC_SCANF 0
3586 #endif
3587 #ifndef GCC_NORETURN
3588 #define GCC_NORETURN /* nothing */
3589 #endif
3590 #ifndef GCC_UNUSED
3591 #define GCC_UNUSED /* nothing */
3592 #endif
3593 EOF
3594 if test "$GCC" = yes
3595 then
3596         { echo "$as_me:3596: checking for $CC __attribute__ directives..." >&5
3597 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3598 cat > "conftest.$ac_ext" <<EOF
3599 #line 3599 "${as_me:-configure}"
3600 #include <stdio.h>
3601 #include "confdefs.h"
3602 #include "conftest.h"
3603 #include "conftest.i"
3604 #if     GCC_PRINTF
3605 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3606 #else
3607 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3608 #endif
3609 #if     GCC_SCANF
3610 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3611 #else
3612 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3613 #endif
3614 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3615 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3616 extern GCC_NORETURN void foo(void);
3617 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3618 EOF
3619         cf_printf_attribute=no
3620         cf_scanf_attribute=no
3621         for cf_attribute in scanf printf unused noreturn
3622         do
3623
3624 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3625
3626                 cf_directive="__attribute__(($cf_attribute))"
3627                 echo "checking for $CC $cf_directive" 1>&5
3628
3629                 case "$cf_attribute" in
3630                 (printf)
3631                         cf_printf_attribute=yes
3632                         cat >conftest.h <<EOF
3633 #define GCC_$cf_ATTRIBUTE 1
3634 EOF
3635                         ;;
3636                 (scanf)
3637                         cf_scanf_attribute=yes
3638                         cat >conftest.h <<EOF
3639 #define GCC_$cf_ATTRIBUTE 1
3640 EOF
3641                         ;;
3642                 (*)
3643                         cat >conftest.h <<EOF
3644 #define GCC_$cf_ATTRIBUTE $cf_directive
3645 EOF
3646                         ;;
3647                 esac
3648
3649                 if { (eval echo "$as_me:3649: \"$ac_compile\"") >&5
3650   (eval $ac_compile) 2>&5
3651   ac_status=$?
3652   echo "$as_me:3652: \$? = $ac_status" >&5
3653   (exit "$ac_status"); }; then
3654                         test -n "$verbose" && echo "$as_me:3654: result: ... $cf_attribute" >&5
3655 echo "${ECHO_T}... $cf_attribute" >&6
3656                         cat conftest.h >>confdefs.h
3657                         case "$cf_attribute" in
3658                         (noreturn)
3659
3660 cat >>confdefs.h <<EOF
3661 #define GCC_NORETURN $cf_directive
3662 EOF
3663
3664                                 ;;
3665                         (printf)
3666                                 cf_value='/* nothing */'
3667                                 if test "$cf_printf_attribute" != no ; then
3668                                         cf_value='__attribute__((format(printf,fmt,var)))'
3669
3670 cat >>confdefs.h <<\EOF
3671 #define GCC_PRINTF 1
3672 EOF
3673
3674                                 fi
3675
3676 cat >>confdefs.h <<EOF
3677 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3678 EOF
3679
3680                                 ;;
3681                         (scanf)
3682                                 cf_value='/* nothing */'
3683                                 if test "$cf_scanf_attribute" != no ; then
3684                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3685
3686 cat >>confdefs.h <<\EOF
3687 #define GCC_SCANF 1
3688 EOF
3689
3690                                 fi
3691
3692 cat >>confdefs.h <<EOF
3693 #define GCC_SCANFLIKE(fmt,var) $cf_value
3694 EOF
3695
3696                                 ;;
3697                         (unused)
3698
3699 cat >>confdefs.h <<EOF
3700 #define GCC_UNUSED $cf_directive
3701 EOF
3702
3703                                 ;;
3704                         esac
3705                 fi
3706         done
3707 else
3708         ${FGREP-fgrep} define conftest.i >>confdefs.h
3709 fi
3710 rm -rf ./conftest*
3711 fi
3712
3713 echo "$as_me:3713: checking if you want to work around bogus compiler/loader warnings" >&5
3714 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3715
3716 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3717 if test "${enable_string_hacks+set}" = set; then
3718   enableval="$enable_string_hacks"
3719   enable_string_hacks=$enableval
3720 else
3721   enable_string_hacks=no
3722 fi;
3723 echo "$as_me:3723: result: $enable_string_hacks" >&5
3724 echo "${ECHO_T}$enable_string_hacks" >&6
3725
3726 if test "x$enable_string_hacks" = "xyes"; then
3727
3728 cat >>confdefs.h <<\EOF
3729 #define USE_STRING_HACKS 1
3730 EOF
3731
3732         { echo "$as_me:3732: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3733 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3734         echo "$as_me:3734: checking for strlcat" >&5
3735 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3736 if test "${ac_cv_func_strlcat+set}" = set; then
3737   echo $ECHO_N "(cached) $ECHO_C" >&6
3738 else
3739   cat >"conftest.$ac_ext" <<_ACEOF
3740 #line 3740 "configure"
3741 #include "confdefs.h"
3742 #define strlcat autoconf_temporary
3743 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3744 #undef strlcat
3745
3746 #ifdef __cplusplus
3747 extern "C"
3748 #endif
3749
3750 /* We use char because int might match the return type of a gcc2
3751    builtin and then its argument prototype would still apply.  */
3752 char strlcat (void);
3753
3754 int
3755 main (void)
3756 {
3757
3758 /* The GNU C library defines stubs for functions which it implements
3759     to always fail with ENOSYS.  Some functions are actually named
3760     something starting with __ and the normal name is an alias.  */
3761 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3762 #error found stub for strlcat
3763 #endif
3764
3765         return strlcat ();
3766   ;
3767   return 0;
3768 }
3769 _ACEOF
3770 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3771 if { (eval echo "$as_me:3771: \"$ac_link\"") >&5
3772   (eval $ac_link) 2>&5
3773   ac_status=$?
3774   echo "$as_me:3774: \$? = $ac_status" >&5
3775   (exit "$ac_status"); } &&
3776          { ac_try='test -s "conftest$ac_exeext"'
3777   { (eval echo "$as_me:3777: \"$ac_try\"") >&5
3778   (eval $ac_try) 2>&5
3779   ac_status=$?
3780   echo "$as_me:3780: \$? = $ac_status" >&5
3781   (exit "$ac_status"); }; }; then
3782   ac_cv_func_strlcat=yes
3783 else
3784   echo "$as_me: failed program was:" >&5
3785 cat "conftest.$ac_ext" >&5
3786 ac_cv_func_strlcat=no
3787 fi
3788 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3789 fi
3790 echo "$as_me:3790: result: $ac_cv_func_strlcat" >&5
3791 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3792 if test "$ac_cv_func_strlcat" = yes; then
3793
3794 cat >>confdefs.h <<\EOF
3795 #define HAVE_STRLCAT 1
3796 EOF
3797
3798 else
3799
3800                 echo "$as_me:3800: checking for strlcat in -lbsd" >&5
3801 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3802 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3803   echo $ECHO_N "(cached) $ECHO_C" >&6
3804 else
3805   ac_check_lib_save_LIBS=$LIBS
3806 LIBS="-lbsd  $LIBS"
3807 cat >"conftest.$ac_ext" <<_ACEOF
3808 #line 3808 "configure"
3809 #include "confdefs.h"
3810
3811 /* Override any gcc2 internal prototype to avoid an error.  */
3812 #ifdef __cplusplus
3813 extern "C"
3814 #endif
3815 /* We use char because int might match the return type of a gcc2
3816    builtin and then its argument prototype would still apply.  */
3817 char strlcat ();
3818 int
3819 main (void)
3820 {
3821 strlcat ();
3822   ;
3823   return 0;
3824 }
3825 _ACEOF
3826 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3827 if { (eval echo "$as_me:3827: \"$ac_link\"") >&5
3828   (eval $ac_link) 2>&5
3829   ac_status=$?
3830   echo "$as_me:3830: \$? = $ac_status" >&5
3831   (exit "$ac_status"); } &&
3832          { ac_try='test -s "conftest$ac_exeext"'
3833   { (eval echo "$as_me:3833: \"$ac_try\"") >&5
3834   (eval $ac_try) 2>&5
3835   ac_status=$?
3836   echo "$as_me:3836: \$? = $ac_status" >&5
3837   (exit "$ac_status"); }; }; then
3838   ac_cv_lib_bsd_strlcat=yes
3839 else
3840   echo "$as_me: failed program was:" >&5
3841 cat "conftest.$ac_ext" >&5
3842 ac_cv_lib_bsd_strlcat=no
3843 fi
3844 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3845 LIBS=$ac_check_lib_save_LIBS
3846 fi
3847 echo "$as_me:3847: result: $ac_cv_lib_bsd_strlcat" >&5
3848 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3849 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3850
3851 cf_add_libs="$LIBS"
3852 # reverse order
3853 cf_add_0lib=
3854 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3855 # filter duplicates
3856 for cf_add_1lib in $cf_add_0lib; do
3857         for cf_add_2lib in $cf_add_libs; do
3858                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3859                         cf_add_1lib=
3860                         break
3861                 fi
3862         done
3863         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3864 done
3865 LIBS="$cf_add_libs"
3866
3867 for ac_header in bsd/string.h
3868 do
3869 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3870 echo "$as_me:3870: checking for $ac_header" >&5
3871 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3872 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3873   echo $ECHO_N "(cached) $ECHO_C" >&6
3874 else
3875   cat >"conftest.$ac_ext" <<_ACEOF
3876 #line 3876 "configure"
3877 #include "confdefs.h"
3878 #include <$ac_header>
3879 _ACEOF
3880 if { (eval echo "$as_me:3880: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3881   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3882   ac_status=$?
3883   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3884   rm -f conftest.er1
3885   cat conftest.err >&5
3886   echo "$as_me:3886: \$? = $ac_status" >&5
3887   (exit "$ac_status"); } >/dev/null; then
3888   if test -s conftest.err; then
3889     ac_cpp_err=$ac_c_preproc_warn_flag
3890   else
3891     ac_cpp_err=
3892   fi
3893 else
3894   ac_cpp_err=yes
3895 fi
3896 if test -z "$ac_cpp_err"; then
3897   eval "$as_ac_Header=yes"
3898 else
3899   echo "$as_me: failed program was:" >&5
3900   cat "conftest.$ac_ext" >&5
3901   eval "$as_ac_Header=no"
3902 fi
3903 rm -f conftest.err "conftest.$ac_ext"
3904 fi
3905 echo "$as_me:3905: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3906 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3907 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3908   cat >>confdefs.h <<EOF
3909 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3910 EOF
3911
3912 fi
3913 done
3914
3915 cat >>confdefs.h <<\EOF
3916 #define HAVE_STRLCAT 1
3917 EOF
3918
3919 fi
3920
3921 fi
3922
3923 for ac_func in strlcpy snprintf
3924 do
3925 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3926 echo "$as_me:3926: checking for $ac_func" >&5
3927 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3928 if eval "test \"\${$as_ac_var+set}\" = set"; then
3929   echo $ECHO_N "(cached) $ECHO_C" >&6
3930 else
3931   cat >"conftest.$ac_ext" <<_ACEOF
3932 #line 3932 "configure"
3933 #include "confdefs.h"
3934 #define $ac_func autoconf_temporary
3935 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3936 #undef $ac_func
3937
3938 #ifdef __cplusplus
3939 extern "C"
3940 #endif
3941
3942 /* We use char because int might match the return type of a gcc2
3943    builtin and then its argument prototype would still apply.  */
3944 char $ac_func (void);
3945
3946 int
3947 main (void)
3948 {
3949
3950 /* The GNU C library defines stubs for functions which it implements
3951     to always fail with ENOSYS.  Some functions are actually named
3952     something starting with __ and the normal name is an alias.  */
3953 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3954 #error found stub for $ac_func
3955 #endif
3956
3957         return $ac_func ();
3958   ;
3959   return 0;
3960 }
3961 _ACEOF
3962 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3963 if { (eval echo "$as_me:3963: \"$ac_link\"") >&5
3964   (eval $ac_link) 2>&5
3965   ac_status=$?
3966   echo "$as_me:3966: \$? = $ac_status" >&5
3967   (exit "$ac_status"); } &&
3968          { ac_try='test -s "conftest$ac_exeext"'
3969   { (eval echo "$as_me:3969: \"$ac_try\"") >&5
3970   (eval $ac_try) 2>&5
3971   ac_status=$?
3972   echo "$as_me:3972: \$? = $ac_status" >&5
3973   (exit "$ac_status"); }; }; then
3974   eval "$as_ac_var=yes"
3975 else
3976   echo "$as_me: failed program was:" >&5
3977 cat "conftest.$ac_ext" >&5
3978 eval "$as_ac_var=no"
3979 fi
3980 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3981 fi
3982 echo "$as_me:3982: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3983 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3984 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3985   cat >>confdefs.h <<EOF
3986 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3987 EOF
3988
3989 fi
3990 done
3991
3992 fi
3993
3994 echo "$as_me:3994: checking if the POSIX test-macros are already defined" >&5
3995 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3996 if test "${cf_cv_posix_visible+set}" = set; then
3997   echo $ECHO_N "(cached) $ECHO_C" >&6
3998 else
3999
4000 cat >"conftest.$ac_ext" <<_ACEOF
4001 #line 4001 "configure"
4002 #include "confdefs.h"
4003 #include <stdio.h>
4004 int
4005 main (void)
4006 {
4007
4008 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
4009         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
4010         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
4011         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
4012 #error conflicting symbols found
4013 #endif
4014
4015   ;
4016   return 0;
4017 }
4018 _ACEOF
4019 rm -f "conftest.$ac_objext"
4020 if { (eval echo "$as_me:4020: \"$ac_compile\"") >&5
4021   (eval $ac_compile) 2>&5
4022   ac_status=$?
4023   echo "$as_me:4023: \$? = $ac_status" >&5
4024   (exit "$ac_status"); } &&
4025          { ac_try='test -s "conftest.$ac_objext"'
4026   { (eval echo "$as_me:4026: \"$ac_try\"") >&5
4027   (eval $ac_try) 2>&5
4028   ac_status=$?
4029   echo "$as_me:4029: \$? = $ac_status" >&5
4030   (exit "$ac_status"); }; }; then
4031   cf_cv_posix_visible=no
4032 else
4033   echo "$as_me: failed program was:" >&5
4034 cat "conftest.$ac_ext" >&5
4035 cf_cv_posix_visible=yes
4036 fi
4037 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4038
4039 fi
4040 echo "$as_me:4040: result: $cf_cv_posix_visible" >&5
4041 echo "${ECHO_T}$cf_cv_posix_visible" >&6
4042
4043 if test "$cf_cv_posix_visible" = no; then
4044
4045 cf_XOPEN_SOURCE=600
4046 cf_POSIX_C_SOURCE=199506L
4047 cf_xopen_source=
4048
4049 case "$host_os" in
4050 (aix[4-7]*)
4051         cf_xopen_source="-D_ALL_SOURCE"
4052         ;;
4053 (darwin[0-8].*)
4054         cf_xopen_source="-D_APPLE_C_SOURCE"
4055         ;;
4056 (darwin*)
4057         cf_xopen_source="-D_DARWIN_C_SOURCE"
4058         cf_XOPEN_SOURCE=
4059         ;;
4060 (freebsd*|dragonfly*|midnightbsd*)
4061         # 5.x headers associate
4062         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
4063         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
4064         cf_POSIX_C_SOURCE=200112L
4065         cf_XOPEN_SOURCE=600
4066         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4067         ;;
4068 (hpux11*)
4069         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
4070         ;;
4071 (hpux*)
4072         cf_xopen_source="-D_HPUX_SOURCE"
4073         ;;
4074 (irix[56].*)
4075         cf_xopen_source="-D_SGI_SOURCE"
4076         cf_XOPEN_SOURCE=
4077         ;;
4078 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys)
4079
4080 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
4081
4082 echo "$as_me:4082: checking if this is the GNU C library" >&5
4083 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
4084 if test "${cf_cv_gnu_library+set}" = set; then
4085   echo $ECHO_N "(cached) $ECHO_C" >&6
4086 else
4087
4088 cat >"conftest.$ac_ext" <<_ACEOF
4089 #line 4089 "configure"
4090 #include "confdefs.h"
4091 #include <sys/types.h>
4092 int
4093 main (void)
4094 {
4095
4096         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
4097                 return 0;
4098         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
4099                 return 0;
4100         #else
4101         #       error not GNU C library
4102         #endif
4103   ;
4104   return 0;
4105 }
4106 _ACEOF
4107 rm -f "conftest.$ac_objext"
4108 if { (eval echo "$as_me:4108: \"$ac_compile\"") >&5
4109   (eval $ac_compile) 2>&5
4110   ac_status=$?
4111   echo "$as_me:4111: \$? = $ac_status" >&5
4112   (exit "$ac_status"); } &&
4113          { ac_try='test -s "conftest.$ac_objext"'
4114   { (eval echo "$as_me:4114: \"$ac_try\"") >&5
4115   (eval $ac_try) 2>&5
4116   ac_status=$?
4117   echo "$as_me:4117: \$? = $ac_status" >&5
4118   (exit "$ac_status"); }; }; then
4119   cf_cv_gnu_library=yes
4120 else
4121   echo "$as_me: failed program was:" >&5
4122 cat "conftest.$ac_ext" >&5
4123 cf_cv_gnu_library=no
4124 fi
4125 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4126
4127 fi
4128 echo "$as_me:4128: result: $cf_cv_gnu_library" >&5
4129 echo "${ECHO_T}$cf_cv_gnu_library" >&6
4130
4131 if test x$cf_cv_gnu_library = xyes; then
4132
4133         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
4134         # was changed to help a little.  newlib incorporated the change about 4
4135         # years later.
4136         echo "$as_me:4136: checking if _DEFAULT_SOURCE can be used as a basis" >&5
4137 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
4138 if test "${cf_cv_gnu_library_219+set}" = set; then
4139   echo $ECHO_N "(cached) $ECHO_C" >&6
4140 else
4141
4142                 cf_save="$CPPFLAGS"
4143
4144         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4145         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4146
4147                 cat >"conftest.$ac_ext" <<_ACEOF
4148 #line 4148 "configure"
4149 #include "confdefs.h"
4150 #include <sys/types.h>
4151 int
4152 main (void)
4153 {
4154
4155                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
4156                                 return 0;
4157                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4158                                 return 0;
4159                         #else
4160                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4161                         #endif
4162   ;
4163   return 0;
4164 }
4165 _ACEOF
4166 rm -f "conftest.$ac_objext"
4167 if { (eval echo "$as_me:4167: \"$ac_compile\"") >&5
4168   (eval $ac_compile) 2>&5
4169   ac_status=$?
4170   echo "$as_me:4170: \$? = $ac_status" >&5
4171   (exit "$ac_status"); } &&
4172          { ac_try='test -s "conftest.$ac_objext"'
4173   { (eval echo "$as_me:4173: \"$ac_try\"") >&5
4174   (eval $ac_try) 2>&5
4175   ac_status=$?
4176   echo "$as_me:4176: \$? = $ac_status" >&5
4177   (exit "$ac_status"); }; }; then
4178   cf_cv_gnu_library_219=yes
4179 else
4180   echo "$as_me: failed program was:" >&5
4181 cat "conftest.$ac_ext" >&5
4182 cf_cv_gnu_library_219=no
4183 fi
4184 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4185                 CPPFLAGS="$cf_save"
4186
4187 fi
4188 echo "$as_me:4188: result: $cf_cv_gnu_library_219" >&5
4189 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4190
4191         if test "x$cf_cv_gnu_library_219" = xyes; then
4192                 cf_save="$CPPFLAGS"
4193                 echo "$as_me:4193: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4194 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4195 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4196   echo $ECHO_N "(cached) $ECHO_C" >&6
4197 else
4198
4199 cf_fix_cppflags=no
4200 cf_new_cflags=
4201 cf_new_cppflags=
4202 cf_new_extra_cppflags=
4203
4204 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4205 do
4206 case "$cf_fix_cppflags" in
4207 (no)
4208         case "$cf_add_cflags" in
4209         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4210                 case "$cf_add_cflags" in
4211                 (-D*)
4212                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4213
4214                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4215                                 && test -z "${cf_tst_cflags}" \
4216                                 && cf_fix_cppflags=yes
4217
4218                         if test "$cf_fix_cppflags" = yes ; then
4219
4220         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4221         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4222
4223                                 continue
4224                         elif test "${cf_tst_cflags}" = "\"'" ; then
4225
4226         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4227         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4228
4229                                 continue
4230                         fi
4231                         ;;
4232                 esac
4233                 case "$CPPFLAGS" in
4234                 (*$cf_add_cflags)
4235                         ;;
4236                 (*)
4237                         case "$cf_add_cflags" in
4238                         (-D*)
4239                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4240
4241 CPPFLAGS=`echo "$CPPFLAGS" | \
4242         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4243                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4244
4245                                 ;;
4246                         esac
4247
4248         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4249         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4250
4251                         ;;
4252                 esac
4253                 ;;
4254         (*)
4255
4256         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4257         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4258
4259                 ;;
4260         esac
4261         ;;
4262 (yes)
4263
4264         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4265         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4266
4267         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4268
4269         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4270                 && test -z "${cf_tst_cflags}" \
4271                 && cf_fix_cppflags=no
4272         ;;
4273 esac
4274 done
4275
4276 if test -n "$cf_new_cflags" ; then
4277
4278         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4279         CFLAGS="${CFLAGS}$cf_new_cflags"
4280
4281 fi
4282
4283 if test -n "$cf_new_cppflags" ; then
4284
4285         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4286         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4287
4288 fi
4289
4290 if test -n "$cf_new_extra_cppflags" ; then
4291
4292         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4293         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4294
4295 fi
4296
4297                         cat >"conftest.$ac_ext" <<_ACEOF
4298 #line 4298 "configure"
4299 #include "confdefs.h"
4300
4301                                 #include <limits.h>
4302                                 #include <sys/types.h>
4303
4304 int
4305 main (void)
4306 {
4307
4308                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4309                                         return 0;
4310                                 #else
4311                                 #       error GNU C library is too old
4312                                 #endif
4313   ;
4314   return 0;
4315 }
4316 _ACEOF
4317 rm -f "conftest.$ac_objext"
4318 if { (eval echo "$as_me:4318: \"$ac_compile\"") >&5
4319   (eval $ac_compile) 2>&5
4320   ac_status=$?
4321   echo "$as_me:4321: \$? = $ac_status" >&5
4322   (exit "$ac_status"); } &&
4323          { ac_try='test -s "conftest.$ac_objext"'
4324   { (eval echo "$as_me:4324: \"$ac_try\"") >&5
4325   (eval $ac_try) 2>&5
4326   ac_status=$?
4327   echo "$as_me:4327: \$? = $ac_status" >&5
4328   (exit "$ac_status"); }; }; then
4329   cf_cv_gnu_dftsrc_219=yes
4330 else
4331   echo "$as_me: failed program was:" >&5
4332 cat "conftest.$ac_ext" >&5
4333 cf_cv_gnu_dftsrc_219=no
4334 fi
4335 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4336
4337 fi
4338 echo "$as_me:4338: result: $cf_cv_gnu_dftsrc_219" >&5
4339 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4340                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4341         else
4342                 cf_cv_gnu_dftsrc_219=maybe
4343         fi
4344
4345         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4346
4347                 echo "$as_me:4347: checking if we must define _GNU_SOURCE" >&5
4348 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4349 if test "${cf_cv_gnu_source+set}" = set; then
4350   echo $ECHO_N "(cached) $ECHO_C" >&6
4351 else
4352
4353                 cat >"conftest.$ac_ext" <<_ACEOF
4354 #line 4354 "configure"
4355 #include "confdefs.h"
4356 #include <sys/types.h>
4357 int
4358 main (void)
4359 {
4360
4361                         #ifndef _XOPEN_SOURCE
4362                         #error  expected _XOPEN_SOURCE to be defined
4363                         #endif
4364   ;
4365   return 0;
4366 }
4367 _ACEOF
4368 rm -f "conftest.$ac_objext"
4369 if { (eval echo "$as_me:4369: \"$ac_compile\"") >&5
4370   (eval $ac_compile) 2>&5
4371   ac_status=$?
4372   echo "$as_me:4372: \$? = $ac_status" >&5
4373   (exit "$ac_status"); } &&
4374          { ac_try='test -s "conftest.$ac_objext"'
4375   { (eval echo "$as_me:4375: \"$ac_try\"") >&5
4376   (eval $ac_try) 2>&5
4377   ac_status=$?
4378   echo "$as_me:4378: \$? = $ac_status" >&5
4379   (exit "$ac_status"); }; }; then
4380   cf_cv_gnu_source=no
4381 else
4382   echo "$as_me: failed program was:" >&5
4383 cat "conftest.$ac_ext" >&5
4384 cf_save="$CPPFLAGS"
4385
4386 cf_fix_cppflags=no
4387 cf_new_cflags=
4388 cf_new_cppflags=
4389 cf_new_extra_cppflags=
4390
4391 for cf_add_cflags in -D_GNU_SOURCE
4392 do
4393 case "$cf_fix_cppflags" in
4394 (no)
4395         case "$cf_add_cflags" in
4396         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4397                 case "$cf_add_cflags" in
4398                 (-D*)
4399                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4400
4401                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4402                                 && test -z "${cf_tst_cflags}" \
4403                                 && cf_fix_cppflags=yes
4404
4405                         if test "$cf_fix_cppflags" = yes ; then
4406
4407         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4408         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4409
4410                                 continue
4411                         elif test "${cf_tst_cflags}" = "\"'" ; then
4412
4413         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4414         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4415
4416                                 continue
4417                         fi
4418                         ;;
4419                 esac
4420                 case "$CPPFLAGS" in
4421                 (*$cf_add_cflags)
4422                         ;;
4423                 (*)
4424                         case "$cf_add_cflags" in
4425                         (-D*)
4426                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4427
4428 CPPFLAGS=`echo "$CPPFLAGS" | \
4429         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4430                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4431
4432                                 ;;
4433                         esac
4434
4435         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4436         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4437
4438                         ;;
4439                 esac
4440                 ;;
4441         (*)
4442
4443         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4444         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4445
4446                 ;;
4447         esac
4448         ;;
4449 (yes)
4450
4451         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4452         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4453
4454         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4455
4456         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4457                 && test -z "${cf_tst_cflags}" \
4458                 && cf_fix_cppflags=no
4459         ;;
4460 esac
4461 done
4462
4463 if test -n "$cf_new_cflags" ; then
4464
4465         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4466         CFLAGS="${CFLAGS}$cf_new_cflags"
4467
4468 fi
4469
4470 if test -n "$cf_new_cppflags" ; then
4471
4472         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4473         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4474
4475 fi
4476
4477 if test -n "$cf_new_extra_cppflags" ; then
4478
4479         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4480         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4481
4482 fi
4483
4484                          cat >"conftest.$ac_ext" <<_ACEOF
4485 #line 4485 "configure"
4486 #include "confdefs.h"
4487 #include <sys/types.h>
4488 int
4489 main (void)
4490 {
4491
4492                                 #ifdef _XOPEN_SOURCE
4493                                 #error  expected _XOPEN_SOURCE to be undefined
4494                                 #endif
4495   ;
4496   return 0;
4497 }
4498 _ACEOF
4499 rm -f "conftest.$ac_objext"
4500 if { (eval echo "$as_me:4500: \"$ac_compile\"") >&5
4501   (eval $ac_compile) 2>&5
4502   ac_status=$?
4503   echo "$as_me:4503: \$? = $ac_status" >&5
4504   (exit "$ac_status"); } &&
4505          { ac_try='test -s "conftest.$ac_objext"'
4506   { (eval echo "$as_me:4506: \"$ac_try\"") >&5
4507   (eval $ac_try) 2>&5
4508   ac_status=$?
4509   echo "$as_me:4509: \$? = $ac_status" >&5
4510   (exit "$ac_status"); }; }; then
4511   cf_cv_gnu_source=no
4512 else
4513   echo "$as_me: failed program was:" >&5
4514 cat "conftest.$ac_ext" >&5
4515 cf_cv_gnu_source=yes
4516 fi
4517 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4518                         CPPFLAGS="$cf_save"
4519
4520 fi
4521 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4522
4523 fi
4524 echo "$as_me:4524: result: $cf_cv_gnu_source" >&5
4525 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4526
4527                 if test "$cf_cv_gnu_source" = yes
4528                 then
4529                 echo "$as_me:4529: checking if we should also define _DEFAULT_SOURCE" >&5
4530 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4531 if test "${cf_cv_default_source+set}" = set; then
4532   echo $ECHO_N "(cached) $ECHO_C" >&6
4533 else
4534
4535         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4536         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4537
4538                         cat >"conftest.$ac_ext" <<_ACEOF
4539 #line 4539 "configure"
4540 #include "confdefs.h"
4541 #include <sys/types.h>
4542 int
4543 main (void)
4544 {
4545
4546                                 #ifdef _DEFAULT_SOURCE
4547                                 #error  expected _DEFAULT_SOURCE to be undefined
4548                                 #endif
4549   ;
4550   return 0;
4551 }
4552 _ACEOF
4553 rm -f "conftest.$ac_objext"
4554 if { (eval echo "$as_me:4554: \"$ac_compile\"") >&5
4555   (eval $ac_compile) 2>&5
4556   ac_status=$?
4557   echo "$as_me:4557: \$? = $ac_status" >&5
4558   (exit "$ac_status"); } &&
4559          { ac_try='test -s "conftest.$ac_objext"'
4560   { (eval echo "$as_me:4560: \"$ac_try\"") >&5
4561   (eval $ac_try) 2>&5
4562   ac_status=$?
4563   echo "$as_me:4563: \$? = $ac_status" >&5
4564   (exit "$ac_status"); }; }; then
4565   cf_cv_default_source=no
4566 else
4567   echo "$as_me: failed program was:" >&5
4568 cat "conftest.$ac_ext" >&5
4569 cf_cv_default_source=yes
4570 fi
4571 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4572
4573 fi
4574 echo "$as_me:4574: result: $cf_cv_default_source" >&5
4575 echo "${ECHO_T}$cf_cv_default_source" >&6
4576                         if test "$cf_cv_default_source" = yes
4577                         then
4578
4579         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4580         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4581
4582                         fi
4583                 fi
4584         fi
4585
4586 fi
4587
4588         ;;
4589 (minix*)
4590         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4591         ;;
4592 (mirbsd*)
4593         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4594         cf_XOPEN_SOURCE=
4595
4596 if test "$cf_cv_posix_visible" = no; then
4597
4598 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4599
4600 cf_save_CFLAGS="$CFLAGS"
4601 cf_save_CPPFLAGS="$CPPFLAGS"
4602
4603 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4604         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4605                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4606
4607 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4608         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4609                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4610
4611 echo "$as_me:4611: checking if we should define _POSIX_C_SOURCE" >&5
4612 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4613 if test "${cf_cv_posix_c_source+set}" = set; then
4614   echo $ECHO_N "(cached) $ECHO_C" >&6
4615 else
4616
4617 echo "${as_me:-configure}:4617: testing if the symbol is already defined go no further ..." 1>&5
4618
4619         cat >"conftest.$ac_ext" <<_ACEOF
4620 #line 4620 "configure"
4621 #include "confdefs.h"
4622 #include <sys/types.h>
4623 int
4624 main (void)
4625 {
4626
4627 #ifndef _POSIX_C_SOURCE
4628 #error _POSIX_C_SOURCE is not defined
4629 #endif
4630   ;
4631   return 0;
4632 }
4633 _ACEOF
4634 rm -f "conftest.$ac_objext"
4635 if { (eval echo "$as_me:4635: \"$ac_compile\"") >&5
4636   (eval $ac_compile) 2>&5
4637   ac_status=$?
4638   echo "$as_me:4638: \$? = $ac_status" >&5
4639   (exit "$ac_status"); } &&
4640          { ac_try='test -s "conftest.$ac_objext"'
4641   { (eval echo "$as_me:4641: \"$ac_try\"") >&5
4642   (eval $ac_try) 2>&5
4643   ac_status=$?
4644   echo "$as_me:4644: \$? = $ac_status" >&5
4645   (exit "$ac_status"); }; }; then
4646   cf_cv_posix_c_source=no
4647 else
4648   echo "$as_me: failed program was:" >&5
4649 cat "conftest.$ac_ext" >&5
4650 cf_want_posix_source=no
4651          case .$cf_POSIX_C_SOURCE in
4652          (.[12]??*)
4653                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4654                 ;;
4655          (.2)
4656                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4657                 cf_want_posix_source=yes
4658                 ;;
4659          (.*)
4660                 cf_want_posix_source=yes
4661                 ;;
4662          esac
4663          if test "$cf_want_posix_source" = yes ; then
4664                 cat >"conftest.$ac_ext" <<_ACEOF
4665 #line 4665 "configure"
4666 #include "confdefs.h"
4667 #include <sys/types.h>
4668 int
4669 main (void)
4670 {
4671
4672 #ifdef _POSIX_SOURCE
4673 #error _POSIX_SOURCE is defined
4674 #endif
4675   ;
4676   return 0;
4677 }
4678 _ACEOF
4679 rm -f "conftest.$ac_objext"
4680 if { (eval echo "$as_me:4680: \"$ac_compile\"") >&5
4681   (eval $ac_compile) 2>&5
4682   ac_status=$?
4683   echo "$as_me:4683: \$? = $ac_status" >&5
4684   (exit "$ac_status"); } &&
4685          { ac_try='test -s "conftest.$ac_objext"'
4686   { (eval echo "$as_me:4686: \"$ac_try\"") >&5
4687   (eval $ac_try) 2>&5
4688   ac_status=$?
4689   echo "$as_me:4689: \$? = $ac_status" >&5
4690   (exit "$ac_status"); }; }; then
4691   :
4692 else
4693   echo "$as_me: failed program was:" >&5
4694 cat "conftest.$ac_ext" >&5
4695 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4696 fi
4697 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4698          fi
4699
4700 echo "${as_me:-configure}:4700: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4701
4702          CFLAGS="$cf_trim_CFLAGS"
4703          CPPFLAGS="$cf_trim_CPPFLAGS"
4704
4705         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4706         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4707
4708 echo "${as_me:-configure}:4708: testing if the second compile does not leave our definition intact error ..." 1>&5
4709
4710          cat >"conftest.$ac_ext" <<_ACEOF
4711 #line 4711 "configure"
4712 #include "confdefs.h"
4713 #include <sys/types.h>
4714 int
4715 main (void)
4716 {
4717
4718 #ifndef _POSIX_C_SOURCE
4719 #error _POSIX_C_SOURCE is not defined
4720 #endif
4721   ;
4722   return 0;
4723 }
4724 _ACEOF
4725 rm -f "conftest.$ac_objext"
4726 if { (eval echo "$as_me:4726: \"$ac_compile\"") >&5
4727   (eval $ac_compile) 2>&5
4728   ac_status=$?
4729   echo "$as_me:4729: \$? = $ac_status" >&5
4730   (exit "$ac_status"); } &&
4731          { ac_try='test -s "conftest.$ac_objext"'
4732   { (eval echo "$as_me:4732: \"$ac_try\"") >&5
4733   (eval $ac_try) 2>&5
4734   ac_status=$?
4735   echo "$as_me:4735: \$? = $ac_status" >&5
4736   (exit "$ac_status"); }; }; then
4737   :
4738 else
4739   echo "$as_me: failed program was:" >&5
4740 cat "conftest.$ac_ext" >&5
4741 cf_cv_posix_c_source=no
4742 fi
4743 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4744          CFLAGS="$cf_save_CFLAGS"
4745          CPPFLAGS="$cf_save_CPPFLAGS"
4746
4747 fi
4748 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4749
4750 fi
4751 echo "$as_me:4751: result: $cf_cv_posix_c_source" >&5
4752 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4753
4754 if test "$cf_cv_posix_c_source" != no ; then
4755         CFLAGS="$cf_trim_CFLAGS"
4756         CPPFLAGS="$cf_trim_CPPFLAGS"
4757
4758 cf_fix_cppflags=no
4759 cf_new_cflags=
4760 cf_new_cppflags=
4761 cf_new_extra_cppflags=
4762
4763 for cf_add_cflags in $cf_cv_posix_c_source
4764 do
4765 case "$cf_fix_cppflags" in
4766 (no)
4767         case "$cf_add_cflags" in
4768         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4769                 case "$cf_add_cflags" in
4770                 (-D*)
4771                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4772
4773                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4774                                 && test -z "${cf_tst_cflags}" \
4775                                 && cf_fix_cppflags=yes
4776
4777                         if test "$cf_fix_cppflags" = yes ; then
4778
4779         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4780         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4781
4782                                 continue
4783                         elif test "${cf_tst_cflags}" = "\"'" ; then
4784
4785         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4786         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4787
4788                                 continue
4789                         fi
4790                         ;;
4791                 esac
4792                 case "$CPPFLAGS" in
4793                 (*$cf_add_cflags)
4794                         ;;
4795                 (*)
4796                         case "$cf_add_cflags" in
4797                         (-D*)
4798                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4799
4800 CPPFLAGS=`echo "$CPPFLAGS" | \
4801         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4802                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4803
4804                                 ;;
4805                         esac
4806
4807         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4808         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4809
4810                         ;;
4811                 esac
4812                 ;;
4813         (*)
4814
4815         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4816         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4817
4818                 ;;
4819         esac
4820         ;;
4821 (yes)
4822
4823         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4824         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4825
4826         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4827
4828         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4829                 && test -z "${cf_tst_cflags}" \
4830                 && cf_fix_cppflags=no
4831         ;;
4832 esac
4833 done
4834
4835 if test -n "$cf_new_cflags" ; then
4836
4837         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4838         CFLAGS="${CFLAGS}$cf_new_cflags"
4839
4840 fi
4841
4842 if test -n "$cf_new_cppflags" ; then
4843
4844         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4845         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4846
4847 fi
4848
4849 if test -n "$cf_new_extra_cppflags" ; then
4850
4851         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4852         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4853
4854 fi
4855
4856 fi
4857
4858 fi # cf_cv_posix_visible
4859
4860         ;;
4861 (netbsd*)
4862         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4863         ;;
4864 (openbsd[6-9]*)
4865         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4866         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4867         # Abusing the conformance level is a workaround.
4868         { echo "$as_me:4868: WARNING: this system does not provide usable locale support" >&5
4869 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4870         cf_xopen_source="-D_BSD_SOURCE"
4871         cf_XOPEN_SOURCE=700
4872         ;;
4873 (openbsd[4-5]*)
4874         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4875         cf_xopen_source="-D_BSD_SOURCE"
4876         cf_XOPEN_SOURCE=600
4877         ;;
4878 (openbsd*)
4879         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4880         ;;
4881 (osf[45]*)
4882         cf_xopen_source="-D_OSF_SOURCE"
4883         ;;
4884 (nto-qnx*)
4885         cf_xopen_source="-D_QNX_SOURCE"
4886         ;;
4887 (sco*)
4888         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4889         ;;
4890 (solaris2.*)
4891         cf_xopen_source="-D__EXTENSIONS__"
4892         cf_cv_xopen_source=broken
4893         ;;
4894 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4895         cf_XOPEN_SOURCE=
4896         cf_POSIX_C_SOURCE=
4897         ;;
4898 (*)
4899
4900 echo "$as_me:4900: checking if we should define _XOPEN_SOURCE" >&5
4901 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4902 if test "${cf_cv_xopen_source+set}" = set; then
4903   echo $ECHO_N "(cached) $ECHO_C" >&6
4904 else
4905
4906         cat >"conftest.$ac_ext" <<_ACEOF
4907 #line 4907 "configure"
4908 #include "confdefs.h"
4909
4910 $ac_includes_default
4911
4912 int
4913 main (void)
4914 {
4915
4916 #ifndef _XOPEN_SOURCE
4917 #error _XOPEN_SOURCE is not defined
4918 #endif
4919
4920   ;
4921   return 0;
4922 }
4923 _ACEOF
4924 rm -f "conftest.$ac_objext"
4925 if { (eval echo "$as_me:4925: \"$ac_compile\"") >&5
4926   (eval $ac_compile) 2>&5
4927   ac_status=$?
4928   echo "$as_me:4928: \$? = $ac_status" >&5
4929   (exit "$ac_status"); } &&
4930          { ac_try='test -s "conftest.$ac_objext"'
4931   { (eval echo "$as_me:4931: \"$ac_try\"") >&5
4932   (eval $ac_try) 2>&5
4933   ac_status=$?
4934   echo "$as_me:4934: \$? = $ac_status" >&5
4935   (exit "$ac_status"); }; }; then
4936   cf_cv_xopen_source=no
4937 else
4938   echo "$as_me: failed program was:" >&5
4939 cat "conftest.$ac_ext" >&5
4940 cf_save="$CPPFLAGS"
4941
4942         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4943         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4944
4945          cat >"conftest.$ac_ext" <<_ACEOF
4946 #line 4946 "configure"
4947 #include "confdefs.h"
4948
4949 $ac_includes_default
4950
4951 int
4952 main (void)
4953 {
4954
4955 #ifndef _XOPEN_SOURCE
4956 #error _XOPEN_SOURCE is not defined
4957 #endif
4958
4959   ;
4960   return 0;
4961 }
4962 _ACEOF
4963 rm -f "conftest.$ac_objext"
4964 if { (eval echo "$as_me:4964: \"$ac_compile\"") >&5
4965   (eval $ac_compile) 2>&5
4966   ac_status=$?
4967   echo "$as_me:4967: \$? = $ac_status" >&5
4968   (exit "$ac_status"); } &&
4969          { ac_try='test -s "conftest.$ac_objext"'
4970   { (eval echo "$as_me:4970: \"$ac_try\"") >&5
4971   (eval $ac_try) 2>&5
4972   ac_status=$?
4973   echo "$as_me:4973: \$? = $ac_status" >&5
4974   (exit "$ac_status"); }; }; then
4975   cf_cv_xopen_source=no
4976 else
4977   echo "$as_me: failed program was:" >&5
4978 cat "conftest.$ac_ext" >&5
4979 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4980 fi
4981 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4982                 CPPFLAGS="$cf_save"
4983
4984 fi
4985 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4986
4987 fi
4988 echo "$as_me:4988: result: $cf_cv_xopen_source" >&5
4989 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4990
4991 if test "$cf_cv_xopen_source" != no ; then
4992
4993 CFLAGS=`echo "$CFLAGS" | \
4994         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4995                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4996
4997 CPPFLAGS=`echo "$CPPFLAGS" | \
4998         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4999                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5000
5001         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5002
5003 for cf_add_cflags in $cf_temp_xopen_source
5004 do
5005         case "x$cf_add_cflags" in
5006         (x-[DU]*)
5007
5008 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5009 while true
5010 do
5011         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5012         test "$CFLAGS" != "$cf_old_cflag" || break
5013
5014         CFLAGS="$cf_old_cflag"
5015 done
5016
5017 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5018 while true
5019 do
5020         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5021         test "$CPPFLAGS" != "$cf_old_cflag" || break
5022
5023         CPPFLAGS="$cf_old_cflag"
5024 done
5025
5026                 ;;
5027         esac
5028
5029 cf_fix_cppflags=no
5030 cf_new_cflags=
5031 cf_new_cppflags=
5032 cf_new_extra_cppflags=
5033
5034 for cf_add_cflags in $cf_add_cflags
5035 do
5036 case "$cf_fix_cppflags" in
5037 (no)
5038         case "$cf_add_cflags" in
5039         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5040                 case "$cf_add_cflags" in
5041                 (-D*)
5042                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5043
5044                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5045                                 && test -z "${cf_tst_cflags}" \
5046                                 && cf_fix_cppflags=yes
5047
5048                         if test "$cf_fix_cppflags" = yes ; then
5049
5050         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5051         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5052
5053                                 continue
5054                         elif test "${cf_tst_cflags}" = "\"'" ; then
5055
5056         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5057         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5058
5059                                 continue
5060                         fi
5061                         ;;
5062                 esac
5063                 case "$CPPFLAGS" in
5064                 (*$cf_add_cflags)
5065                         ;;
5066                 (*)
5067                         case "$cf_add_cflags" in
5068                         (-D*)
5069                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5070
5071 CPPFLAGS=`echo "$CPPFLAGS" | \
5072         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5073                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5074
5075                                 ;;
5076                         esac
5077
5078         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5079         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5080
5081                         ;;
5082                 esac
5083                 ;;
5084         (*)
5085
5086         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5087         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5088
5089                 ;;
5090         esac
5091         ;;
5092 (yes)
5093
5094         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5095         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5096
5097         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5098
5099         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5100                 && test -z "${cf_tst_cflags}" \
5101                 && cf_fix_cppflags=no
5102         ;;
5103 esac
5104 done
5105
5106 if test -n "$cf_new_cflags" ; then
5107
5108         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5109         CFLAGS="${CFLAGS}$cf_new_cflags"
5110
5111 fi
5112
5113 if test -n "$cf_new_cppflags" ; then
5114
5115         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5116         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5117
5118 fi
5119
5120 if test -n "$cf_new_extra_cppflags" ; then
5121
5122         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5123         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5124
5125 fi
5126
5127 done
5128
5129 fi
5130
5131         cf_save_xopen_cppflags="$CPPFLAGS"
5132
5133 if test "$cf_cv_posix_visible" = no; then
5134
5135 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5136
5137 cf_save_CFLAGS="$CFLAGS"
5138 cf_save_CPPFLAGS="$CPPFLAGS"
5139
5140 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5141         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5142                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5143
5144 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5145         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5146                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5147
5148 echo "$as_me:5148: checking if we should define _POSIX_C_SOURCE" >&5
5149 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5150 if test "${cf_cv_posix_c_source+set}" = set; then
5151   echo $ECHO_N "(cached) $ECHO_C" >&6
5152 else
5153
5154 echo "${as_me:-configure}:5154: testing if the symbol is already defined go no further ..." 1>&5
5155
5156         cat >"conftest.$ac_ext" <<_ACEOF
5157 #line 5157 "configure"
5158 #include "confdefs.h"
5159 #include <sys/types.h>
5160 int
5161 main (void)
5162 {
5163
5164 #ifndef _POSIX_C_SOURCE
5165 #error _POSIX_C_SOURCE is not defined
5166 #endif
5167   ;
5168   return 0;
5169 }
5170 _ACEOF
5171 rm -f "conftest.$ac_objext"
5172 if { (eval echo "$as_me:5172: \"$ac_compile\"") >&5
5173   (eval $ac_compile) 2>&5
5174   ac_status=$?
5175   echo "$as_me:5175: \$? = $ac_status" >&5
5176   (exit "$ac_status"); } &&
5177          { ac_try='test -s "conftest.$ac_objext"'
5178   { (eval echo "$as_me:5178: \"$ac_try\"") >&5
5179   (eval $ac_try) 2>&5
5180   ac_status=$?
5181   echo "$as_me:5181: \$? = $ac_status" >&5
5182   (exit "$ac_status"); }; }; then
5183   cf_cv_posix_c_source=no
5184 else
5185   echo "$as_me: failed program was:" >&5
5186 cat "conftest.$ac_ext" >&5
5187 cf_want_posix_source=no
5188          case .$cf_POSIX_C_SOURCE in
5189          (.[12]??*)
5190                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5191                 ;;
5192          (.2)
5193                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5194                 cf_want_posix_source=yes
5195                 ;;
5196          (.*)
5197                 cf_want_posix_source=yes
5198                 ;;
5199          esac
5200          if test "$cf_want_posix_source" = yes ; then
5201                 cat >"conftest.$ac_ext" <<_ACEOF
5202 #line 5202 "configure"
5203 #include "confdefs.h"
5204 #include <sys/types.h>
5205 int
5206 main (void)
5207 {
5208
5209 #ifdef _POSIX_SOURCE
5210 #error _POSIX_SOURCE is defined
5211 #endif
5212   ;
5213   return 0;
5214 }
5215 _ACEOF
5216 rm -f "conftest.$ac_objext"
5217 if { (eval echo "$as_me:5217: \"$ac_compile\"") >&5
5218   (eval $ac_compile) 2>&5
5219   ac_status=$?
5220   echo "$as_me:5220: \$? = $ac_status" >&5
5221   (exit "$ac_status"); } &&
5222          { ac_try='test -s "conftest.$ac_objext"'
5223   { (eval echo "$as_me:5223: \"$ac_try\"") >&5
5224   (eval $ac_try) 2>&5
5225   ac_status=$?
5226   echo "$as_me:5226: \$? = $ac_status" >&5
5227   (exit "$ac_status"); }; }; then
5228   :
5229 else
5230   echo "$as_me: failed program was:" >&5
5231 cat "conftest.$ac_ext" >&5
5232 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5233 fi
5234 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5235          fi
5236
5237 echo "${as_me:-configure}:5237: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5238
5239          CFLAGS="$cf_trim_CFLAGS"
5240          CPPFLAGS="$cf_trim_CPPFLAGS"
5241
5242         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5243         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5244
5245 echo "${as_me:-configure}:5245: testing if the second compile does not leave our definition intact error ..." 1>&5
5246
5247          cat >"conftest.$ac_ext" <<_ACEOF
5248 #line 5248 "configure"
5249 #include "confdefs.h"
5250 #include <sys/types.h>
5251 int
5252 main (void)
5253 {
5254
5255 #ifndef _POSIX_C_SOURCE
5256 #error _POSIX_C_SOURCE is not defined
5257 #endif
5258   ;
5259   return 0;
5260 }
5261 _ACEOF
5262 rm -f "conftest.$ac_objext"
5263 if { (eval echo "$as_me:5263: \"$ac_compile\"") >&5
5264   (eval $ac_compile) 2>&5
5265   ac_status=$?
5266   echo "$as_me:5266: \$? = $ac_status" >&5
5267   (exit "$ac_status"); } &&
5268          { ac_try='test -s "conftest.$ac_objext"'
5269   { (eval echo "$as_me:5269: \"$ac_try\"") >&5
5270   (eval $ac_try) 2>&5
5271   ac_status=$?
5272   echo "$as_me:5272: \$? = $ac_status" >&5
5273   (exit "$ac_status"); }; }; then
5274   :
5275 else
5276   echo "$as_me: failed program was:" >&5
5277 cat "conftest.$ac_ext" >&5
5278 cf_cv_posix_c_source=no
5279 fi
5280 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5281          CFLAGS="$cf_save_CFLAGS"
5282          CPPFLAGS="$cf_save_CPPFLAGS"
5283
5284 fi
5285 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5286
5287 fi
5288 echo "$as_me:5288: result: $cf_cv_posix_c_source" >&5
5289 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5290
5291 if test "$cf_cv_posix_c_source" != no ; then
5292         CFLAGS="$cf_trim_CFLAGS"
5293         CPPFLAGS="$cf_trim_CPPFLAGS"
5294
5295 cf_fix_cppflags=no
5296 cf_new_cflags=
5297 cf_new_cppflags=
5298 cf_new_extra_cppflags=
5299
5300 for cf_add_cflags in $cf_cv_posix_c_source
5301 do
5302 case "$cf_fix_cppflags" in
5303 (no)
5304         case "$cf_add_cflags" in
5305         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5306                 case "$cf_add_cflags" in
5307                 (-D*)
5308                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5309
5310                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5311                                 && test -z "${cf_tst_cflags}" \
5312                                 && cf_fix_cppflags=yes
5313
5314                         if test "$cf_fix_cppflags" = yes ; then
5315
5316         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5317         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5318
5319                                 continue
5320                         elif test "${cf_tst_cflags}" = "\"'" ; then
5321
5322         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5323         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5324
5325                                 continue
5326                         fi
5327                         ;;
5328                 esac
5329                 case "$CPPFLAGS" in
5330                 (*$cf_add_cflags)
5331                         ;;
5332                 (*)
5333                         case "$cf_add_cflags" in
5334                         (-D*)
5335                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5336
5337 CPPFLAGS=`echo "$CPPFLAGS" | \
5338         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5339                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5340
5341                                 ;;
5342                         esac
5343
5344         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5345         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5346
5347                         ;;
5348                 esac
5349                 ;;
5350         (*)
5351
5352         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5353         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5354
5355                 ;;
5356         esac
5357         ;;
5358 (yes)
5359
5360         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5361         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5362
5363         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5364
5365         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5366                 && test -z "${cf_tst_cflags}" \
5367                 && cf_fix_cppflags=no
5368         ;;
5369 esac
5370 done
5371
5372 if test -n "$cf_new_cflags" ; then
5373
5374         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5375         CFLAGS="${CFLAGS}$cf_new_cflags"
5376
5377 fi
5378
5379 if test -n "$cf_new_cppflags" ; then
5380
5381         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5382         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5383
5384 fi
5385
5386 if test -n "$cf_new_extra_cppflags" ; then
5387
5388         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5389         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5390
5391 fi
5392
5393 fi
5394
5395 fi # cf_cv_posix_visible
5396
5397         # Some of these niche implementations use copy/paste, double-check...
5398         if test "$cf_cv_xopen_source" != no ; then
5399                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
5400
5401 echo "${as_me:-configure}:5401: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
5402
5403                 cat >"conftest.$ac_ext" <<_ACEOF
5404 #line 5404 "configure"
5405 #include "confdefs.h"
5406
5407 $ac_includes_default
5408
5409 int
5410 main (void)
5411 {
5412
5413 #ifndef _XOPEN_SOURCE
5414 #error _XOPEN_SOURCE is not defined
5415 #endif
5416
5417   ;
5418   return 0;
5419 }
5420 _ACEOF
5421 rm -f "conftest.$ac_objext"
5422 if { (eval echo "$as_me:5422: \"$ac_compile\"") >&5
5423   (eval $ac_compile) 2>&5
5424   ac_status=$?
5425   echo "$as_me:5425: \$? = $ac_status" >&5
5426   (exit "$ac_status"); } &&
5427          { ac_try='test -s "conftest.$ac_objext"'
5428   { (eval echo "$as_me:5428: \"$ac_try\"") >&5
5429   (eval $ac_try) 2>&5
5430   ac_status=$?
5431   echo "$as_me:5431: \$? = $ac_status" >&5
5432   (exit "$ac_status"); }; }; then
5433   :
5434 else
5435   echo "$as_me: failed program was:" >&5
5436 cat "conftest.$ac_ext" >&5
5437
5438                         { echo "$as_me:5438: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
5439 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
5440                         CPPFLAGS="$cf_save_xopen_cppflags"
5441 fi
5442 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5443         fi
5444         ;;
5445 esac
5446
5447 if test -n "$cf_xopen_source" ; then
5448
5449 for cf_add_cflags in $cf_xopen_source
5450 do
5451         case "x$cf_add_cflags" in
5452         (x-[DU]*)
5453
5454 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5455 while true
5456 do
5457         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5458         test "$CFLAGS" != "$cf_old_cflag" || break
5459         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
5460
5461 echo "${as_me:-configure}:5461: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
5462
5463         CFLAGS="$cf_old_cflag"
5464 done
5465
5466 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5467 while true
5468 do
5469         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5470         test "$CPPFLAGS" != "$cf_old_cflag" || break
5471         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
5472
5473 echo "${as_me:-configure}:5473: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
5474
5475         CPPFLAGS="$cf_old_cflag"
5476 done
5477
5478                 ;;
5479         esac
5480
5481 cf_fix_cppflags=no
5482 cf_new_cflags=
5483 cf_new_cppflags=
5484 cf_new_extra_cppflags=
5485
5486 for cf_add_cflags in $cf_add_cflags
5487 do
5488 case "$cf_fix_cppflags" in
5489 (no)
5490         case "$cf_add_cflags" in
5491         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5492                 case "$cf_add_cflags" in
5493                 (-D*)
5494                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5495
5496                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5497                                 && test -z "${cf_tst_cflags}" \
5498                                 && cf_fix_cppflags=yes
5499
5500                         if test "$cf_fix_cppflags" = yes ; then
5501
5502         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5503         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5504
5505                                 continue
5506                         elif test "${cf_tst_cflags}" = "\"'" ; then
5507
5508         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5509         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5510
5511                                 continue
5512                         fi
5513                         ;;
5514                 esac
5515                 case "$CPPFLAGS" in
5516                 (*$cf_add_cflags)
5517                         ;;
5518                 (*)
5519                         case "$cf_add_cflags" in
5520                         (-D*)
5521                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5522
5523 CPPFLAGS=`echo "$CPPFLAGS" | \
5524         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5525                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5526
5527                                 ;;
5528                         esac
5529
5530         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5531         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5532
5533                         ;;
5534                 esac
5535                 ;;
5536         (*)
5537
5538         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5539         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5540
5541                 ;;
5542         esac
5543         ;;
5544 (yes)
5545
5546         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5547         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5548
5549         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5550
5551         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5552                 && test -z "${cf_tst_cflags}" \
5553                 && cf_fix_cppflags=no
5554         ;;
5555 esac
5556 done
5557
5558 if test -n "$cf_new_cflags" ; then
5559         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5560
5561 echo "${as_me:-configure}:5561: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5562
5563         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5564         CFLAGS="${CFLAGS}$cf_new_cflags"
5565
5566 fi
5567
5568 if test -n "$cf_new_cppflags" ; then
5569         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5570
5571 echo "${as_me:-configure}:5571: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5572
5573         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5574         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5575
5576 fi
5577
5578 if test -n "$cf_new_extra_cppflags" ; then
5579         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5580
5581 echo "${as_me:-configure}:5581: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5582
5583         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5584         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5585
5586 fi
5587
5588 done
5589
5590 fi
5591
5592 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5593         echo "$as_me:5593: checking if _XOPEN_SOURCE really is set" >&5
5594 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5595         cat >"conftest.$ac_ext" <<_ACEOF
5596 #line 5596 "configure"
5597 #include "confdefs.h"
5598 #include <stdlib.h>
5599 int
5600 main (void)
5601 {
5602
5603 #ifndef _XOPEN_SOURCE
5604 #error _XOPEN_SOURCE is not defined
5605 #endif
5606   ;
5607   return 0;
5608 }
5609 _ACEOF
5610 rm -f "conftest.$ac_objext"
5611 if { (eval echo "$as_me:5611: \"$ac_compile\"") >&5
5612   (eval $ac_compile) 2>&5
5613   ac_status=$?
5614   echo "$as_me:5614: \$? = $ac_status" >&5
5615   (exit "$ac_status"); } &&
5616          { ac_try='test -s "conftest.$ac_objext"'
5617   { (eval echo "$as_me:5617: \"$ac_try\"") >&5
5618   (eval $ac_try) 2>&5
5619   ac_status=$?
5620   echo "$as_me:5620: \$? = $ac_status" >&5
5621   (exit "$ac_status"); }; }; then
5622   cf_XOPEN_SOURCE_set=yes
5623 else
5624   echo "$as_me: failed program was:" >&5
5625 cat "conftest.$ac_ext" >&5
5626 cf_XOPEN_SOURCE_set=no
5627 fi
5628 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5629         echo "$as_me:5629: result: $cf_XOPEN_SOURCE_set" >&5
5630 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5631         if test "$cf_XOPEN_SOURCE_set" = yes
5632         then
5633                 cat >"conftest.$ac_ext" <<_ACEOF
5634 #line 5634 "configure"
5635 #include "confdefs.h"
5636 #include <stdlib.h>
5637 int
5638 main (void)
5639 {
5640
5641 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5642 #error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5643 #endif
5644   ;
5645   return 0;
5646 }
5647 _ACEOF
5648 rm -f "conftest.$ac_objext"
5649 if { (eval echo "$as_me:5649: \"$ac_compile\"") >&5
5650   (eval $ac_compile) 2>&5
5651   ac_status=$?
5652   echo "$as_me:5652: \$? = $ac_status" >&5
5653   (exit "$ac_status"); } &&
5654          { ac_try='test -s "conftest.$ac_objext"'
5655   { (eval echo "$as_me:5655: \"$ac_try\"") >&5
5656   (eval $ac_try) 2>&5
5657   ac_status=$?
5658   echo "$as_me:5658: \$? = $ac_status" >&5
5659   (exit "$ac_status"); }; }; then
5660   cf_XOPEN_SOURCE_set_ok=yes
5661 else
5662   echo "$as_me: failed program was:" >&5
5663 cat "conftest.$ac_ext" >&5
5664 cf_XOPEN_SOURCE_set_ok=no
5665 fi
5666 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5667                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5668                 then
5669                         { echo "$as_me:5669: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5670 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5671                 fi
5672         else
5673
5674 echo "$as_me:5674: checking if we should define _XOPEN_SOURCE" >&5
5675 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5676 if test "${cf_cv_xopen_source+set}" = set; then
5677   echo $ECHO_N "(cached) $ECHO_C" >&6
5678 else
5679
5680         cat >"conftest.$ac_ext" <<_ACEOF
5681 #line 5681 "configure"
5682 #include "confdefs.h"
5683
5684 $ac_includes_default
5685
5686 int
5687 main (void)
5688 {
5689
5690 #ifndef _XOPEN_SOURCE
5691 #error _XOPEN_SOURCE is not defined
5692 #endif
5693
5694   ;
5695   return 0;
5696 }
5697 _ACEOF
5698 rm -f "conftest.$ac_objext"
5699 if { (eval echo "$as_me:5699: \"$ac_compile\"") >&5
5700   (eval $ac_compile) 2>&5
5701   ac_status=$?
5702   echo "$as_me:5702: \$? = $ac_status" >&5
5703   (exit "$ac_status"); } &&
5704          { ac_try='test -s "conftest.$ac_objext"'
5705   { (eval echo "$as_me:5705: \"$ac_try\"") >&5
5706   (eval $ac_try) 2>&5
5707   ac_status=$?
5708   echo "$as_me:5708: \$? = $ac_status" >&5
5709   (exit "$ac_status"); }; }; then
5710   cf_cv_xopen_source=no
5711 else
5712   echo "$as_me: failed program was:" >&5
5713 cat "conftest.$ac_ext" >&5
5714 cf_save="$CPPFLAGS"
5715
5716         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5717         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5718
5719          cat >"conftest.$ac_ext" <<_ACEOF
5720 #line 5720 "configure"
5721 #include "confdefs.h"
5722
5723 $ac_includes_default
5724
5725 int
5726 main (void)
5727 {
5728
5729 #ifndef _XOPEN_SOURCE
5730 #error _XOPEN_SOURCE is not defined
5731 #endif
5732
5733   ;
5734   return 0;
5735 }
5736 _ACEOF
5737 rm -f "conftest.$ac_objext"
5738 if { (eval echo "$as_me:5738: \"$ac_compile\"") >&5
5739   (eval $ac_compile) 2>&5
5740   ac_status=$?
5741   echo "$as_me:5741: \$? = $ac_status" >&5
5742   (exit "$ac_status"); } &&
5743          { ac_try='test -s "conftest.$ac_objext"'
5744   { (eval echo "$as_me:5744: \"$ac_try\"") >&5
5745   (eval $ac_try) 2>&5
5746   ac_status=$?
5747   echo "$as_me:5747: \$? = $ac_status" >&5
5748   (exit "$ac_status"); }; }; then
5749   cf_cv_xopen_source=no
5750 else
5751   echo "$as_me: failed program was:" >&5
5752 cat "conftest.$ac_ext" >&5
5753 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5754 fi
5755 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5756                 CPPFLAGS="$cf_save"
5757
5758 fi
5759 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5760
5761 fi
5762 echo "$as_me:5762: result: $cf_cv_xopen_source" >&5
5763 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5764
5765 if test "$cf_cv_xopen_source" != no ; then
5766
5767 CFLAGS=`echo "$CFLAGS" | \
5768         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5769                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5770
5771 CPPFLAGS=`echo "$CPPFLAGS" | \
5772         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5773                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5774
5775         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5776
5777 for cf_add_cflags in $cf_temp_xopen_source
5778 do
5779         case "x$cf_add_cflags" in
5780         (x-[DU]*)
5781
5782 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5783 while true
5784 do
5785         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5786         test "$CFLAGS" != "$cf_old_cflag" || break
5787
5788         CFLAGS="$cf_old_cflag"
5789 done
5790
5791 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5792 while true
5793 do
5794         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5795         test "$CPPFLAGS" != "$cf_old_cflag" || break
5796
5797         CPPFLAGS="$cf_old_cflag"
5798 done
5799
5800                 ;;
5801         esac
5802
5803 cf_fix_cppflags=no
5804 cf_new_cflags=
5805 cf_new_cppflags=
5806 cf_new_extra_cppflags=
5807
5808 for cf_add_cflags in $cf_add_cflags
5809 do
5810 case "$cf_fix_cppflags" in
5811 (no)
5812         case "$cf_add_cflags" in
5813         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5814                 case "$cf_add_cflags" in
5815                 (-D*)
5816                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5817
5818                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5819                                 && test -z "${cf_tst_cflags}" \
5820                                 && cf_fix_cppflags=yes
5821
5822                         if test "$cf_fix_cppflags" = yes ; then
5823
5824         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5825         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5826
5827                                 continue
5828                         elif test "${cf_tst_cflags}" = "\"'" ; then
5829
5830         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5831         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5832
5833                                 continue
5834                         fi
5835                         ;;
5836                 esac
5837                 case "$CPPFLAGS" in
5838                 (*$cf_add_cflags)
5839                         ;;
5840                 (*)
5841                         case "$cf_add_cflags" in
5842                         (-D*)
5843                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5844
5845 CPPFLAGS=`echo "$CPPFLAGS" | \
5846         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5847                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5848
5849                                 ;;
5850                         esac
5851
5852         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5853         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5854
5855                         ;;
5856                 esac
5857                 ;;
5858         (*)
5859
5860         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5861         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5862
5863                 ;;
5864         esac
5865         ;;
5866 (yes)
5867
5868         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5869         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5870
5871         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5872
5873         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5874                 && test -z "${cf_tst_cflags}" \
5875                 && cf_fix_cppflags=no
5876         ;;
5877 esac
5878 done
5879
5880 if test -n "$cf_new_cflags" ; then
5881
5882         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5883         CFLAGS="${CFLAGS}$cf_new_cflags"
5884
5885 fi
5886
5887 if test -n "$cf_new_cppflags" ; then
5888
5889         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5890         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5891
5892 fi
5893
5894 if test -n "$cf_new_extra_cppflags" ; then
5895
5896         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5897         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5898
5899 fi
5900
5901 done
5902
5903 fi
5904
5905         fi
5906 fi
5907 fi # cf_cv_posix_visible
5908
5909 echo "$as_me:5909: checking for ANSI C header files" >&5
5910 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
5911 if test "${ac_cv_header_stdc+set}" = set; then
5912   echo $ECHO_N "(cached) $ECHO_C" >&6
5913 else
5914   cat >"conftest.$ac_ext" <<_ACEOF
5915 #line 5915 "configure"
5916 #include "confdefs.h"
5917 #include <stdlib.h>
5918 #include <stdarg.h>
5919 #include <string.h>
5920 #include <float.h>
5921
5922 _ACEOF
5923 if { (eval echo "$as_me:5923: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5924   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5925   ac_status=$?
5926   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5927   rm -f conftest.er1
5928   cat conftest.err >&5
5929   echo "$as_me:5929: \$? = $ac_status" >&5
5930   (exit "$ac_status"); } >/dev/null; then
5931   if test -s conftest.err; then
5932     ac_cpp_err=$ac_c_preproc_warn_flag
5933   else
5934     ac_cpp_err=
5935   fi
5936 else
5937   ac_cpp_err=yes
5938 fi
5939 if test -z "$ac_cpp_err"; then
5940   ac_cv_header_stdc=yes
5941 else
5942   echo "$as_me: failed program was:" >&5
5943   cat "conftest.$ac_ext" >&5
5944   ac_cv_header_stdc=no
5945 fi
5946 rm -f conftest.err "conftest.$ac_ext"
5947
5948 if test $ac_cv_header_stdc = yes; then
5949   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5950   cat >"conftest.$ac_ext" <<_ACEOF
5951 #line 5951 "configure"
5952 #include "confdefs.h"
5953 #include <string.h>
5954
5955 _ACEOF
5956 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5957   $EGREP "memchr" >/dev/null 2>&1; then
5958   :
5959 else
5960   ac_cv_header_stdc=no
5961 fi
5962 rm -rf conftest*
5963
5964 fi
5965
5966 if test $ac_cv_header_stdc = yes; then
5967   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5968   cat >"conftest.$ac_ext" <<_ACEOF
5969 #line 5969 "configure"
5970 #include "confdefs.h"
5971 #include <stdlib.h>
5972
5973 _ACEOF
5974 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5975   $EGREP "free" >/dev/null 2>&1; then
5976   :
5977 else
5978   ac_cv_header_stdc=no
5979 fi
5980 rm -rf conftest*
5981
5982 fi
5983
5984 if test $ac_cv_header_stdc = yes; then
5985   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5986   if test "$cross_compiling" = yes; then
5987   :
5988 else
5989   cat >"conftest.$ac_ext" <<_ACEOF
5990 #line 5990 "configure"
5991 #include "confdefs.h"
5992 #include <ctype.h>
5993 #if ((' ' & 0x0FF) == 0x020)
5994 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5995 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5996 #else
5997 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
5998                      || ('j' <= (c) && (c) <= 'r') \
5999                      || ('s' <= (c) && (c) <= 'z'))
6000 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
6001 #endif
6002
6003 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6004 int
6005 main (void)
6006 {
6007   int i;
6008   for (i = 0; i < 256; i++)
6009     if (XOR (islower (i), ISLOWER (i))
6010         || toupper (i) != TOUPPER (i))
6011       $ac_main_return(2);
6012   $ac_main_return (0);
6013 }
6014 _ACEOF
6015 rm -f "conftest$ac_exeext"
6016 if { (eval echo "$as_me:6016: \"$ac_link\"") >&5
6017   (eval $ac_link) 2>&5
6018   ac_status=$?
6019   echo "$as_me:6019: \$? = $ac_status" >&5
6020   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6021   { (eval echo "$as_me:6021: \"$ac_try\"") >&5
6022   (eval $ac_try) 2>&5
6023   ac_status=$?
6024   echo "$as_me:6024: \$? = $ac_status" >&5
6025   (exit "$ac_status"); }; }; then
6026   :
6027 else
6028   echo "$as_me: program exited with status $ac_status" >&5
6029 echo "$as_me: failed program was:" >&5
6030 cat "conftest.$ac_ext" >&5
6031 ac_cv_header_stdc=no
6032 fi
6033 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6034 fi
6035 fi
6036 fi
6037 echo "$as_me:6037: result: $ac_cv_header_stdc" >&5
6038 echo "${ECHO_T}$ac_cv_header_stdc" >&6
6039 if test $ac_cv_header_stdc = yes; then
6040
6041 cat >>confdefs.h <<\EOF
6042 #define STDC_HEADERS 1
6043 EOF
6044
6045 fi
6046
6047 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
6048
6049 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
6050                   inttypes.h stdint.h unistd.h
6051 do
6052 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6053 echo "$as_me:6053: checking for $ac_header" >&5
6054 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6055 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6056   echo $ECHO_N "(cached) $ECHO_C" >&6
6057 else
6058   cat >"conftest.$ac_ext" <<_ACEOF
6059 #line 6059 "configure"
6060 #include "confdefs.h"
6061 $ac_includes_default
6062 #include <$ac_header>
6063 _ACEOF
6064 rm -f "conftest.$ac_objext"
6065 if { (eval echo "$as_me:6065: \"$ac_compile\"") >&5
6066   (eval $ac_compile) 2>&5
6067   ac_status=$?
6068   echo "$as_me:6068: \$? = $ac_status" >&5
6069   (exit "$ac_status"); } &&
6070          { ac_try='test -s "conftest.$ac_objext"'
6071   { (eval echo "$as_me:6071: \"$ac_try\"") >&5
6072   (eval $ac_try) 2>&5
6073   ac_status=$?
6074   echo "$as_me:6074: \$? = $ac_status" >&5
6075   (exit "$ac_status"); }; }; then
6076   eval "$as_ac_Header=yes"
6077 else
6078   echo "$as_me: failed program was:" >&5
6079 cat "conftest.$ac_ext" >&5
6080 eval "$as_ac_Header=no"
6081 fi
6082 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6083 fi
6084 echo "$as_me:6084: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6085 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6086 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6087   cat >>confdefs.h <<EOF
6088 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6089 EOF
6090
6091 fi
6092 done
6093
6094 echo "$as_me:6094: checking whether exit is declared" >&5
6095 echo $ECHO_N "checking whether exit is declared... $ECHO_C" >&6
6096 if test "${ac_cv_have_decl_exit+set}" = set; then
6097   echo $ECHO_N "(cached) $ECHO_C" >&6
6098 else
6099   cat >"conftest.$ac_ext" <<_ACEOF
6100 #line 6100 "configure"
6101 #include "confdefs.h"
6102 $ac_includes_default
6103 int
6104 main (void)
6105 {
6106 #ifndef exit
6107   char *p = (char *) exit; (void) p;
6108 #endif
6109
6110   ;
6111   return 0;
6112 }
6113 _ACEOF
6114 rm -f "conftest.$ac_objext"
6115 if { (eval echo "$as_me:6115: \"$ac_compile\"") >&5
6116   (eval $ac_compile) 2>&5
6117   ac_status=$?
6118   echo "$as_me:6118: \$? = $ac_status" >&5
6119   (exit "$ac_status"); } &&
6120          { ac_try='test -s "conftest.$ac_objext"'
6121   { (eval echo "$as_me:6121: \"$ac_try\"") >&5
6122   (eval $ac_try) 2>&5
6123   ac_status=$?
6124   echo "$as_me:6124: \$? = $ac_status" >&5
6125   (exit "$ac_status"); }; }; then
6126   ac_cv_have_decl_exit=yes
6127 else
6128   echo "$as_me: failed program was:" >&5
6129 cat "conftest.$ac_ext" >&5
6130 ac_cv_have_decl_exit=no
6131 fi
6132 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6133 fi
6134 echo "$as_me:6134: result: $ac_cv_have_decl_exit" >&5
6135 echo "${ECHO_T}$ac_cv_have_decl_exit" >&6
6136
6137 echo "$as_me:6137: checking for signal global datatype" >&5
6138 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
6139 if test "${cf_cv_sig_atomic_t+set}" = set; then
6140   echo $ECHO_N "(cached) $ECHO_C" >&6
6141 else
6142
6143         for cf_type in \
6144                 "volatile sig_atomic_t" \
6145                 "sig_atomic_t" \
6146                 "int"
6147         do
6148         cat >"conftest.$ac_ext" <<_ACEOF
6149 #line 6149 "configure"
6150 #include "confdefs.h"
6151
6152 #include <sys/types.h>
6153 #include <signal.h>
6154 #include <stdio.h>
6155
6156 extern $cf_type x;
6157 $cf_type x;
6158 static void handler(int sig)
6159 {
6160         (void)sig;
6161         x = 5;
6162 }
6163 int
6164 main (void)
6165 {
6166 signal(SIGINT, handler);
6167                  x = 1
6168   ;
6169   return 0;
6170 }
6171 _ACEOF
6172 rm -f "conftest.$ac_objext"
6173 if { (eval echo "$as_me:6173: \"$ac_compile\"") >&5
6174   (eval $ac_compile) 2>&5
6175   ac_status=$?
6176   echo "$as_me:6176: \$? = $ac_status" >&5
6177   (exit "$ac_status"); } &&
6178          { ac_try='test -s "conftest.$ac_objext"'
6179   { (eval echo "$as_me:6179: \"$ac_try\"") >&5
6180   (eval $ac_try) 2>&5
6181   ac_status=$?
6182   echo "$as_me:6182: \$? = $ac_status" >&5
6183   (exit "$ac_status"); }; }; then
6184   cf_cv_sig_atomic_t=$cf_type
6185 else
6186   echo "$as_me: failed program was:" >&5
6187 cat "conftest.$ac_ext" >&5
6188 cf_cv_sig_atomic_t=no
6189 fi
6190 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6191                 test "$cf_cv_sig_atomic_t" != no && break
6192         done
6193
6194 fi
6195
6196 echo "$as_me:6196: result: $cf_cv_sig_atomic_t" >&5
6197 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
6198 test "$cf_cv_sig_atomic_t" != no &&
6199 cat >>confdefs.h <<EOF
6200 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
6201 EOF
6202
6203 # Work around breakage on OS X
6204
6205 echo "$as_me:6205: checking if SIGWINCH is defined" >&5
6206 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
6207 if test "${cf_cv_define_sigwinch+set}" = set; then
6208   echo $ECHO_N "(cached) $ECHO_C" >&6
6209 else
6210
6211         cat >"conftest.$ac_ext" <<_ACEOF
6212 #line 6212 "configure"
6213 #include "confdefs.h"
6214
6215 #include <sys/types.h>
6216 #include <sys/signal.h>
6217
6218 int
6219 main (void)
6220 {
6221 int x = SIGWINCH; (void)x
6222   ;
6223   return 0;
6224 }
6225 _ACEOF
6226 rm -f "conftest.$ac_objext"
6227 if { (eval echo "$as_me:6227: \"$ac_compile\"") >&5
6228   (eval $ac_compile) 2>&5
6229   ac_status=$?
6230   echo "$as_me:6230: \$? = $ac_status" >&5
6231   (exit "$ac_status"); } &&
6232          { ac_try='test -s "conftest.$ac_objext"'
6233   { (eval echo "$as_me:6233: \"$ac_try\"") >&5
6234   (eval $ac_try) 2>&5
6235   ac_status=$?
6236   echo "$as_me:6236: \$? = $ac_status" >&5
6237   (exit "$ac_status"); }; }; then
6238   cf_cv_define_sigwinch=yes
6239 else
6240   echo "$as_me: failed program was:" >&5
6241 cat "conftest.$ac_ext" >&5
6242 cat >"conftest.$ac_ext" <<_ACEOF
6243 #line 6243 "configure"
6244 #include "confdefs.h"
6245
6246 #undef _XOPEN_SOURCE
6247 #undef _POSIX_SOURCE
6248 #undef _POSIX_C_SOURCE
6249 #include <sys/types.h>
6250 #include <sys/signal.h>
6251
6252 int
6253 main (void)
6254 {
6255 int x = SIGWINCH; (void)x
6256   ;
6257   return 0;
6258 }
6259 _ACEOF
6260 rm -f "conftest.$ac_objext"
6261 if { (eval echo "$as_me:6261: \"$ac_compile\"") >&5
6262   (eval $ac_compile) 2>&5
6263   ac_status=$?
6264   echo "$as_me:6264: \$? = $ac_status" >&5
6265   (exit "$ac_status"); } &&
6266          { ac_try='test -s "conftest.$ac_objext"'
6267   { (eval echo "$as_me:6267: \"$ac_try\"") >&5
6268   (eval $ac_try) 2>&5
6269   ac_status=$?
6270   echo "$as_me:6270: \$? = $ac_status" >&5
6271   (exit "$ac_status"); }; }; then
6272   cf_cv_define_sigwinch=maybe
6273 else
6274   echo "$as_me: failed program was:" >&5
6275 cat "conftest.$ac_ext" >&5
6276 cf_cv_define_sigwinch=no
6277 fi
6278 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6279
6280 fi
6281 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6282
6283 fi
6284 echo "$as_me:6284: result: $cf_cv_define_sigwinch" >&5
6285 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
6286
6287 if test "$cf_cv_define_sigwinch" = maybe ; then
6288 echo "$as_me:6288: checking for actual SIGWINCH definition" >&5
6289 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
6290 if test "${cf_cv_fixup_sigwinch+set}" = set; then
6291   echo $ECHO_N "(cached) $ECHO_C" >&6
6292 else
6293
6294 cf_cv_fixup_sigwinch=unknown
6295 cf_sigwinch=32
6296 while test "$cf_sigwinch" != 1
6297 do
6298         cat >"conftest.$ac_ext" <<_ACEOF
6299 #line 6299 "configure"
6300 #include "confdefs.h"
6301
6302 #undef _XOPEN_SOURCE
6303 #undef _POSIX_SOURCE
6304 #undef _POSIX_C_SOURCE
6305 #include <sys/types.h>
6306 #include <sys/signal.h>
6307
6308 int
6309 main (void)
6310 {
6311
6312 #if SIGWINCH != $cf_sigwinch
6313 #error SIGWINCH is not $cf_sigwinch
6314 #endif
6315 int x = SIGWINCH; (void)x
6316   ;
6317   return 0;
6318 }
6319 _ACEOF
6320 rm -f "conftest.$ac_objext"
6321 if { (eval echo "$as_me:6321: \"$ac_compile\"") >&5
6322   (eval $ac_compile) 2>&5
6323   ac_status=$?
6324   echo "$as_me:6324: \$? = $ac_status" >&5
6325   (exit "$ac_status"); } &&
6326          { ac_try='test -s "conftest.$ac_objext"'
6327   { (eval echo "$as_me:6327: \"$ac_try\"") >&5
6328   (eval $ac_try) 2>&5
6329   ac_status=$?
6330   echo "$as_me:6330: \$? = $ac_status" >&5
6331   (exit "$ac_status"); }; }; then
6332   cf_cv_fixup_sigwinch=$cf_sigwinch
6333          break
6334 else
6335   echo "$as_me: failed program was:" >&5
6336 cat "conftest.$ac_ext" >&5
6337 fi
6338 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6339
6340 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
6341 done
6342
6343 fi
6344 echo "$as_me:6344: result: $cf_cv_fixup_sigwinch" >&5
6345 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
6346
6347         if test "$cf_cv_fixup_sigwinch" != unknown ; then
6348                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
6349         fi
6350 fi
6351
6352 # Checks for CODESET support.
6353
6354 echo "$as_me:6354: checking for nl_langinfo and CODESET" >&5
6355 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
6356 if test "${am_cv_langinfo_codeset+set}" = set; then
6357   echo $ECHO_N "(cached) $ECHO_C" >&6
6358 else
6359   cat >"conftest.$ac_ext" <<_ACEOF
6360 #line 6360 "configure"
6361 #include "confdefs.h"
6362
6363 $ac_includes_default
6364 #include <langinfo.h>
6365 int
6366 main (void)
6367 {
6368 char* cs = nl_langinfo(CODESET); (void)cs
6369   ;
6370   return 0;
6371 }
6372 _ACEOF
6373 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6374 if { (eval echo "$as_me:6374: \"$ac_link\"") >&5
6375   (eval $ac_link) 2>&5
6376   ac_status=$?
6377   echo "$as_me:6377: \$? = $ac_status" >&5
6378   (exit "$ac_status"); } &&
6379          { ac_try='test -s "conftest$ac_exeext"'
6380   { (eval echo "$as_me:6380: \"$ac_try\"") >&5
6381   (eval $ac_try) 2>&5
6382   ac_status=$?
6383   echo "$as_me:6383: \$? = $ac_status" >&5
6384   (exit "$ac_status"); }; }; then
6385   am_cv_langinfo_codeset=yes
6386 else
6387   echo "$as_me: failed program was:" >&5
6388 cat "conftest.$ac_ext" >&5
6389 am_cv_langinfo_codeset=no
6390 fi
6391 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6392
6393 fi
6394 echo "$as_me:6394: result: $am_cv_langinfo_codeset" >&5
6395 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
6396         if test "$am_cv_langinfo_codeset" = yes; then
6397
6398 cat >>confdefs.h <<\EOF
6399 #define HAVE_LANGINFO_CODESET 1
6400 EOF
6401
6402         fi
6403
6404 echo "$as_me:6404: checking if you want to use pkg-config" >&5
6405 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
6406
6407 # Check whether --with-pkg-config or --without-pkg-config was given.
6408 if test "${with_pkg_config+set}" = set; then
6409   withval="$with_pkg_config"
6410   cf_pkg_config=$withval
6411 else
6412   cf_pkg_config=yes
6413 fi;
6414 echo "$as_me:6414: result: $cf_pkg_config" >&5
6415 echo "${ECHO_T}$cf_pkg_config" >&6
6416
6417 case "$cf_pkg_config" in
6418 (no)
6419         PKG_CONFIG=none
6420         ;;
6421 (yes)
6422
6423 if test -n "$ac_tool_prefix"; then
6424   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
6425 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
6426 echo "$as_me:6426: checking for $ac_word" >&5
6427 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6428 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
6429   echo $ECHO_N "(cached) $ECHO_C" >&6
6430 else
6431   case $PKG_CONFIG in
6432   [\\/]* | ?:[\\/]*)
6433   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6434   ;;
6435   *)
6436   ac_save_IFS=$IFS; IFS=$ac_path_separator
6437 ac_dummy="$PATH"
6438 for ac_dir in $ac_dummy; do
6439   IFS=$ac_save_IFS
6440   test -z "$ac_dir" && ac_dir=.
6441   if $as_executable_p "$ac_dir/$ac_word"; then
6442    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
6443    echo "$as_me:6443: found $ac_dir/$ac_word" >&5
6444    break
6445 fi
6446 done
6447
6448   ;;
6449 esac
6450 fi
6451 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
6452
6453 if test -n "$PKG_CONFIG"; then
6454   echo "$as_me:6454: result: $PKG_CONFIG" >&5
6455 echo "${ECHO_T}$PKG_CONFIG" >&6
6456 else
6457   echo "$as_me:6457: result: no" >&5
6458 echo "${ECHO_T}no" >&6
6459 fi
6460
6461 fi
6462 if test -z "$ac_cv_path_PKG_CONFIG"; then
6463   ac_pt_PKG_CONFIG=$PKG_CONFIG
6464   # Extract the first word of "pkg-config", so it can be a program name with args.
6465 set dummy pkg-config; ac_word=$2
6466 echo "$as_me:6466: checking for $ac_word" >&5
6467 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6468 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6469   echo $ECHO_N "(cached) $ECHO_C" >&6
6470 else
6471   case $ac_pt_PKG_CONFIG in
6472   [\\/]* | ?:[\\/]*)
6473   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6474   ;;
6475   *)
6476   ac_save_IFS=$IFS; IFS=$ac_path_separator
6477 ac_dummy="$PATH"
6478 for ac_dir in $ac_dummy; do
6479   IFS=$ac_save_IFS
6480   test -z "$ac_dir" && ac_dir=.
6481   if $as_executable_p "$ac_dir/$ac_word"; then
6482    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
6483    echo "$as_me:6483: found $ac_dir/$ac_word" >&5
6484    break
6485 fi
6486 done
6487
6488   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6489   ;;
6490 esac
6491 fi
6492 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6493
6494 if test -n "$ac_pt_PKG_CONFIG"; then
6495   echo "$as_me:6495: result: $ac_pt_PKG_CONFIG" >&5
6496 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6497 else
6498   echo "$as_me:6498: result: no" >&5
6499 echo "${ECHO_T}no" >&6
6500 fi
6501
6502   PKG_CONFIG=$ac_pt_PKG_CONFIG
6503 else
6504   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6505 fi
6506
6507         ;;
6508 (*)
6509         PKG_CONFIG=$withval
6510         ;;
6511 esac
6512
6513 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6514 if test "$PKG_CONFIG" != none ; then
6515
6516 if test "x$prefix" != xNONE; then
6517         cf_path_syntax="$prefix"
6518 else
6519         cf_path_syntax="$ac_default_prefix"
6520 fi
6521
6522 case ".$PKG_CONFIG" in
6523 (.\$\(*\)*|.\'*\'*)
6524         ;;
6525 (..|./*|.\\*)
6526         ;;
6527 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6528         ;;
6529 (.\$\{*prefix\}*|.\$\{*dir\}*)
6530         eval PKG_CONFIG="$PKG_CONFIG"
6531         case ".$PKG_CONFIG" in
6532         (.NONE/*)
6533                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6534                 ;;
6535         esac
6536         ;;
6537 (.no|.NONE/*)
6538         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6539         ;;
6540 (*)
6541         { { echo "$as_me:6541: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6542 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6543    { (exit 1); exit 1; }; }
6544         ;;
6545 esac
6546
6547 elif test "x$cf_pkg_config" != xno ; then
6548         { echo "$as_me:6548: WARNING: pkg-config is not installed" >&5
6549 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6550 fi
6551
6552 echo "$as_me:6552: checking if you want to see long compiling messages" >&5
6553 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6554
6555 # Check whether --enable-echo or --disable-echo was given.
6556 if test "${enable_echo+set}" = set; then
6557   enableval="$enable_echo"
6558   test "$enableval" != no && enableval=yes
6559         if test "$enableval" != "yes" ; then
6560
6561         ECHO_LT='--silent'
6562         ECHO_LD='@echo linking $@;'
6563         RULE_CC='@echo compiling $<'
6564         SHOW_CC='@echo compiling $@'
6565         ECHO_CC='@'
6566
6567         else
6568
6569         ECHO_LT=''
6570         ECHO_LD=''
6571         RULE_CC=''
6572         SHOW_CC=''
6573         ECHO_CC=''
6574
6575         fi
6576 else
6577   enableval=yes
6578
6579         ECHO_LT=''
6580         ECHO_LD=''
6581         RULE_CC=''
6582         SHOW_CC=''
6583         ECHO_CC=''
6584
6585 fi;
6586 echo "$as_me:6586: result: $enableval" >&5
6587 echo "${ECHO_T}$enableval" >&6
6588
6589 echo "$as_me:6589: checking for ncurses wrap-prefix" >&5
6590 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6591
6592 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6593 if test "${with_ncurses_wrap_prefix+set}" = set; then
6594   withval="$with_ncurses_wrap_prefix"
6595   NCURSES_WRAP_PREFIX=$withval
6596 else
6597   NCURSES_WRAP_PREFIX=_nc_
6598 fi;
6599 echo "$as_me:6599: result: $NCURSES_WRAP_PREFIX" >&5
6600 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6601
6602 echo "$as_me:6602: checking if you want to check for wide-character functions" >&5
6603 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6604
6605 # Check whether --enable-widec or --disable-widec was given.
6606 if test "${enable_widec+set}" = set; then
6607   enableval="$enable_widec"
6608   test "$enableval" != no && enableval=yes
6609         if test "$enableval" != "yes" ; then
6610     cf_enable_widec=no
6611         else
6612                 cf_enable_widec=yes
6613         fi
6614 else
6615   enableval=yes
6616         cf_enable_widec=yes
6617
6618 fi;
6619 echo "$as_me:6619: result: $cf_enable_widec" >&5
6620 echo "${ECHO_T}$cf_enable_widec" >&6
6621
6622 echo "$as_me:6622: checking for specific curses-directory" >&5
6623 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6624
6625 # Check whether --with-curses-dir or --without-curses-dir was given.
6626 if test "${with_curses_dir+set}" = set; then
6627   withval="$with_curses_dir"
6628   cf_cv_curses_dir=$withval
6629 else
6630   cf_cv_curses_dir=no
6631 fi;
6632 echo "$as_me:6632: result: $cf_cv_curses_dir" >&5
6633 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6634
6635 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6636 then
6637
6638 if test "x$prefix" != xNONE; then
6639         cf_path_syntax="$prefix"
6640 else
6641         cf_path_syntax="$ac_default_prefix"
6642 fi
6643
6644 case ".$withval" in
6645 (.\$\(*\)*|.\'*\'*)
6646         ;;
6647 (..|./*|.\\*)
6648         ;;
6649 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6650         ;;
6651 (.\$\{*prefix\}*|.\$\{*dir\}*)
6652         eval withval="$withval"
6653         case ".$withval" in
6654         (.NONE/*)
6655                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6656                 ;;
6657         esac
6658         ;;
6659 (.no|.NONE/*)
6660         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6661         ;;
6662 (*)
6663         { { echo "$as_me:6663: error: expected a pathname, not \"$withval\"" >&5
6664 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6665    { (exit 1); exit 1; }; }
6666         ;;
6667 esac
6668
6669         if test -d "$cf_cv_curses_dir"
6670         then
6671
6672 if test -n "$cf_cv_curses_dir/include" ; then
6673   for cf_add_incdir in $cf_cv_curses_dir/include
6674   do
6675         while test "$cf_add_incdir" != /usr/include
6676         do
6677           if test -d "$cf_add_incdir"
6678           then
6679                 cf_have_incdir=no
6680                 if test -n "$CFLAGS$CPPFLAGS" ; then
6681                   # a loop is needed to ensure we can add subdirs of existing dirs
6682                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6683                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6684                           cf_have_incdir=yes; break
6685                         fi
6686                   done
6687                 fi
6688
6689                 if test "$cf_have_incdir" = no ; then
6690                   if test "$cf_add_incdir" = /usr/local/include ; then
6691                         if test "$GCC" = yes
6692                         then
6693                           cf_save_CPPFLAGS=$CPPFLAGS
6694
6695         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6696         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6697
6698                           cat >"conftest.$ac_ext" <<_ACEOF
6699 #line 6699 "configure"
6700 #include "confdefs.h"
6701 #include <stdio.h>
6702 int
6703 main (void)
6704 {
6705 printf("Hello")
6706   ;
6707   return 0;
6708 }
6709 _ACEOF
6710 rm -f "conftest.$ac_objext"
6711 if { (eval echo "$as_me:6711: \"$ac_compile\"") >&5
6712   (eval $ac_compile) 2>&5
6713   ac_status=$?
6714   echo "$as_me:6714: \$? = $ac_status" >&5
6715   (exit "$ac_status"); } &&
6716          { ac_try='test -s "conftest.$ac_objext"'
6717   { (eval echo "$as_me:6717: \"$ac_try\"") >&5
6718   (eval $ac_try) 2>&5
6719   ac_status=$?
6720   echo "$as_me:6720: \$? = $ac_status" >&5
6721   (exit "$ac_status"); }; }; then
6722   :
6723 else
6724   echo "$as_me: failed program was:" >&5
6725 cat "conftest.$ac_ext" >&5
6726 cf_have_incdir=yes
6727 fi
6728 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6729                           CPPFLAGS=$cf_save_CPPFLAGS
6730                         fi
6731                   fi
6732                 fi
6733
6734                 if test "$cf_have_incdir" = no ; then
6735                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6736
6737 echo "${as_me:-configure}:6737: testing adding $cf_add_incdir to include-path ..." 1>&5
6738
6739                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6740
6741                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6742                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6743                   cf_add_incdir="$cf_top_incdir"
6744                 else
6745                   break
6746                 fi
6747           else
6748                 break
6749           fi
6750         done
6751   done
6752 fi
6753
6754 if test -n "$cf_cv_curses_dir/lib" ; then
6755         for cf_add_libdir in $cf_cv_curses_dir/lib
6756         do
6757                 if test "$cf_add_libdir" = /usr/lib ; then
6758                         :
6759                 elif test -d "$cf_add_libdir"
6760                 then
6761                         cf_have_libdir=no
6762                         if test -n "$LDFLAGS$LIBS" ; then
6763                                 # a loop is needed to ensure we can add subdirs of existing dirs
6764                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6765                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6766                                                 cf_have_libdir=yes; break
6767                                         fi
6768                                 done
6769                         fi
6770                         if test "$cf_have_libdir" = no ; then
6771                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6772
6773 echo "${as_me:-configure}:6773: testing adding $cf_add_libdir to library-path ..." 1>&5
6774
6775                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6776                         fi
6777                 fi
6778         done
6779 fi
6780
6781         fi
6782 fi
6783
6784 cf_cv_screen=curses
6785
6786 echo "$as_me:6786: checking for specified curses library type" >&5
6787 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6788
6789 # Check whether --with-screen or --without-screen was given.
6790 if test "${with_screen+set}" = set; then
6791   withval="$with_screen"
6792   cf_cv_screen=$withval
6793 else
6794
6795 # Check whether --with-ncursesw or --without-ncursesw was given.
6796 if test "${with_ncursesw+set}" = set; then
6797   withval="$with_ncursesw"
6798   cf_cv_screen=ncursesw
6799 else
6800
6801 # Check whether --with-ncurses or --without-ncurses was given.
6802 if test "${with_ncurses+set}" = set; then
6803   withval="$with_ncurses"
6804   cf_cv_screen=ncurses
6805 else
6806
6807 # Check whether --with-pdcurses or --without-pdcurses was given.
6808 if test "${with_pdcurses+set}" = set; then
6809   withval="$with_pdcurses"
6810   cf_cv_screen=pdcurses
6811 else
6812
6813 # Check whether --with-curses-colr or --without-curses-colr was given.
6814 if test "${with_curses_colr+set}" = set; then
6815   withval="$with_curses_colr"
6816   cf_cv_screen=curses_colr
6817 else
6818
6819 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6820 if test "${with_curses_5lib+set}" = set; then
6821   withval="$with_curses_5lib"
6822   cf_cv_screen=curses_5lib
6823 fi;
6824 fi;
6825 fi;
6826 fi;
6827 fi;
6828 fi;
6829
6830 echo "$as_me:6830: result: $cf_cv_screen" >&5
6831 echo "${ECHO_T}$cf_cv_screen" >&6
6832
6833 case $cf_cv_screen in
6834 (curses|curses_*)
6835
6836 echo "$as_me:6836: checking for extra include directories" >&5
6837 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6838 if test "${cf_cv_curses_incdir+set}" = set; then
6839   echo $ECHO_N "(cached) $ECHO_C" >&6
6840 else
6841
6842 cf_cv_curses_incdir=no
6843 case "$host_os" in
6844 (hpux10.*)
6845         if test "x$cf_cv_screen" = "xcurses_colr"
6846         then
6847                 test -d /usr/include/curses_colr && \
6848                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6849         fi
6850         ;;
6851 (sunos3*|sunos4*)
6852         if test "x$cf_cv_screen" = "xcurses_5lib"
6853         then
6854                 test -d /usr/5lib && \
6855                 test -d /usr/5include && \
6856                 cf_cv_curses_incdir="-I/usr/5include"
6857         fi
6858         ;;
6859 esac
6860
6861 fi
6862 echo "$as_me:6862: result: $cf_cv_curses_incdir" >&5
6863 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6864 if test "$cf_cv_curses_incdir" != no
6865 then
6866
6867         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6868         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6869
6870 fi
6871
6872 echo "$as_me:6872: checking if we have identified curses headers" >&5
6873 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6874 if test "${cf_cv_ncurses_header+set}" = set; then
6875   echo $ECHO_N "(cached) $ECHO_C" >&6
6876 else
6877
6878 cf_cv_ncurses_header=none
6879 for cf_header in \
6880         ncurses.h  \
6881         curses.h  ncurses/ncurses.h ncurses/curses.h
6882 do
6883 cat >"conftest.$ac_ext" <<_ACEOF
6884 #line 6884 "configure"
6885 #include "confdefs.h"
6886 #include <${cf_header}>
6887 int
6888 main (void)
6889 {
6890 initscr(); endwin()
6891   ;
6892   return 0;
6893 }
6894 _ACEOF
6895 rm -f "conftest.$ac_objext"
6896 if { (eval echo "$as_me:6896: \"$ac_compile\"") >&5
6897   (eval $ac_compile) 2>&5
6898   ac_status=$?
6899   echo "$as_me:6899: \$? = $ac_status" >&5
6900   (exit "$ac_status"); } &&
6901          { ac_try='test -s "conftest.$ac_objext"'
6902   { (eval echo "$as_me:6902: \"$ac_try\"") >&5
6903   (eval $ac_try) 2>&5
6904   ac_status=$?
6905   echo "$as_me:6905: \$? = $ac_status" >&5
6906   (exit "$ac_status"); }; }; then
6907   cf_cv_ncurses_header=$cf_header; break
6908 else
6909   echo "$as_me: failed program was:" >&5
6910 cat "conftest.$ac_ext" >&5
6911 fi
6912 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6913 done
6914
6915 fi
6916 echo "$as_me:6916: result: $cf_cv_ncurses_header" >&5
6917 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6918
6919 if test "$cf_cv_ncurses_header" = none ; then
6920         { { echo "$as_me:6920: error: No curses header-files found" >&5
6921 echo "$as_me: error: No curses header-files found" >&2;}
6922    { (exit 1); exit 1; }; }
6923 fi
6924
6925 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6926
6927 for ac_header in $cf_cv_ncurses_header
6928 do
6929 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6930 echo "$as_me:6930: checking for $ac_header" >&5
6931 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6932 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6933   echo $ECHO_N "(cached) $ECHO_C" >&6
6934 else
6935   cat >"conftest.$ac_ext" <<_ACEOF
6936 #line 6936 "configure"
6937 #include "confdefs.h"
6938 #include <$ac_header>
6939 _ACEOF
6940 if { (eval echo "$as_me:6940: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6941   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6942   ac_status=$?
6943   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6944   rm -f conftest.er1
6945   cat conftest.err >&5
6946   echo "$as_me:6946: \$? = $ac_status" >&5
6947   (exit "$ac_status"); } >/dev/null; then
6948   if test -s conftest.err; then
6949     ac_cpp_err=$ac_c_preproc_warn_flag
6950   else
6951     ac_cpp_err=
6952   fi
6953 else
6954   ac_cpp_err=yes
6955 fi
6956 if test -z "$ac_cpp_err"; then
6957   eval "$as_ac_Header=yes"
6958 else
6959   echo "$as_me: failed program was:" >&5
6960   cat "conftest.$ac_ext" >&5
6961   eval "$as_ac_Header=no"
6962 fi
6963 rm -f conftest.err "conftest.$ac_ext"
6964 fi
6965 echo "$as_me:6965: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6966 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6967 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6968   cat >>confdefs.h <<EOF
6969 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6970 EOF
6971
6972 fi
6973 done
6974
6975 echo "$as_me:6975: checking for terminfo header" >&5
6976 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6977 if test "${cf_cv_term_header+set}" = set; then
6978   echo $ECHO_N "(cached) $ECHO_C" >&6
6979 else
6980
6981 case "${cf_cv_ncurses_header}" in
6982 (*/ncurses.h|*/ncursesw.h)
6983         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6984         ;;
6985 (*)
6986         cf_term_header=term.h
6987         ;;
6988 esac
6989
6990 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6991 do
6992 cat >"conftest.$ac_ext" <<_ACEOF
6993 #line 6993 "configure"
6994 #include "confdefs.h"
6995 #include <stdio.h>
6996 #include <${cf_cv_ncurses_header:-curses.h}>
6997 #include <$cf_test>
6998
6999 int
7000 main (void)
7001 {
7002 int x = auto_left_margin; (void)x
7003   ;
7004   return 0;
7005 }
7006 _ACEOF
7007 rm -f "conftest.$ac_objext"
7008 if { (eval echo "$as_me:7008: \"$ac_compile\"") >&5
7009   (eval $ac_compile) 2>&5
7010   ac_status=$?
7011   echo "$as_me:7011: \$? = $ac_status" >&5
7012   (exit "$ac_status"); } &&
7013          { ac_try='test -s "conftest.$ac_objext"'
7014   { (eval echo "$as_me:7014: \"$ac_try\"") >&5
7015   (eval $ac_try) 2>&5
7016   ac_status=$?
7017   echo "$as_me:7017: \$? = $ac_status" >&5
7018   (exit "$ac_status"); }; }; then
7019
7020         cf_cv_term_header="$cf_test"
7021 else
7022   echo "$as_me: failed program was:" >&5
7023 cat "conftest.$ac_ext" >&5
7024
7025         cf_cv_term_header=unknown
7026
7027 fi
7028 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7029         test "$cf_cv_term_header" != unknown && break
7030 done
7031
7032 fi
7033 echo "$as_me:7033: result: $cf_cv_term_header" >&5
7034 echo "${ECHO_T}$cf_cv_term_header" >&6
7035
7036 # Set definitions to allow ifdef'ing to accommodate subdirectories
7037
7038 case "$cf_cv_term_header" in
7039 (*term.h)
7040
7041 cat >>confdefs.h <<\EOF
7042 #define HAVE_TERM_H 1
7043 EOF
7044
7045         ;;
7046 esac
7047
7048 case "$cf_cv_term_header" in
7049 (ncurses/term.h)
7050
7051 cat >>confdefs.h <<\EOF
7052 #define HAVE_NCURSES_TERM_H 1
7053 EOF
7054
7055         ;;
7056 (ncursesw/term.h)
7057
7058 cat >>confdefs.h <<\EOF
7059 #define HAVE_NCURSESW_TERM_H 1
7060 EOF
7061
7062         ;;
7063 esac
7064
7065 echo "$as_me:7065: checking for ncurses version" >&5
7066 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7067 if test "${cf_cv_ncurses_version+set}" = set; then
7068   echo $ECHO_N "(cached) $ECHO_C" >&6
7069 else
7070
7071         cf_cv_ncurses_version=no
7072         cf_tempfile=out$$
7073         rm -f "$cf_tempfile"
7074         if test "$cross_compiling" = yes; then
7075
7076         # This will not work if the preprocessor splits the line after the
7077         # Autoconf token.  The 'unproto' program does that.
7078         cat > "conftest.$ac_ext" <<EOF
7079 #include <${cf_cv_ncurses_header:-curses.h}>
7080 #undef Autoconf
7081 #ifdef NCURSES_VERSION
7082 Autoconf NCURSES_VERSION
7083 #else
7084 #ifdef __NCURSES_H
7085 Autoconf "old"
7086 #endif
7087 ;
7088 #endif
7089 EOF
7090         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7091         { (eval echo "$as_me:7091: \"$cf_try\"") >&5
7092   (eval $cf_try) 2>&5
7093   ac_status=$?
7094   echo "$as_me:7094: \$? = $ac_status" >&5
7095   (exit "$ac_status"); }
7096         if test -f conftest.out ; then
7097                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
7098                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7099                 rm -f conftest.out
7100         fi
7101
7102 else
7103   cat >"conftest.$ac_ext" <<_ACEOF
7104 #line 7104 "configure"
7105 #include "confdefs.h"
7106
7107 $ac_includes_default
7108
7109 #include <${cf_cv_ncurses_header:-curses.h}>
7110
7111 int main(void)
7112 {
7113         FILE *fp = fopen("$cf_tempfile", "w");
7114 #ifdef NCURSES_VERSION
7115 # ifdef NCURSES_VERSION_PATCH
7116         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7117 # else
7118         fprintf(fp, "%s\\n", NCURSES_VERSION);
7119 # endif
7120 #else
7121 # ifdef __NCURSES_H
7122         fprintf(fp, "old\\n");
7123 # else
7124         make an error
7125 # endif
7126 #endif
7127         ${cf_cv_main_return:-return}(0);
7128 }
7129 _ACEOF
7130 rm -f "conftest$ac_exeext"
7131 if { (eval echo "$as_me:7131: \"$ac_link\"") >&5
7132   (eval $ac_link) 2>&5
7133   ac_status=$?
7134   echo "$as_me:7134: \$? = $ac_status" >&5
7135   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7136   { (eval echo "$as_me:7136: \"$ac_try\"") >&5
7137   (eval $ac_try) 2>&5
7138   ac_status=$?
7139   echo "$as_me:7139: \$? = $ac_status" >&5
7140   (exit "$ac_status"); }; }; then
7141
7142         cf_cv_ncurses_version=`cat $cf_tempfile`
7143 else
7144   echo "$as_me: program exited with status $ac_status" >&5
7145 echo "$as_me: failed program was:" >&5
7146 cat "conftest.$ac_ext" >&5
7147 fi
7148 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7149 fi
7150         rm -f "$cf_tempfile"
7151
7152 fi
7153 echo "$as_me:7153: result: $cf_cv_ncurses_version" >&5
7154 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7155 test "$cf_cv_ncurses_version" = no ||
7156 cat >>confdefs.h <<\EOF
7157 #define NCURSES 1
7158 EOF
7159
7160 echo "$as_me:7160: checking if we have identified curses libraries" >&5
7161 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
7162 cat >"conftest.$ac_ext" <<_ACEOF
7163 #line 7163 "configure"
7164 #include "confdefs.h"
7165 #include <${cf_cv_ncurses_header:-curses.h}>
7166 int
7167 main (void)
7168 {
7169 initscr(); endwin()
7170   ;
7171   return 0;
7172 }
7173 _ACEOF
7174 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7175 if { (eval echo "$as_me:7175: \"$ac_link\"") >&5
7176   (eval $ac_link) 2>&5
7177   ac_status=$?
7178   echo "$as_me:7178: \$? = $ac_status" >&5
7179   (exit "$ac_status"); } &&
7180          { ac_try='test -s "conftest$ac_exeext"'
7181   { (eval echo "$as_me:7181: \"$ac_try\"") >&5
7182   (eval $ac_try) 2>&5
7183   ac_status=$?
7184   echo "$as_me:7184: \$? = $ac_status" >&5
7185   (exit "$ac_status"); }; }; then
7186   cf_result=yes
7187 else
7188   echo "$as_me: failed program was:" >&5
7189 cat "conftest.$ac_ext" >&5
7190 cf_result=no
7191 fi
7192 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7193 echo "$as_me:7193: result: $cf_result" >&5
7194 echo "${ECHO_T}$cf_result" >&6
7195
7196 if test "$cf_result" = no ; then
7197 case "$host_os" in
7198 (freebsd*)
7199         echo "$as_me:7199: checking for tgoto in -lmytinfo" >&5
7200 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7201 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7202   echo $ECHO_N "(cached) $ECHO_C" >&6
7203 else
7204   ac_check_lib_save_LIBS=$LIBS
7205 LIBS="-lmytinfo  $LIBS"
7206 cat >"conftest.$ac_ext" <<_ACEOF
7207 #line 7207 "configure"
7208 #include "confdefs.h"
7209
7210 /* Override any gcc2 internal prototype to avoid an error.  */
7211 #ifdef __cplusplus
7212 extern "C"
7213 #endif
7214 /* We use char because int might match the return type of a gcc2
7215    builtin and then its argument prototype would still apply.  */
7216 char tgoto ();
7217 int
7218 main (void)
7219 {
7220 tgoto ();
7221   ;
7222   return 0;
7223 }
7224 _ACEOF
7225 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7226 if { (eval echo "$as_me:7226: \"$ac_link\"") >&5
7227   (eval $ac_link) 2>&5
7228   ac_status=$?
7229   echo "$as_me:7229: \$? = $ac_status" >&5
7230   (exit "$ac_status"); } &&
7231          { ac_try='test -s "conftest$ac_exeext"'
7232   { (eval echo "$as_me:7232: \"$ac_try\"") >&5
7233   (eval $ac_try) 2>&5
7234   ac_status=$?
7235   echo "$as_me:7235: \$? = $ac_status" >&5
7236   (exit "$ac_status"); }; }; then
7237   ac_cv_lib_mytinfo_tgoto=yes
7238 else
7239   echo "$as_me: failed program was:" >&5
7240 cat "conftest.$ac_ext" >&5
7241 ac_cv_lib_mytinfo_tgoto=no
7242 fi
7243 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7244 LIBS=$ac_check_lib_save_LIBS
7245 fi
7246 echo "$as_me:7246: result: $ac_cv_lib_mytinfo_tgoto" >&5
7247 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7248 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
7249
7250 cf_add_libs="$LIBS"
7251 # reverse order
7252 cf_add_0lib=
7253 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7254 # filter duplicates
7255 for cf_add_1lib in $cf_add_0lib; do
7256         for cf_add_2lib in $cf_add_libs; do
7257                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7258                         cf_add_1lib=
7259                         break
7260                 fi
7261         done
7262         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7263 done
7264 LIBS="$cf_add_libs"
7265
7266 fi
7267
7268         ;;
7269 (hpux10.*)
7270         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
7271         # next (1998), and xcurses "newer" (2000).  There is no header file for
7272         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
7273         # term.h) for cur_colr
7274         if test "x$cf_cv_screen" = "xcurses_colr"
7275         then
7276                 echo "$as_me:7276: checking for initscr in -lcur_colr" >&5
7277 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
7278 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
7279   echo $ECHO_N "(cached) $ECHO_C" >&6
7280 else
7281   ac_check_lib_save_LIBS=$LIBS
7282 LIBS="-lcur_colr  $LIBS"
7283 cat >"conftest.$ac_ext" <<_ACEOF
7284 #line 7284 "configure"
7285 #include "confdefs.h"
7286
7287 /* Override any gcc2 internal prototype to avoid an error.  */
7288 #ifdef __cplusplus
7289 extern "C"
7290 #endif
7291 /* We use char because int might match the return type of a gcc2
7292    builtin and then its argument prototype would still apply.  */
7293 char initscr ();
7294 int
7295 main (void)
7296 {
7297 initscr ();
7298   ;
7299   return 0;
7300 }
7301 _ACEOF
7302 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7303 if { (eval echo "$as_me:7303: \"$ac_link\"") >&5
7304   (eval $ac_link) 2>&5
7305   ac_status=$?
7306   echo "$as_me:7306: \$? = $ac_status" >&5
7307   (exit "$ac_status"); } &&
7308          { ac_try='test -s "conftest$ac_exeext"'
7309   { (eval echo "$as_me:7309: \"$ac_try\"") >&5
7310   (eval $ac_try) 2>&5
7311   ac_status=$?
7312   echo "$as_me:7312: \$? = $ac_status" >&5
7313   (exit "$ac_status"); }; }; then
7314   ac_cv_lib_cur_colr_initscr=yes
7315 else
7316   echo "$as_me: failed program was:" >&5
7317 cat "conftest.$ac_ext" >&5
7318 ac_cv_lib_cur_colr_initscr=no
7319 fi
7320 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7321 LIBS=$ac_check_lib_save_LIBS
7322 fi
7323 echo "$as_me:7323: result: $ac_cv_lib_cur_colr_initscr" >&5
7324 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
7325 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
7326
7327 cf_add_libs="$LIBS"
7328 # reverse order
7329 cf_add_0lib=
7330 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7331 # filter duplicates
7332 for cf_add_1lib in $cf_add_0lib; do
7333         for cf_add_2lib in $cf_add_libs; do
7334                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7335                         cf_add_1lib=
7336                         break
7337                 fi
7338         done
7339         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7340 done
7341 LIBS="$cf_add_libs"
7342
7343                         ac_cv_func_initscr=yes
7344
7345 else
7346
7347                 echo "$as_me:7347: checking for initscr in -lHcurses" >&5
7348 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
7349 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
7350   echo $ECHO_N "(cached) $ECHO_C" >&6
7351 else
7352   ac_check_lib_save_LIBS=$LIBS
7353 LIBS="-lHcurses  $LIBS"
7354 cat >"conftest.$ac_ext" <<_ACEOF
7355 #line 7355 "configure"
7356 #include "confdefs.h"
7357
7358 /* Override any gcc2 internal prototype to avoid an error.  */
7359 #ifdef __cplusplus
7360 extern "C"
7361 #endif
7362 /* We use char because int might match the return type of a gcc2
7363    builtin and then its argument prototype would still apply.  */
7364 char initscr ();
7365 int
7366 main (void)
7367 {
7368 initscr ();
7369   ;
7370   return 0;
7371 }
7372 _ACEOF
7373 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7374 if { (eval echo "$as_me:7374: \"$ac_link\"") >&5
7375   (eval $ac_link) 2>&5
7376   ac_status=$?
7377   echo "$as_me:7377: \$? = $ac_status" >&5
7378   (exit "$ac_status"); } &&
7379          { ac_try='test -s "conftest$ac_exeext"'
7380   { (eval echo "$as_me:7380: \"$ac_try\"") >&5
7381   (eval $ac_try) 2>&5
7382   ac_status=$?
7383   echo "$as_me:7383: \$? = $ac_status" >&5
7384   (exit "$ac_status"); }; }; then
7385   ac_cv_lib_Hcurses_initscr=yes
7386 else
7387   echo "$as_me: failed program was:" >&5
7388 cat "conftest.$ac_ext" >&5
7389 ac_cv_lib_Hcurses_initscr=no
7390 fi
7391 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7392 LIBS=$ac_check_lib_save_LIBS
7393 fi
7394 echo "$as_me:7394: result: $ac_cv_lib_Hcurses_initscr" >&5
7395 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
7396 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
7397
7398                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
7399
7400 cf_add_libs="$LIBS"
7401 # reverse order
7402 cf_add_0lib=
7403 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7404 # filter duplicates
7405 for cf_add_1lib in $cf_add_0lib; do
7406         for cf_add_2lib in $cf_add_libs; do
7407                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7408                         cf_add_1lib=
7409                         break
7410                 fi
7411         done
7412         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7413 done
7414 LIBS="$cf_add_libs"
7415
7416         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7417         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
7418
7419                         ac_cv_func_initscr=yes
7420
7421 fi
7422
7423 fi
7424
7425         fi
7426         ;;
7427 (linux*)
7428         case `arch 2>/dev/null` in
7429         (x86_64)
7430                 if test -d /lib64
7431                 then
7432
7433 if test -n "/lib64" ; then
7434         for cf_add_libdir in /lib64
7435         do
7436                 if test "$cf_add_libdir" = /usr/lib ; then
7437                         :
7438                 elif test -d "$cf_add_libdir"
7439                 then
7440                         cf_have_libdir=no
7441                         if test -n "$LDFLAGS$LIBS" ; then
7442                                 # a loop is needed to ensure we can add subdirs of existing dirs
7443                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7444                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7445                                                 cf_have_libdir=yes; break
7446                                         fi
7447                                 done
7448                         fi
7449                         if test "$cf_have_libdir" = no ; then
7450                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7451
7452 echo "${as_me:-configure}:7452: testing adding $cf_add_libdir to library-path ..." 1>&5
7453
7454                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7455                         fi
7456                 fi
7457         done
7458 fi
7459
7460                 else
7461
7462 if test -n "/lib" ; then
7463         for cf_add_libdir in /lib
7464         do
7465                 if test "$cf_add_libdir" = /usr/lib ; then
7466                         :
7467                 elif test -d "$cf_add_libdir"
7468                 then
7469                         cf_have_libdir=no
7470                         if test -n "$LDFLAGS$LIBS" ; then
7471                                 # a loop is needed to ensure we can add subdirs of existing dirs
7472                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7473                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7474                                                 cf_have_libdir=yes; break
7475                                         fi
7476                                 done
7477                         fi
7478                         if test "$cf_have_libdir" = no ; then
7479                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7480
7481 echo "${as_me:-configure}:7481: testing adding $cf_add_libdir to library-path ..." 1>&5
7482
7483                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7484                         fi
7485                 fi
7486         done
7487 fi
7488
7489                 fi
7490                 ;;
7491         (*)
7492
7493 if test -n "/lib" ; then
7494         for cf_add_libdir in /lib
7495         do
7496                 if test "$cf_add_libdir" = /usr/lib ; then
7497                         :
7498                 elif test -d "$cf_add_libdir"
7499                 then
7500                         cf_have_libdir=no
7501                         if test -n "$LDFLAGS$LIBS" ; then
7502                                 # a loop is needed to ensure we can add subdirs of existing dirs
7503                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7504                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7505                                                 cf_have_libdir=yes; break
7506                                         fi
7507                                 done
7508                         fi
7509                         if test "$cf_have_libdir" = no ; then
7510                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7511
7512 echo "${as_me:-configure}:7512: testing adding $cf_add_libdir to library-path ..." 1>&5
7513
7514                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7515                         fi
7516                 fi
7517         done
7518 fi
7519
7520                 ;;
7521         esac
7522         ;;
7523 (sunos3*|sunos4*)
7524         if test "x$cf_cv_screen" = "xcurses_5lib"
7525         then
7526                 if test -d /usr/5lib ; then
7527
7528 if test -n "/usr/5lib" ; then
7529         for cf_add_libdir in /usr/5lib
7530         do
7531                 if test "$cf_add_libdir" = /usr/lib ; then
7532                         :
7533                 elif test -d "$cf_add_libdir"
7534                 then
7535                         cf_have_libdir=no
7536                         if test -n "$LDFLAGS$LIBS" ; then
7537                                 # a loop is needed to ensure we can add subdirs of existing dirs
7538                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7539                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7540                                                 cf_have_libdir=yes; break
7541                                         fi
7542                                 done
7543                         fi
7544                         if test "$cf_have_libdir" = no ; then
7545                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7546
7547 echo "${as_me:-configure}:7547: testing adding $cf_add_libdir to library-path ..." 1>&5
7548
7549                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7550                         fi
7551                 fi
7552         done
7553 fi
7554
7555 cf_add_libs="$LIBS"
7556 # reverse order
7557 cf_add_0lib=
7558 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7559 # filter duplicates
7560 for cf_add_1lib in $cf_add_0lib; do
7561         for cf_add_2lib in $cf_add_libs; do
7562                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7563                         cf_add_1lib=
7564                         break
7565                 fi
7566         done
7567         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7568 done
7569 LIBS="$cf_add_libs"
7570
7571                 fi
7572         fi
7573         ac_cv_func_initscr=yes
7574         ;;
7575 esac
7576
7577 if test ".$ac_cv_func_initscr" != .yes ; then
7578         cf_save_LIBS="$LIBS"
7579
7580         if test ".${cf_cv_ncurses_version:-no}" != .no
7581         then
7582                 cf_check_list="ncurses curses cursesX"
7583         else
7584                 cf_check_list="cursesX curses ncurses"
7585         fi
7586
7587         # Check for library containing tgoto.  Do this before curses library
7588         # because it may be needed to link the test-case for initscr.
7589         if test "x$cf_term_lib" = x
7590         then
7591                 echo "$as_me:7591: checking for tgoto" >&5
7592 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7593 if test "${ac_cv_func_tgoto+set}" = set; then
7594   echo $ECHO_N "(cached) $ECHO_C" >&6
7595 else
7596   cat >"conftest.$ac_ext" <<_ACEOF
7597 #line 7597 "configure"
7598 #include "confdefs.h"
7599 #define tgoto autoconf_temporary
7600 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7601 #undef tgoto
7602
7603 #ifdef __cplusplus
7604 extern "C"
7605 #endif
7606
7607 /* We use char because int might match the return type of a gcc2
7608    builtin and then its argument prototype would still apply.  */
7609 char tgoto (void);
7610
7611 int
7612 main (void)
7613 {
7614
7615 /* The GNU C library defines stubs for functions which it implements
7616     to always fail with ENOSYS.  Some functions are actually named
7617     something starting with __ and the normal name is an alias.  */
7618 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7619 #error found stub for tgoto
7620 #endif
7621
7622         return tgoto ();
7623   ;
7624   return 0;
7625 }
7626 _ACEOF
7627 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7628 if { (eval echo "$as_me:7628: \"$ac_link\"") >&5
7629   (eval $ac_link) 2>&5
7630   ac_status=$?
7631   echo "$as_me:7631: \$? = $ac_status" >&5
7632   (exit "$ac_status"); } &&
7633          { ac_try='test -s "conftest$ac_exeext"'
7634   { (eval echo "$as_me:7634: \"$ac_try\"") >&5
7635   (eval $ac_try) 2>&5
7636   ac_status=$?
7637   echo "$as_me:7637: \$? = $ac_status" >&5
7638   (exit "$ac_status"); }; }; then
7639   ac_cv_func_tgoto=yes
7640 else
7641   echo "$as_me: failed program was:" >&5
7642 cat "conftest.$ac_ext" >&5
7643 ac_cv_func_tgoto=no
7644 fi
7645 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7646 fi
7647 echo "$as_me:7647: result: $ac_cv_func_tgoto" >&5
7648 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7649 if test "$ac_cv_func_tgoto" = yes; then
7650   cf_term_lib=predefined
7651 else
7652
7653                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7654                         do
7655                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7656 echo "$as_me:7656: checking for tgoto in -l$cf_term_lib" >&5
7657 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7658 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7659   echo $ECHO_N "(cached) $ECHO_C" >&6
7660 else
7661   ac_check_lib_save_LIBS=$LIBS
7662 LIBS="-l$cf_term_lib  $LIBS"
7663 cat >"conftest.$ac_ext" <<_ACEOF
7664 #line 7664 "configure"
7665 #include "confdefs.h"
7666
7667 /* Override any gcc2 internal prototype to avoid an error.  */
7668 #ifdef __cplusplus
7669 extern "C"
7670 #endif
7671 /* We use char because int might match the return type of a gcc2
7672    builtin and then its argument prototype would still apply.  */
7673 char tgoto ();
7674 int
7675 main (void)
7676 {
7677 tgoto ();
7678   ;
7679   return 0;
7680 }
7681 _ACEOF
7682 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7683 if { (eval echo "$as_me:7683: \"$ac_link\"") >&5
7684   (eval $ac_link) 2>&5
7685   ac_status=$?
7686   echo "$as_me:7686: \$? = $ac_status" >&5
7687   (exit "$ac_status"); } &&
7688          { ac_try='test -s "conftest$ac_exeext"'
7689   { (eval echo "$as_me:7689: \"$ac_try\"") >&5
7690   (eval $ac_try) 2>&5
7691   ac_status=$?
7692   echo "$as_me:7692: \$? = $ac_status" >&5
7693   (exit "$ac_status"); }; }; then
7694   eval "$as_ac_Lib=yes"
7695 else
7696   echo "$as_me: failed program was:" >&5
7697 cat "conftest.$ac_ext" >&5
7698 eval "$as_ac_Lib=no"
7699 fi
7700 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7701 LIBS=$ac_check_lib_save_LIBS
7702 fi
7703 echo "$as_me:7703: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7704 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7705 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7706
7707                                         : "${cf_nculib_root:=$cf_term_lib}"
7708                                         break
7709
7710 fi
7711
7712                         done
7713
7714 fi
7715
7716         fi
7717
7718         # Check for library containing initscr
7719         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7720         if test "x$cf_curs_lib" = x
7721         then
7722                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7723                 do
7724                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7725                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7726                                 echo "$as_me:7726: checking if we can link with $cf_curs_lib library" >&5
7727 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7728                                 cat >"conftest.$ac_ext" <<_ACEOF
7729 #line 7729 "configure"
7730 #include "confdefs.h"
7731 #include <${cf_cv_ncurses_header:-curses.h}>
7732 int
7733 main (void)
7734 {
7735 initscr()
7736   ;
7737   return 0;
7738 }
7739 _ACEOF
7740 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7741 if { (eval echo "$as_me:7741: \"$ac_link\"") >&5
7742   (eval $ac_link) 2>&5
7743   ac_status=$?
7744   echo "$as_me:7744: \$? = $ac_status" >&5
7745   (exit "$ac_status"); } &&
7746          { ac_try='test -s "conftest$ac_exeext"'
7747   { (eval echo "$as_me:7747: \"$ac_try\"") >&5
7748   (eval $ac_try) 2>&5
7749   ac_status=$?
7750   echo "$as_me:7750: \$? = $ac_status" >&5
7751   (exit "$ac_status"); }; }; then
7752   cf_result=yes
7753 else
7754   echo "$as_me: failed program was:" >&5
7755 cat "conftest.$ac_ext" >&5
7756 cf_result=no
7757 fi
7758 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7759                                 echo "$as_me:7759: result: $cf_result" >&5
7760 echo "${ECHO_T}$cf_result" >&6
7761                                 test "$cf_result" = yes && break
7762                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7763                                 cf_result=no
7764                         elif test "$cf_term_lib" != predefined ; then
7765                                 echo "$as_me:7765: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7766 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7767                                 cat >"conftest.$ac_ext" <<_ACEOF
7768 #line 7768 "configure"
7769 #include "confdefs.h"
7770 #include <${cf_cv_ncurses_header:-curses.h}>
7771 int
7772 main (void)
7773 {
7774 initscr(); endwin();
7775   ;
7776   return 0;
7777 }
7778 _ACEOF
7779 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7780 if { (eval echo "$as_me:7780: \"$ac_link\"") >&5
7781   (eval $ac_link) 2>&5
7782   ac_status=$?
7783   echo "$as_me:7783: \$? = $ac_status" >&5
7784   (exit "$ac_status"); } &&
7785          { ac_try='test -s "conftest$ac_exeext"'
7786   { (eval echo "$as_me:7786: \"$ac_try\"") >&5
7787   (eval $ac_try) 2>&5
7788   ac_status=$?
7789   echo "$as_me:7789: \$? = $ac_status" >&5
7790   (exit "$ac_status"); }; }; then
7791   cf_result=no
7792 else
7793   echo "$as_me: failed program was:" >&5
7794 cat "conftest.$ac_ext" >&5
7795
7796                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7797                                         cat >"conftest.$ac_ext" <<_ACEOF
7798 #line 7798 "configure"
7799 #include "confdefs.h"
7800 #include <${cf_cv_ncurses_header:-curses.h}>
7801 int
7802 main (void)
7803 {
7804 initscr()
7805   ;
7806   return 0;
7807 }
7808 _ACEOF
7809 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7810 if { (eval echo "$as_me:7810: \"$ac_link\"") >&5
7811   (eval $ac_link) 2>&5
7812   ac_status=$?
7813   echo "$as_me:7813: \$? = $ac_status" >&5
7814   (exit "$ac_status"); } &&
7815          { ac_try='test -s "conftest$ac_exeext"'
7816   { (eval echo "$as_me:7816: \"$ac_try\"") >&5
7817   (eval $ac_try) 2>&5
7818   ac_status=$?
7819   echo "$as_me:7819: \$? = $ac_status" >&5
7820   (exit "$ac_status"); }; }; then
7821   cf_result=yes
7822 else
7823   echo "$as_me: failed program was:" >&5
7824 cat "conftest.$ac_ext" >&5
7825 cf_result=error
7826 fi
7827 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7828
7829 fi
7830 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7831                                 echo "$as_me:7831: result: $cf_result" >&5
7832 echo "${ECHO_T}$cf_result" >&6
7833                                 test "$cf_result" != error && break
7834                         fi
7835                 done
7836         fi
7837         test "$cf_curs_lib" = unknown && { { echo "$as_me:7837: error: no curses library found" >&5
7838 echo "$as_me: error: no curses library found" >&2;}
7839    { (exit 1); exit 1; }; }
7840 fi
7841 fi
7842
7843         ;;
7844 (ncursesw*)
7845
7846 for ac_header in wchar.h
7847 do
7848 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7849 echo "$as_me:7849: checking for $ac_header" >&5
7850 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7851 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7852   echo $ECHO_N "(cached) $ECHO_C" >&6
7853 else
7854   cat >"conftest.$ac_ext" <<_ACEOF
7855 #line 7855 "configure"
7856 #include "confdefs.h"
7857 #include <$ac_header>
7858 _ACEOF
7859 if { (eval echo "$as_me:7859: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7860   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7861   ac_status=$?
7862   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7863   rm -f conftest.er1
7864   cat conftest.err >&5
7865   echo "$as_me:7865: \$? = $ac_status" >&5
7866   (exit "$ac_status"); } >/dev/null; then
7867   if test -s conftest.err; then
7868     ac_cpp_err=$ac_c_preproc_warn_flag
7869   else
7870     ac_cpp_err=
7871   fi
7872 else
7873   ac_cpp_err=yes
7874 fi
7875 if test -z "$ac_cpp_err"; then
7876   eval "$as_ac_Header=yes"
7877 else
7878   echo "$as_me: failed program was:" >&5
7879   cat "conftest.$ac_ext" >&5
7880   eval "$as_ac_Header=no"
7881 fi
7882 rm -f conftest.err "conftest.$ac_ext"
7883 fi
7884 echo "$as_me:7884: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7885 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7886 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7887   cat >>confdefs.h <<EOF
7888 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7889 EOF
7890
7891 fi
7892 done
7893
7894 echo "$as_me:7894: checking for multibyte character support" >&5
7895 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7896 if test "${cf_cv_utf8_lib+set}" = set; then
7897   echo $ECHO_N "(cached) $ECHO_C" >&6
7898 else
7899
7900         cf_save_LIBS="$LIBS"
7901         cat >"conftest.$ac_ext" <<_ACEOF
7902 #line 7902 "configure"
7903 #include "confdefs.h"
7904
7905 $ac_includes_default
7906 #ifdef HAVE_WCHAR_H
7907 #include <wchar.h>
7908 #endif
7909
7910 int
7911 main (void)
7912 {
7913 putwc(0,0);
7914   ;
7915   return 0;
7916 }
7917 _ACEOF
7918 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7919 if { (eval echo "$as_me:7919: \"$ac_link\"") >&5
7920   (eval $ac_link) 2>&5
7921   ac_status=$?
7922   echo "$as_me:7922: \$? = $ac_status" >&5
7923   (exit "$ac_status"); } &&
7924          { ac_try='test -s "conftest$ac_exeext"'
7925   { (eval echo "$as_me:7925: \"$ac_try\"") >&5
7926   (eval $ac_try) 2>&5
7927   ac_status=$?
7928   echo "$as_me:7928: \$? = $ac_status" >&5
7929   (exit "$ac_status"); }; }; then
7930   cf_cv_utf8_lib=yes
7931 else
7932   echo "$as_me: failed program was:" >&5
7933 cat "conftest.$ac_ext" >&5
7934
7935 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7936 # will be set on completion of the AC_TRY_LINK below.
7937 cf_cv_header_path_utf8=
7938 cf_cv_library_path_utf8=
7939
7940 echo "${as_me:-configure}:7940: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7941
7942 cf_save_LIBS="$LIBS"
7943
7944 cat >"conftest.$ac_ext" <<_ACEOF
7945 #line 7945 "configure"
7946 #include "confdefs.h"
7947
7948 #include <libutf8.h>
7949 int
7950 main (void)
7951 {
7952 putwc(0,0);
7953   ;
7954   return 0;
7955 }
7956 _ACEOF
7957 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7958 if { (eval echo "$as_me:7958: \"$ac_link\"") >&5
7959   (eval $ac_link) 2>&5
7960   ac_status=$?
7961   echo "$as_me:7961: \$? = $ac_status" >&5
7962   (exit "$ac_status"); } &&
7963          { ac_try='test -s "conftest$ac_exeext"'
7964   { (eval echo "$as_me:7964: \"$ac_try\"") >&5
7965   (eval $ac_try) 2>&5
7966   ac_status=$?
7967   echo "$as_me:7967: \$? = $ac_status" >&5
7968   (exit "$ac_status"); }; }; then
7969
7970         cf_cv_find_linkage_utf8=yes
7971         cf_cv_header_path_utf8=/usr/include
7972         cf_cv_library_path_utf8=/usr/lib
7973
7974 else
7975   echo "$as_me: failed program was:" >&5
7976 cat "conftest.$ac_ext" >&5
7977
7978 LIBS="-lutf8  $cf_save_LIBS"
7979
7980 cat >"conftest.$ac_ext" <<_ACEOF
7981 #line 7981 "configure"
7982 #include "confdefs.h"
7983
7984 #include <libutf8.h>
7985 int
7986 main (void)
7987 {
7988 putwc(0,0);
7989   ;
7990   return 0;
7991 }
7992 _ACEOF
7993 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7994 if { (eval echo "$as_me:7994: \"$ac_link\"") >&5
7995   (eval $ac_link) 2>&5
7996   ac_status=$?
7997   echo "$as_me:7997: \$? = $ac_status" >&5
7998   (exit "$ac_status"); } &&
7999          { ac_try='test -s "conftest$ac_exeext"'
8000   { (eval echo "$as_me:8000: \"$ac_try\"") >&5
8001   (eval $ac_try) 2>&5
8002   ac_status=$?
8003   echo "$as_me:8003: \$? = $ac_status" >&5
8004   (exit "$ac_status"); }; }; then
8005
8006         cf_cv_find_linkage_utf8=yes
8007         cf_cv_header_path_utf8=/usr/include
8008         cf_cv_library_path_utf8=/usr/lib
8009         cf_cv_library_file_utf8="-lutf8"
8010
8011 else
8012   echo "$as_me: failed program was:" >&5
8013 cat "conftest.$ac_ext" >&5
8014
8015         cf_cv_find_linkage_utf8=no
8016         LIBS="$cf_save_LIBS"
8017
8018         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
8019
8020 echo "${as_me:-configure}:8020: testing find linkage for utf8 library ..." 1>&5
8021
8022 echo "${as_me:-configure}:8022: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
8023
8024         cf_save_CPPFLAGS="$CPPFLAGS"
8025         cf_test_CPPFLAGS="$CPPFLAGS"
8026
8027 cf_search=
8028
8029 # collect the current set of include-directories from compiler flags
8030 cf_header_path_list=""
8031 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8032         for cf_header_path in $CPPFLAGS $CFLAGS
8033         do
8034                 case "$cf_header_path" in
8035                 (-I*)
8036                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8037
8038 test "x$cf_header_path" != "xNONE" && \
8039 test -d "$cf_header_path" && \
8040  {
8041         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8042         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8043         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
8044         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
8045         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
8046         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
8047 }
8048
8049                         cf_header_path_list="$cf_header_path_list $cf_search"
8050                         ;;
8051                 esac
8052         done
8053 fi
8054
8055 # add the variations for the package we are looking for
8056
8057 cf_search=
8058
8059 test "x$prefix" != "xNONE" && \
8060 test -d "$prefix" && \
8061  {
8062         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8063         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8064         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
8065         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
8066         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
8067         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
8068 }
8069
8070 for cf_subdir_prefix in \
8071         /usr \
8072         /usr/local \
8073         /usr/pkg \
8074         /opt \
8075         /opt/local \
8076         $HOME
8077 do
8078
8079 test "x$cf_subdir_prefix" != "x$prefix" && \
8080 test -d "$cf_subdir_prefix" && \
8081 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8082         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8083         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8084         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
8085         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
8086         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
8087         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
8088 }
8089
8090 done
8091
8092 test "$includedir" != NONE && \
8093 test "$includedir" != "/usr/include" && \
8094 test -d "$includedir" && {
8095         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8096         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
8097 }
8098
8099 test "$oldincludedir" != NONE && \
8100 test "$oldincludedir" != "/usr/include" && \
8101 test -d "$oldincludedir" && {
8102         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8103         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
8104 }
8105
8106 cf_search="$cf_search $cf_header_path_list"
8107
8108         for cf_cv_header_path_utf8 in $cf_search
8109         do
8110                 if test -d "$cf_cv_header_path_utf8" ; then
8111                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
8112
8113 echo "${as_me:-configure}:8113: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
8114
8115                         CPPFLAGS="$cf_save_CPPFLAGS"
8116
8117         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8118         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
8119
8120                         cat >"conftest.$ac_ext" <<_ACEOF
8121 #line 8121 "configure"
8122 #include "confdefs.h"
8123
8124 #include <libutf8.h>
8125 int
8126 main (void)
8127 {
8128 putwc(0,0);
8129   ;
8130   return 0;
8131 }
8132 _ACEOF
8133 rm -f "conftest.$ac_objext"
8134 if { (eval echo "$as_me:8134: \"$ac_compile\"") >&5
8135   (eval $ac_compile) 2>&5
8136   ac_status=$?
8137   echo "$as_me:8137: \$? = $ac_status" >&5
8138   (exit "$ac_status"); } &&
8139          { ac_try='test -s "conftest.$ac_objext"'
8140   { (eval echo "$as_me:8140: \"$ac_try\"") >&5
8141   (eval $ac_try) 2>&5
8142   ac_status=$?
8143   echo "$as_me:8143: \$? = $ac_status" >&5
8144   (exit "$ac_status"); }; }; then
8145
8146                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
8147
8148 echo "${as_me:-configure}:8148: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
8149
8150                                 cf_cv_find_linkage_utf8=maybe
8151                                 cf_test_CPPFLAGS="$CPPFLAGS"
8152                                 break
8153 else
8154   echo "$as_me: failed program was:" >&5
8155 cat "conftest.$ac_ext" >&5
8156
8157                                 CPPFLAGS="$cf_save_CPPFLAGS"
8158
8159 fi
8160 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8161                 fi
8162         done
8163
8164         if test "$cf_cv_find_linkage_utf8" = maybe ; then
8165
8166 echo "${as_me:-configure}:8166: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
8167
8168                 cf_save_LIBS="$LIBS"
8169                 cf_save_LDFLAGS="$LDFLAGS"
8170
8171                 if test "$cf_cv_find_linkage_utf8" != yes ; then
8172
8173 cf_search=
8174 cf_library_path_list=""
8175 if test -n "${LDFLAGS}${LIBS}" ; then
8176         for cf_library_path in $LDFLAGS $LIBS
8177         do
8178                 case "$cf_library_path" in
8179                 (-L*)
8180                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8181
8182 test "x$cf_library_path" != "xNONE" && \
8183 test -d "$cf_library_path" && \
8184  {
8185         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8186         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
8187         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
8188         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
8189         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
8190         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
8191 }
8192
8193                         cf_library_path_list="$cf_library_path_list $cf_search"
8194                         ;;
8195                 esac
8196         done
8197 fi
8198
8199 cf_search=
8200
8201 test "x$prefix" != "xNONE" && \
8202 test -d "$prefix" && \
8203  {
8204         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8205         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
8206         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
8207         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
8208         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
8209         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
8210 }
8211
8212 for cf_subdir_prefix in \
8213         /usr \
8214         /usr/local \
8215         /usr/pkg \
8216         /opt \
8217         /opt/local \
8218         $HOME
8219 do
8220
8221 test "x$cf_subdir_prefix" != "x$prefix" && \
8222 test -d "$cf_subdir_prefix" && \
8223 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8224         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8225         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8226         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
8227         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
8228         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
8229         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
8230 }
8231
8232 done
8233
8234 cf_search="$cf_library_path_list $cf_search"
8235
8236                         for cf_cv_library_path_utf8 in $cf_search
8237                         do
8238                                 if test -d "$cf_cv_library_path_utf8" ; then
8239                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
8240
8241 echo "${as_me:-configure}:8241: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
8242
8243                                         CPPFLAGS="$cf_test_CPPFLAGS"
8244                                         LIBS="-lutf8  $cf_save_LIBS"
8245                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
8246                                         cat >"conftest.$ac_ext" <<_ACEOF
8247 #line 8247 "configure"
8248 #include "confdefs.h"
8249
8250 #include <libutf8.h>
8251 int
8252 main (void)
8253 {
8254 putwc(0,0);
8255   ;
8256   return 0;
8257 }
8258 _ACEOF
8259 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8260 if { (eval echo "$as_me:8260: \"$ac_link\"") >&5
8261   (eval $ac_link) 2>&5
8262   ac_status=$?
8263   echo "$as_me:8263: \$? = $ac_status" >&5
8264   (exit "$ac_status"); } &&
8265          { ac_try='test -s "conftest$ac_exeext"'
8266   { (eval echo "$as_me:8266: \"$ac_try\"") >&5
8267   (eval $ac_try) 2>&5
8268   ac_status=$?
8269   echo "$as_me:8269: \$? = $ac_status" >&5
8270   (exit "$ac_status"); }; }; then
8271
8272                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8273
8274 echo "${as_me:-configure}:8274: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8275
8276                                         cf_cv_find_linkage_utf8=yes
8277                                         cf_cv_library_file_utf8="-lutf8"
8278                                         break
8279 else
8280   echo "$as_me: failed program was:" >&5
8281 cat "conftest.$ac_ext" >&5
8282
8283                                         CPPFLAGS="$cf_save_CPPFLAGS"
8284                                         LIBS="$cf_save_LIBS"
8285                                         LDFLAGS="$cf_save_LDFLAGS"
8286
8287 fi
8288 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8289                                 fi
8290                         done
8291                         CPPFLAGS="$cf_save_CPPFLAGS"
8292                         LDFLAGS="$cf_save_LDFLAGS"
8293                 fi
8294
8295         else
8296                 cf_cv_find_linkage_utf8=no
8297         fi
8298
8299 fi
8300 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8301
8302 fi
8303 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8304
8305 LIBS="$cf_save_LIBS"
8306
8307 if test "$cf_cv_find_linkage_utf8" = yes ; then
8308 cf_cv_utf8_lib=add-on
8309 else
8310 cf_cv_utf8_lib=no
8311 fi
8312
8313 fi
8314 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8315 fi
8316 echo "$as_me:8316: result: $cf_cv_utf8_lib" >&5
8317 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8318
8319 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8320 # ncurses/ncursesw:
8321 if test "$cf_cv_utf8_lib" = "add-on" ; then
8322
8323 cat >>confdefs.h <<\EOF
8324 #define HAVE_LIBUTF8_H 1
8325 EOF
8326
8327 if test -n "$cf_cv_header_path_utf8" ; then
8328   for cf_add_incdir in $cf_cv_header_path_utf8
8329   do
8330         while test "$cf_add_incdir" != /usr/include
8331         do
8332           if test -d "$cf_add_incdir"
8333           then
8334                 cf_have_incdir=no
8335                 if test -n "$CFLAGS$CPPFLAGS" ; then
8336                   # a loop is needed to ensure we can add subdirs of existing dirs
8337                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8338                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8339                           cf_have_incdir=yes; break
8340                         fi
8341                   done
8342                 fi
8343
8344                 if test "$cf_have_incdir" = no ; then
8345                   if test "$cf_add_incdir" = /usr/local/include ; then
8346                         if test "$GCC" = yes
8347                         then
8348                           cf_save_CPPFLAGS=$CPPFLAGS
8349
8350         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8351         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8352
8353                           cat >"conftest.$ac_ext" <<_ACEOF
8354 #line 8354 "configure"
8355 #include "confdefs.h"
8356 #include <stdio.h>
8357 int
8358 main (void)
8359 {
8360 printf("Hello")
8361   ;
8362   return 0;
8363 }
8364 _ACEOF
8365 rm -f "conftest.$ac_objext"
8366 if { (eval echo "$as_me:8366: \"$ac_compile\"") >&5
8367   (eval $ac_compile) 2>&5
8368   ac_status=$?
8369   echo "$as_me:8369: \$? = $ac_status" >&5
8370   (exit "$ac_status"); } &&
8371          { ac_try='test -s "conftest.$ac_objext"'
8372   { (eval echo "$as_me:8372: \"$ac_try\"") >&5
8373   (eval $ac_try) 2>&5
8374   ac_status=$?
8375   echo "$as_me:8375: \$? = $ac_status" >&5
8376   (exit "$ac_status"); }; }; then
8377   :
8378 else
8379   echo "$as_me: failed program was:" >&5
8380 cat "conftest.$ac_ext" >&5
8381 cf_have_incdir=yes
8382 fi
8383 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8384                           CPPFLAGS=$cf_save_CPPFLAGS
8385                         fi
8386                   fi
8387                 fi
8388
8389                 if test "$cf_have_incdir" = no ; then
8390                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8391
8392 echo "${as_me:-configure}:8392: testing adding $cf_add_incdir to include-path ..." 1>&5
8393
8394                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8395
8396                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8397                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8398                   cf_add_incdir="$cf_top_incdir"
8399                 else
8400                   break
8401                 fi
8402           else
8403                 break
8404           fi
8405         done
8406   done
8407 fi
8408
8409 if test -n "$cf_cv_library_path_utf8" ; then
8410         for cf_add_libdir in $cf_cv_library_path_utf8
8411         do
8412                 if test "$cf_add_libdir" = /usr/lib ; then
8413                         :
8414                 elif test -d "$cf_add_libdir"
8415                 then
8416                         cf_have_libdir=no
8417                         if test -n "$LDFLAGS$LIBS" ; then
8418                                 # a loop is needed to ensure we can add subdirs of existing dirs
8419                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
8420                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8421                                                 cf_have_libdir=yes; break
8422                                         fi
8423                                 done
8424                         fi
8425                         if test "$cf_have_libdir" = no ; then
8426                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8427
8428 echo "${as_me:-configure}:8428: testing adding $cf_add_libdir to library-path ..." 1>&5
8429
8430                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8431                         fi
8432                 fi
8433         done
8434 fi
8435
8436 cf_add_libs="$LIBS"
8437 # reverse order
8438 cf_add_0lib=
8439 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8440 # filter duplicates
8441 for cf_add_1lib in $cf_add_0lib; do
8442         for cf_add_2lib in $cf_add_libs; do
8443                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8444                         cf_add_1lib=
8445                         break
8446                 fi
8447         done
8448         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8449 done
8450 LIBS="$cf_add_libs"
8451
8452 fi
8453
8454 cf_ncuconfig_root=$cf_cv_screen
8455 cf_have_ncuconfig=no
8456
8457 if test "x${PKG_CONFIG:=none}" != xnone; then
8458         echo "$as_me:8458: checking pkg-config for $cf_ncuconfig_root" >&5
8459 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8460         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8461                 echo "$as_me:8461: result: yes" >&5
8462 echo "${ECHO_T}yes" >&6
8463
8464                 echo "$as_me:8464: checking if the $cf_ncuconfig_root package files work" >&5
8465 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8466                 cf_have_ncuconfig=unknown
8467
8468                 cf_save_CFLAGS="$CFLAGS"
8469                 cf_save_CPPFLAGS="$CPPFLAGS"
8470                 cf_save_LIBS="$LIBS"
8471
8472                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8473                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8474
8475                 # while -W for passing linker flags is prevalent, it is not "standard".
8476                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8477                 # incompatible _and_ non-standard -W option which gives an error.  Work
8478                 # around that pitfall.
8479                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8480                 (x*c[89]9@@*-W*)
8481
8482 cf_fix_cppflags=no
8483 cf_new_cflags=
8484 cf_new_cppflags=
8485 cf_new_extra_cppflags=
8486
8487 for cf_add_cflags in $cf_pkg_cflags
8488 do
8489 case "$cf_fix_cppflags" in
8490 (no)
8491         case "$cf_add_cflags" in
8492         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8493                 case "$cf_add_cflags" in
8494                 (-D*)
8495                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8496
8497                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8498                                 && test -z "${cf_tst_cflags}" \
8499                                 && cf_fix_cppflags=yes
8500
8501                         if test "$cf_fix_cppflags" = yes ; then
8502
8503         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8504         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8505
8506                                 continue
8507                         elif test "${cf_tst_cflags}" = "\"'" ; then
8508
8509         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8510         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8511
8512                                 continue
8513                         fi
8514                         ;;
8515                 esac
8516                 case "$CPPFLAGS" in
8517                 (*$cf_add_cflags)
8518                         ;;
8519                 (*)
8520                         case "$cf_add_cflags" in
8521                         (-D*)
8522                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8523
8524 CPPFLAGS=`echo "$CPPFLAGS" | \
8525         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8526                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8527
8528                                 ;;
8529                         esac
8530
8531         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8532         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8533
8534                         ;;
8535                 esac
8536                 ;;
8537         (*)
8538
8539         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8540         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8541
8542                 ;;
8543         esac
8544         ;;
8545 (yes)
8546
8547         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8548         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8549
8550         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8551
8552         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8553                 && test -z "${cf_tst_cflags}" \
8554                 && cf_fix_cppflags=no
8555         ;;
8556 esac
8557 done
8558
8559 if test -n "$cf_new_cflags" ; then
8560
8561         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8562         CFLAGS="${CFLAGS}$cf_new_cflags"
8563
8564 fi
8565
8566 if test -n "$cf_new_cppflags" ; then
8567
8568         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8569         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8570
8571 fi
8572
8573 if test -n "$cf_new_extra_cppflags" ; then
8574
8575         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8576         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8577
8578 fi
8579
8580 cf_add_libs="$LIBS"
8581 # reverse order
8582 cf_add_0lib=
8583 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8584 # filter duplicates
8585 for cf_add_1lib in $cf_add_0lib; do
8586         for cf_add_2lib in $cf_add_libs; do
8587                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8588                         cf_add_1lib=
8589                         break
8590                 fi
8591         done
8592         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8593 done
8594 LIBS="$cf_add_libs"
8595
8596                         cat >"conftest.$ac_ext" <<_ACEOF
8597 #line 8597 "configure"
8598 #include "confdefs.h"
8599 #include <${cf_cv_ncurses_header:-curses.h}>
8600 int
8601 main (void)
8602 {
8603 initscr(); mousemask(0,0); tigetstr((char *)0);
8604   ;
8605   return 0;
8606 }
8607 _ACEOF
8608 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8609 if { (eval echo "$as_me:8609: \"$ac_link\"") >&5
8610   (eval $ac_link) 2>&5
8611   ac_status=$?
8612   echo "$as_me:8612: \$? = $ac_status" >&5
8613   (exit "$ac_status"); } &&
8614          { ac_try='test -s "conftest$ac_exeext"'
8615   { (eval echo "$as_me:8615: \"$ac_try\"") >&5
8616   (eval $ac_try) 2>&5
8617   ac_status=$?
8618   echo "$as_me:8618: \$? = $ac_status" >&5
8619   (exit "$ac_status"); }; }; then
8620   if test "$cross_compiling" = yes; then
8621   cf_test_ncuconfig=maybe
8622 else
8623   cat >"conftest.$ac_ext" <<_ACEOF
8624 #line 8624 "configure"
8625 #include "confdefs.h"
8626 #include <${cf_cv_ncurses_header:-curses.h}>
8627                                         int main(void)
8628                                         { const char *xx = curses_version(); return (xx == 0); }
8629 _ACEOF
8630 rm -f "conftest$ac_exeext"
8631 if { (eval echo "$as_me:8631: \"$ac_link\"") >&5
8632   (eval $ac_link) 2>&5
8633   ac_status=$?
8634   echo "$as_me:8634: \$? = $ac_status" >&5
8635   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8636   { (eval echo "$as_me:8636: \"$ac_try\"") >&5
8637   (eval $ac_try) 2>&5
8638   ac_status=$?
8639   echo "$as_me:8639: \$? = $ac_status" >&5
8640   (exit "$ac_status"); }; }; then
8641   cf_test_ncuconfig=yes
8642 else
8643   echo "$as_me: program exited with status $ac_status" >&5
8644 echo "$as_me: failed program was:" >&5
8645 cat "conftest.$ac_ext" >&5
8646 cf_test_ncuconfig=no
8647 fi
8648 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8649 fi
8650 else
8651   echo "$as_me: failed program was:" >&5
8652 cat "conftest.$ac_ext" >&5
8653 cf_test_ncuconfig=no
8654 fi
8655 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8656
8657                         CFLAGS="$cf_save_CFLAGS"
8658                         CPPFLAGS="$cf_save_CPPFLAGS"
8659                         LIBS="$cf_save_LIBS"
8660
8661                         if test "x$cf_test_ncuconfig" != xyes; then
8662                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8663                                 cf_pkg_cflags="$cf_temp"
8664                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8665                                 cf_pkg_libs="$cf_temp"
8666                         fi
8667                         ;;
8668                 esac
8669
8670 for cf_add_cflags in $cf_pkg_cflags
8671 do
8672         case "x$cf_add_cflags" in
8673         (x-[DU]*)
8674
8675 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8676 while true
8677 do
8678         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8679         test "$CFLAGS" != "$cf_old_cflag" || break
8680
8681         CFLAGS="$cf_old_cflag"
8682 done
8683
8684 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8685 while true
8686 do
8687         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8688         test "$CPPFLAGS" != "$cf_old_cflag" || break
8689
8690         CPPFLAGS="$cf_old_cflag"
8691 done
8692
8693                 ;;
8694         esac
8695
8696 cf_fix_cppflags=no
8697 cf_new_cflags=
8698 cf_new_cppflags=
8699 cf_new_extra_cppflags=
8700
8701 for cf_add_cflags in $cf_add_cflags
8702 do
8703 case "$cf_fix_cppflags" in
8704 (no)
8705         case "$cf_add_cflags" in
8706         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8707                 case "$cf_add_cflags" in
8708                 (-D*)
8709                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8710
8711                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8712                                 && test -z "${cf_tst_cflags}" \
8713                                 && cf_fix_cppflags=yes
8714
8715                         if test "$cf_fix_cppflags" = yes ; then
8716
8717         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8718         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8719
8720                                 continue
8721                         elif test "${cf_tst_cflags}" = "\"'" ; then
8722
8723         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8724         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8725
8726                                 continue
8727                         fi
8728                         ;;
8729                 esac
8730                 case "$CPPFLAGS" in
8731                 (*$cf_add_cflags)
8732                         ;;
8733                 (*)
8734                         case "$cf_add_cflags" in
8735                         (-D*)
8736                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8737
8738 CPPFLAGS=`echo "$CPPFLAGS" | \
8739         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8740                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8741
8742                                 ;;
8743                         esac
8744
8745         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8746         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8747
8748                         ;;
8749                 esac
8750                 ;;
8751         (*)
8752
8753         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8754         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8755
8756                 ;;
8757         esac
8758         ;;
8759 (yes)
8760
8761         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8762         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8763
8764         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8765
8766         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8767                 && test -z "${cf_tst_cflags}" \
8768                 && cf_fix_cppflags=no
8769         ;;
8770 esac
8771 done
8772
8773 if test -n "$cf_new_cflags" ; then
8774
8775         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8776         CFLAGS="${CFLAGS}$cf_new_cflags"
8777
8778 fi
8779
8780 if test -n "$cf_new_cppflags" ; then
8781
8782         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8783         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8784
8785 fi
8786
8787 if test -n "$cf_new_extra_cppflags" ; then
8788
8789         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8790         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8791
8792 fi
8793
8794 done
8795
8796 cf_add_libs="$LIBS"
8797 # reverse order
8798 cf_add_0lib=
8799 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8800 # filter duplicates
8801 for cf_add_1lib in $cf_add_0lib; do
8802         for cf_add_2lib in $cf_add_libs; do
8803                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8804                         cf_add_1lib=
8805                         break
8806                 fi
8807         done
8808         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8809 done
8810 LIBS="$cf_add_libs"
8811
8812                 cat >"conftest.$ac_ext" <<_ACEOF
8813 #line 8813 "configure"
8814 #include "confdefs.h"
8815 #include <${cf_cv_ncurses_header:-curses.h}>
8816 int
8817 main (void)
8818 {
8819 initscr(); mousemask(0,0); tigetstr((char *)0);
8820   ;
8821   return 0;
8822 }
8823 _ACEOF
8824 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8825 if { (eval echo "$as_me:8825: \"$ac_link\"") >&5
8826   (eval $ac_link) 2>&5
8827   ac_status=$?
8828   echo "$as_me:8828: \$? = $ac_status" >&5
8829   (exit "$ac_status"); } &&
8830          { ac_try='test -s "conftest$ac_exeext"'
8831   { (eval echo "$as_me:8831: \"$ac_try\"") >&5
8832   (eval $ac_try) 2>&5
8833   ac_status=$?
8834   echo "$as_me:8834: \$? = $ac_status" >&5
8835   (exit "$ac_status"); }; }; then
8836   if test "$cross_compiling" = yes; then
8837   cf_have_ncuconfig=maybe
8838 else
8839   cat >"conftest.$ac_ext" <<_ACEOF
8840 #line 8840 "configure"
8841 #include "confdefs.h"
8842 #include <${cf_cv_ncurses_header:-curses.h}>
8843                                 int main(void)
8844                                 { const char *xx = curses_version(); return (xx == 0); }
8845 _ACEOF
8846 rm -f "conftest$ac_exeext"
8847 if { (eval echo "$as_me:8847: \"$ac_link\"") >&5
8848   (eval $ac_link) 2>&5
8849   ac_status=$?
8850   echo "$as_me:8850: \$? = $ac_status" >&5
8851   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8852   { (eval echo "$as_me:8852: \"$ac_try\"") >&5
8853   (eval $ac_try) 2>&5
8854   ac_status=$?
8855   echo "$as_me:8855: \$? = $ac_status" >&5
8856   (exit "$ac_status"); }; }; then
8857   cf_have_ncuconfig=yes
8858 else
8859   echo "$as_me: program exited with status $ac_status" >&5
8860 echo "$as_me: failed program was:" >&5
8861 cat "conftest.$ac_ext" >&5
8862 cf_have_ncuconfig=no
8863 fi
8864 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8865 fi
8866 else
8867   echo "$as_me: failed program was:" >&5
8868 cat "conftest.$ac_ext" >&5
8869 cf_have_ncuconfig=no
8870 fi
8871 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8872                 echo "$as_me:8872: result: $cf_have_ncuconfig" >&5
8873 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8874                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8875                 if test "$cf_have_ncuconfig" != "yes"
8876                 then
8877                         CPPFLAGS="$cf_save_CPPFLAGS"
8878                         LIBS="$cf_save_LIBS"
8879                         NCURSES_CONFIG_PKG=none
8880                 else
8881
8882 cat >>confdefs.h <<\EOF
8883 #define NCURSES 1
8884 EOF
8885
8886                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8887
8888 echo "$as_me:8888: checking for terminfo header" >&5
8889 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8890 if test "${cf_cv_term_header+set}" = set; then
8891   echo $ECHO_N "(cached) $ECHO_C" >&6
8892 else
8893
8894 case "${cf_cv_ncurses_header}" in
8895 (*/ncurses.h|*/ncursesw.h)
8896         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8897         ;;
8898 (*)
8899         cf_term_header=term.h
8900         ;;
8901 esac
8902
8903 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8904 do
8905 cat >"conftest.$ac_ext" <<_ACEOF
8906 #line 8906 "configure"
8907 #include "confdefs.h"
8908 #include <stdio.h>
8909 #include <${cf_cv_ncurses_header:-curses.h}>
8910 #include <$cf_test>
8911
8912 int
8913 main (void)
8914 {
8915 int x = auto_left_margin; (void)x
8916   ;
8917   return 0;
8918 }
8919 _ACEOF
8920 rm -f "conftest.$ac_objext"
8921 if { (eval echo "$as_me:8921: \"$ac_compile\"") >&5
8922   (eval $ac_compile) 2>&5
8923   ac_status=$?
8924   echo "$as_me:8924: \$? = $ac_status" >&5
8925   (exit "$ac_status"); } &&
8926          { ac_try='test -s "conftest.$ac_objext"'
8927   { (eval echo "$as_me:8927: \"$ac_try\"") >&5
8928   (eval $ac_try) 2>&5
8929   ac_status=$?
8930   echo "$as_me:8930: \$? = $ac_status" >&5
8931   (exit "$ac_status"); }; }; then
8932
8933         cf_cv_term_header="$cf_test"
8934 else
8935   echo "$as_me: failed program was:" >&5
8936 cat "conftest.$ac_ext" >&5
8937
8938         cf_cv_term_header=unknown
8939
8940 fi
8941 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8942         test "$cf_cv_term_header" != unknown && break
8943 done
8944
8945 fi
8946 echo "$as_me:8946: result: $cf_cv_term_header" >&5
8947 echo "${ECHO_T}$cf_cv_term_header" >&6
8948
8949 # Set definitions to allow ifdef'ing to accommodate subdirectories
8950
8951 case "$cf_cv_term_header" in
8952 (*term.h)
8953
8954 cat >>confdefs.h <<\EOF
8955 #define HAVE_TERM_H 1
8956 EOF
8957
8958         ;;
8959 esac
8960
8961 case "$cf_cv_term_header" in
8962 (ncurses/term.h)
8963
8964 cat >>confdefs.h <<\EOF
8965 #define HAVE_NCURSES_TERM_H 1
8966 EOF
8967
8968         ;;
8969 (ncursesw/term.h)
8970
8971 cat >>confdefs.h <<\EOF
8972 #define HAVE_NCURSESW_TERM_H 1
8973 EOF
8974
8975         ;;
8976 esac
8977
8978                 fi
8979
8980         else
8981                 echo "$as_me:8981: result: no" >&5
8982 echo "${ECHO_T}no" >&6
8983                 NCURSES_CONFIG_PKG=none
8984         fi
8985 else
8986         NCURSES_CONFIG_PKG=none
8987 fi
8988
8989 if test "x$cf_have_ncuconfig" = "xno"; then
8990         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8991
8992 if test -n "$ac_tool_prefix"; then
8993   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8994   do
8995     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8996 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8997 echo "$as_me:8997: checking for $ac_word" >&5
8998 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8999 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9000   echo $ECHO_N "(cached) $ECHO_C" >&6
9001 else
9002   if test -n "$NCURSES_CONFIG"; then
9003   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9004 else
9005   ac_save_IFS=$IFS; IFS=$ac_path_separator
9006 ac_dummy="$PATH"
9007 for ac_dir in $ac_dummy; do
9008   IFS=$ac_save_IFS
9009   test -z "$ac_dir" && ac_dir=.
9010   $as_executable_p "$ac_dir/$ac_word" || continue
9011 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9012 echo "$as_me:9012: found $ac_dir/$ac_word" >&5
9013 break
9014 done
9015
9016 fi
9017 fi
9018 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9019 if test -n "$NCURSES_CONFIG"; then
9020   echo "$as_me:9020: result: $NCURSES_CONFIG" >&5
9021 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9022 else
9023   echo "$as_me:9023: result: no" >&5
9024 echo "${ECHO_T}no" >&6
9025 fi
9026
9027     test -n "$NCURSES_CONFIG" && break
9028   done
9029 fi
9030 if test -z "$NCURSES_CONFIG"; then
9031   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9032   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9033 do
9034   # Extract the first word of "$ac_prog", so it can be a program name with args.
9035 set dummy $ac_prog; ac_word=$2
9036 echo "$as_me:9036: checking for $ac_word" >&5
9037 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9038 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9039   echo $ECHO_N "(cached) $ECHO_C" >&6
9040 else
9041   if test -n "$ac_ct_NCURSES_CONFIG"; then
9042   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9043 else
9044   ac_save_IFS=$IFS; IFS=$ac_path_separator
9045 ac_dummy="$PATH"
9046 for ac_dir in $ac_dummy; do
9047   IFS=$ac_save_IFS
9048   test -z "$ac_dir" && ac_dir=.
9049   $as_executable_p "$ac_dir/$ac_word" || continue
9050 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9051 echo "$as_me:9051: found $ac_dir/$ac_word" >&5
9052 break
9053 done
9054
9055 fi
9056 fi
9057 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9058 if test -n "$ac_ct_NCURSES_CONFIG"; then
9059   echo "$as_me:9059: result: $ac_ct_NCURSES_CONFIG" >&5
9060 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9061 else
9062   echo "$as_me:9062: result: no" >&5
9063 echo "${ECHO_T}no" >&6
9064 fi
9065
9066   test -n "$ac_ct_NCURSES_CONFIG" && break
9067 done
9068 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9069
9070   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9071 fi
9072
9073         if test "$NCURSES_CONFIG" != none ; then
9074
9075 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9076 do
9077         case "x$cf_add_cflags" in
9078         (x-[DU]*)
9079
9080 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9081 while true
9082 do
9083         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9084         test "$CFLAGS" != "$cf_old_cflag" || break
9085
9086         CFLAGS="$cf_old_cflag"
9087 done
9088
9089 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9090 while true
9091 do
9092         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9093         test "$CPPFLAGS" != "$cf_old_cflag" || break
9094
9095         CPPFLAGS="$cf_old_cflag"
9096 done
9097
9098                 ;;
9099         esac
9100
9101 cf_fix_cppflags=no
9102 cf_new_cflags=
9103 cf_new_cppflags=
9104 cf_new_extra_cppflags=
9105
9106 for cf_add_cflags in $cf_add_cflags
9107 do
9108 case "$cf_fix_cppflags" in
9109 (no)
9110         case "$cf_add_cflags" in
9111         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9112                 case "$cf_add_cflags" in
9113                 (-D*)
9114                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9115
9116                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9117                                 && test -z "${cf_tst_cflags}" \
9118                                 && cf_fix_cppflags=yes
9119
9120                         if test "$cf_fix_cppflags" = yes ; then
9121
9122         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9123         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9124
9125                                 continue
9126                         elif test "${cf_tst_cflags}" = "\"'" ; then
9127
9128         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9129         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9130
9131                                 continue
9132                         fi
9133                         ;;
9134                 esac
9135                 case "$CPPFLAGS" in
9136                 (*$cf_add_cflags)
9137                         ;;
9138                 (*)
9139                         case "$cf_add_cflags" in
9140                         (-D*)
9141                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9142
9143 CPPFLAGS=`echo "$CPPFLAGS" | \
9144         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9145                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9146
9147                                 ;;
9148                         esac
9149
9150         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9151         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9152
9153                         ;;
9154                 esac
9155                 ;;
9156         (*)
9157
9158         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9159         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9160
9161                 ;;
9162         esac
9163         ;;
9164 (yes)
9165
9166         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9167         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9168
9169         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9170
9171         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9172                 && test -z "${cf_tst_cflags}" \
9173                 && cf_fix_cppflags=no
9174         ;;
9175 esac
9176 done
9177
9178 if test -n "$cf_new_cflags" ; then
9179
9180         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9181         CFLAGS="${CFLAGS}$cf_new_cflags"
9182
9183 fi
9184
9185 if test -n "$cf_new_cppflags" ; then
9186
9187         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9188         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9189
9190 fi
9191
9192 if test -n "$cf_new_extra_cppflags" ; then
9193
9194         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9195         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9196
9197 fi
9198
9199 done
9200
9201 cf_add_libs="$LIBS"
9202 # reverse order
9203 cf_add_0lib=
9204 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9205 # filter duplicates
9206 for cf_add_1lib in $cf_add_0lib; do
9207         for cf_add_2lib in $cf_add_libs; do
9208                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9209                         cf_add_1lib=
9210                         break
9211                 fi
9212         done
9213         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9214 done
9215 LIBS="$cf_add_libs"
9216
9217                 # even with config script, some packages use no-override for curses.h
9218
9219 echo "$as_me:9219: checking if we have identified curses headers" >&5
9220 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9221 if test "${cf_cv_ncurses_header+set}" = set; then
9222   echo $ECHO_N "(cached) $ECHO_C" >&6
9223 else
9224
9225 cf_cv_ncurses_header=none
9226 for cf_header in \
9227         ncurses.h $cf_cv_screen/ncurses.h \
9228         curses.h $cf_cv_screen/curses.h
9229 do
9230 cat >"conftest.$ac_ext" <<_ACEOF
9231 #line 9231 "configure"
9232 #include "confdefs.h"
9233 #include <${cf_header}>
9234 int
9235 main (void)
9236 {
9237 initscr(); endwin()
9238   ;
9239   return 0;
9240 }
9241 _ACEOF
9242 rm -f "conftest.$ac_objext"
9243 if { (eval echo "$as_me:9243: \"$ac_compile\"") >&5
9244   (eval $ac_compile) 2>&5
9245   ac_status=$?
9246   echo "$as_me:9246: \$? = $ac_status" >&5
9247   (exit "$ac_status"); } &&
9248          { ac_try='test -s "conftest.$ac_objext"'
9249   { (eval echo "$as_me:9249: \"$ac_try\"") >&5
9250   (eval $ac_try) 2>&5
9251   ac_status=$?
9252   echo "$as_me:9252: \$? = $ac_status" >&5
9253   (exit "$ac_status"); }; }; then
9254   cf_cv_ncurses_header=$cf_header; break
9255 else
9256   echo "$as_me: failed program was:" >&5
9257 cat "conftest.$ac_ext" >&5
9258 fi
9259 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9260 done
9261
9262 fi
9263 echo "$as_me:9263: result: $cf_cv_ncurses_header" >&5
9264 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9265
9266 if test "$cf_cv_ncurses_header" = none ; then
9267         { { echo "$as_me:9267: error: No curses header-files found" >&5
9268 echo "$as_me: error: No curses header-files found" >&2;}
9269    { (exit 1); exit 1; }; }
9270 fi
9271
9272 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9273
9274 for ac_header in $cf_cv_ncurses_header
9275 do
9276 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9277 echo "$as_me:9277: checking for $ac_header" >&5
9278 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9279 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9280   echo $ECHO_N "(cached) $ECHO_C" >&6
9281 else
9282   cat >"conftest.$ac_ext" <<_ACEOF
9283 #line 9283 "configure"
9284 #include "confdefs.h"
9285 #include <$ac_header>
9286 _ACEOF
9287 if { (eval echo "$as_me:9287: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9288   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9289   ac_status=$?
9290   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9291   rm -f conftest.er1
9292   cat conftest.err >&5
9293   echo "$as_me:9293: \$? = $ac_status" >&5
9294   (exit "$ac_status"); } >/dev/null; then
9295   if test -s conftest.err; then
9296     ac_cpp_err=$ac_c_preproc_warn_flag
9297   else
9298     ac_cpp_err=
9299   fi
9300 else
9301   ac_cpp_err=yes
9302 fi
9303 if test -z "$ac_cpp_err"; then
9304   eval "$as_ac_Header=yes"
9305 else
9306   echo "$as_me: failed program was:" >&5
9307   cat "conftest.$ac_ext" >&5
9308   eval "$as_ac_Header=no"
9309 fi
9310 rm -f conftest.err "conftest.$ac_ext"
9311 fi
9312 echo "$as_me:9312: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9313 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9314 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9315   cat >>confdefs.h <<EOF
9316 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9317 EOF
9318
9319 fi
9320 done
9321
9322 cat >>confdefs.h <<\EOF
9323 #define NCURSES 1
9324 EOF
9325
9326 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9327
9328                 cat >>confdefs.h <<EOF
9329 #define $cf_nculib_ROOT 1
9330 EOF
9331
9332                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9333
9334         else
9335
9336 cf_ncuhdr_root=$cf_cv_screen
9337
9338 test -n "$cf_cv_curses_dir" && \
9339 test "$cf_cv_curses_dir" != "no" && { \
9340
9341 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9342   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9343   do
9344         while test "$cf_add_incdir" != /usr/include
9345         do
9346           if test -d "$cf_add_incdir"
9347           then
9348                 cf_have_incdir=no
9349                 if test -n "$CFLAGS$CPPFLAGS" ; then
9350                   # a loop is needed to ensure we can add subdirs of existing dirs
9351                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9352                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9353                           cf_have_incdir=yes; break
9354                         fi
9355                   done
9356                 fi
9357
9358                 if test "$cf_have_incdir" = no ; then
9359                   if test "$cf_add_incdir" = /usr/local/include ; then
9360                         if test "$GCC" = yes
9361                         then
9362                           cf_save_CPPFLAGS=$CPPFLAGS
9363
9364         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9365         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9366
9367                           cat >"conftest.$ac_ext" <<_ACEOF
9368 #line 9368 "configure"
9369 #include "confdefs.h"
9370 #include <stdio.h>
9371 int
9372 main (void)
9373 {
9374 printf("Hello")
9375   ;
9376   return 0;
9377 }
9378 _ACEOF
9379 rm -f "conftest.$ac_objext"
9380 if { (eval echo "$as_me:9380: \"$ac_compile\"") >&5
9381   (eval $ac_compile) 2>&5
9382   ac_status=$?
9383   echo "$as_me:9383: \$? = $ac_status" >&5
9384   (exit "$ac_status"); } &&
9385          { ac_try='test -s "conftest.$ac_objext"'
9386   { (eval echo "$as_me:9386: \"$ac_try\"") >&5
9387   (eval $ac_try) 2>&5
9388   ac_status=$?
9389   echo "$as_me:9389: \$? = $ac_status" >&5
9390   (exit "$ac_status"); }; }; then
9391   :
9392 else
9393   echo "$as_me: failed program was:" >&5
9394 cat "conftest.$ac_ext" >&5
9395 cf_have_incdir=yes
9396 fi
9397 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9398                           CPPFLAGS=$cf_save_CPPFLAGS
9399                         fi
9400                   fi
9401                 fi
9402
9403                 if test "$cf_have_incdir" = no ; then
9404                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9405
9406 echo "${as_me:-configure}:9406: testing adding $cf_add_incdir to include-path ..." 1>&5
9407
9408                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9409
9410                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9411                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9412                   cf_add_incdir="$cf_top_incdir"
9413                 else
9414                   break
9415                 fi
9416           else
9417                 break
9418           fi
9419         done
9420   done
9421 fi
9422
9423 }
9424
9425 echo "$as_me:9425: checking for $cf_ncuhdr_root header in include-path" >&5
9426 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9427 if test "${cf_cv_ncurses_h+set}" = set; then
9428   echo $ECHO_N "(cached) $ECHO_C" >&6
9429 else
9430
9431         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9432         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9433         for cf_header in $cf_header_list
9434         do
9435
9436         cat >"conftest.$ac_ext" <<_ACEOF
9437 #line 9437 "configure"
9438 #include "confdefs.h"
9439
9440 #include <$cf_header>
9441 int
9442 main (void)
9443 {
9444
9445 #ifdef NCURSES_VERSION
9446
9447 printf("%s\\n", NCURSES_VERSION);
9448 #else
9449 #ifdef __NCURSES_H
9450 printf("old\\n");
9451 #else
9452         #error __NCURSES_H is not defined
9453 #endif
9454 #endif
9455
9456   ;
9457   return 0;
9458 }
9459 _ACEOF
9460 rm -f "conftest.$ac_objext"
9461 if { (eval echo "$as_me:9461: \"$ac_compile\"") >&5
9462   (eval $ac_compile) 2>&5
9463   ac_status=$?
9464   echo "$as_me:9464: \$? = $ac_status" >&5
9465   (exit "$ac_status"); } &&
9466          { ac_try='test -s "conftest.$ac_objext"'
9467   { (eval echo "$as_me:9467: \"$ac_try\"") >&5
9468   (eval $ac_try) 2>&5
9469   ac_status=$?
9470   echo "$as_me:9470: \$? = $ac_status" >&5
9471   (exit "$ac_status"); }; }; then
9472   cf_cv_ncurses_h=$cf_header
9473
9474 else
9475   echo "$as_me: failed program was:" >&5
9476 cat "conftest.$ac_ext" >&5
9477 cf_cv_ncurses_h=no
9478 fi
9479 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9480
9481                 test "$cf_cv_ncurses_h" != no && break
9482         done
9483
9484 fi
9485 echo "$as_me:9485: result: $cf_cv_ncurses_h" >&5
9486 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9487
9488 if test "$cf_cv_ncurses_h" != no ; then
9489         cf_cv_ncurses_header=$cf_cv_ncurses_h
9490 else
9491
9492 echo "$as_me:9492: checking for $cf_ncuhdr_root include-path" >&5
9493 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9494 if test "${cf_cv_ncurses_h2+set}" = set; then
9495   echo $ECHO_N "(cached) $ECHO_C" >&6
9496 else
9497
9498         test -n "$verbose" && echo
9499
9500 cf_search=
9501
9502 # collect the current set of include-directories from compiler flags
9503 cf_header_path_list=""
9504 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9505         for cf_header_path in $CPPFLAGS $CFLAGS
9506         do
9507                 case "$cf_header_path" in
9508                 (-I*)
9509                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9510
9511 test "x$cf_header_path" != "xNONE" && \
9512 test -d "$cf_header_path" && \
9513  {
9514         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9515         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
9516         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9517         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9518         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9519         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"
9520 }
9521
9522                         cf_header_path_list="$cf_header_path_list $cf_search"
9523                         ;;
9524                 esac
9525         done
9526 fi
9527
9528 # add the variations for the package we are looking for
9529
9530 cf_search=
9531
9532 test "x$prefix" != "xNONE" && \
9533 test -d "$prefix" && \
9534  {
9535         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9536         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
9537         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9538         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9539         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9540         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9541 }
9542
9543 for cf_subdir_prefix in \
9544         /usr \
9545         /usr/local \
9546         /usr/pkg \
9547         /opt \
9548         /opt/local \
9549         $HOME
9550 do
9551
9552 test "x$cf_subdir_prefix" != "x$prefix" && \
9553 test -d "$cf_subdir_prefix" && \
9554 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9555         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9556         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
9557         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9558         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9559         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9560         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"
9561 }
9562
9563 done
9564
9565 test "$includedir" != NONE && \
9566 test "$includedir" != "/usr/include" && \
9567 test -d "$includedir" && {
9568         test -d "$includedir" &&    cf_search="$cf_search $includedir"
9569         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9570 }
9571
9572 test "$oldincludedir" != NONE && \
9573 test "$oldincludedir" != "/usr/include" && \
9574 test -d "$oldincludedir" && {
9575         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
9576         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9577 }
9578
9579 cf_search="$cf_search $cf_header_path_list"
9580
9581         test -n "$verbose" && echo "search path $cf_search"
9582         cf_save2_CPPFLAGS="$CPPFLAGS"
9583         for cf_incdir in $cf_search
9584         do
9585
9586 if test -n "$cf_incdir" ; then
9587   for cf_add_incdir in $cf_incdir
9588   do
9589         while test "$cf_add_incdir" != /usr/include
9590         do
9591           if test -d "$cf_add_incdir"
9592           then
9593                 cf_have_incdir=no
9594                 if test -n "$CFLAGS$CPPFLAGS" ; then
9595                   # a loop is needed to ensure we can add subdirs of existing dirs
9596                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9597                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9598                           cf_have_incdir=yes; break
9599                         fi
9600                   done
9601                 fi
9602
9603                 if test "$cf_have_incdir" = no ; then
9604                   if test "$cf_add_incdir" = /usr/local/include ; then
9605                         if test "$GCC" = yes
9606                         then
9607                           cf_save_CPPFLAGS=$CPPFLAGS
9608
9609         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9610         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9611
9612                           cat >"conftest.$ac_ext" <<_ACEOF
9613 #line 9613 "configure"
9614 #include "confdefs.h"
9615 #include <stdio.h>
9616 int
9617 main (void)
9618 {
9619 printf("Hello")
9620   ;
9621   return 0;
9622 }
9623 _ACEOF
9624 rm -f "conftest.$ac_objext"
9625 if { (eval echo "$as_me:9625: \"$ac_compile\"") >&5
9626   (eval $ac_compile) 2>&5
9627   ac_status=$?
9628   echo "$as_me:9628: \$? = $ac_status" >&5
9629   (exit "$ac_status"); } &&
9630          { ac_try='test -s "conftest.$ac_objext"'
9631   { (eval echo "$as_me:9631: \"$ac_try\"") >&5
9632   (eval $ac_try) 2>&5
9633   ac_status=$?
9634   echo "$as_me:9634: \$? = $ac_status" >&5
9635   (exit "$ac_status"); }; }; then
9636   :
9637 else
9638   echo "$as_me: failed program was:" >&5
9639 cat "conftest.$ac_ext" >&5
9640 cf_have_incdir=yes
9641 fi
9642 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9643                           CPPFLAGS=$cf_save_CPPFLAGS
9644                         fi
9645                   fi
9646                 fi
9647
9648                 if test "$cf_have_incdir" = no ; then
9649                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9650
9651 echo "${as_me:-configure}:9651: testing adding $cf_add_incdir to include-path ..." 1>&5
9652
9653                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9654
9655                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9656                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9657                   cf_add_incdir="$cf_top_incdir"
9658                 else
9659                   break
9660                 fi
9661           else
9662                 break
9663           fi
9664         done
9665   done
9666 fi
9667
9668                 for cf_header in \
9669                         ncurses.h \
9670                         curses.h
9671                 do
9672
9673         cat >"conftest.$ac_ext" <<_ACEOF
9674 #line 9674 "configure"
9675 #include "confdefs.h"
9676
9677 #include <$cf_header>
9678 int
9679 main (void)
9680 {
9681
9682 #ifdef NCURSES_VERSION
9683
9684 printf("%s\\n", NCURSES_VERSION);
9685 #else
9686 #ifdef __NCURSES_H
9687 printf("old\\n");
9688 #else
9689         #error __NCURSES_H is not defined
9690 #endif
9691 #endif
9692
9693   ;
9694   return 0;
9695 }
9696 _ACEOF
9697 rm -f "conftest.$ac_objext"
9698 if { (eval echo "$as_me:9698: \"$ac_compile\"") >&5
9699   (eval $ac_compile) 2>&5
9700   ac_status=$?
9701   echo "$as_me:9701: \$? = $ac_status" >&5
9702   (exit "$ac_status"); } &&
9703          { ac_try='test -s "conftest.$ac_objext"'
9704   { (eval echo "$as_me:9704: \"$ac_try\"") >&5
9705   (eval $ac_try) 2>&5
9706   ac_status=$?
9707   echo "$as_me:9707: \$? = $ac_status" >&5
9708   (exit "$ac_status"); }; }; then
9709   cf_cv_ncurses_h2=$cf_header
9710
9711 else
9712   echo "$as_me: failed program was:" >&5
9713 cat "conftest.$ac_ext" >&5
9714 cf_cv_ncurses_h2=no
9715 fi
9716 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9717
9718                         if test "$cf_cv_ncurses_h2" != no ; then
9719                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9720                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9721                                 break
9722                         fi
9723                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9724                 done
9725                 CPPFLAGS="$cf_save2_CPPFLAGS"
9726                 test "$cf_cv_ncurses_h2" != no && break
9727         done
9728         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9728: error: not found" >&5
9729 echo "$as_me: error: not found" >&2;}
9730    { (exit 1); exit 1; }; }
9731
9732 fi
9733 echo "$as_me:9733: result: $cf_cv_ncurses_h2" >&5
9734 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9735
9736         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9737         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9738         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9739                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9740         fi
9741
9742 if test -n "$cf_1st_incdir" ; then
9743   for cf_add_incdir in $cf_1st_incdir
9744   do
9745         while test "$cf_add_incdir" != /usr/include
9746         do
9747           if test -d "$cf_add_incdir"
9748           then
9749                 cf_have_incdir=no
9750                 if test -n "$CFLAGS$CPPFLAGS" ; then
9751                   # a loop is needed to ensure we can add subdirs of existing dirs
9752                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9753                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9754                           cf_have_incdir=yes; break
9755                         fi
9756                   done
9757                 fi
9758
9759                 if test "$cf_have_incdir" = no ; then
9760                   if test "$cf_add_incdir" = /usr/local/include ; then
9761                         if test "$GCC" = yes
9762                         then
9763                           cf_save_CPPFLAGS=$CPPFLAGS
9764
9765         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9766         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9767
9768                           cat >"conftest.$ac_ext" <<_ACEOF
9769 #line 9769 "configure"
9770 #include "confdefs.h"
9771 #include <stdio.h>
9772 int
9773 main (void)
9774 {
9775 printf("Hello")
9776   ;
9777   return 0;
9778 }
9779 _ACEOF
9780 rm -f "conftest.$ac_objext"
9781 if { (eval echo "$as_me:9781: \"$ac_compile\"") >&5
9782   (eval $ac_compile) 2>&5
9783   ac_status=$?
9784   echo "$as_me:9784: \$? = $ac_status" >&5
9785   (exit "$ac_status"); } &&
9786          { ac_try='test -s "conftest.$ac_objext"'
9787   { (eval echo "$as_me:9787: \"$ac_try\"") >&5
9788   (eval $ac_try) 2>&5
9789   ac_status=$?
9790   echo "$as_me:9790: \$? = $ac_status" >&5
9791   (exit "$ac_status"); }; }; then
9792   :
9793 else
9794   echo "$as_me: failed program was:" >&5
9795 cat "conftest.$ac_ext" >&5
9796 cf_have_incdir=yes
9797 fi
9798 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9799                           CPPFLAGS=$cf_save_CPPFLAGS
9800                         fi
9801                   fi
9802                 fi
9803
9804                 if test "$cf_have_incdir" = no ; then
9805                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9806
9807 echo "${as_me:-configure}:9807: testing adding $cf_add_incdir to include-path ..." 1>&5
9808
9809                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9810
9811                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9812                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9813                   cf_add_incdir="$cf_top_incdir"
9814                 else
9815                   break
9816                 fi
9817           else
9818                 break
9819           fi
9820         done
9821   done
9822 fi
9823
9824 fi
9825
9826 # Set definitions to allow ifdef'ing for ncurses.h
9827
9828 case "$cf_cv_ncurses_header" in
9829 (*ncurses.h)
9830
9831 cat >>confdefs.h <<\EOF
9832 #define HAVE_NCURSES_H 1
9833 EOF
9834
9835         ;;
9836 esac
9837
9838 case "$cf_cv_ncurses_header" in
9839 (ncurses/curses.h|ncurses/ncurses.h)
9840
9841 cat >>confdefs.h <<\EOF
9842 #define HAVE_NCURSES_NCURSES_H 1
9843 EOF
9844
9845         ;;
9846 (ncursesw/curses.h|ncursesw/ncurses.h)
9847
9848 cat >>confdefs.h <<\EOF
9849 #define HAVE_NCURSESW_NCURSES_H 1
9850 EOF
9851
9852         ;;
9853 esac
9854
9855 echo "$as_me:9855: checking for terminfo header" >&5
9856 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9857 if test "${cf_cv_term_header+set}" = set; then
9858   echo $ECHO_N "(cached) $ECHO_C" >&6
9859 else
9860
9861 case "${cf_cv_ncurses_header}" in
9862 (*/ncurses.h|*/ncursesw.h)
9863         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9864         ;;
9865 (*)
9866         cf_term_header=term.h
9867         ;;
9868 esac
9869
9870 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9871 do
9872 cat >"conftest.$ac_ext" <<_ACEOF
9873 #line 9873 "configure"
9874 #include "confdefs.h"
9875 #include <stdio.h>
9876 #include <${cf_cv_ncurses_header:-curses.h}>
9877 #include <$cf_test>
9878
9879 int
9880 main (void)
9881 {
9882 int x = auto_left_margin; (void)x
9883   ;
9884   return 0;
9885 }
9886 _ACEOF
9887 rm -f "conftest.$ac_objext"
9888 if { (eval echo "$as_me:9888: \"$ac_compile\"") >&5
9889   (eval $ac_compile) 2>&5
9890   ac_status=$?
9891   echo "$as_me:9891: \$? = $ac_status" >&5
9892   (exit "$ac_status"); } &&
9893          { ac_try='test -s "conftest.$ac_objext"'
9894   { (eval echo "$as_me:9894: \"$ac_try\"") >&5
9895   (eval $ac_try) 2>&5
9896   ac_status=$?
9897   echo "$as_me:9897: \$? = $ac_status" >&5
9898   (exit "$ac_status"); }; }; then
9899
9900         cf_cv_term_header="$cf_test"
9901 else
9902   echo "$as_me: failed program was:" >&5
9903 cat "conftest.$ac_ext" >&5
9904
9905         cf_cv_term_header=unknown
9906
9907 fi
9908 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9909         test "$cf_cv_term_header" != unknown && break
9910 done
9911
9912 fi
9913 echo "$as_me:9913: result: $cf_cv_term_header" >&5
9914 echo "${ECHO_T}$cf_cv_term_header" >&6
9915
9916 # Set definitions to allow ifdef'ing to accommodate subdirectories
9917
9918 case "$cf_cv_term_header" in
9919 (*term.h)
9920
9921 cat >>confdefs.h <<\EOF
9922 #define HAVE_TERM_H 1
9923 EOF
9924
9925         ;;
9926 esac
9927
9928 case "$cf_cv_term_header" in
9929 (ncurses/term.h)
9930
9931 cat >>confdefs.h <<\EOF
9932 #define HAVE_NCURSES_TERM_H 1
9933 EOF
9934
9935         ;;
9936 (ncursesw/term.h)
9937
9938 cat >>confdefs.h <<\EOF
9939 #define HAVE_NCURSESW_TERM_H 1
9940 EOF
9941
9942         ;;
9943 esac
9944
9945 # some applications need this, but should check for NCURSES_VERSION
9946
9947 cat >>confdefs.h <<\EOF
9948 #define NCURSES 1
9949 EOF
9950
9951 echo "$as_me:9951: checking for ncurses version" >&5
9952 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9953 if test "${cf_cv_ncurses_version+set}" = set; then
9954   echo $ECHO_N "(cached) $ECHO_C" >&6
9955 else
9956
9957         cf_cv_ncurses_version=no
9958         cf_tempfile=out$$
9959         rm -f "$cf_tempfile"
9960         if test "$cross_compiling" = yes; then
9961
9962         # This will not work if the preprocessor splits the line after the
9963         # Autoconf token.  The 'unproto' program does that.
9964         cat > "conftest.$ac_ext" <<EOF
9965 #include <${cf_cv_ncurses_header:-curses.h}>
9966 #undef Autoconf
9967 #ifdef NCURSES_VERSION
9968 Autoconf NCURSES_VERSION
9969 #else
9970 #ifdef __NCURSES_H
9971 Autoconf "old"
9972 #endif
9973 ;
9974 #endif
9975 EOF
9976         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9977         { (eval echo "$as_me:9977: \"$cf_try\"") >&5
9978   (eval $cf_try) 2>&5
9979   ac_status=$?
9980   echo "$as_me:9980: \$? = $ac_status" >&5
9981   (exit "$ac_status"); }
9982         if test -f conftest.out ; then
9983                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9984                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9985                 rm -f conftest.out
9986         fi
9987
9988 else
9989   cat >"conftest.$ac_ext" <<_ACEOF
9990 #line 9990 "configure"
9991 #include "confdefs.h"
9992
9993 $ac_includes_default
9994
9995 #include <${cf_cv_ncurses_header:-curses.h}>
9996
9997 int main(void)
9998 {
9999         FILE *fp = fopen("$cf_tempfile", "w");
10000 #ifdef NCURSES_VERSION
10001 # ifdef NCURSES_VERSION_PATCH
10002         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10003 # else
10004         fprintf(fp, "%s\\n", NCURSES_VERSION);
10005 # endif
10006 #else
10007 # ifdef __NCURSES_H
10008         fprintf(fp, "old\\n");
10009 # else
10010         make an error
10011 # endif
10012 #endif
10013         ${cf_cv_main_return:-return}(0);
10014 }
10015 _ACEOF
10016 rm -f "conftest$ac_exeext"
10017 if { (eval echo "$as_me:10017: \"$ac_link\"") >&5
10018   (eval $ac_link) 2>&5
10019   ac_status=$?
10020   echo "$as_me:10020: \$? = $ac_status" >&5
10021   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10022   { (eval echo "$as_me:10022: \"$ac_try\"") >&5
10023   (eval $ac_try) 2>&5
10024   ac_status=$?
10025   echo "$as_me:10025: \$? = $ac_status" >&5
10026   (exit "$ac_status"); }; }; then
10027
10028         cf_cv_ncurses_version=`cat $cf_tempfile`
10029 else
10030   echo "$as_me: program exited with status $ac_status" >&5
10031 echo "$as_me: failed program was:" >&5
10032 cat "conftest.$ac_ext" >&5
10033 fi
10034 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10035 fi
10036         rm -f "$cf_tempfile"
10037
10038 fi
10039 echo "$as_me:10039: result: $cf_cv_ncurses_version" >&5
10040 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10041 test "$cf_cv_ncurses_version" = no ||
10042 cat >>confdefs.h <<\EOF
10043 #define NCURSES 1
10044 EOF
10045
10046 cf_nculib_root=$cf_cv_screen
10047         # This works, except for the special case where we find gpm, but
10048         # ncurses is in a nonstandard location via $LIBS, and we really want
10049         # to link gpm.
10050 cf_ncurses_LIBS=""
10051 cf_ncurses_SAVE="$LIBS"
10052 echo "$as_me:10052: checking for Gpm_Open in -lgpm" >&5
10053 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10054 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10055   echo $ECHO_N "(cached) $ECHO_C" >&6
10056 else
10057   ac_check_lib_save_LIBS=$LIBS
10058 LIBS="-lgpm  $LIBS"
10059 cat >"conftest.$ac_ext" <<_ACEOF
10060 #line 10060 "configure"
10061 #include "confdefs.h"
10062
10063 /* Override any gcc2 internal prototype to avoid an error.  */
10064 #ifdef __cplusplus
10065 extern "C"
10066 #endif
10067 /* We use char because int might match the return type of a gcc2
10068    builtin and then its argument prototype would still apply.  */
10069 char Gpm_Open ();
10070 int
10071 main (void)
10072 {
10073 Gpm_Open ();
10074   ;
10075   return 0;
10076 }
10077 _ACEOF
10078 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10079 if { (eval echo "$as_me:10079: \"$ac_link\"") >&5
10080   (eval $ac_link) 2>&5
10081   ac_status=$?
10082   echo "$as_me:10082: \$? = $ac_status" >&5
10083   (exit "$ac_status"); } &&
10084          { ac_try='test -s "conftest$ac_exeext"'
10085   { (eval echo "$as_me:10085: \"$ac_try\"") >&5
10086   (eval $ac_try) 2>&5
10087   ac_status=$?
10088   echo "$as_me:10088: \$? = $ac_status" >&5
10089   (exit "$ac_status"); }; }; then
10090   ac_cv_lib_gpm_Gpm_Open=yes
10091 else
10092   echo "$as_me: failed program was:" >&5
10093 cat "conftest.$ac_ext" >&5
10094 ac_cv_lib_gpm_Gpm_Open=no
10095 fi
10096 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10097 LIBS=$ac_check_lib_save_LIBS
10098 fi
10099 echo "$as_me:10099: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10100 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10101 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10102   echo "$as_me:10102: checking for initscr in -lgpm" >&5
10103 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10104 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10105   echo $ECHO_N "(cached) $ECHO_C" >&6
10106 else
10107   ac_check_lib_save_LIBS=$LIBS
10108 LIBS="-lgpm  $LIBS"
10109 cat >"conftest.$ac_ext" <<_ACEOF
10110 #line 10110 "configure"
10111 #include "confdefs.h"
10112
10113 /* Override any gcc2 internal prototype to avoid an error.  */
10114 #ifdef __cplusplus
10115 extern "C"
10116 #endif
10117 /* We use char because int might match the return type of a gcc2
10118    builtin and then its argument prototype would still apply.  */
10119 char initscr ();
10120 int
10121 main (void)
10122 {
10123 initscr ();
10124   ;
10125   return 0;
10126 }
10127 _ACEOF
10128 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10129 if { (eval echo "$as_me:10129: \"$ac_link\"") >&5
10130   (eval $ac_link) 2>&5
10131   ac_status=$?
10132   echo "$as_me:10132: \$? = $ac_status" >&5
10133   (exit "$ac_status"); } &&
10134          { ac_try='test -s "conftest$ac_exeext"'
10135   { (eval echo "$as_me:10135: \"$ac_try\"") >&5
10136   (eval $ac_try) 2>&5
10137   ac_status=$?
10138   echo "$as_me:10138: \$? = $ac_status" >&5
10139   (exit "$ac_status"); }; }; then
10140   ac_cv_lib_gpm_initscr=yes
10141 else
10142   echo "$as_me: failed program was:" >&5
10143 cat "conftest.$ac_ext" >&5
10144 ac_cv_lib_gpm_initscr=no
10145 fi
10146 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10147 LIBS=$ac_check_lib_save_LIBS
10148 fi
10149 echo "$as_me:10149: result: $ac_cv_lib_gpm_initscr" >&5
10150 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10151 if test "$ac_cv_lib_gpm_initscr" = yes; then
10152   LIBS="$cf_ncurses_SAVE"
10153 else
10154   cf_ncurses_LIBS="-lgpm"
10155 fi
10156
10157 fi
10158
10159 case "$host_os" in
10160 (freebsd*)
10161         # This is only necessary if you are linking against an obsolete
10162         # version of ncurses (but it should do no harm, since it is static).
10163         if test "$cf_nculib_root" = ncurses ; then
10164                 echo "$as_me:10164: checking for tgoto in -lmytinfo" >&5
10165 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10166 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10167   echo $ECHO_N "(cached) $ECHO_C" >&6
10168 else
10169   ac_check_lib_save_LIBS=$LIBS
10170 LIBS="-lmytinfo  $LIBS"
10171 cat >"conftest.$ac_ext" <<_ACEOF
10172 #line 10172 "configure"
10173 #include "confdefs.h"
10174
10175 /* Override any gcc2 internal prototype to avoid an error.  */
10176 #ifdef __cplusplus
10177 extern "C"
10178 #endif
10179 /* We use char because int might match the return type of a gcc2
10180    builtin and then its argument prototype would still apply.  */
10181 char tgoto ();
10182 int
10183 main (void)
10184 {
10185 tgoto ();
10186   ;
10187   return 0;
10188 }
10189 _ACEOF
10190 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10191 if { (eval echo "$as_me:10191: \"$ac_link\"") >&5
10192   (eval $ac_link) 2>&5
10193   ac_status=$?
10194   echo "$as_me:10194: \$? = $ac_status" >&5
10195   (exit "$ac_status"); } &&
10196          { ac_try='test -s "conftest$ac_exeext"'
10197   { (eval echo "$as_me:10197: \"$ac_try\"") >&5
10198   (eval $ac_try) 2>&5
10199   ac_status=$?
10200   echo "$as_me:10200: \$? = $ac_status" >&5
10201   (exit "$ac_status"); }; }; then
10202   ac_cv_lib_mytinfo_tgoto=yes
10203 else
10204   echo "$as_me: failed program was:" >&5
10205 cat "conftest.$ac_ext" >&5
10206 ac_cv_lib_mytinfo_tgoto=no
10207 fi
10208 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10209 LIBS=$ac_check_lib_save_LIBS
10210 fi
10211 echo "$as_me:10211: result: $ac_cv_lib_mytinfo_tgoto" >&5
10212 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10213 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
10214   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10215 fi
10216
10217         fi
10218         ;;
10219 esac
10220
10221 cf_add_libs="$LIBS"
10222 # reverse order
10223 cf_add_0lib=
10224 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10225 # filter duplicates
10226 for cf_add_1lib in $cf_add_0lib; do
10227         for cf_add_2lib in $cf_add_libs; do
10228                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10229                         cf_add_1lib=
10230                         break
10231                 fi
10232         done
10233         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10234 done
10235 LIBS="$cf_add_libs"
10236
10237 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
10238 then
10239
10240 cf_add_libs="$LIBS"
10241 # reverse order
10242 cf_add_0lib=
10243 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10244 # filter duplicates
10245 for cf_add_1lib in $cf_add_0lib; do
10246         for cf_add_2lib in $cf_add_libs; do
10247                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10248                         cf_add_1lib=
10249                         break
10250                 fi
10251         done
10252         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10253 done
10254 LIBS="$cf_add_libs"
10255
10256 else
10257
10258         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10259         cf_libdir=""
10260         echo "$as_me:10260: checking for initscr" >&5
10261 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10262 if test "${ac_cv_func_initscr+set}" = set; then
10263   echo $ECHO_N "(cached) $ECHO_C" >&6
10264 else
10265   cat >"conftest.$ac_ext" <<_ACEOF
10266 #line 10266 "configure"
10267 #include "confdefs.h"
10268 #define initscr autoconf_temporary
10269 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10270 #undef initscr
10271
10272 #ifdef __cplusplus
10273 extern "C"
10274 #endif
10275
10276 /* We use char because int might match the return type of a gcc2
10277    builtin and then its argument prototype would still apply.  */
10278 char initscr (void);
10279
10280 int
10281 main (void)
10282 {
10283
10284 /* The GNU C library defines stubs for functions which it implements
10285     to always fail with ENOSYS.  Some functions are actually named
10286     something starting with __ and the normal name is an alias.  */
10287 #if defined (__stub_initscr) || defined (__stub___initscr)
10288 #error found stub for initscr
10289 #endif
10290
10291         return initscr ();
10292   ;
10293   return 0;
10294 }
10295 _ACEOF
10296 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10297 if { (eval echo "$as_me:10297: \"$ac_link\"") >&5
10298   (eval $ac_link) 2>&5
10299   ac_status=$?
10300   echo "$as_me:10300: \$? = $ac_status" >&5
10301   (exit "$ac_status"); } &&
10302          { ac_try='test -s "conftest$ac_exeext"'
10303   { (eval echo "$as_me:10303: \"$ac_try\"") >&5
10304   (eval $ac_try) 2>&5
10305   ac_status=$?
10306   echo "$as_me:10306: \$? = $ac_status" >&5
10307   (exit "$ac_status"); }; }; then
10308   ac_cv_func_initscr=yes
10309 else
10310   echo "$as_me: failed program was:" >&5
10311 cat "conftest.$ac_ext" >&5
10312 ac_cv_func_initscr=no
10313 fi
10314 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10315 fi
10316 echo "$as_me:10316: result: $ac_cv_func_initscr" >&5
10317 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10318 if test "$ac_cv_func_initscr" = yes; then
10319   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10320 else
10321
10322                 cf_save_LIBS="$LIBS"
10323                 echo "$as_me:10323: checking for initscr in -l$cf_nculib_root" >&5
10324 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10325                 LIBS="-l$cf_nculib_root $LIBS"
10326                 cat >"conftest.$ac_ext" <<_ACEOF
10327 #line 10327 "configure"
10328 #include "confdefs.h"
10329 #include <${cf_cv_ncurses_header:-curses.h}>
10330 int
10331 main (void)
10332 {
10333 initscr()
10334   ;
10335   return 0;
10336 }
10337 _ACEOF
10338 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10339 if { (eval echo "$as_me:10339: \"$ac_link\"") >&5
10340   (eval $ac_link) 2>&5
10341   ac_status=$?
10342   echo "$as_me:10342: \$? = $ac_status" >&5
10343   (exit "$ac_status"); } &&
10344          { ac_try='test -s "conftest$ac_exeext"'
10345   { (eval echo "$as_me:10345: \"$ac_try\"") >&5
10346   (eval $ac_try) 2>&5
10347   ac_status=$?
10348   echo "$as_me:10348: \$? = $ac_status" >&5
10349   (exit "$ac_status"); }; }; then
10350   echo "$as_me:10350: result: yes" >&5
10351 echo "${ECHO_T}yes" >&6
10352                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10353
10354 else
10355   echo "$as_me: failed program was:" >&5
10356 cat "conftest.$ac_ext" >&5
10357 echo "$as_me:10357: result: no" >&5
10358 echo "${ECHO_T}no" >&6
10359
10360 cf_search=
10361 cf_library_path_list=""
10362 if test -n "${LDFLAGS}${LIBS}" ; then
10363         for cf_library_path in $LDFLAGS $LIBS
10364         do
10365                 case "$cf_library_path" in
10366                 (-L*)
10367                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10368
10369 test "x$cf_library_path" != "xNONE" && \
10370 test -d "$cf_library_path" && \
10371  {
10372         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10373         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10374         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10375         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10376         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10377         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"
10378 }
10379
10380                         cf_library_path_list="$cf_library_path_list $cf_search"
10381                         ;;
10382                 esac
10383         done
10384 fi
10385
10386 cf_search=
10387
10388 test "x$prefix" != "xNONE" && \
10389 test -d "$prefix" && \
10390  {
10391         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10392         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10393         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10394         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10395         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10396         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10397 }
10398
10399 for cf_subdir_prefix in \
10400         /usr \
10401         /usr/local \
10402         /usr/pkg \
10403         /opt \
10404         /opt/local \
10405         $HOME
10406 do
10407
10408 test "x$cf_subdir_prefix" != "x$prefix" && \
10409 test -d "$cf_subdir_prefix" && \
10410 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10411         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10412         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10413         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10414         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10415         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10416         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"
10417 }
10418
10419 done
10420
10421 cf_search="$cf_library_path_list $cf_search"
10422
10423                         for cf_libdir in $cf_search
10424                         do
10425                                 echo "$as_me:10425: checking for -l$cf_nculib_root in $cf_libdir" >&5
10426 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10427                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10428                                 cat >"conftest.$ac_ext" <<_ACEOF
10429 #line 10429 "configure"
10430 #include "confdefs.h"
10431 #include <${cf_cv_ncurses_header:-curses.h}>
10432 int
10433 main (void)
10434 {
10435 initscr()
10436   ;
10437   return 0;
10438 }
10439 _ACEOF
10440 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10441 if { (eval echo "$as_me:10441: \"$ac_link\"") >&5
10442   (eval $ac_link) 2>&5
10443   ac_status=$?
10444   echo "$as_me:10444: \$? = $ac_status" >&5
10445   (exit "$ac_status"); } &&
10446          { ac_try='test -s "conftest$ac_exeext"'
10447   { (eval echo "$as_me:10447: \"$ac_try\"") >&5
10448   (eval $ac_try) 2>&5
10449   ac_status=$?
10450   echo "$as_me:10450: \$? = $ac_status" >&5
10451   (exit "$ac_status"); }; }; then
10452   echo "$as_me:10452: result: yes" >&5
10453 echo "${ECHO_T}yes" >&6
10454                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10455                                          break
10456 else
10457   echo "$as_me: failed program was:" >&5
10458 cat "conftest.$ac_ext" >&5
10459 echo "$as_me:10459: result: no" >&5
10460 echo "${ECHO_T}no" >&6
10461                                          LIBS="$cf_save_LIBS"
10462 fi
10463 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10464                         done
10465
10466 fi
10467 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10468
10469 fi
10470
10471 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10472
10473 if test "$cf_found_library" = no ; then
10474         { { echo "$as_me:10474: error: Cannot link $cf_nculib_root library" >&5
10475 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10476    { (exit 1); exit 1; }; }
10477 fi
10478
10479 fi
10480
10481 if test -n "$cf_ncurses_LIBS" ; then
10482         echo "$as_me:10482: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10483 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10484         cf_ncurses_SAVE="$LIBS"
10485         for p in $cf_ncurses_LIBS ; do
10486                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
10487                 if test "$q" != "$LIBS" ; then
10488                         LIBS="$q"
10489                 fi
10490         done
10491         cat >"conftest.$ac_ext" <<_ACEOF
10492 #line 10492 "configure"
10493 #include "confdefs.h"
10494 #include <${cf_cv_ncurses_header:-curses.h}>
10495 int
10496 main (void)
10497 {
10498 initscr(); mousemask(0,0); tigetstr((char *)0);
10499   ;
10500   return 0;
10501 }
10502 _ACEOF
10503 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10504 if { (eval echo "$as_me:10504: \"$ac_link\"") >&5
10505   (eval $ac_link) 2>&5
10506   ac_status=$?
10507   echo "$as_me:10507: \$? = $ac_status" >&5
10508   (exit "$ac_status"); } &&
10509          { ac_try='test -s "conftest$ac_exeext"'
10510   { (eval echo "$as_me:10510: \"$ac_try\"") >&5
10511   (eval $ac_try) 2>&5
10512   ac_status=$?
10513   echo "$as_me:10513: \$? = $ac_status" >&5
10514   (exit "$ac_status"); }; }; then
10515   echo "$as_me:10515: result: yes" >&5
10516 echo "${ECHO_T}yes" >&6
10517 else
10518   echo "$as_me: failed program was:" >&5
10519 cat "conftest.$ac_ext" >&5
10520 echo "$as_me:10520: result: no" >&5
10521 echo "${ECHO_T}no" >&6
10522                  LIBS="$cf_ncurses_SAVE"
10523 fi
10524 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10525 fi
10526
10527 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10528
10529 cat >>confdefs.h <<EOF
10530 #define $cf_nculib_ROOT 1
10531 EOF
10532
10533         fi
10534 else
10535         NCURSES_CONFIG=none
10536 fi
10537
10538         ;;
10539 (ncurses*)
10540
10541 cf_ncuconfig_root=$cf_cv_screen
10542 cf_have_ncuconfig=no
10543
10544 if test "x${PKG_CONFIG:=none}" != xnone; then
10545         echo "$as_me:10545: checking pkg-config for $cf_ncuconfig_root" >&5
10546 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10547         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
10548                 echo "$as_me:10548: result: yes" >&5
10549 echo "${ECHO_T}yes" >&6
10550
10551                 echo "$as_me:10551: checking if the $cf_ncuconfig_root package files work" >&5
10552 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10553                 cf_have_ncuconfig=unknown
10554
10555                 cf_save_CFLAGS="$CFLAGS"
10556                 cf_save_CPPFLAGS="$CPPFLAGS"
10557                 cf_save_LIBS="$LIBS"
10558
10559                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10560                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
10561
10562                 # while -W for passing linker flags is prevalent, it is not "standard".
10563                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10564                 # incompatible _and_ non-standard -W option which gives an error.  Work
10565                 # around that pitfall.
10566                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10567                 (x*c[89]9@@*-W*)
10568
10569 cf_fix_cppflags=no
10570 cf_new_cflags=
10571 cf_new_cppflags=
10572 cf_new_extra_cppflags=
10573
10574 for cf_add_cflags in $cf_pkg_cflags
10575 do
10576 case "$cf_fix_cppflags" in
10577 (no)
10578         case "$cf_add_cflags" in
10579         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10580                 case "$cf_add_cflags" in
10581                 (-D*)
10582                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10583
10584                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10585                                 && test -z "${cf_tst_cflags}" \
10586                                 && cf_fix_cppflags=yes
10587
10588                         if test "$cf_fix_cppflags" = yes ; then
10589
10590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10592
10593                                 continue
10594                         elif test "${cf_tst_cflags}" = "\"'" ; then
10595
10596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10598
10599                                 continue
10600                         fi
10601                         ;;
10602                 esac
10603                 case "$CPPFLAGS" in
10604                 (*$cf_add_cflags)
10605                         ;;
10606                 (*)
10607                         case "$cf_add_cflags" in
10608                         (-D*)
10609                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10610
10611 CPPFLAGS=`echo "$CPPFLAGS" | \
10612         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10613                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10614
10615                                 ;;
10616                         esac
10617
10618         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10619         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10620
10621                         ;;
10622                 esac
10623                 ;;
10624         (*)
10625
10626         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10627         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10628
10629                 ;;
10630         esac
10631         ;;
10632 (yes)
10633
10634         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10635         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10636
10637         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10638
10639         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10640                 && test -z "${cf_tst_cflags}" \
10641                 && cf_fix_cppflags=no
10642         ;;
10643 esac
10644 done
10645
10646 if test -n "$cf_new_cflags" ; then
10647
10648         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10649         CFLAGS="${CFLAGS}$cf_new_cflags"
10650
10651 fi
10652
10653 if test -n "$cf_new_cppflags" ; then
10654
10655         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10656         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10657
10658 fi
10659
10660 if test -n "$cf_new_extra_cppflags" ; then
10661
10662         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10663         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10664
10665 fi
10666
10667 cf_add_libs="$LIBS"
10668 # reverse order
10669 cf_add_0lib=
10670 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10671 # filter duplicates
10672 for cf_add_1lib in $cf_add_0lib; do
10673         for cf_add_2lib in $cf_add_libs; do
10674                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10675                         cf_add_1lib=
10676                         break
10677                 fi
10678         done
10679         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10680 done
10681 LIBS="$cf_add_libs"
10682
10683                         cat >"conftest.$ac_ext" <<_ACEOF
10684 #line 10684 "configure"
10685 #include "confdefs.h"
10686 #include <${cf_cv_ncurses_header:-curses.h}>
10687 int
10688 main (void)
10689 {
10690 initscr(); mousemask(0,0); tigetstr((char *)0);
10691   ;
10692   return 0;
10693 }
10694 _ACEOF
10695 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10696 if { (eval echo "$as_me:10696: \"$ac_link\"") >&5
10697   (eval $ac_link) 2>&5
10698   ac_status=$?
10699   echo "$as_me:10699: \$? = $ac_status" >&5
10700   (exit "$ac_status"); } &&
10701          { ac_try='test -s "conftest$ac_exeext"'
10702   { (eval echo "$as_me:10702: \"$ac_try\"") >&5
10703   (eval $ac_try) 2>&5
10704   ac_status=$?
10705   echo "$as_me:10705: \$? = $ac_status" >&5
10706   (exit "$ac_status"); }; }; then
10707   if test "$cross_compiling" = yes; then
10708   cf_test_ncuconfig=maybe
10709 else
10710   cat >"conftest.$ac_ext" <<_ACEOF
10711 #line 10711 "configure"
10712 #include "confdefs.h"
10713 #include <${cf_cv_ncurses_header:-curses.h}>
10714                                         int main(void)
10715                                         { const char *xx = curses_version(); return (xx == 0); }
10716 _ACEOF
10717 rm -f "conftest$ac_exeext"
10718 if { (eval echo "$as_me:10718: \"$ac_link\"") >&5
10719   (eval $ac_link) 2>&5
10720   ac_status=$?
10721   echo "$as_me:10721: \$? = $ac_status" >&5
10722   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10723   { (eval echo "$as_me:10723: \"$ac_try\"") >&5
10724   (eval $ac_try) 2>&5
10725   ac_status=$?
10726   echo "$as_me:10726: \$? = $ac_status" >&5
10727   (exit "$ac_status"); }; }; then
10728   cf_test_ncuconfig=yes
10729 else
10730   echo "$as_me: program exited with status $ac_status" >&5
10731 echo "$as_me: failed program was:" >&5
10732 cat "conftest.$ac_ext" >&5
10733 cf_test_ncuconfig=no
10734 fi
10735 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10736 fi
10737 else
10738   echo "$as_me: failed program was:" >&5
10739 cat "conftest.$ac_ext" >&5
10740 cf_test_ncuconfig=no
10741 fi
10742 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10743
10744                         CFLAGS="$cf_save_CFLAGS"
10745                         CPPFLAGS="$cf_save_CPPFLAGS"
10746                         LIBS="$cf_save_LIBS"
10747
10748                         if test "x$cf_test_ncuconfig" != xyes; then
10749                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10750                                 cf_pkg_cflags="$cf_temp"
10751                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10752                                 cf_pkg_libs="$cf_temp"
10753                         fi
10754                         ;;
10755                 esac
10756
10757 for cf_add_cflags in $cf_pkg_cflags
10758 do
10759         case "x$cf_add_cflags" in
10760         (x-[DU]*)
10761
10762 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10763 while true
10764 do
10765         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10766         test "$CFLAGS" != "$cf_old_cflag" || break
10767
10768         CFLAGS="$cf_old_cflag"
10769 done
10770
10771 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10772 while true
10773 do
10774         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10775         test "$CPPFLAGS" != "$cf_old_cflag" || break
10776
10777         CPPFLAGS="$cf_old_cflag"
10778 done
10779
10780                 ;;
10781         esac
10782
10783 cf_fix_cppflags=no
10784 cf_new_cflags=
10785 cf_new_cppflags=
10786 cf_new_extra_cppflags=
10787
10788 for cf_add_cflags in $cf_add_cflags
10789 do
10790 case "$cf_fix_cppflags" in
10791 (no)
10792         case "$cf_add_cflags" in
10793         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10794                 case "$cf_add_cflags" in
10795                 (-D*)
10796                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10797
10798                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10799                                 && test -z "${cf_tst_cflags}" \
10800                                 && cf_fix_cppflags=yes
10801
10802                         if test "$cf_fix_cppflags" = yes ; then
10803
10804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10806
10807                                 continue
10808                         elif test "${cf_tst_cflags}" = "\"'" ; then
10809
10810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10812
10813                                 continue
10814                         fi
10815                         ;;
10816                 esac
10817                 case "$CPPFLAGS" in
10818                 (*$cf_add_cflags)
10819                         ;;
10820                 (*)
10821                         case "$cf_add_cflags" in
10822                         (-D*)
10823                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10824
10825 CPPFLAGS=`echo "$CPPFLAGS" | \
10826         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10827                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10828
10829                                 ;;
10830                         esac
10831
10832         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10833         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10834
10835                         ;;
10836                 esac
10837                 ;;
10838         (*)
10839
10840         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10841         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10842
10843                 ;;
10844         esac
10845         ;;
10846 (yes)
10847
10848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10850
10851         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10852
10853         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10854                 && test -z "${cf_tst_cflags}" \
10855                 && cf_fix_cppflags=no
10856         ;;
10857 esac
10858 done
10859
10860 if test -n "$cf_new_cflags" ; then
10861
10862         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10863         CFLAGS="${CFLAGS}$cf_new_cflags"
10864
10865 fi
10866
10867 if test -n "$cf_new_cppflags" ; then
10868
10869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10870         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10871
10872 fi
10873
10874 if test -n "$cf_new_extra_cppflags" ; then
10875
10876         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10877         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10878
10879 fi
10880
10881 done
10882
10883 cf_add_libs="$LIBS"
10884 # reverse order
10885 cf_add_0lib=
10886 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10887 # filter duplicates
10888 for cf_add_1lib in $cf_add_0lib; do
10889         for cf_add_2lib in $cf_add_libs; do
10890                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10891                         cf_add_1lib=
10892                         break
10893                 fi
10894         done
10895         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10896 done
10897 LIBS="$cf_add_libs"
10898
10899                 cat >"conftest.$ac_ext" <<_ACEOF
10900 #line 10900 "configure"
10901 #include "confdefs.h"
10902 #include <${cf_cv_ncurses_header:-curses.h}>
10903 int
10904 main (void)
10905 {
10906 initscr(); mousemask(0,0); tigetstr((char *)0);
10907   ;
10908   return 0;
10909 }
10910 _ACEOF
10911 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10912 if { (eval echo "$as_me:10912: \"$ac_link\"") >&5
10913   (eval $ac_link) 2>&5
10914   ac_status=$?
10915   echo "$as_me:10915: \$? = $ac_status" >&5
10916   (exit "$ac_status"); } &&
10917          { ac_try='test -s "conftest$ac_exeext"'
10918   { (eval echo "$as_me:10918: \"$ac_try\"") >&5
10919   (eval $ac_try) 2>&5
10920   ac_status=$?
10921   echo "$as_me:10921: \$? = $ac_status" >&5
10922   (exit "$ac_status"); }; }; then
10923   if test "$cross_compiling" = yes; then
10924   cf_have_ncuconfig=maybe
10925 else
10926   cat >"conftest.$ac_ext" <<_ACEOF
10927 #line 10927 "configure"
10928 #include "confdefs.h"
10929 #include <${cf_cv_ncurses_header:-curses.h}>
10930                                 int main(void)
10931                                 { const char *xx = curses_version(); return (xx == 0); }
10932 _ACEOF
10933 rm -f "conftest$ac_exeext"
10934 if { (eval echo "$as_me:10934: \"$ac_link\"") >&5
10935   (eval $ac_link) 2>&5
10936   ac_status=$?
10937   echo "$as_me:10937: \$? = $ac_status" >&5
10938   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10939   { (eval echo "$as_me:10939: \"$ac_try\"") >&5
10940   (eval $ac_try) 2>&5
10941   ac_status=$?
10942   echo "$as_me:10942: \$? = $ac_status" >&5
10943   (exit "$ac_status"); }; }; then
10944   cf_have_ncuconfig=yes
10945 else
10946   echo "$as_me: program exited with status $ac_status" >&5
10947 echo "$as_me: failed program was:" >&5
10948 cat "conftest.$ac_ext" >&5
10949 cf_have_ncuconfig=no
10950 fi
10951 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10952 fi
10953 else
10954   echo "$as_me: failed program was:" >&5
10955 cat "conftest.$ac_ext" >&5
10956 cf_have_ncuconfig=no
10957 fi
10958 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10959                 echo "$as_me:10959: result: $cf_have_ncuconfig" >&5
10960 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10961                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10962                 if test "$cf_have_ncuconfig" != "yes"
10963                 then
10964                         CPPFLAGS="$cf_save_CPPFLAGS"
10965                         LIBS="$cf_save_LIBS"
10966                         NCURSES_CONFIG_PKG=none
10967                 else
10968
10969 cat >>confdefs.h <<\EOF
10970 #define NCURSES 1
10971 EOF
10972
10973                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10974
10975 echo "$as_me:10975: checking for terminfo header" >&5
10976 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10977 if test "${cf_cv_term_header+set}" = set; then
10978   echo $ECHO_N "(cached) $ECHO_C" >&6
10979 else
10980
10981 case "${cf_cv_ncurses_header}" in
10982 (*/ncurses.h|*/ncursesw.h)
10983         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10984         ;;
10985 (*)
10986         cf_term_header=term.h
10987         ;;
10988 esac
10989
10990 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10991 do
10992 cat >"conftest.$ac_ext" <<_ACEOF
10993 #line 10993 "configure"
10994 #include "confdefs.h"
10995 #include <stdio.h>
10996 #include <${cf_cv_ncurses_header:-curses.h}>
10997 #include <$cf_test>
10998
10999 int
11000 main (void)
11001 {
11002 int x = auto_left_margin; (void)x
11003   ;
11004   return 0;
11005 }
11006 _ACEOF
11007 rm -f "conftest.$ac_objext"
11008 if { (eval echo "$as_me:11008: \"$ac_compile\"") >&5
11009   (eval $ac_compile) 2>&5
11010   ac_status=$?
11011   echo "$as_me:11011: \$? = $ac_status" >&5
11012   (exit "$ac_status"); } &&
11013          { ac_try='test -s "conftest.$ac_objext"'
11014   { (eval echo "$as_me:11014: \"$ac_try\"") >&5
11015   (eval $ac_try) 2>&5
11016   ac_status=$?
11017   echo "$as_me:11017: \$? = $ac_status" >&5
11018   (exit "$ac_status"); }; }; then
11019
11020         cf_cv_term_header="$cf_test"
11021 else
11022   echo "$as_me: failed program was:" >&5
11023 cat "conftest.$ac_ext" >&5
11024
11025         cf_cv_term_header=unknown
11026
11027 fi
11028 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11029         test "$cf_cv_term_header" != unknown && break
11030 done
11031
11032 fi
11033 echo "$as_me:11033: result: $cf_cv_term_header" >&5
11034 echo "${ECHO_T}$cf_cv_term_header" >&6
11035
11036 # Set definitions to allow ifdef'ing to accommodate subdirectories
11037
11038 case "$cf_cv_term_header" in
11039 (*term.h)
11040
11041 cat >>confdefs.h <<\EOF
11042 #define HAVE_TERM_H 1
11043 EOF
11044
11045         ;;
11046 esac
11047
11048 case "$cf_cv_term_header" in
11049 (ncurses/term.h)
11050
11051 cat >>confdefs.h <<\EOF
11052 #define HAVE_NCURSES_TERM_H 1
11053 EOF
11054
11055         ;;
11056 (ncursesw/term.h)
11057
11058 cat >>confdefs.h <<\EOF
11059 #define HAVE_NCURSESW_TERM_H 1
11060 EOF
11061
11062         ;;
11063 esac
11064
11065                 fi
11066
11067         else
11068                 echo "$as_me:11068: result: no" >&5
11069 echo "${ECHO_T}no" >&6
11070                 NCURSES_CONFIG_PKG=none
11071         fi
11072 else
11073         NCURSES_CONFIG_PKG=none
11074 fi
11075
11076 if test "x$cf_have_ncuconfig" = "xno"; then
11077         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
11078
11079 if test -n "$ac_tool_prefix"; then
11080   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
11081   do
11082     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
11083 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
11084 echo "$as_me:11084: checking for $ac_word" >&5
11085 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11086 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
11087   echo $ECHO_N "(cached) $ECHO_C" >&6
11088 else
11089   if test -n "$NCURSES_CONFIG"; then
11090   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
11091 else
11092   ac_save_IFS=$IFS; IFS=$ac_path_separator
11093 ac_dummy="$PATH"
11094 for ac_dir in $ac_dummy; do
11095   IFS=$ac_save_IFS
11096   test -z "$ac_dir" && ac_dir=.
11097   $as_executable_p "$ac_dir/$ac_word" || continue
11098 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
11099 echo "$as_me:11099: found $ac_dir/$ac_word" >&5
11100 break
11101 done
11102
11103 fi
11104 fi
11105 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
11106 if test -n "$NCURSES_CONFIG"; then
11107   echo "$as_me:11107: result: $NCURSES_CONFIG" >&5
11108 echo "${ECHO_T}$NCURSES_CONFIG" >&6
11109 else
11110   echo "$as_me:11110: result: no" >&5
11111 echo "${ECHO_T}no" >&6
11112 fi
11113
11114     test -n "$NCURSES_CONFIG" && break
11115   done
11116 fi
11117 if test -z "$NCURSES_CONFIG"; then
11118   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
11119   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
11120 do
11121   # Extract the first word of "$ac_prog", so it can be a program name with args.
11122 set dummy $ac_prog; ac_word=$2
11123 echo "$as_me:11123: checking for $ac_word" >&5
11124 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
11125 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
11126   echo $ECHO_N "(cached) $ECHO_C" >&6
11127 else
11128   if test -n "$ac_ct_NCURSES_CONFIG"; then
11129   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
11130 else
11131   ac_save_IFS=$IFS; IFS=$ac_path_separator
11132 ac_dummy="$PATH"
11133 for ac_dir in $ac_dummy; do
11134   IFS=$ac_save_IFS
11135   test -z "$ac_dir" && ac_dir=.
11136   $as_executable_p "$ac_dir/$ac_word" || continue
11137 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
11138 echo "$as_me:11138: found $ac_dir/$ac_word" >&5
11139 break
11140 done
11141
11142 fi
11143 fi
11144 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
11145 if test -n "$ac_ct_NCURSES_CONFIG"; then
11146   echo "$as_me:11146: result: $ac_ct_NCURSES_CONFIG" >&5
11147 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
11148 else
11149   echo "$as_me:11149: result: no" >&5
11150 echo "${ECHO_T}no" >&6
11151 fi
11152
11153   test -n "$ac_ct_NCURSES_CONFIG" && break
11154 done
11155 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
11156
11157   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
11158 fi
11159
11160         if test "$NCURSES_CONFIG" != none ; then
11161
11162 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
11163 do
11164         case "x$cf_add_cflags" in
11165         (x-[DU]*)
11166
11167 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
11168 while true
11169 do
11170         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
11171         test "$CFLAGS" != "$cf_old_cflag" || break
11172
11173         CFLAGS="$cf_old_cflag"
11174 done
11175
11176 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
11177 while true
11178 do
11179         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
11180         test "$CPPFLAGS" != "$cf_old_cflag" || break
11181
11182         CPPFLAGS="$cf_old_cflag"
11183 done
11184
11185                 ;;
11186         esac
11187
11188 cf_fix_cppflags=no
11189 cf_new_cflags=
11190 cf_new_cppflags=
11191 cf_new_extra_cppflags=
11192
11193 for cf_add_cflags in $cf_add_cflags
11194 do
11195 case "$cf_fix_cppflags" in
11196 (no)
11197         case "$cf_add_cflags" in
11198         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11199                 case "$cf_add_cflags" in
11200                 (-D*)
11201                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11202
11203                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11204                                 && test -z "${cf_tst_cflags}" \
11205                                 && cf_fix_cppflags=yes
11206
11207                         if test "$cf_fix_cppflags" = yes ; then
11208
11209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11211
11212                                 continue
11213                         elif test "${cf_tst_cflags}" = "\"'" ; then
11214
11215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11217
11218                                 continue
11219                         fi
11220                         ;;
11221                 esac
11222                 case "$CPPFLAGS" in
11223                 (*$cf_add_cflags)
11224                         ;;
11225                 (*)
11226                         case "$cf_add_cflags" in
11227                         (-D*)
11228                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11229
11230 CPPFLAGS=`echo "$CPPFLAGS" | \
11231         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11232                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11233
11234                                 ;;
11235                         esac
11236
11237         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11238         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11239
11240                         ;;
11241                 esac
11242                 ;;
11243         (*)
11244
11245         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11246         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11247
11248                 ;;
11249         esac
11250         ;;
11251 (yes)
11252
11253         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11254         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11255
11256         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
11257
11258         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11259                 && test -z "${cf_tst_cflags}" \
11260                 && cf_fix_cppflags=no
11261         ;;
11262 esac
11263 done
11264
11265 if test -n "$cf_new_cflags" ; then
11266
11267         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11268         CFLAGS="${CFLAGS}$cf_new_cflags"
11269
11270 fi
11271
11272 if test -n "$cf_new_cppflags" ; then
11273
11274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11275         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11276
11277 fi
11278
11279 if test -n "$cf_new_extra_cppflags" ; then
11280
11281         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11282         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11283
11284 fi
11285
11286 done
11287
11288 cf_add_libs="$LIBS"
11289 # reverse order
11290 cf_add_0lib=
11291 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11292 # filter duplicates
11293 for cf_add_1lib in $cf_add_0lib; do
11294         for cf_add_2lib in $cf_add_libs; do
11295                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11296                         cf_add_1lib=
11297                         break
11298                 fi
11299         done
11300         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11301 done
11302 LIBS="$cf_add_libs"
11303
11304                 # even with config script, some packages use no-override for curses.h
11305
11306 echo "$as_me:11306: checking if we have identified curses headers" >&5
11307 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
11308 if test "${cf_cv_ncurses_header+set}" = set; then
11309   echo $ECHO_N "(cached) $ECHO_C" >&6
11310 else
11311
11312 cf_cv_ncurses_header=none
11313 for cf_header in \
11314         ncurses.h $cf_cv_screen/ncurses.h \
11315         curses.h $cf_cv_screen/curses.h
11316 do
11317 cat >"conftest.$ac_ext" <<_ACEOF
11318 #line 11318 "configure"
11319 #include "confdefs.h"
11320 #include <${cf_header}>
11321 int
11322 main (void)
11323 {
11324 initscr(); endwin()
11325   ;
11326   return 0;
11327 }
11328 _ACEOF
11329 rm -f "conftest.$ac_objext"
11330 if { (eval echo "$as_me:11330: \"$ac_compile\"") >&5
11331   (eval $ac_compile) 2>&5
11332   ac_status=$?
11333   echo "$as_me:11333: \$? = $ac_status" >&5
11334   (exit "$ac_status"); } &&
11335          { ac_try='test -s "conftest.$ac_objext"'
11336   { (eval echo "$as_me:11336: \"$ac_try\"") >&5
11337   (eval $ac_try) 2>&5
11338   ac_status=$?
11339   echo "$as_me:11339: \$? = $ac_status" >&5
11340   (exit "$ac_status"); }; }; then
11341   cf_cv_ncurses_header=$cf_header; break
11342 else
11343   echo "$as_me: failed program was:" >&5
11344 cat "conftest.$ac_ext" >&5
11345 fi
11346 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11347 done
11348
11349 fi
11350 echo "$as_me:11350: result: $cf_cv_ncurses_header" >&5
11351 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
11352
11353 if test "$cf_cv_ncurses_header" = none ; then
11354         { { echo "$as_me:11354: error: No curses header-files found" >&5
11355 echo "$as_me: error: No curses header-files found" >&2;}
11356    { (exit 1); exit 1; }; }
11357 fi
11358
11359 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
11360
11361 for ac_header in $cf_cv_ncurses_header
11362 do
11363 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11364 echo "$as_me:11364: checking for $ac_header" >&5
11365 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11366 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11367   echo $ECHO_N "(cached) $ECHO_C" >&6
11368 else
11369   cat >"conftest.$ac_ext" <<_ACEOF
11370 #line 11370 "configure"
11371 #include "confdefs.h"
11372 #include <$ac_header>
11373 _ACEOF
11374 if { (eval echo "$as_me:11374: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11375   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
11376   ac_status=$?
11377   $EGREP -v '^ *\+' conftest.er1 >conftest.err
11378   rm -f conftest.er1
11379   cat conftest.err >&5
11380   echo "$as_me:11380: \$? = $ac_status" >&5
11381   (exit "$ac_status"); } >/dev/null; then
11382   if test -s conftest.err; then
11383     ac_cpp_err=$ac_c_preproc_warn_flag
11384   else
11385     ac_cpp_err=
11386   fi
11387 else
11388   ac_cpp_err=yes
11389 fi
11390 if test -z "$ac_cpp_err"; then
11391   eval "$as_ac_Header=yes"
11392 else
11393   echo "$as_me: failed program was:" >&5
11394   cat "conftest.$ac_ext" >&5
11395   eval "$as_ac_Header=no"
11396 fi
11397 rm -f conftest.err "conftest.$ac_ext"
11398 fi
11399 echo "$as_me:11399: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
11400 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
11401 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
11402   cat >>confdefs.h <<EOF
11403 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11404 EOF
11405
11406 fi
11407 done
11408
11409 cat >>confdefs.h <<\EOF
11410 #define NCURSES 1
11411 EOF
11412
11413 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11414
11415                 cat >>confdefs.h <<EOF
11416 #define $cf_nculib_ROOT 1
11417 EOF
11418
11419                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
11420
11421         else
11422
11423 cf_ncuhdr_root=$cf_cv_screen
11424
11425 test -n "$cf_cv_curses_dir" && \
11426 test "$cf_cv_curses_dir" != "no" && { \
11427
11428 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
11429   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
11430   do
11431         while test "$cf_add_incdir" != /usr/include
11432         do
11433           if test -d "$cf_add_incdir"
11434           then
11435                 cf_have_incdir=no
11436                 if test -n "$CFLAGS$CPPFLAGS" ; then
11437                   # a loop is needed to ensure we can add subdirs of existing dirs
11438                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11439                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11440                           cf_have_incdir=yes; break
11441                         fi
11442                   done
11443                 fi
11444
11445                 if test "$cf_have_incdir" = no ; then
11446                   if test "$cf_add_incdir" = /usr/local/include ; then
11447                         if test "$GCC" = yes
11448                         then
11449                           cf_save_CPPFLAGS=$CPPFLAGS
11450
11451         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11452         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11453
11454                           cat >"conftest.$ac_ext" <<_ACEOF
11455 #line 11455 "configure"
11456 #include "confdefs.h"
11457 #include <stdio.h>
11458 int
11459 main (void)
11460 {
11461 printf("Hello")
11462   ;
11463   return 0;
11464 }
11465 _ACEOF
11466 rm -f "conftest.$ac_objext"
11467 if { (eval echo "$as_me:11467: \"$ac_compile\"") >&5
11468   (eval $ac_compile) 2>&5
11469   ac_status=$?
11470   echo "$as_me:11470: \$? = $ac_status" >&5
11471   (exit "$ac_status"); } &&
11472          { ac_try='test -s "conftest.$ac_objext"'
11473   { (eval echo "$as_me:11473: \"$ac_try\"") >&5
11474   (eval $ac_try) 2>&5
11475   ac_status=$?
11476   echo "$as_me:11476: \$? = $ac_status" >&5
11477   (exit "$ac_status"); }; }; then
11478   :
11479 else
11480   echo "$as_me: failed program was:" >&5
11481 cat "conftest.$ac_ext" >&5
11482 cf_have_incdir=yes
11483 fi
11484 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11485                           CPPFLAGS=$cf_save_CPPFLAGS
11486                         fi
11487                   fi
11488                 fi
11489
11490                 if test "$cf_have_incdir" = no ; then
11491                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11492
11493 echo "${as_me:-configure}:11493: testing adding $cf_add_incdir to include-path ..." 1>&5
11494
11495                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11496
11497                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11498                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11499                   cf_add_incdir="$cf_top_incdir"
11500                 else
11501                   break
11502                 fi
11503           else
11504                 break
11505           fi
11506         done
11507   done
11508 fi
11509
11510 }
11511
11512 echo "$as_me:11512: checking for $cf_ncuhdr_root header in include-path" >&5
11513 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
11514 if test "${cf_cv_ncurses_h+set}" = set; then
11515   echo $ECHO_N "(cached) $ECHO_C" >&6
11516 else
11517
11518         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
11519         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
11520         for cf_header in $cf_header_list
11521         do
11522
11523         cat >"conftest.$ac_ext" <<_ACEOF
11524 #line 11524 "configure"
11525 #include "confdefs.h"
11526
11527 #include <$cf_header>
11528 int
11529 main (void)
11530 {
11531
11532 #ifdef NCURSES_VERSION
11533
11534 printf("%s\\n", NCURSES_VERSION);
11535 #else
11536 #ifdef __NCURSES_H
11537 printf("old\\n");
11538 #else
11539         #error __NCURSES_H is not defined
11540 #endif
11541 #endif
11542
11543   ;
11544   return 0;
11545 }
11546 _ACEOF
11547 rm -f "conftest.$ac_objext"
11548 if { (eval echo "$as_me:11548: \"$ac_compile\"") >&5
11549   (eval $ac_compile) 2>&5
11550   ac_status=$?
11551   echo "$as_me:11551: \$? = $ac_status" >&5
11552   (exit "$ac_status"); } &&
11553          { ac_try='test -s "conftest.$ac_objext"'
11554   { (eval echo "$as_me:11554: \"$ac_try\"") >&5
11555   (eval $ac_try) 2>&5
11556   ac_status=$?
11557   echo "$as_me:11557: \$? = $ac_status" >&5
11558   (exit "$ac_status"); }; }; then
11559   cf_cv_ncurses_h=$cf_header
11560
11561 else
11562   echo "$as_me: failed program was:" >&5
11563 cat "conftest.$ac_ext" >&5
11564 cf_cv_ncurses_h=no
11565 fi
11566 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11567
11568                 test "$cf_cv_ncurses_h" != no && break
11569         done
11570
11571 fi
11572 echo "$as_me:11572: result: $cf_cv_ncurses_h" >&5
11573 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
11574
11575 if test "$cf_cv_ncurses_h" != no ; then
11576         cf_cv_ncurses_header=$cf_cv_ncurses_h
11577 else
11578
11579 echo "$as_me:11579: checking for $cf_ncuhdr_root include-path" >&5
11580 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11581 if test "${cf_cv_ncurses_h2+set}" = set; then
11582   echo $ECHO_N "(cached) $ECHO_C" >&6
11583 else
11584
11585         test -n "$verbose" && echo
11586
11587 cf_search=
11588
11589 # collect the current set of include-directories from compiler flags
11590 cf_header_path_list=""
11591 if test -n "${CFLAGS}${CPPFLAGS}" ; then
11592         for cf_header_path in $CPPFLAGS $CFLAGS
11593         do
11594                 case "$cf_header_path" in
11595                 (-I*)
11596                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11597
11598 test "x$cf_header_path" != "xNONE" && \
11599 test -d "$cf_header_path" && \
11600  {
11601         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
11602         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
11603         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11604         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11605         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11606         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"
11607 }
11608
11609                         cf_header_path_list="$cf_header_path_list $cf_search"
11610                         ;;
11611                 esac
11612         done
11613 fi
11614
11615 # add the variations for the package we are looking for
11616
11617 cf_search=
11618
11619 test "x$prefix" != "xNONE" && \
11620 test -d "$prefix" && \
11621  {
11622         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
11623         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
11624         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11625         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11626         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11627         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
11628 }
11629
11630 for cf_subdir_prefix in \
11631         /usr \
11632         /usr/local \
11633         /usr/pkg \
11634         /opt \
11635         /opt/local \
11636         $HOME
11637 do
11638
11639 test "x$cf_subdir_prefix" != "x$prefix" && \
11640 test -d "$cf_subdir_prefix" && \
11641 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11642         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11643         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11644         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11645         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11646         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11647         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"
11648 }
11649
11650 done
11651
11652 test "$includedir" != NONE && \
11653 test "$includedir" != "/usr/include" && \
11654 test -d "$includedir" && {
11655         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11656         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11657 }
11658
11659 test "$oldincludedir" != NONE && \
11660 test "$oldincludedir" != "/usr/include" && \
11661 test -d "$oldincludedir" && {
11662         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11663         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11664 }
11665
11666 cf_search="$cf_search $cf_header_path_list"
11667
11668         test -n "$verbose" && echo "search path $cf_search"
11669         cf_save2_CPPFLAGS="$CPPFLAGS"
11670         for cf_incdir in $cf_search
11671         do
11672
11673 if test -n "$cf_incdir" ; then
11674   for cf_add_incdir in $cf_incdir
11675   do
11676         while test "$cf_add_incdir" != /usr/include
11677         do
11678           if test -d "$cf_add_incdir"
11679           then
11680                 cf_have_incdir=no
11681                 if test -n "$CFLAGS$CPPFLAGS" ; then
11682                   # a loop is needed to ensure we can add subdirs of existing dirs
11683                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11684                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11685                           cf_have_incdir=yes; break
11686                         fi
11687                   done
11688                 fi
11689
11690                 if test "$cf_have_incdir" = no ; then
11691                   if test "$cf_add_incdir" = /usr/local/include ; then
11692                         if test "$GCC" = yes
11693                         then
11694                           cf_save_CPPFLAGS=$CPPFLAGS
11695
11696         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11697         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11698
11699                           cat >"conftest.$ac_ext" <<_ACEOF
11700 #line 11700 "configure"
11701 #include "confdefs.h"
11702 #include <stdio.h>
11703 int
11704 main (void)
11705 {
11706 printf("Hello")
11707   ;
11708   return 0;
11709 }
11710 _ACEOF
11711 rm -f "conftest.$ac_objext"
11712 if { (eval echo "$as_me:11712: \"$ac_compile\"") >&5
11713   (eval $ac_compile) 2>&5
11714   ac_status=$?
11715   echo "$as_me:11715: \$? = $ac_status" >&5
11716   (exit "$ac_status"); } &&
11717          { ac_try='test -s "conftest.$ac_objext"'
11718   { (eval echo "$as_me:11718: \"$ac_try\"") >&5
11719   (eval $ac_try) 2>&5
11720   ac_status=$?
11721   echo "$as_me:11721: \$? = $ac_status" >&5
11722   (exit "$ac_status"); }; }; then
11723   :
11724 else
11725   echo "$as_me: failed program was:" >&5
11726 cat "conftest.$ac_ext" >&5
11727 cf_have_incdir=yes
11728 fi
11729 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11730                           CPPFLAGS=$cf_save_CPPFLAGS
11731                         fi
11732                   fi
11733                 fi
11734
11735                 if test "$cf_have_incdir" = no ; then
11736                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11737
11738 echo "${as_me:-configure}:11738: testing adding $cf_add_incdir to include-path ..." 1>&5
11739
11740                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11741
11742                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11743                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11744                   cf_add_incdir="$cf_top_incdir"
11745                 else
11746                   break
11747                 fi
11748           else
11749                 break
11750           fi
11751         done
11752   done
11753 fi
11754
11755                 for cf_header in \
11756                         ncurses.h \
11757                         curses.h
11758                 do
11759
11760         cat >"conftest.$ac_ext" <<_ACEOF
11761 #line 11761 "configure"
11762 #include "confdefs.h"
11763
11764 #include <$cf_header>
11765 int
11766 main (void)
11767 {
11768
11769 #ifdef NCURSES_VERSION
11770
11771 printf("%s\\n", NCURSES_VERSION);
11772 #else
11773 #ifdef __NCURSES_H
11774 printf("old\\n");
11775 #else
11776         #error __NCURSES_H is not defined
11777 #endif
11778 #endif
11779
11780   ;
11781   return 0;
11782 }
11783 _ACEOF
11784 rm -f "conftest.$ac_objext"
11785 if { (eval echo "$as_me:11785: \"$ac_compile\"") >&5
11786   (eval $ac_compile) 2>&5
11787   ac_status=$?
11788   echo "$as_me:11788: \$? = $ac_status" >&5
11789   (exit "$ac_status"); } &&
11790          { ac_try='test -s "conftest.$ac_objext"'
11791   { (eval echo "$as_me:11791: \"$ac_try\"") >&5
11792   (eval $ac_try) 2>&5
11793   ac_status=$?
11794   echo "$as_me:11794: \$? = $ac_status" >&5
11795   (exit "$ac_status"); }; }; then
11796   cf_cv_ncurses_h2=$cf_header
11797
11798 else
11799   echo "$as_me: failed program was:" >&5
11800 cat "conftest.$ac_ext" >&5
11801 cf_cv_ncurses_h2=no
11802 fi
11803 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11804
11805                         if test "$cf_cv_ncurses_h2" != no ; then
11806                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11807                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11808                                 break
11809                         fi
11810                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11811                 done
11812                 CPPFLAGS="$cf_save2_CPPFLAGS"
11813                 test "$cf_cv_ncurses_h2" != no && break
11814         done
11815         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11815: error: not found" >&5
11816 echo "$as_me: error: not found" >&2;}
11817    { (exit 1); exit 1; }; }
11818
11819 fi
11820 echo "$as_me:11820: result: $cf_cv_ncurses_h2" >&5
11821 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11822
11823         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11824         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11825         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11826                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11827         fi
11828
11829 if test -n "$cf_1st_incdir" ; then
11830   for cf_add_incdir in $cf_1st_incdir
11831   do
11832         while test "$cf_add_incdir" != /usr/include
11833         do
11834           if test -d "$cf_add_incdir"
11835           then
11836                 cf_have_incdir=no
11837                 if test -n "$CFLAGS$CPPFLAGS" ; then
11838                   # a loop is needed to ensure we can add subdirs of existing dirs
11839                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11840                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11841                           cf_have_incdir=yes; break
11842                         fi
11843                   done
11844                 fi
11845
11846                 if test "$cf_have_incdir" = no ; then
11847                   if test "$cf_add_incdir" = /usr/local/include ; then
11848                         if test "$GCC" = yes
11849                         then
11850                           cf_save_CPPFLAGS=$CPPFLAGS
11851
11852         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11853         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11854
11855                           cat >"conftest.$ac_ext" <<_ACEOF
11856 #line 11856 "configure"
11857 #include "confdefs.h"
11858 #include <stdio.h>
11859 int
11860 main (void)
11861 {
11862 printf("Hello")
11863   ;
11864   return 0;
11865 }
11866 _ACEOF
11867 rm -f "conftest.$ac_objext"
11868 if { (eval echo "$as_me:11868: \"$ac_compile\"") >&5
11869   (eval $ac_compile) 2>&5
11870   ac_status=$?
11871   echo "$as_me:11871: \$? = $ac_status" >&5
11872   (exit "$ac_status"); } &&
11873          { ac_try='test -s "conftest.$ac_objext"'
11874   { (eval echo "$as_me:11874: \"$ac_try\"") >&5
11875   (eval $ac_try) 2>&5
11876   ac_status=$?
11877   echo "$as_me:11877: \$? = $ac_status" >&5
11878   (exit "$ac_status"); }; }; then
11879   :
11880 else
11881   echo "$as_me: failed program was:" >&5
11882 cat "conftest.$ac_ext" >&5
11883 cf_have_incdir=yes
11884 fi
11885 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11886                           CPPFLAGS=$cf_save_CPPFLAGS
11887                         fi
11888                   fi
11889                 fi
11890
11891                 if test "$cf_have_incdir" = no ; then
11892                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11893
11894 echo "${as_me:-configure}:11894: testing adding $cf_add_incdir to include-path ..." 1>&5
11895
11896                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11897
11898                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11899                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11900                   cf_add_incdir="$cf_top_incdir"
11901                 else
11902                   break
11903                 fi
11904           else
11905                 break
11906           fi
11907         done
11908   done
11909 fi
11910
11911 fi
11912
11913 # Set definitions to allow ifdef'ing for ncurses.h
11914
11915 case "$cf_cv_ncurses_header" in
11916 (*ncurses.h)
11917
11918 cat >>confdefs.h <<\EOF
11919 #define HAVE_NCURSES_H 1
11920 EOF
11921
11922         ;;
11923 esac
11924
11925 case "$cf_cv_ncurses_header" in
11926 (ncurses/curses.h|ncurses/ncurses.h)
11927
11928 cat >>confdefs.h <<\EOF
11929 #define HAVE_NCURSES_NCURSES_H 1
11930 EOF
11931
11932         ;;
11933 (ncursesw/curses.h|ncursesw/ncurses.h)
11934
11935 cat >>confdefs.h <<\EOF
11936 #define HAVE_NCURSESW_NCURSES_H 1
11937 EOF
11938
11939         ;;
11940 esac
11941
11942 echo "$as_me:11942: checking for terminfo header" >&5
11943 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11944 if test "${cf_cv_term_header+set}" = set; then
11945   echo $ECHO_N "(cached) $ECHO_C" >&6
11946 else
11947
11948 case "${cf_cv_ncurses_header}" in
11949 (*/ncurses.h|*/ncursesw.h)
11950         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11951         ;;
11952 (*)
11953         cf_term_header=term.h
11954         ;;
11955 esac
11956
11957 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11958 do
11959 cat >"conftest.$ac_ext" <<_ACEOF
11960 #line 11960 "configure"
11961 #include "confdefs.h"
11962 #include <stdio.h>
11963 #include <${cf_cv_ncurses_header:-curses.h}>
11964 #include <$cf_test>
11965
11966 int
11967 main (void)
11968 {
11969 int x = auto_left_margin; (void)x
11970   ;
11971   return 0;
11972 }
11973 _ACEOF
11974 rm -f "conftest.$ac_objext"
11975 if { (eval echo "$as_me:11975: \"$ac_compile\"") >&5
11976   (eval $ac_compile) 2>&5
11977   ac_status=$?
11978   echo "$as_me:11978: \$? = $ac_status" >&5
11979   (exit "$ac_status"); } &&
11980          { ac_try='test -s "conftest.$ac_objext"'
11981   { (eval echo "$as_me:11981: \"$ac_try\"") >&5
11982   (eval $ac_try) 2>&5
11983   ac_status=$?
11984   echo "$as_me:11984: \$? = $ac_status" >&5
11985   (exit "$ac_status"); }; }; then
11986
11987         cf_cv_term_header="$cf_test"
11988 else
11989   echo "$as_me: failed program was:" >&5
11990 cat "conftest.$ac_ext" >&5
11991
11992         cf_cv_term_header=unknown
11993
11994 fi
11995 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11996         test "$cf_cv_term_header" != unknown && break
11997 done
11998
11999 fi
12000 echo "$as_me:12000: result: $cf_cv_term_header" >&5
12001 echo "${ECHO_T}$cf_cv_term_header" >&6
12002
12003 # Set definitions to allow ifdef'ing to accommodate subdirectories
12004
12005 case "$cf_cv_term_header" in
12006 (*term.h)
12007
12008 cat >>confdefs.h <<\EOF
12009 #define HAVE_TERM_H 1
12010 EOF
12011
12012         ;;
12013 esac
12014
12015 case "$cf_cv_term_header" in
12016 (ncurses/term.h)
12017
12018 cat >>confdefs.h <<\EOF
12019 #define HAVE_NCURSES_TERM_H 1
12020 EOF
12021
12022         ;;
12023 (ncursesw/term.h)
12024
12025 cat >>confdefs.h <<\EOF
12026 #define HAVE_NCURSESW_TERM_H 1
12027 EOF
12028
12029         ;;
12030 esac
12031
12032 # some applications need this, but should check for NCURSES_VERSION
12033
12034 cat >>confdefs.h <<\EOF
12035 #define NCURSES 1
12036 EOF
12037
12038 echo "$as_me:12038: checking for ncurses version" >&5
12039 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
12040 if test "${cf_cv_ncurses_version+set}" = set; then
12041   echo $ECHO_N "(cached) $ECHO_C" >&6
12042 else
12043
12044         cf_cv_ncurses_version=no
12045         cf_tempfile=out$$
12046         rm -f "$cf_tempfile"
12047         if test "$cross_compiling" = yes; then
12048
12049         # This will not work if the preprocessor splits the line after the
12050         # Autoconf token.  The 'unproto' program does that.
12051         cat > "conftest.$ac_ext" <<EOF
12052 #include <${cf_cv_ncurses_header:-curses.h}>
12053 #undef Autoconf
12054 #ifdef NCURSES_VERSION
12055 Autoconf NCURSES_VERSION
12056 #else
12057 #ifdef __NCURSES_H
12058 Autoconf "old"
12059 #endif
12060 ;
12061 #endif
12062 EOF
12063         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
12064         { (eval echo "$as_me:12064: \"$cf_try\"") >&5
12065   (eval $cf_try) 2>&5
12066   ac_status=$?
12067   echo "$as_me:12067: \$? = $ac_status" >&5
12068   (exit "$ac_status"); }
12069         if test -f conftest.out ; then
12070                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
12071                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
12072                 rm -f conftest.out
12073         fi
12074
12075 else
12076   cat >"conftest.$ac_ext" <<_ACEOF
12077 #line 12077 "configure"
12078 #include "confdefs.h"
12079
12080 $ac_includes_default
12081
12082 #include <${cf_cv_ncurses_header:-curses.h}>
12083
12084 int main(void)
12085 {
12086         FILE *fp = fopen("$cf_tempfile", "w");
12087 #ifdef NCURSES_VERSION
12088 # ifdef NCURSES_VERSION_PATCH
12089         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
12090 # else
12091         fprintf(fp, "%s\\n", NCURSES_VERSION);
12092 # endif
12093 #else
12094 # ifdef __NCURSES_H
12095         fprintf(fp, "old\\n");
12096 # else
12097         make an error
12098 # endif
12099 #endif
12100         ${cf_cv_main_return:-return}(0);
12101 }
12102 _ACEOF
12103 rm -f "conftest$ac_exeext"
12104 if { (eval echo "$as_me:12104: \"$ac_link\"") >&5
12105   (eval $ac_link) 2>&5
12106   ac_status=$?
12107   echo "$as_me:12107: \$? = $ac_status" >&5
12108   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
12109   { (eval echo "$as_me:12109: \"$ac_try\"") >&5
12110   (eval $ac_try) 2>&5
12111   ac_status=$?
12112   echo "$as_me:12112: \$? = $ac_status" >&5
12113   (exit "$ac_status"); }; }; then
12114
12115         cf_cv_ncurses_version=`cat $cf_tempfile`
12116 else
12117   echo "$as_me: program exited with status $ac_status" >&5
12118 echo "$as_me: failed program was:" >&5
12119 cat "conftest.$ac_ext" >&5
12120 fi
12121 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
12122 fi
12123         rm -f "$cf_tempfile"
12124
12125 fi
12126 echo "$as_me:12126: result: $cf_cv_ncurses_version" >&5
12127 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
12128 test "$cf_cv_ncurses_version" = no ||
12129 cat >>confdefs.h <<\EOF
12130 #define NCURSES 1
12131 EOF
12132
12133 cf_nculib_root=$cf_cv_screen
12134         # This works, except for the special case where we find gpm, but
12135         # ncurses is in a nonstandard location via $LIBS, and we really want
12136         # to link gpm.
12137 cf_ncurses_LIBS=""
12138 cf_ncurses_SAVE="$LIBS"
12139 echo "$as_me:12139: checking for Gpm_Open in -lgpm" >&5
12140 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
12141 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
12142   echo $ECHO_N "(cached) $ECHO_C" >&6
12143 else
12144   ac_check_lib_save_LIBS=$LIBS
12145 LIBS="-lgpm  $LIBS"
12146 cat >"conftest.$ac_ext" <<_ACEOF
12147 #line 12147 "configure"
12148 #include "confdefs.h"
12149
12150 /* Override any gcc2 internal prototype to avoid an error.  */
12151 #ifdef __cplusplus
12152 extern "C"
12153 #endif
12154 /* We use char because int might match the return type of a gcc2
12155    builtin and then its argument prototype would still apply.  */
12156 char Gpm_Open ();
12157 int
12158 main (void)
12159 {
12160 Gpm_Open ();
12161   ;
12162   return 0;
12163 }
12164 _ACEOF
12165 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12166 if { (eval echo "$as_me:12166: \"$ac_link\"") >&5
12167   (eval $ac_link) 2>&5
12168   ac_status=$?
12169   echo "$as_me:12169: \$? = $ac_status" >&5
12170   (exit "$ac_status"); } &&
12171          { ac_try='test -s "conftest$ac_exeext"'
12172   { (eval echo "$as_me:12172: \"$ac_try\"") >&5
12173   (eval $ac_try) 2>&5
12174   ac_status=$?
12175   echo "$as_me:12175: \$? = $ac_status" >&5
12176   (exit "$ac_status"); }; }; then
12177   ac_cv_lib_gpm_Gpm_Open=yes
12178 else
12179   echo "$as_me: failed program was:" >&5
12180 cat "conftest.$ac_ext" >&5
12181 ac_cv_lib_gpm_Gpm_Open=no
12182 fi
12183 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12184 LIBS=$ac_check_lib_save_LIBS
12185 fi
12186 echo "$as_me:12186: result: $ac_cv_lib_gpm_Gpm_Open" >&5
12187 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
12188 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
12189   echo "$as_me:12189: checking for initscr in -lgpm" >&5
12190 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
12191 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
12192   echo $ECHO_N "(cached) $ECHO_C" >&6
12193 else
12194   ac_check_lib_save_LIBS=$LIBS
12195 LIBS="-lgpm  $LIBS"
12196 cat >"conftest.$ac_ext" <<_ACEOF
12197 #line 12197 "configure"
12198 #include "confdefs.h"
12199
12200 /* Override any gcc2 internal prototype to avoid an error.  */
12201 #ifdef __cplusplus
12202 extern "C"
12203 #endif
12204 /* We use char because int might match the return type of a gcc2
12205    builtin and then its argument prototype would still apply.  */
12206 char initscr ();
12207 int
12208 main (void)
12209 {
12210 initscr ();
12211   ;
12212   return 0;
12213 }
12214 _ACEOF
12215 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12216 if { (eval echo "$as_me:12216: \"$ac_link\"") >&5
12217   (eval $ac_link) 2>&5
12218   ac_status=$?
12219   echo "$as_me:12219: \$? = $ac_status" >&5
12220   (exit "$ac_status"); } &&
12221          { ac_try='test -s "conftest$ac_exeext"'
12222   { (eval echo "$as_me:12222: \"$ac_try\"") >&5
12223   (eval $ac_try) 2>&5
12224   ac_status=$?
12225   echo "$as_me:12225: \$? = $ac_status" >&5
12226   (exit "$ac_status"); }; }; then
12227   ac_cv_lib_gpm_initscr=yes
12228 else
12229   echo "$as_me: failed program was:" >&5
12230 cat "conftest.$ac_ext" >&5
12231 ac_cv_lib_gpm_initscr=no
12232 fi
12233 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12234 LIBS=$ac_check_lib_save_LIBS
12235 fi
12236 echo "$as_me:12236: result: $ac_cv_lib_gpm_initscr" >&5
12237 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
12238 if test "$ac_cv_lib_gpm_initscr" = yes; then
12239   LIBS="$cf_ncurses_SAVE"
12240 else
12241   cf_ncurses_LIBS="-lgpm"
12242 fi
12243
12244 fi
12245
12246 case "$host_os" in
12247 (freebsd*)
12248         # This is only necessary if you are linking against an obsolete
12249         # version of ncurses (but it should do no harm, since it is static).
12250         if test "$cf_nculib_root" = ncurses ; then
12251                 echo "$as_me:12251: checking for tgoto in -lmytinfo" >&5
12252 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
12253 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
12254   echo $ECHO_N "(cached) $ECHO_C" >&6
12255 else
12256   ac_check_lib_save_LIBS=$LIBS
12257 LIBS="-lmytinfo  $LIBS"
12258 cat >"conftest.$ac_ext" <<_ACEOF
12259 #line 12259 "configure"
12260 #include "confdefs.h"
12261
12262 /* Override any gcc2 internal prototype to avoid an error.  */
12263 #ifdef __cplusplus
12264 extern "C"
12265 #endif
12266 /* We use char because int might match the return type of a gcc2
12267    builtin and then its argument prototype would still apply.  */
12268 char tgoto ();
12269 int
12270 main (void)
12271 {
12272 tgoto ();
12273   ;
12274   return 0;
12275 }
12276 _ACEOF
12277 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12278 if { (eval echo "$as_me:12278: \"$ac_link\"") >&5
12279   (eval $ac_link) 2>&5
12280   ac_status=$?
12281   echo "$as_me:12281: \$? = $ac_status" >&5
12282   (exit "$ac_status"); } &&
12283          { ac_try='test -s "conftest$ac_exeext"'
12284   { (eval echo "$as_me:12284: \"$ac_try\"") >&5
12285   (eval $ac_try) 2>&5
12286   ac_status=$?
12287   echo "$as_me:12287: \$? = $ac_status" >&5
12288   (exit "$ac_status"); }; }; then
12289   ac_cv_lib_mytinfo_tgoto=yes
12290 else
12291   echo "$as_me: failed program was:" >&5
12292 cat "conftest.$ac_ext" >&5
12293 ac_cv_lib_mytinfo_tgoto=no
12294 fi
12295 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12296 LIBS=$ac_check_lib_save_LIBS
12297 fi
12298 echo "$as_me:12298: result: $ac_cv_lib_mytinfo_tgoto" >&5
12299 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
12300 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
12301   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
12302 fi
12303
12304         fi
12305         ;;
12306 esac
12307
12308 cf_add_libs="$LIBS"
12309 # reverse order
12310 cf_add_0lib=
12311 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12312 # filter duplicates
12313 for cf_add_1lib in $cf_add_0lib; do
12314         for cf_add_2lib in $cf_add_libs; do
12315                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12316                         cf_add_1lib=
12317                         break
12318                 fi
12319         done
12320         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12321 done
12322 LIBS="$cf_add_libs"
12323
12324 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
12325 then
12326
12327 cf_add_libs="$LIBS"
12328 # reverse order
12329 cf_add_0lib=
12330 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12331 # filter duplicates
12332 for cf_add_1lib in $cf_add_0lib; do
12333         for cf_add_2lib in $cf_add_libs; do
12334                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12335                         cf_add_1lib=
12336                         break
12337                 fi
12338         done
12339         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12340 done
12341 LIBS="$cf_add_libs"
12342
12343 else
12344
12345         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
12346         cf_libdir=""
12347         echo "$as_me:12347: checking for initscr" >&5
12348 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
12349 if test "${ac_cv_func_initscr+set}" = set; then
12350   echo $ECHO_N "(cached) $ECHO_C" >&6
12351 else
12352   cat >"conftest.$ac_ext" <<_ACEOF
12353 #line 12353 "configure"
12354 #include "confdefs.h"
12355 #define initscr autoconf_temporary
12356 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12357 #undef initscr
12358
12359 #ifdef __cplusplus
12360 extern "C"
12361 #endif
12362
12363 /* We use char because int might match the return type of a gcc2
12364    builtin and then its argument prototype would still apply.  */
12365 char initscr (void);
12366
12367 int
12368 main (void)
12369 {
12370
12371 /* The GNU C library defines stubs for functions which it implements
12372     to always fail with ENOSYS.  Some functions are actually named
12373     something starting with __ and the normal name is an alias.  */
12374 #if defined (__stub_initscr) || defined (__stub___initscr)
12375 #error found stub for initscr
12376 #endif
12377
12378         return initscr ();
12379   ;
12380   return 0;
12381 }
12382 _ACEOF
12383 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12384 if { (eval echo "$as_me:12384: \"$ac_link\"") >&5
12385   (eval $ac_link) 2>&5
12386   ac_status=$?
12387   echo "$as_me:12387: \$? = $ac_status" >&5
12388   (exit "$ac_status"); } &&
12389          { ac_try='test -s "conftest$ac_exeext"'
12390   { (eval echo "$as_me:12390: \"$ac_try\"") >&5
12391   (eval $ac_try) 2>&5
12392   ac_status=$?
12393   echo "$as_me:12393: \$? = $ac_status" >&5
12394   (exit "$ac_status"); }; }; then
12395   ac_cv_func_initscr=yes
12396 else
12397   echo "$as_me: failed program was:" >&5
12398 cat "conftest.$ac_ext" >&5
12399 ac_cv_func_initscr=no
12400 fi
12401 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12402 fi
12403 echo "$as_me:12403: result: $ac_cv_func_initscr" >&5
12404 echo "${ECHO_T}$ac_cv_func_initscr" >&6
12405 if test "$ac_cv_func_initscr" = yes; then
12406   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12407 else
12408
12409                 cf_save_LIBS="$LIBS"
12410                 echo "$as_me:12410: checking for initscr in -l$cf_nculib_root" >&5
12411 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
12412                 LIBS="-l$cf_nculib_root $LIBS"
12413                 cat >"conftest.$ac_ext" <<_ACEOF
12414 #line 12414 "configure"
12415 #include "confdefs.h"
12416 #include <${cf_cv_ncurses_header:-curses.h}>
12417 int
12418 main (void)
12419 {
12420 initscr()
12421   ;
12422   return 0;
12423 }
12424 _ACEOF
12425 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12426 if { (eval echo "$as_me:12426: \"$ac_link\"") >&5
12427   (eval $ac_link) 2>&5
12428   ac_status=$?
12429   echo "$as_me:12429: \$? = $ac_status" >&5
12430   (exit "$ac_status"); } &&
12431          { ac_try='test -s "conftest$ac_exeext"'
12432   { (eval echo "$as_me:12432: \"$ac_try\"") >&5
12433   (eval $ac_try) 2>&5
12434   ac_status=$?
12435   echo "$as_me:12435: \$? = $ac_status" >&5
12436   (exit "$ac_status"); }; }; then
12437   echo "$as_me:12437: result: yes" >&5
12438 echo "${ECHO_T}yes" >&6
12439                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12440
12441 else
12442   echo "$as_me: failed program was:" >&5
12443 cat "conftest.$ac_ext" >&5
12444 echo "$as_me:12444: result: no" >&5
12445 echo "${ECHO_T}no" >&6
12446
12447 cf_search=
12448 cf_library_path_list=""
12449 if test -n "${LDFLAGS}${LIBS}" ; then
12450         for cf_library_path in $LDFLAGS $LIBS
12451         do
12452                 case "$cf_library_path" in
12453                 (-L*)
12454                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
12455
12456 test "x$cf_library_path" != "xNONE" && \
12457 test -d "$cf_library_path" && \
12458  {
12459         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
12460         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
12461         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
12462         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
12463         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
12464         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"
12465 }
12466
12467                         cf_library_path_list="$cf_library_path_list $cf_search"
12468                         ;;
12469                 esac
12470         done
12471 fi
12472
12473 cf_search=
12474
12475 test "x$prefix" != "xNONE" && \
12476 test -d "$prefix" && \
12477  {
12478         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
12479         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
12480         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
12481         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
12482         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
12483         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
12484 }
12485
12486 for cf_subdir_prefix in \
12487         /usr \
12488         /usr/local \
12489         /usr/pkg \
12490         /opt \
12491         /opt/local \
12492         $HOME
12493 do
12494
12495 test "x$cf_subdir_prefix" != "x$prefix" && \
12496 test -d "$cf_subdir_prefix" && \
12497 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
12498         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
12499         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
12500         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
12501         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
12502         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
12503         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"
12504 }
12505
12506 done
12507
12508 cf_search="$cf_library_path_list $cf_search"
12509
12510                         for cf_libdir in $cf_search
12511                         do
12512                                 echo "$as_me:12512: checking for -l$cf_nculib_root in $cf_libdir" >&5
12513 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
12514                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
12515                                 cat >"conftest.$ac_ext" <<_ACEOF
12516 #line 12516 "configure"
12517 #include "confdefs.h"
12518 #include <${cf_cv_ncurses_header:-curses.h}>
12519 int
12520 main (void)
12521 {
12522 initscr()
12523   ;
12524   return 0;
12525 }
12526 _ACEOF
12527 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12528 if { (eval echo "$as_me:12528: \"$ac_link\"") >&5
12529   (eval $ac_link) 2>&5
12530   ac_status=$?
12531   echo "$as_me:12531: \$? = $ac_status" >&5
12532   (exit "$ac_status"); } &&
12533          { ac_try='test -s "conftest$ac_exeext"'
12534   { (eval echo "$as_me:12534: \"$ac_try\"") >&5
12535   (eval $ac_try) 2>&5
12536   ac_status=$?
12537   echo "$as_me:12537: \$? = $ac_status" >&5
12538   (exit "$ac_status"); }; }; then
12539   echo "$as_me:12539: result: yes" >&5
12540 echo "${ECHO_T}yes" >&6
12541                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12542                                          break
12543 else
12544   echo "$as_me: failed program was:" >&5
12545 cat "conftest.$ac_ext" >&5
12546 echo "$as_me:12546: result: no" >&5
12547 echo "${ECHO_T}no" >&6
12548                                          LIBS="$cf_save_LIBS"
12549 fi
12550 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12551                         done
12552
12553 fi
12554 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12555
12556 fi
12557
12558 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
12559
12560 if test "$cf_found_library" = no ; then
12561         { { echo "$as_me:12561: error: Cannot link $cf_nculib_root library" >&5
12562 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
12563    { (exit 1); exit 1; }; }
12564 fi
12565
12566 fi
12567
12568 if test -n "$cf_ncurses_LIBS" ; then
12569         echo "$as_me:12569: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
12570 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
12571         cf_ncurses_SAVE="$LIBS"
12572         for p in $cf_ncurses_LIBS ; do
12573                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
12574                 if test "$q" != "$LIBS" ; then
12575                         LIBS="$q"
12576                 fi
12577         done
12578         cat >"conftest.$ac_ext" <<_ACEOF
12579 #line 12579 "configure"
12580 #include "confdefs.h"
12581 #include <${cf_cv_ncurses_header:-curses.h}>
12582 int
12583 main (void)
12584 {
12585 initscr(); mousemask(0,0); tigetstr((char *)0);
12586   ;
12587   return 0;
12588 }
12589 _ACEOF
12590 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12591 if { (eval echo "$as_me:12591: \"$ac_link\"") >&5
12592   (eval $ac_link) 2>&5
12593   ac_status=$?
12594   echo "$as_me:12594: \$? = $ac_status" >&5
12595   (exit "$ac_status"); } &&
12596          { ac_try='test -s "conftest$ac_exeext"'
12597   { (eval echo "$as_me:12597: \"$ac_try\"") >&5
12598   (eval $ac_try) 2>&5
12599   ac_status=$?
12600   echo "$as_me:12600: \$? = $ac_status" >&5
12601   (exit "$ac_status"); }; }; then
12602   echo "$as_me:12602: result: yes" >&5
12603 echo "${ECHO_T}yes" >&6
12604 else
12605   echo "$as_me: failed program was:" >&5
12606 cat "conftest.$ac_ext" >&5
12607 echo "$as_me:12607: result: no" >&5
12608 echo "${ECHO_T}no" >&6
12609                  LIBS="$cf_ncurses_SAVE"
12610 fi
12611 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12612 fi
12613
12614 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12615
12616 cat >>confdefs.h <<EOF
12617 #define $cf_nculib_ROOT 1
12618 EOF
12619
12620         fi
12621 else
12622         NCURSES_CONFIG=none
12623 fi
12624
12625         ;;
12626 (pdcurses)
12627         echo "$as_me:12627: checking for X" >&5
12628 echo $ECHO_N "checking for X... $ECHO_C" >&6
12629
12630 # Check whether --with-x or --without-x was given.
12631 if test "${with_x+set}" = set; then
12632   withval="$with_x"
12633
12634 fi;
12635 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12636 if test "x$with_x" = xno; then
12637   # The user explicitly disabled X.
12638   have_x=disabled
12639 else
12640   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12641     # Both variables are already set.
12642     have_x=yes
12643   else
12644     if test "${ac_cv_have_x+set}" = set; then
12645   echo $ECHO_N "(cached) $ECHO_C" >&6
12646 else
12647   # One or both of the vars are not set, and there is no cached value.
12648 ac_x_includes=no ac_x_libraries=no
12649 rm -fr conftest.dir
12650 if mkdir conftest.dir; then
12651   cd conftest.dir
12652   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12653   cat >Imakefile <<'EOF'
12654 acfindx:
12655         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12656 EOF
12657   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12658     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12659     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12660     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12661     for ac_extension in a so sl dylib dll; do
12662       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12663          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12664         ac_im_usrlibdir=$ac_im_libdir; break
12665       fi
12666     done
12667     # Screen out bogus values from the imake configuration.  They are
12668     # bogus both because they are the default anyway, and because
12669     # using them would break gcc on systems where it needs fixed includes.
12670     case $ac_im_incroot in
12671         /usr/include) ;;
12672         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12673     esac
12674     case $ac_im_usrlibdir in
12675         /usr/lib | /lib) ;;
12676         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12677     esac
12678   fi
12679   cd ..
12680   rm -fr conftest.dir
12681 fi
12682
12683 # Standard set of common directories for X headers.
12684 # Check X11 before X11Rn because it is often a symlink to the current release.
12685 ac_x_header_dirs='
12686 /usr/X11/include
12687 /usr/X11R7/include
12688 /usr/X11R6/include
12689 /usr/X11R5/include
12690 /usr/X11R4/include
12691
12692 /opt/local/include
12693 /opt/X11/include
12694
12695 /usr/include/X11
12696 /usr/include/X11R7
12697 /usr/include/X11R6
12698 /usr/include/X11R5
12699 /usr/include/X11R4
12700
12701 /usr/local/X11/include
12702 /usr/local/X11R7/include
12703 /usr/local/X11R6/include
12704 /usr/local/X11R5/include
12705 /usr/local/X11R4/include
12706
12707 /usr/local/include/X11
12708 /usr/local/include/X11R7
12709 /usr/local/include/X11R6
12710 /usr/local/include/X11R5
12711 /usr/local/include/X11R4
12712
12713 /usr/X386/include
12714 /usr/x386/include
12715 /usr/XFree86/include/X11
12716
12717 /usr/include
12718 /usr/local/include
12719 /usr/unsupported/include
12720 /usr/athena/include
12721 /usr/local/x11r5/include
12722 /usr/lpp/Xamples/include
12723
12724 /usr/openwin/include
12725 /usr/openwin/share/include'
12726
12727 if test "$ac_x_includes" = no; then
12728   # Guess where to find include files, by looking for Intrinsic.h.
12729   # First, try using that file with no special directory specified.
12730   cat >"conftest.$ac_ext" <<_ACEOF
12731 #line 12731 "configure"
12732 #include "confdefs.h"
12733 #include <X11/Intrinsic.h>
12734 _ACEOF
12735 if { (eval echo "$as_me:12735: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12736   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12737   ac_status=$?
12738   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12739   rm -f conftest.er1
12740   cat conftest.err >&5
12741   echo "$as_me:12741: \$? = $ac_status" >&5
12742   (exit "$ac_status"); } >/dev/null; then
12743   if test -s conftest.err; then
12744     ac_cpp_err=$ac_c_preproc_warn_flag
12745   else
12746     ac_cpp_err=
12747   fi
12748 else
12749   ac_cpp_err=yes
12750 fi
12751 if test -z "$ac_cpp_err"; then
12752   # We can compile using X headers with no special include directory.
12753 ac_x_includes=
12754 else
12755   echo "$as_me: failed program was:" >&5
12756   cat "conftest.$ac_ext" >&5
12757   for ac_dir in $ac_x_header_dirs; do
12758   if test -r "$ac_dir/X11/Intrinsic.h"; then
12759     ac_x_includes=$ac_dir
12760     break
12761   fi
12762 done
12763 fi
12764 rm -f conftest.err "conftest.$ac_ext"
12765 fi # $ac_x_includes = no
12766
12767 if test "$ac_x_libraries" = no; then
12768   # Check for the libraries.
12769   # See if we find them without any special options.
12770   # Don't add to $LIBS permanently.
12771   ac_save_LIBS=$LIBS
12772   LIBS="-lXt $LIBS"
12773   cat >"conftest.$ac_ext" <<_ACEOF
12774 #line 12774 "configure"
12775 #include "confdefs.h"
12776 #include <X11/Intrinsic.h>
12777 int
12778 main (void)
12779 {
12780 XtMalloc (0)
12781   ;
12782   return 0;
12783 }
12784 _ACEOF
12785 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12786 if { (eval echo "$as_me:12786: \"$ac_link\"") >&5
12787   (eval $ac_link) 2>&5
12788   ac_status=$?
12789   echo "$as_me:12789: \$? = $ac_status" >&5
12790   (exit "$ac_status"); } &&
12791          { ac_try='test -s "conftest$ac_exeext"'
12792   { (eval echo "$as_me:12792: \"$ac_try\"") >&5
12793   (eval $ac_try) 2>&5
12794   ac_status=$?
12795   echo "$as_me:12795: \$? = $ac_status" >&5
12796   (exit "$ac_status"); }; }; then
12797   LIBS=$ac_save_LIBS
12798 # We can link X programs with no special library path.
12799 ac_x_libraries=
12800 else
12801   echo "$as_me: failed program was:" >&5
12802 cat "conftest.$ac_ext" >&5
12803 LIBS=$ac_save_LIBS
12804 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12805 do
12806   # Don't even attempt the hair of trying to link an X program!
12807   for ac_extension in a so sl dylib dll; do
12808     if test -r "$ac_dir/libXt.$ac_extension"; then
12809       ac_x_libraries=$ac_dir
12810       break 2
12811     fi
12812   done
12813 done
12814 fi
12815 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12816 fi # $ac_x_libraries = no
12817
12818 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12819   # Didn't find X anywhere.  Cache the known absence of X.
12820   ac_cv_have_x="have_x=no"
12821 else
12822   # Record where we found X for the cache.
12823   ac_cv_have_x="have_x=yes \
12824                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12825 fi
12826 fi
12827
12828   fi
12829   eval "$ac_cv_have_x"
12830 fi # $with_x != no
12831
12832 if test "$have_x" != yes; then
12833   echo "$as_me:12833: result: $have_x" >&5
12834 echo "${ECHO_T}$have_x" >&6
12835   no_x=yes
12836 else
12837   # If each of the values was on the command line, it overrides each guess.
12838   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12839   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12840   # Update the cache value to reflect the command line values.
12841   ac_cv_have_x="have_x=yes \
12842                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12843   echo "$as_me:12843: result: libraries $x_libraries, headers $x_includes" >&5
12844 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12845 fi
12846
12847 if test "$no_x" = yes; then
12848   # Not all programs may use this symbol, but it does not hurt to define it.
12849
12850 cat >>confdefs.h <<\EOF
12851 #define X_DISPLAY_MISSING 1
12852 EOF
12853
12854   X_CFLAGS=
12855   X_PRE_LIBS=
12856   X_LIBS=
12857   X_EXTRA_LIBS=
12858 else
12859   if test -n "$x_includes"; then
12860     X_CFLAGS="$X_CFLAGS -I$x_includes"
12861   fi
12862
12863   # It would also be nice to do this for all -L options, not just this one.
12864   if test -n "$x_libraries"; then
12865     X_LIBS="$X_LIBS -L$x_libraries"
12866     # For Solaris; some versions of Sun CC require a space after -R and
12867     # others require no space.  Words are not sufficient . . . .
12868     case `(uname -sr) 2>/dev/null` in
12869     "SunOS 5"*)
12870       echo "$as_me:12870: checking whether -R must be followed by a space" >&5
12871 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12872       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12873       cat >"conftest.$ac_ext" <<_ACEOF
12874 #line 12874 "configure"
12875 #include "confdefs.h"
12876
12877 int
12878 main (void)
12879 {
12880
12881   ;
12882   return 0;
12883 }
12884 _ACEOF
12885 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12886 if { (eval echo "$as_me:12886: \"$ac_link\"") >&5
12887   (eval $ac_link) 2>&5
12888   ac_status=$?
12889   echo "$as_me:12889: \$? = $ac_status" >&5
12890   (exit "$ac_status"); } &&
12891          { ac_try='test -s "conftest$ac_exeext"'
12892   { (eval echo "$as_me:12892: \"$ac_try\"") >&5
12893   (eval $ac_try) 2>&5
12894   ac_status=$?
12895   echo "$as_me:12895: \$? = $ac_status" >&5
12896   (exit "$ac_status"); }; }; then
12897   ac_R_nospace=yes
12898 else
12899   echo "$as_me: failed program was:" >&5
12900 cat "conftest.$ac_ext" >&5
12901 ac_R_nospace=no
12902 fi
12903 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12904       if test $ac_R_nospace = yes; then
12905         echo "$as_me:12905: result: no" >&5
12906 echo "${ECHO_T}no" >&6
12907         X_LIBS="$X_LIBS -R$x_libraries"
12908       else
12909         LIBS="$ac_xsave_LIBS -R $x_libraries"
12910         cat >"conftest.$ac_ext" <<_ACEOF
12911 #line 12911 "configure"
12912 #include "confdefs.h"
12913
12914 int
12915 main (void)
12916 {
12917
12918   ;
12919   return 0;
12920 }
12921 _ACEOF
12922 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12923 if { (eval echo "$as_me:12923: \"$ac_link\"") >&5
12924   (eval $ac_link) 2>&5
12925   ac_status=$?
12926   echo "$as_me:12926: \$? = $ac_status" >&5
12927   (exit "$ac_status"); } &&
12928          { ac_try='test -s "conftest$ac_exeext"'
12929   { (eval echo "$as_me:12929: \"$ac_try\"") >&5
12930   (eval $ac_try) 2>&5
12931   ac_status=$?
12932   echo "$as_me:12932: \$? = $ac_status" >&5
12933   (exit "$ac_status"); }; }; then
12934   ac_R_space=yes
12935 else
12936   echo "$as_me: failed program was:" >&5
12937 cat "conftest.$ac_ext" >&5
12938 ac_R_space=no
12939 fi
12940 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12941         if test $ac_R_space = yes; then
12942           echo "$as_me:12942: result: yes" >&5
12943 echo "${ECHO_T}yes" >&6
12944           X_LIBS="$X_LIBS -R $x_libraries"
12945         else
12946           echo "$as_me:12946: result: neither works" >&5
12947 echo "${ECHO_T}neither works" >&6
12948         fi
12949       fi
12950       LIBS=$ac_xsave_LIBS
12951     esac
12952   fi
12953
12954   # Check for system-dependent libraries X programs must link with.
12955   # Do this before checking for the system-independent R6 libraries
12956   # (-lICE), since we may need -lsocket or whatever for X linking.
12957
12958   if test "$ISC" = yes; then
12959     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12960   else
12961     # Martyn Johnson says this is needed for Ultrix, if the X
12962     # libraries were built with DECnet support.  And Karl Berry says
12963     # the Alpha needs dnet_stub (dnet does not exist).
12964     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12965     cat >"conftest.$ac_ext" <<_ACEOF
12966 #line 12966 "configure"
12967 #include "confdefs.h"
12968
12969 /* Override any gcc2 internal prototype to avoid an error.  */
12970 #ifdef __cplusplus
12971 extern "C"
12972 #endif
12973 /* We use char because int might match the return type of a gcc2
12974    builtin and then its argument prototype would still apply.  */
12975 char XOpenDisplay ();
12976 int
12977 main (void)
12978 {
12979 XOpenDisplay ();
12980   ;
12981   return 0;
12982 }
12983 _ACEOF
12984 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12985 if { (eval echo "$as_me:12985: \"$ac_link\"") >&5
12986   (eval $ac_link) 2>&5
12987   ac_status=$?
12988   echo "$as_me:12988: \$? = $ac_status" >&5
12989   (exit "$ac_status"); } &&
12990          { ac_try='test -s "conftest$ac_exeext"'
12991   { (eval echo "$as_me:12991: \"$ac_try\"") >&5
12992   (eval $ac_try) 2>&5
12993   ac_status=$?
12994   echo "$as_me:12994: \$? = $ac_status" >&5
12995   (exit "$ac_status"); }; }; then
12996   :
12997 else
12998   echo "$as_me: failed program was:" >&5
12999 cat "conftest.$ac_ext" >&5
13000 echo "$as_me:13000: checking for dnet_ntoa in -ldnet" >&5
13001 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
13002 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
13003   echo $ECHO_N "(cached) $ECHO_C" >&6
13004 else
13005   ac_check_lib_save_LIBS=$LIBS
13006 LIBS="-ldnet  $LIBS"
13007 cat >"conftest.$ac_ext" <<_ACEOF
13008 #line 13008 "configure"
13009 #include "confdefs.h"
13010
13011 /* Override any gcc2 internal prototype to avoid an error.  */
13012 #ifdef __cplusplus
13013 extern "C"
13014 #endif
13015 /* We use char because int might match the return type of a gcc2
13016    builtin and then its argument prototype would still apply.  */
13017 char dnet_ntoa ();
13018 int
13019 main (void)
13020 {
13021 dnet_ntoa ();
13022   ;
13023   return 0;
13024 }
13025 _ACEOF
13026 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13027 if { (eval echo "$as_me:13027: \"$ac_link\"") >&5
13028   (eval $ac_link) 2>&5
13029   ac_status=$?
13030   echo "$as_me:13030: \$? = $ac_status" >&5
13031   (exit "$ac_status"); } &&
13032          { ac_try='test -s "conftest$ac_exeext"'
13033   { (eval echo "$as_me:13033: \"$ac_try\"") >&5
13034   (eval $ac_try) 2>&5
13035   ac_status=$?
13036   echo "$as_me:13036: \$? = $ac_status" >&5
13037   (exit "$ac_status"); }; }; then
13038   ac_cv_lib_dnet_dnet_ntoa=yes
13039 else
13040   echo "$as_me: failed program was:" >&5
13041 cat "conftest.$ac_ext" >&5
13042 ac_cv_lib_dnet_dnet_ntoa=no
13043 fi
13044 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13045 LIBS=$ac_check_lib_save_LIBS
13046 fi
13047 echo "$as_me:13047: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
13048 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
13049 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
13050   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
13051 fi
13052
13053     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
13054       echo "$as_me:13054: checking for dnet_ntoa in -ldnet_stub" >&5
13055 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
13056 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
13057   echo $ECHO_N "(cached) $ECHO_C" >&6
13058 else
13059   ac_check_lib_save_LIBS=$LIBS
13060 LIBS="-ldnet_stub  $LIBS"
13061 cat >"conftest.$ac_ext" <<_ACEOF
13062 #line 13062 "configure"
13063 #include "confdefs.h"
13064
13065 /* Override any gcc2 internal prototype to avoid an error.  */
13066 #ifdef __cplusplus
13067 extern "C"
13068 #endif
13069 /* We use char because int might match the return type of a gcc2
13070    builtin and then its argument prototype would still apply.  */
13071 char dnet_ntoa ();
13072 int
13073 main (void)
13074 {
13075 dnet_ntoa ();
13076   ;
13077   return 0;
13078 }
13079 _ACEOF
13080 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13081 if { (eval echo "$as_me:13081: \"$ac_link\"") >&5
13082   (eval $ac_link) 2>&5
13083   ac_status=$?
13084   echo "$as_me:13084: \$? = $ac_status" >&5
13085   (exit "$ac_status"); } &&
13086          { ac_try='test -s "conftest$ac_exeext"'
13087   { (eval echo "$as_me:13087: \"$ac_try\"") >&5
13088   (eval $ac_try) 2>&5
13089   ac_status=$?
13090   echo "$as_me:13090: \$? = $ac_status" >&5
13091   (exit "$ac_status"); }; }; then
13092   ac_cv_lib_dnet_stub_dnet_ntoa=yes
13093 else
13094   echo "$as_me: failed program was:" >&5
13095 cat "conftest.$ac_ext" >&5
13096 ac_cv_lib_dnet_stub_dnet_ntoa=no
13097 fi
13098 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13099 LIBS=$ac_check_lib_save_LIBS
13100 fi
13101 echo "$as_me:13101: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
13102 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
13103 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
13104   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
13105 fi
13106
13107     fi
13108 fi
13109 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13110     LIBS="$ac_xsave_LIBS"
13111
13112     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
13113     # to get the SysV transport functions.
13114     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
13115     # needs -lnsl.
13116     # The nsl library prevents programs from opening the X display
13117     # on Irix 5.2, according to T.E. Dickey.
13118     # The functions gethostbyname, getservbyname, and inet_addr are
13119     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
13120     echo "$as_me:13120: checking for gethostbyname" >&5
13121 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
13122 if test "${ac_cv_func_gethostbyname+set}" = set; then
13123   echo $ECHO_N "(cached) $ECHO_C" >&6
13124 else
13125   cat >"conftest.$ac_ext" <<_ACEOF
13126 #line 13126 "configure"
13127 #include "confdefs.h"
13128 #define gethostbyname autoconf_temporary
13129 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13130 #undef gethostbyname
13131
13132 #ifdef __cplusplus
13133 extern "C"
13134 #endif
13135
13136 /* We use char because int might match the return type of a gcc2
13137    builtin and then its argument prototype would still apply.  */
13138 char gethostbyname (void);
13139
13140 int
13141 main (void)
13142 {
13143
13144 /* The GNU C library defines stubs for functions which it implements
13145     to always fail with ENOSYS.  Some functions are actually named
13146     something starting with __ and the normal name is an alias.  */
13147 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
13148 #error found stub for gethostbyname
13149 #endif
13150
13151         return gethostbyname ();
13152   ;
13153   return 0;
13154 }
13155 _ACEOF
13156 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13157 if { (eval echo "$as_me:13157: \"$ac_link\"") >&5
13158   (eval $ac_link) 2>&5
13159   ac_status=$?
13160   echo "$as_me:13160: \$? = $ac_status" >&5
13161   (exit "$ac_status"); } &&
13162          { ac_try='test -s "conftest$ac_exeext"'
13163   { (eval echo "$as_me:13163: \"$ac_try\"") >&5
13164   (eval $ac_try) 2>&5
13165   ac_status=$?
13166   echo "$as_me:13166: \$? = $ac_status" >&5
13167   (exit "$ac_status"); }; }; then
13168   ac_cv_func_gethostbyname=yes
13169 else
13170   echo "$as_me: failed program was:" >&5
13171 cat "conftest.$ac_ext" >&5
13172 ac_cv_func_gethostbyname=no
13173 fi
13174 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13175 fi
13176 echo "$as_me:13176: result: $ac_cv_func_gethostbyname" >&5
13177 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
13178
13179     if test $ac_cv_func_gethostbyname = no; then
13180       echo "$as_me:13180: checking for gethostbyname in -lnsl" >&5
13181 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
13182 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
13183   echo $ECHO_N "(cached) $ECHO_C" >&6
13184 else
13185   ac_check_lib_save_LIBS=$LIBS
13186 LIBS="-lnsl  $LIBS"
13187 cat >"conftest.$ac_ext" <<_ACEOF
13188 #line 13188 "configure"
13189 #include "confdefs.h"
13190
13191 /* Override any gcc2 internal prototype to avoid an error.  */
13192 #ifdef __cplusplus
13193 extern "C"
13194 #endif
13195 /* We use char because int might match the return type of a gcc2
13196    builtin and then its argument prototype would still apply.  */
13197 char gethostbyname ();
13198 int
13199 main (void)
13200 {
13201 gethostbyname ();
13202   ;
13203   return 0;
13204 }
13205 _ACEOF
13206 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13207 if { (eval echo "$as_me:13207: \"$ac_link\"") >&5
13208   (eval $ac_link) 2>&5
13209   ac_status=$?
13210   echo "$as_me:13210: \$? = $ac_status" >&5
13211   (exit "$ac_status"); } &&
13212          { ac_try='test -s "conftest$ac_exeext"'
13213   { (eval echo "$as_me:13213: \"$ac_try\"") >&5
13214   (eval $ac_try) 2>&5
13215   ac_status=$?
13216   echo "$as_me:13216: \$? = $ac_status" >&5
13217   (exit "$ac_status"); }; }; then
13218   ac_cv_lib_nsl_gethostbyname=yes
13219 else
13220   echo "$as_me: failed program was:" >&5
13221 cat "conftest.$ac_ext" >&5
13222 ac_cv_lib_nsl_gethostbyname=no
13223 fi
13224 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13225 LIBS=$ac_check_lib_save_LIBS
13226 fi
13227 echo "$as_me:13227: result: $ac_cv_lib_nsl_gethostbyname" >&5
13228 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
13229 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
13230   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
13231 fi
13232
13233       if test $ac_cv_lib_nsl_gethostbyname = no; then
13234         echo "$as_me:13234: checking for gethostbyname in -lbsd" >&5
13235 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
13236 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
13237   echo $ECHO_N "(cached) $ECHO_C" >&6
13238 else
13239   ac_check_lib_save_LIBS=$LIBS
13240 LIBS="-lbsd  $LIBS"
13241 cat >"conftest.$ac_ext" <<_ACEOF
13242 #line 13242 "configure"
13243 #include "confdefs.h"
13244
13245 /* Override any gcc2 internal prototype to avoid an error.  */
13246 #ifdef __cplusplus
13247 extern "C"
13248 #endif
13249 /* We use char because int might match the return type of a gcc2
13250    builtin and then its argument prototype would still apply.  */
13251 char gethostbyname ();
13252 int
13253 main (void)
13254 {
13255 gethostbyname ();
13256   ;
13257   return 0;
13258 }
13259 _ACEOF
13260 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13261 if { (eval echo "$as_me:13261: \"$ac_link\"") >&5
13262   (eval $ac_link) 2>&5
13263   ac_status=$?
13264   echo "$as_me:13264: \$? = $ac_status" >&5
13265   (exit "$ac_status"); } &&
13266          { ac_try='test -s "conftest$ac_exeext"'
13267   { (eval echo "$as_me:13267: \"$ac_try\"") >&5
13268   (eval $ac_try) 2>&5
13269   ac_status=$?
13270   echo "$as_me:13270: \$? = $ac_status" >&5
13271   (exit "$ac_status"); }; }; then
13272   ac_cv_lib_bsd_gethostbyname=yes
13273 else
13274   echo "$as_me: failed program was:" >&5
13275 cat "conftest.$ac_ext" >&5
13276 ac_cv_lib_bsd_gethostbyname=no
13277 fi
13278 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13279 LIBS=$ac_check_lib_save_LIBS
13280 fi
13281 echo "$as_me:13281: result: $ac_cv_lib_bsd_gethostbyname" >&5
13282 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
13283 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
13284   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
13285 fi
13286
13287       fi
13288     fi
13289
13290     # lieder@skyler.mavd.honeywell.com says without -lsocket,
13291     # socket/setsockopt and other routines are undefined under SCO ODT
13292     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
13293     # on later versions), says Simon Leinen: it contains gethostby*
13294     # variants that don't use the nameserver (or something).  -lsocket
13295     # must be given before -lnsl if both are needed.  We assume that
13296     # if connect needs -lnsl, so does gethostbyname.
13297     echo "$as_me:13297: checking for connect" >&5
13298 echo $ECHO_N "checking for connect... $ECHO_C" >&6
13299 if test "${ac_cv_func_connect+set}" = set; then
13300   echo $ECHO_N "(cached) $ECHO_C" >&6
13301 else
13302   cat >"conftest.$ac_ext" <<_ACEOF
13303 #line 13303 "configure"
13304 #include "confdefs.h"
13305 #define connect autoconf_temporary
13306 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13307 #undef connect
13308
13309 #ifdef __cplusplus
13310 extern "C"
13311 #endif
13312
13313 /* We use char because int might match the return type of a gcc2
13314    builtin and then its argument prototype would still apply.  */
13315 char connect (void);
13316
13317 int
13318 main (void)
13319 {
13320
13321 /* The GNU C library defines stubs for functions which it implements
13322     to always fail with ENOSYS.  Some functions are actually named
13323     something starting with __ and the normal name is an alias.  */
13324 #if defined (__stub_connect) || defined (__stub___connect)
13325 #error found stub for connect
13326 #endif
13327
13328         return connect ();
13329   ;
13330   return 0;
13331 }
13332 _ACEOF
13333 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13334 if { (eval echo "$as_me:13334: \"$ac_link\"") >&5
13335   (eval $ac_link) 2>&5
13336   ac_status=$?
13337   echo "$as_me:13337: \$? = $ac_status" >&5
13338   (exit "$ac_status"); } &&
13339          { ac_try='test -s "conftest$ac_exeext"'
13340   { (eval echo "$as_me:13340: \"$ac_try\"") >&5
13341   (eval $ac_try) 2>&5
13342   ac_status=$?
13343   echo "$as_me:13343: \$? = $ac_status" >&5
13344   (exit "$ac_status"); }; }; then
13345   ac_cv_func_connect=yes
13346 else
13347   echo "$as_me: failed program was:" >&5
13348 cat "conftest.$ac_ext" >&5
13349 ac_cv_func_connect=no
13350 fi
13351 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13352 fi
13353 echo "$as_me:13353: result: $ac_cv_func_connect" >&5
13354 echo "${ECHO_T}$ac_cv_func_connect" >&6
13355
13356     if test $ac_cv_func_connect = no; then
13357       echo "$as_me:13357: checking for connect in -lsocket" >&5
13358 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
13359 if test "${ac_cv_lib_socket_connect+set}" = set; then
13360   echo $ECHO_N "(cached) $ECHO_C" >&6
13361 else
13362   ac_check_lib_save_LIBS=$LIBS
13363 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
13364 cat >"conftest.$ac_ext" <<_ACEOF
13365 #line 13365 "configure"
13366 #include "confdefs.h"
13367
13368 /* Override any gcc2 internal prototype to avoid an error.  */
13369 #ifdef __cplusplus
13370 extern "C"
13371 #endif
13372 /* We use char because int might match the return type of a gcc2
13373    builtin and then its argument prototype would still apply.  */
13374 char connect ();
13375 int
13376 main (void)
13377 {
13378 connect ();
13379   ;
13380   return 0;
13381 }
13382 _ACEOF
13383 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13384 if { (eval echo "$as_me:13384: \"$ac_link\"") >&5
13385   (eval $ac_link) 2>&5
13386   ac_status=$?
13387   echo "$as_me:13387: \$? = $ac_status" >&5
13388   (exit "$ac_status"); } &&
13389          { ac_try='test -s "conftest$ac_exeext"'
13390   { (eval echo "$as_me:13390: \"$ac_try\"") >&5
13391   (eval $ac_try) 2>&5
13392   ac_status=$?
13393   echo "$as_me:13393: \$? = $ac_status" >&5
13394   (exit "$ac_status"); }; }; then
13395   ac_cv_lib_socket_connect=yes
13396 else
13397   echo "$as_me: failed program was:" >&5
13398 cat "conftest.$ac_ext" >&5
13399 ac_cv_lib_socket_connect=no
13400 fi
13401 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13402 LIBS=$ac_check_lib_save_LIBS
13403 fi
13404 echo "$as_me:13404: result: $ac_cv_lib_socket_connect" >&5
13405 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
13406 if test "$ac_cv_lib_socket_connect" = yes; then
13407   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
13408 fi
13409
13410     fi
13411
13412     # Guillermo Gomez says -lposix is necessary on A/UX.
13413     echo "$as_me:13413: checking for remove" >&5
13414 echo $ECHO_N "checking for remove... $ECHO_C" >&6
13415 if test "${ac_cv_func_remove+set}" = set; then
13416   echo $ECHO_N "(cached) $ECHO_C" >&6
13417 else
13418   cat >"conftest.$ac_ext" <<_ACEOF
13419 #line 13419 "configure"
13420 #include "confdefs.h"
13421 #define remove autoconf_temporary
13422 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13423 #undef remove
13424
13425 #ifdef __cplusplus
13426 extern "C"
13427 #endif
13428
13429 /* We use char because int might match the return type of a gcc2
13430    builtin and then its argument prototype would still apply.  */
13431 char remove (void);
13432
13433 int
13434 main (void)
13435 {
13436
13437 /* The GNU C library defines stubs for functions which it implements
13438     to always fail with ENOSYS.  Some functions are actually named
13439     something starting with __ and the normal name is an alias.  */
13440 #if defined (__stub_remove) || defined (__stub___remove)
13441 #error found stub for remove
13442 #endif
13443
13444         return remove ();
13445   ;
13446   return 0;
13447 }
13448 _ACEOF
13449 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13450 if { (eval echo "$as_me:13450: \"$ac_link\"") >&5
13451   (eval $ac_link) 2>&5
13452   ac_status=$?
13453   echo "$as_me:13453: \$? = $ac_status" >&5
13454   (exit "$ac_status"); } &&
13455          { ac_try='test -s "conftest$ac_exeext"'
13456   { (eval echo "$as_me:13456: \"$ac_try\"") >&5
13457   (eval $ac_try) 2>&5
13458   ac_status=$?
13459   echo "$as_me:13459: \$? = $ac_status" >&5
13460   (exit "$ac_status"); }; }; then
13461   ac_cv_func_remove=yes
13462 else
13463   echo "$as_me: failed program was:" >&5
13464 cat "conftest.$ac_ext" >&5
13465 ac_cv_func_remove=no
13466 fi
13467 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13468 fi
13469 echo "$as_me:13469: result: $ac_cv_func_remove" >&5
13470 echo "${ECHO_T}$ac_cv_func_remove" >&6
13471
13472     if test $ac_cv_func_remove = no; then
13473       echo "$as_me:13473: checking for remove in -lposix" >&5
13474 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
13475 if test "${ac_cv_lib_posix_remove+set}" = set; then
13476   echo $ECHO_N "(cached) $ECHO_C" >&6
13477 else
13478   ac_check_lib_save_LIBS=$LIBS
13479 LIBS="-lposix  $LIBS"
13480 cat >"conftest.$ac_ext" <<_ACEOF
13481 #line 13481 "configure"
13482 #include "confdefs.h"
13483
13484 /* Override any gcc2 internal prototype to avoid an error.  */
13485 #ifdef __cplusplus
13486 extern "C"
13487 #endif
13488 /* We use char because int might match the return type of a gcc2
13489    builtin and then its argument prototype would still apply.  */
13490 char remove ();
13491 int
13492 main (void)
13493 {
13494 remove ();
13495   ;
13496   return 0;
13497 }
13498 _ACEOF
13499 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13500 if { (eval echo "$as_me:13500: \"$ac_link\"") >&5
13501   (eval $ac_link) 2>&5
13502   ac_status=$?
13503   echo "$as_me:13503: \$? = $ac_status" >&5
13504   (exit "$ac_status"); } &&
13505          { ac_try='test -s "conftest$ac_exeext"'
13506   { (eval echo "$as_me:13506: \"$ac_try\"") >&5
13507   (eval $ac_try) 2>&5
13508   ac_status=$?
13509   echo "$as_me:13509: \$? = $ac_status" >&5
13510   (exit "$ac_status"); }; }; then
13511   ac_cv_lib_posix_remove=yes
13512 else
13513   echo "$as_me: failed program was:" >&5
13514 cat "conftest.$ac_ext" >&5
13515 ac_cv_lib_posix_remove=no
13516 fi
13517 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13518 LIBS=$ac_check_lib_save_LIBS
13519 fi
13520 echo "$as_me:13520: result: $ac_cv_lib_posix_remove" >&5
13521 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
13522 if test "$ac_cv_lib_posix_remove" = yes; then
13523   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
13524 fi
13525
13526     fi
13527
13528     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
13529     echo "$as_me:13529: checking for shmat" >&5
13530 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
13531 if test "${ac_cv_func_shmat+set}" = set; then
13532   echo $ECHO_N "(cached) $ECHO_C" >&6
13533 else
13534   cat >"conftest.$ac_ext" <<_ACEOF
13535 #line 13535 "configure"
13536 #include "confdefs.h"
13537 #define shmat autoconf_temporary
13538 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13539 #undef shmat
13540
13541 #ifdef __cplusplus
13542 extern "C"
13543 #endif
13544
13545 /* We use char because int might match the return type of a gcc2
13546    builtin and then its argument prototype would still apply.  */
13547 char shmat (void);
13548
13549 int
13550 main (void)
13551 {
13552
13553 /* The GNU C library defines stubs for functions which it implements
13554     to always fail with ENOSYS.  Some functions are actually named
13555     something starting with __ and the normal name is an alias.  */
13556 #if defined (__stub_shmat) || defined (__stub___shmat)
13557 #error found stub for shmat
13558 #endif
13559
13560         return shmat ();
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_func_shmat=yes
13578 else
13579   echo "$as_me: failed program was:" >&5
13580 cat "conftest.$ac_ext" >&5
13581 ac_cv_func_shmat=no
13582 fi
13583 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13584 fi
13585 echo "$as_me:13585: result: $ac_cv_func_shmat" >&5
13586 echo "${ECHO_T}$ac_cv_func_shmat" >&6
13587
13588     if test $ac_cv_func_shmat = no; then
13589       echo "$as_me:13589: checking for shmat in -lipc" >&5
13590 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13591 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13592   echo $ECHO_N "(cached) $ECHO_C" >&6
13593 else
13594   ac_check_lib_save_LIBS=$LIBS
13595 LIBS="-lipc  $LIBS"
13596 cat >"conftest.$ac_ext" <<_ACEOF
13597 #line 13597 "configure"
13598 #include "confdefs.h"
13599
13600 /* Override any gcc2 internal prototype to avoid an error.  */
13601 #ifdef __cplusplus
13602 extern "C"
13603 #endif
13604 /* We use char because int might match the return type of a gcc2
13605    builtin and then its argument prototype would still apply.  */
13606 char shmat ();
13607 int
13608 main (void)
13609 {
13610 shmat ();
13611   ;
13612   return 0;
13613 }
13614 _ACEOF
13615 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13616 if { (eval echo "$as_me:13616: \"$ac_link\"") >&5
13617   (eval $ac_link) 2>&5
13618   ac_status=$?
13619   echo "$as_me:13619: \$? = $ac_status" >&5
13620   (exit "$ac_status"); } &&
13621          { ac_try='test -s "conftest$ac_exeext"'
13622   { (eval echo "$as_me:13622: \"$ac_try\"") >&5
13623   (eval $ac_try) 2>&5
13624   ac_status=$?
13625   echo "$as_me:13625: \$? = $ac_status" >&5
13626   (exit "$ac_status"); }; }; then
13627   ac_cv_lib_ipc_shmat=yes
13628 else
13629   echo "$as_me: failed program was:" >&5
13630 cat "conftest.$ac_ext" >&5
13631 ac_cv_lib_ipc_shmat=no
13632 fi
13633 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13634 LIBS=$ac_check_lib_save_LIBS
13635 fi
13636 echo "$as_me:13636: result: $ac_cv_lib_ipc_shmat" >&5
13637 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
13638 if test "$ac_cv_lib_ipc_shmat" = yes; then
13639   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13640 fi
13641
13642     fi
13643   fi
13644
13645   # Check for libraries that X11R6 Xt/Xaw programs need.
13646   ac_save_LDFLAGS=$LDFLAGS
13647   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13648   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13649   # check for ICE first), but we must link in the order -lSM -lICE or
13650   # we get undefined symbols.  So assume we have SM if we have ICE.
13651   # These have to be linked with before -lX11, unlike the other
13652   # libraries we check for below, so use a different variable.
13653   # John Interrante, Karl Berry
13654   echo "$as_me:13654: checking for IceConnectionNumber in -lICE" >&5
13655 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13656 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13657   echo $ECHO_N "(cached) $ECHO_C" >&6
13658 else
13659   ac_check_lib_save_LIBS=$LIBS
13660 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13661 cat >"conftest.$ac_ext" <<_ACEOF
13662 #line 13662 "configure"
13663 #include "confdefs.h"
13664
13665 /* Override any gcc2 internal prototype to avoid an error.  */
13666 #ifdef __cplusplus
13667 extern "C"
13668 #endif
13669 /* We use char because int might match the return type of a gcc2
13670    builtin and then its argument prototype would still apply.  */
13671 char IceConnectionNumber ();
13672 int
13673 main (void)
13674 {
13675 IceConnectionNumber ();
13676   ;
13677   return 0;
13678 }
13679 _ACEOF
13680 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13681 if { (eval echo "$as_me:13681: \"$ac_link\"") >&5
13682   (eval $ac_link) 2>&5
13683   ac_status=$?
13684   echo "$as_me:13684: \$? = $ac_status" >&5
13685   (exit "$ac_status"); } &&
13686          { ac_try='test -s "conftest$ac_exeext"'
13687   { (eval echo "$as_me:13687: \"$ac_try\"") >&5
13688   (eval $ac_try) 2>&5
13689   ac_status=$?
13690   echo "$as_me:13690: \$? = $ac_status" >&5
13691   (exit "$ac_status"); }; }; then
13692   ac_cv_lib_ICE_IceConnectionNumber=yes
13693 else
13694   echo "$as_me: failed program was:" >&5
13695 cat "conftest.$ac_ext" >&5
13696 ac_cv_lib_ICE_IceConnectionNumber=no
13697 fi
13698 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13699 LIBS=$ac_check_lib_save_LIBS
13700 fi
13701 echo "$as_me:13701: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13702 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13703 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13704   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13705 fi
13706
13707   LDFLAGS=$ac_save_LDFLAGS
13708
13709 fi
13710
13711 cf_x_athena=${cf_x_athena:-Xaw}
13712
13713 echo "$as_me:13713: checking if you want to link with Xaw 3d library" >&5
13714 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13715 withval=
13716
13717 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13718 if test "${with_Xaw3d+set}" = set; then
13719   withval="$with_Xaw3d"
13720
13721 fi;
13722 if test "$withval" = yes ; then
13723         cf_x_athena=Xaw3d
13724         echo "$as_me:13724: result: yes" >&5
13725 echo "${ECHO_T}yes" >&6
13726 else
13727         echo "$as_me:13727: result: no" >&5
13728 echo "${ECHO_T}no" >&6
13729 fi
13730
13731 echo "$as_me:13731: checking if you want to link with Xaw 3d xft library" >&5
13732 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13733 withval=
13734
13735 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13736 if test "${with_Xaw3dxft+set}" = set; then
13737   withval="$with_Xaw3dxft"
13738
13739 fi;
13740 if test "$withval" = yes ; then
13741         cf_x_athena=Xaw3dxft
13742         echo "$as_me:13742: result: yes" >&5
13743 echo "${ECHO_T}yes" >&6
13744 else
13745         echo "$as_me:13745: result: no" >&5
13746 echo "${ECHO_T}no" >&6
13747 fi
13748
13749 echo "$as_me:13749: checking if you want to link with neXT Athena library" >&5
13750 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13751 withval=
13752
13753 # Check whether --with-neXtaw or --without-neXtaw was given.
13754 if test "${with_neXtaw+set}" = set; then
13755   withval="$with_neXtaw"
13756
13757 fi;
13758 if test "$withval" = yes ; then
13759         cf_x_athena=neXtaw
13760         echo "$as_me:13760: result: yes" >&5
13761 echo "${ECHO_T}yes" >&6
13762 else
13763         echo "$as_me:13763: result: no" >&5
13764 echo "${ECHO_T}no" >&6
13765 fi
13766
13767 echo "$as_me:13767: checking if you want to link with Athena-Plus library" >&5
13768 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13769 withval=
13770
13771 # Check whether --with-XawPlus or --without-XawPlus was given.
13772 if test "${with_XawPlus+set}" = set; then
13773   withval="$with_XawPlus"
13774
13775 fi;
13776 if test "$withval" = yes ; then
13777         cf_x_athena=XawPlus
13778         echo "$as_me:13778: result: yes" >&5
13779 echo "${ECHO_T}yes" >&6
13780 else
13781         echo "$as_me:13781: result: no" >&5
13782 echo "${ECHO_T}no" >&6
13783 fi
13784
13785 cf_x_athena_lib=""
13786
13787 if test "$PKG_CONFIG" != none ; then
13788         cf_athena_list=
13789         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13790         for cf_athena_pkg in \
13791                 $cf_athena_list \
13792                 ${cf_x_athena} \
13793                 ${cf_x_athena}-devel \
13794                 lib${cf_x_athena} \
13795                 lib${cf_x_athena}-devel
13796         do
13797
13798 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13799         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13800
13801 echo "${as_me:-configure}:13801: testing found package $cf_athena_pkg ..." 1>&5
13802
13803         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13804         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13805         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13806
13807 echo "${as_me:-configure}:13807: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13808
13809         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13810
13811 echo "${as_me:-configure}:13811: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13812
13813 cf_fix_cppflags=no
13814 cf_new_cflags=
13815 cf_new_cppflags=
13816 cf_new_extra_cppflags=
13817
13818 for cf_add_cflags in $cf_pkgconfig_incs
13819 do
13820 case "$cf_fix_cppflags" in
13821 (no)
13822         case "$cf_add_cflags" in
13823         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13824                 case "$cf_add_cflags" in
13825                 (-D*)
13826                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13827
13828                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13829                                 && test -z "${cf_tst_cflags}" \
13830                                 && cf_fix_cppflags=yes
13831
13832                         if test "$cf_fix_cppflags" = yes ; then
13833
13834         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13835         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13836
13837                                 continue
13838                         elif test "${cf_tst_cflags}" = "\"'" ; then
13839
13840         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13841         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13842
13843                                 continue
13844                         fi
13845                         ;;
13846                 esac
13847                 case "$CPPFLAGS" in
13848                 (*$cf_add_cflags)
13849                         ;;
13850                 (*)
13851                         case "$cf_add_cflags" in
13852                         (-D*)
13853                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13854
13855 CPPFLAGS=`echo "$CPPFLAGS" | \
13856         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13857                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13858
13859                                 ;;
13860                         esac
13861
13862         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13863         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13864
13865                         ;;
13866                 esac
13867                 ;;
13868         (*)
13869
13870         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13871         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13872
13873                 ;;
13874         esac
13875         ;;
13876 (yes)
13877
13878         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13879         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13880
13881         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13882
13883         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13884                 && test -z "${cf_tst_cflags}" \
13885                 && cf_fix_cppflags=no
13886         ;;
13887 esac
13888 done
13889
13890 if test -n "$cf_new_cflags" ; then
13891
13892         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13893         CFLAGS="${CFLAGS}$cf_new_cflags"
13894
13895 fi
13896
13897 if test -n "$cf_new_cppflags" ; then
13898
13899         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13900         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13901
13902 fi
13903
13904 if test -n "$cf_new_extra_cppflags" ; then
13905
13906         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13907         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13908
13909 fi
13910
13911 cf_add_libs="$LIBS"
13912 # reverse order
13913 cf_add_0lib=
13914 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13915 # filter duplicates
13916 for cf_add_1lib in $cf_add_0lib; do
13917         for cf_add_2lib in $cf_add_libs; do
13918                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13919                         cf_add_1lib=
13920                         break
13921                 fi
13922         done
13923         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13924 done
13925 LIBS="$cf_add_libs"
13926
13927                         cf_x_athena_lib="$cf_pkgconfig_libs"
13928
13929 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13930
13931                         cat >>confdefs.h <<EOF
13932 #define $cf_x_athena_LIBS 1
13933 EOF
13934
13935         for cf_trim_lib in Xmu Xt X11
13936         do
13937                 case "$LIBS" in
13938                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13939                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13940                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13941
13942 echo "${as_me:-configure}:13942: testing ..trimmed $LIBS ..." 1>&5
13943
13944                         ;;
13945                 esac
13946         done
13947
13948 echo "$as_me:13948: checking for usable $cf_x_athena/Xmu package" >&5
13949 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13950 if test "${cf_cv_xaw_compat+set}" = set; then
13951   echo $ECHO_N "(cached) $ECHO_C" >&6
13952 else
13953
13954 cat >"conftest.$ac_ext" <<_ACEOF
13955 #line 13955 "configure"
13956 #include "confdefs.h"
13957
13958 $ac_includes_default
13959 #include <X11/Xmu/CharSet.h>
13960
13961 int
13962 main (void)
13963 {
13964
13965 int check = XmuCompareISOLatin1("big", "small");
13966 (void)check;
13967
13968   ;
13969   return 0;
13970 }
13971 _ACEOF
13972 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13973 if { (eval echo "$as_me:13973: \"$ac_link\"") >&5
13974   (eval $ac_link) 2>&5
13975   ac_status=$?
13976   echo "$as_me:13976: \$? = $ac_status" >&5
13977   (exit "$ac_status"); } &&
13978          { ac_try='test -s "conftest$ac_exeext"'
13979   { (eval echo "$as_me:13979: \"$ac_try\"") >&5
13980   (eval $ac_try) 2>&5
13981   ac_status=$?
13982   echo "$as_me:13982: \$? = $ac_status" >&5
13983   (exit "$ac_status"); }; }; then
13984   cf_cv_xaw_compat=yes
13985 else
13986   echo "$as_me: failed program was:" >&5
13987 cat "conftest.$ac_ext" >&5
13988 cf_cv_xaw_compat=no
13989 fi
13990 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13991 fi
13992 echo "$as_me:13992: result: $cf_cv_xaw_compat" >&5
13993 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13994
13995                         if test "$cf_cv_xaw_compat" = no
13996                         then
13997                                 # workaround for broken ".pc" files...
13998                                 case "$cf_x_athena_lib" in
13999                                 (*-lXmu*)
14000                                         ;;
14001                                 (*)
14002                                         test -n "$verbose" && echo "    work around broken package" 1>&6
14003
14004 echo "${as_me:-configure}:14004: testing work around broken package ..." 1>&5
14005
14006                                         cf_save_xmu="$LIBS"
14007                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
14008
14009 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
14010         test -n "$verbose" && echo "    found package xmu" 1>&6
14011
14012 echo "${as_me:-configure}:14012: testing found package xmu ..." 1>&5
14013
14014         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
14015         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
14016         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
14017
14018 echo "${as_me:-configure}:14018: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14019
14020         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
14021
14022 echo "${as_me:-configure}:14022: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
14023
14024 cf_fix_cppflags=no
14025 cf_new_cflags=
14026 cf_new_cppflags=
14027 cf_new_extra_cppflags=
14028
14029 for cf_add_cflags in $cf_pkgconfig_incs
14030 do
14031 case "$cf_fix_cppflags" in
14032 (no)
14033         case "$cf_add_cflags" in
14034         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14035                 case "$cf_add_cflags" in
14036                 (-D*)
14037                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14038
14039                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14040                                 && test -z "${cf_tst_cflags}" \
14041                                 && cf_fix_cppflags=yes
14042
14043                         if test "$cf_fix_cppflags" = yes ; then
14044
14045         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14046         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14047
14048                                 continue
14049                         elif test "${cf_tst_cflags}" = "\"'" ; then
14050
14051         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14052         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14053
14054                                 continue
14055                         fi
14056                         ;;
14057                 esac
14058                 case "$CPPFLAGS" in
14059                 (*$cf_add_cflags)
14060                         ;;
14061                 (*)
14062                         case "$cf_add_cflags" in
14063                         (-D*)
14064                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14065
14066 CPPFLAGS=`echo "$CPPFLAGS" | \
14067         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14068                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14069
14070                                 ;;
14071                         esac
14072
14073         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14074         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14075
14076                         ;;
14077                 esac
14078                 ;;
14079         (*)
14080
14081         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14082         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14083
14084                 ;;
14085         esac
14086         ;;
14087 (yes)
14088
14089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14091
14092         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14093
14094         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14095                 && test -z "${cf_tst_cflags}" \
14096                 && cf_fix_cppflags=no
14097         ;;
14098 esac
14099 done
14100
14101 if test -n "$cf_new_cflags" ; then
14102
14103         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14104         CFLAGS="${CFLAGS}$cf_new_cflags"
14105
14106 fi
14107
14108 if test -n "$cf_new_cppflags" ; then
14109
14110         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14111         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14112
14113 fi
14114
14115 if test -n "$cf_new_extra_cppflags" ; then
14116
14117         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14118         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14119
14120 fi
14121
14122 cf_add_libs="$LIBS"
14123 # reverse order
14124 cf_add_0lib=
14125 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14126 # filter duplicates
14127 for cf_add_1lib in $cf_add_0lib; do
14128         for cf_add_2lib in $cf_add_libs; do
14129                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14130                         cf_add_1lib=
14131                         break
14132                 fi
14133         done
14134         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14135 done
14136 LIBS="$cf_add_libs"
14137
14138                                                         LIBS="$cf_save_xmu"
14139
14140 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14141
14142 echo "${as_me:-configure}:14142: testing ...before $LIBS ..." 1>&5
14143
14144 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
14145 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14146
14147 echo "${as_me:-configure}:14147: testing ...after  $LIBS ..." 1>&5
14148
14149 else
14150         cf_pkgconfig_incs=
14151         cf_pkgconfig_libs=
14152
14153 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14154
14155 echo "${as_me:-configure}:14155: testing ...before $LIBS ..." 1>&5
14156
14157 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
14158 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14159
14160 echo "${as_me:-configure}:14160: testing ...after  $LIBS ..." 1>&5
14161
14162 fi
14163
14164         for cf_trim_lib in Xmu Xt X11
14165         do
14166                 case "$LIBS" in
14167                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
14168                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
14169                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
14170
14171 echo "${as_me:-configure}:14171: testing ..trimmed $LIBS ..." 1>&5
14172
14173                         ;;
14174                 esac
14175         done
14176
14177                                         ;;
14178                                 esac
14179                         fi
14180
14181                         break
14182 else
14183         cf_pkgconfig_incs=
14184         cf_pkgconfig_libs=
14185         :
14186 fi
14187
14188         done
14189 fi
14190
14191 if test -z "$cf_x_athena_lib" ; then
14192
14193 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
14194         test -n "$verbose" && echo "    found package Xext" 1>&6
14195
14196 echo "${as_me:-configure}:14196: testing found package Xext ..." 1>&5
14197
14198         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
14199         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
14200         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
14201
14202 echo "${as_me:-configure}:14202: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14203
14204         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
14205
14206 echo "${as_me:-configure}:14206: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
14207
14208 cf_fix_cppflags=no
14209 cf_new_cflags=
14210 cf_new_cppflags=
14211 cf_new_extra_cppflags=
14212
14213 for cf_add_cflags in $cf_pkgconfig_incs
14214 do
14215 case "$cf_fix_cppflags" in
14216 (no)
14217         case "$cf_add_cflags" in
14218         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14219                 case "$cf_add_cflags" in
14220                 (-D*)
14221                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14222
14223                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14224                                 && test -z "${cf_tst_cflags}" \
14225                                 && cf_fix_cppflags=yes
14226
14227                         if test "$cf_fix_cppflags" = yes ; then
14228
14229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14231
14232                                 continue
14233                         elif test "${cf_tst_cflags}" = "\"'" ; then
14234
14235         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14236         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14237
14238                                 continue
14239                         fi
14240                         ;;
14241                 esac
14242                 case "$CPPFLAGS" in
14243                 (*$cf_add_cflags)
14244                         ;;
14245                 (*)
14246                         case "$cf_add_cflags" in
14247                         (-D*)
14248                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14249
14250 CPPFLAGS=`echo "$CPPFLAGS" | \
14251         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14252                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14253
14254                                 ;;
14255                         esac
14256
14257         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14258         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14259
14260                         ;;
14261                 esac
14262                 ;;
14263         (*)
14264
14265         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14266         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14267
14268                 ;;
14269         esac
14270         ;;
14271 (yes)
14272
14273         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14274         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14275
14276         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14277
14278         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14279                 && test -z "${cf_tst_cflags}" \
14280                 && cf_fix_cppflags=no
14281         ;;
14282 esac
14283 done
14284
14285 if test -n "$cf_new_cflags" ; then
14286
14287         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14288         CFLAGS="${CFLAGS}$cf_new_cflags"
14289
14290 fi
14291
14292 if test -n "$cf_new_cppflags" ; then
14293
14294         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14295         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14296
14297 fi
14298
14299 if test -n "$cf_new_extra_cppflags" ; then
14300
14301         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14302         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14303
14304 fi
14305
14306 cf_add_libs="$LIBS"
14307 # reverse order
14308 cf_add_0lib=
14309 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14310 # filter duplicates
14311 for cf_add_1lib in $cf_add_0lib; do
14312         for cf_add_2lib in $cf_add_libs; do
14313                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14314                         cf_add_1lib=
14315                         break
14316                 fi
14317         done
14318         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14319 done
14320 LIBS="$cf_add_libs"
14321
14322         :
14323 else
14324         cf_pkgconfig_incs=
14325         cf_pkgconfig_libs=
14326
14327         echo "$as_me:14327: checking for XextCreateExtension in -lXext" >&5
14328 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
14329 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
14330   echo $ECHO_N "(cached) $ECHO_C" >&6
14331 else
14332   ac_check_lib_save_LIBS=$LIBS
14333 LIBS="-lXext  $LIBS"
14334 cat >"conftest.$ac_ext" <<_ACEOF
14335 #line 14335 "configure"
14336 #include "confdefs.h"
14337
14338 /* Override any gcc2 internal prototype to avoid an error.  */
14339 #ifdef __cplusplus
14340 extern "C"
14341 #endif
14342 /* We use char because int might match the return type of a gcc2
14343    builtin and then its argument prototype would still apply.  */
14344 char XextCreateExtension ();
14345 int
14346 main (void)
14347 {
14348 XextCreateExtension ();
14349   ;
14350   return 0;
14351 }
14352 _ACEOF
14353 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14354 if { (eval echo "$as_me:14354: \"$ac_link\"") >&5
14355   (eval $ac_link) 2>&5
14356   ac_status=$?
14357   echo "$as_me:14357: \$? = $ac_status" >&5
14358   (exit "$ac_status"); } &&
14359          { ac_try='test -s "conftest$ac_exeext"'
14360   { (eval echo "$as_me:14360: \"$ac_try\"") >&5
14361   (eval $ac_try) 2>&5
14362   ac_status=$?
14363   echo "$as_me:14363: \$? = $ac_status" >&5
14364   (exit "$ac_status"); }; }; then
14365   ac_cv_lib_Xext_XextCreateExtension=yes
14366 else
14367   echo "$as_me: failed program was:" >&5
14368 cat "conftest.$ac_ext" >&5
14369 ac_cv_lib_Xext_XextCreateExtension=no
14370 fi
14371 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14372 LIBS=$ac_check_lib_save_LIBS
14373 fi
14374 echo "$as_me:14374: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
14375 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
14376 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
14377
14378 cf_add_libs="$LIBS"
14379 # reverse order
14380 cf_add_0lib=
14381 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14382 # filter duplicates
14383 for cf_add_1lib in $cf_add_0lib; do
14384         for cf_add_2lib in $cf_add_libs; do
14385                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14386                         cf_add_1lib=
14387                         break
14388                 fi
14389         done
14390         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14391 done
14392 LIBS="$cf_add_libs"
14393
14394 fi
14395
14396 fi
14397
14398 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
14399 # in some cases has installed dummy files in the former, other cases replaced
14400 # it with a link to the new location).  This complicates the configure script.
14401 # Check for that pitfall, and recover using pkg-config
14402 #
14403 # If none of these are set, the configuration is almost certainly broken.
14404 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
14405 then
14406
14407 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14408         test -n "$verbose" && echo "    found package x11" 1>&6
14409
14410 echo "${as_me:-configure}:14410: testing found package x11 ..." 1>&5
14411
14412         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14413         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14414         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14415
14416 echo "${as_me:-configure}:14416: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14417
14418         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14419
14420 echo "${as_me:-configure}:14420: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14421
14422 cf_fix_cppflags=no
14423 cf_new_cflags=
14424 cf_new_cppflags=
14425 cf_new_extra_cppflags=
14426
14427 for cf_add_cflags in $cf_pkgconfig_incs
14428 do
14429 case "$cf_fix_cppflags" in
14430 (no)
14431         case "$cf_add_cflags" in
14432         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14433                 case "$cf_add_cflags" in
14434                 (-D*)
14435                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14436
14437                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14438                                 && test -z "${cf_tst_cflags}" \
14439                                 && cf_fix_cppflags=yes
14440
14441                         if test "$cf_fix_cppflags" = yes ; then
14442
14443         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14444         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14445
14446                                 continue
14447                         elif test "${cf_tst_cflags}" = "\"'" ; then
14448
14449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14451
14452                                 continue
14453                         fi
14454                         ;;
14455                 esac
14456                 case "$CPPFLAGS" in
14457                 (*$cf_add_cflags)
14458                         ;;
14459                 (*)
14460                         case "$cf_add_cflags" in
14461                         (-D*)
14462                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14463
14464 CPPFLAGS=`echo "$CPPFLAGS" | \
14465         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14466                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14467
14468                                 ;;
14469                         esac
14470
14471         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14472         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14473
14474                         ;;
14475                 esac
14476                 ;;
14477         (*)
14478
14479         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14480         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14481
14482                 ;;
14483         esac
14484         ;;
14485 (yes)
14486
14487         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14488         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14489
14490         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14491
14492         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14493                 && test -z "${cf_tst_cflags}" \
14494                 && cf_fix_cppflags=no
14495         ;;
14496 esac
14497 done
14498
14499 if test -n "$cf_new_cflags" ; then
14500
14501         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14502         CFLAGS="${CFLAGS}$cf_new_cflags"
14503
14504 fi
14505
14506 if test -n "$cf_new_cppflags" ; then
14507
14508         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14509         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14510
14511 fi
14512
14513 if test -n "$cf_new_extra_cppflags" ; then
14514
14515         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14516         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14517
14518 fi
14519
14520 cf_add_libs="$LIBS"
14521 # reverse order
14522 cf_add_0lib=
14523 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14524 # filter duplicates
14525 for cf_add_1lib in $cf_add_0lib; do
14526         for cf_add_2lib in $cf_add_libs; do
14527                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14528                         cf_add_1lib=
14529                         break
14530                 fi
14531         done
14532         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14533 done
14534 LIBS="$cf_add_libs"
14535
14536         :
14537 else
14538         cf_pkgconfig_incs=
14539         cf_pkgconfig_libs=
14540         { echo "$as_me:14540: WARNING: unable to find X11 library" >&5
14541 echo "$as_me: WARNING: unable to find X11 library" >&2;}
14542 fi
14543
14544 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14545         test -n "$verbose" && echo "    found package ice" 1>&6
14546
14547 echo "${as_me:-configure}:14547: testing found package ice ..." 1>&5
14548
14549         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14550         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14551         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14552
14553 echo "${as_me:-configure}:14553: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14554
14555         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14556
14557 echo "${as_me:-configure}:14557: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14558
14559 cf_fix_cppflags=no
14560 cf_new_cflags=
14561 cf_new_cppflags=
14562 cf_new_extra_cppflags=
14563
14564 for cf_add_cflags in $cf_pkgconfig_incs
14565 do
14566 case "$cf_fix_cppflags" in
14567 (no)
14568         case "$cf_add_cflags" in
14569         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14570                 case "$cf_add_cflags" in
14571                 (-D*)
14572                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14573
14574                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14575                                 && test -z "${cf_tst_cflags}" \
14576                                 && cf_fix_cppflags=yes
14577
14578                         if test "$cf_fix_cppflags" = yes ; then
14579
14580         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14581         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14582
14583                                 continue
14584                         elif test "${cf_tst_cflags}" = "\"'" ; then
14585
14586         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14587         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14588
14589                                 continue
14590                         fi
14591                         ;;
14592                 esac
14593                 case "$CPPFLAGS" in
14594                 (*$cf_add_cflags)
14595                         ;;
14596                 (*)
14597                         case "$cf_add_cflags" in
14598                         (-D*)
14599                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14600
14601 CPPFLAGS=`echo "$CPPFLAGS" | \
14602         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14603                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14604
14605                                 ;;
14606                         esac
14607
14608         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14609         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14610
14611                         ;;
14612                 esac
14613                 ;;
14614         (*)
14615
14616         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14617         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14618
14619                 ;;
14620         esac
14621         ;;
14622 (yes)
14623
14624         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14625         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14626
14627         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14628
14629         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14630                 && test -z "${cf_tst_cflags}" \
14631                 && cf_fix_cppflags=no
14632         ;;
14633 esac
14634 done
14635
14636 if test -n "$cf_new_cflags" ; then
14637
14638         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14639         CFLAGS="${CFLAGS}$cf_new_cflags"
14640
14641 fi
14642
14643 if test -n "$cf_new_cppflags" ; then
14644
14645         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14646         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14647
14648 fi
14649
14650 if test -n "$cf_new_extra_cppflags" ; then
14651
14652         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14653         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14654
14655 fi
14656
14657 cf_add_libs="$LIBS"
14658 # reverse order
14659 cf_add_0lib=
14660 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14661 # filter duplicates
14662 for cf_add_1lib in $cf_add_0lib; do
14663         for cf_add_2lib in $cf_add_libs; do
14664                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14665                         cf_add_1lib=
14666                         break
14667                 fi
14668         done
14669         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14670 done
14671 LIBS="$cf_add_libs"
14672
14673         :
14674 else
14675         cf_pkgconfig_incs=
14676         cf_pkgconfig_libs=
14677         { echo "$as_me:14677: WARNING: unable to find ICE library" >&5
14678 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14679 fi
14680
14681 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14682         test -n "$verbose" && echo "    found package sm" 1>&6
14683
14684 echo "${as_me:-configure}:14684: testing found package sm ..." 1>&5
14685
14686         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14687         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14688         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14689
14690 echo "${as_me:-configure}:14690: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14691
14692         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14693
14694 echo "${as_me:-configure}:14694: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14695
14696 cf_fix_cppflags=no
14697 cf_new_cflags=
14698 cf_new_cppflags=
14699 cf_new_extra_cppflags=
14700
14701 for cf_add_cflags in $cf_pkgconfig_incs
14702 do
14703 case "$cf_fix_cppflags" in
14704 (no)
14705         case "$cf_add_cflags" in
14706         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14707                 case "$cf_add_cflags" in
14708                 (-D*)
14709                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14710
14711                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14712                                 && test -z "${cf_tst_cflags}" \
14713                                 && cf_fix_cppflags=yes
14714
14715                         if test "$cf_fix_cppflags" = yes ; then
14716
14717         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14718         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14719
14720                                 continue
14721                         elif test "${cf_tst_cflags}" = "\"'" ; then
14722
14723         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14724         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14725
14726                                 continue
14727                         fi
14728                         ;;
14729                 esac
14730                 case "$CPPFLAGS" in
14731                 (*$cf_add_cflags)
14732                         ;;
14733                 (*)
14734                         case "$cf_add_cflags" in
14735                         (-D*)
14736                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14737
14738 CPPFLAGS=`echo "$CPPFLAGS" | \
14739         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14740                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14741
14742                                 ;;
14743                         esac
14744
14745         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14746         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14747
14748                         ;;
14749                 esac
14750                 ;;
14751         (*)
14752
14753         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14754         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14755
14756                 ;;
14757         esac
14758         ;;
14759 (yes)
14760
14761         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14762         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14763
14764         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14765
14766         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14767                 && test -z "${cf_tst_cflags}" \
14768                 && cf_fix_cppflags=no
14769         ;;
14770 esac
14771 done
14772
14773 if test -n "$cf_new_cflags" ; then
14774
14775         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14776         CFLAGS="${CFLAGS}$cf_new_cflags"
14777
14778 fi
14779
14780 if test -n "$cf_new_cppflags" ; then
14781
14782         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14783         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14784
14785 fi
14786
14787 if test -n "$cf_new_extra_cppflags" ; then
14788
14789         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14790         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14791
14792 fi
14793
14794 cf_add_libs="$LIBS"
14795 # reverse order
14796 cf_add_0lib=
14797 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14798 # filter duplicates
14799 for cf_add_1lib in $cf_add_0lib; do
14800         for cf_add_2lib in $cf_add_libs; do
14801                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14802                         cf_add_1lib=
14803                         break
14804                 fi
14805         done
14806         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14807 done
14808 LIBS="$cf_add_libs"
14809
14810         :
14811 else
14812         cf_pkgconfig_incs=
14813         cf_pkgconfig_libs=
14814         { echo "$as_me:14814: WARNING: unable to find SM library" >&5
14815 echo "$as_me: WARNING: unable to find SM library" >&2;}
14816 fi
14817
14818 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14819         test -n "$verbose" && echo "    found package xt" 1>&6
14820
14821 echo "${as_me:-configure}:14821: testing found package xt ..." 1>&5
14822
14823         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14824         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14825         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14826
14827 echo "${as_me:-configure}:14827: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14828
14829         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14830
14831 echo "${as_me:-configure}:14831: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14832
14833 cf_fix_cppflags=no
14834 cf_new_cflags=
14835 cf_new_cppflags=
14836 cf_new_extra_cppflags=
14837
14838 for cf_add_cflags in $cf_pkgconfig_incs
14839 do
14840 case "$cf_fix_cppflags" in
14841 (no)
14842         case "$cf_add_cflags" in
14843         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14844                 case "$cf_add_cflags" in
14845                 (-D*)
14846                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14847
14848                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14849                                 && test -z "${cf_tst_cflags}" \
14850                                 && cf_fix_cppflags=yes
14851
14852                         if test "$cf_fix_cppflags" = yes ; then
14853
14854         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14855         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14856
14857                                 continue
14858                         elif test "${cf_tst_cflags}" = "\"'" ; then
14859
14860         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14861         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14862
14863                                 continue
14864                         fi
14865                         ;;
14866                 esac
14867                 case "$CPPFLAGS" in
14868                 (*$cf_add_cflags)
14869                         ;;
14870                 (*)
14871                         case "$cf_add_cflags" in
14872                         (-D*)
14873                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14874
14875 CPPFLAGS=`echo "$CPPFLAGS" | \
14876         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14877                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14878
14879                                 ;;
14880                         esac
14881
14882         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14883         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14884
14885                         ;;
14886                 esac
14887                 ;;
14888         (*)
14889
14890         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14891         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14892
14893                 ;;
14894         esac
14895         ;;
14896 (yes)
14897
14898         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14899         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14900
14901         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14902
14903         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14904                 && test -z "${cf_tst_cflags}" \
14905                 && cf_fix_cppflags=no
14906         ;;
14907 esac
14908 done
14909
14910 if test -n "$cf_new_cflags" ; then
14911
14912         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14913         CFLAGS="${CFLAGS}$cf_new_cflags"
14914
14915 fi
14916
14917 if test -n "$cf_new_cppflags" ; then
14918
14919         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14920         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14921
14922 fi
14923
14924 if test -n "$cf_new_extra_cppflags" ; then
14925
14926         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14927         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14928
14929 fi
14930
14931 cf_add_libs="$LIBS"
14932 # reverse order
14933 cf_add_0lib=
14934 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14935 # filter duplicates
14936 for cf_add_1lib in $cf_add_0lib; do
14937         for cf_add_2lib in $cf_add_libs; do
14938                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14939                         cf_add_1lib=
14940                         break
14941                 fi
14942         done
14943         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14944 done
14945 LIBS="$cf_add_libs"
14946
14947         :
14948 else
14949         cf_pkgconfig_incs=
14950         cf_pkgconfig_libs=
14951         { echo "$as_me:14951: WARNING: unable to find Xt library" >&5
14952 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14953 fi
14954
14955 else
14956         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14957 fi
14958
14959 cf_have_X_LIBS=no
14960
14961 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14962         test -n "$verbose" && echo "    found package xt" 1>&6
14963
14964 echo "${as_me:-configure}:14964: testing found package xt ..." 1>&5
14965
14966         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14967         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14968         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14969
14970 echo "${as_me:-configure}:14970: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14971
14972         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14973
14974 echo "${as_me:-configure}:14974: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14975
14976 cf_fix_cppflags=no
14977 cf_new_cflags=
14978 cf_new_cppflags=
14979 cf_new_extra_cppflags=
14980
14981 for cf_add_cflags in $cf_pkgconfig_incs
14982 do
14983 case "$cf_fix_cppflags" in
14984 (no)
14985         case "$cf_add_cflags" in
14986         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14987                 case "$cf_add_cflags" in
14988                 (-D*)
14989                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14990
14991                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14992                                 && test -z "${cf_tst_cflags}" \
14993                                 && cf_fix_cppflags=yes
14994
14995                         if test "$cf_fix_cppflags" = yes ; then
14996
14997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14999
15000                                 continue
15001                         elif test "${cf_tst_cflags}" = "\"'" ; then
15002
15003         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15004         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15005
15006                                 continue
15007                         fi
15008                         ;;
15009                 esac
15010                 case "$CPPFLAGS" in
15011                 (*$cf_add_cflags)
15012                         ;;
15013                 (*)
15014                         case "$cf_add_cflags" in
15015                         (-D*)
15016                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15017
15018 CPPFLAGS=`echo "$CPPFLAGS" | \
15019         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15020                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15021
15022                                 ;;
15023                         esac
15024
15025         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15026         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15027
15028                         ;;
15029                 esac
15030                 ;;
15031         (*)
15032
15033         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15034         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15035
15036                 ;;
15037         esac
15038         ;;
15039 (yes)
15040
15041         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15042         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15043
15044         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15045
15046         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15047                 && test -z "${cf_tst_cflags}" \
15048                 && cf_fix_cppflags=no
15049         ;;
15050 esac
15051 done
15052
15053 if test -n "$cf_new_cflags" ; then
15054
15055         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15056         CFLAGS="${CFLAGS}$cf_new_cflags"
15057
15058 fi
15059
15060 if test -n "$cf_new_cppflags" ; then
15061
15062         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15063         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15064
15065 fi
15066
15067 if test -n "$cf_new_extra_cppflags" ; then
15068
15069         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15070         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15071
15072 fi
15073
15074 cf_add_libs="$LIBS"
15075 # reverse order
15076 cf_add_0lib=
15077 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15078 # filter duplicates
15079 for cf_add_1lib in $cf_add_0lib; do
15080         for cf_add_2lib in $cf_add_libs; do
15081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15082                         cf_add_1lib=
15083                         break
15084                 fi
15085         done
15086         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15087 done
15088 LIBS="$cf_add_libs"
15089
15090         case "x$LIBS" in
15091         (*-lX11*)
15092                 ;;
15093         (*)
15094 # we have an "xt" package, but it may omit Xt's dependency on X11
15095 echo "$as_me:15095: checking for usable X dependency" >&5
15096 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
15097 if test "${cf_cv_xt_x11_compat+set}" = set; then
15098   echo $ECHO_N "(cached) $ECHO_C" >&6
15099 else
15100
15101 cat >"conftest.$ac_ext" <<_ACEOF
15102 #line 15102 "configure"
15103 #include "confdefs.h"
15104
15105 $ac_includes_default
15106 #include <X11/Xlib.h>
15107
15108 int
15109 main (void)
15110 {
15111
15112         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
15113         int rc2 = XClearWindow((Display*) 0, (Window) 0);
15114         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
15115         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
15116
15117   ;
15118   return 0;
15119 }
15120 _ACEOF
15121 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15122 if { (eval echo "$as_me:15122: \"$ac_link\"") >&5
15123   (eval $ac_link) 2>&5
15124   ac_status=$?
15125   echo "$as_me:15125: \$? = $ac_status" >&5
15126   (exit "$ac_status"); } &&
15127          { ac_try='test -s "conftest$ac_exeext"'
15128   { (eval echo "$as_me:15128: \"$ac_try\"") >&5
15129   (eval $ac_try) 2>&5
15130   ac_status=$?
15131   echo "$as_me:15131: \$? = $ac_status" >&5
15132   (exit "$ac_status"); }; }; then
15133   cf_cv_xt_x11_compat=yes
15134 else
15135   echo "$as_me: failed program was:" >&5
15136 cat "conftest.$ac_ext" >&5
15137 cf_cv_xt_x11_compat=no
15138 fi
15139 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15140 fi
15141 echo "$as_me:15141: result: $cf_cv_xt_x11_compat" >&5
15142 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
15143                 if test "$cf_cv_xt_x11_compat" = no
15144                 then
15145                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
15146
15147 echo "${as_me:-configure}:15147: testing work around broken X11 dependency ..." 1>&5
15148
15149                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
15150
15151 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
15152         test -n "$verbose" && echo "    found package x11" 1>&6
15153
15154 echo "${as_me:-configure}:15154: testing found package x11 ..." 1>&5
15155
15156         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
15157         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
15158         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
15159
15160 echo "${as_me:-configure}:15160: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15161
15162         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
15163
15164 echo "${as_me:-configure}:15164: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
15165
15166 cf_fix_cppflags=no
15167 cf_new_cflags=
15168 cf_new_cppflags=
15169 cf_new_extra_cppflags=
15170
15171 for cf_add_cflags in $cf_pkgconfig_incs
15172 do
15173 case "$cf_fix_cppflags" in
15174 (no)
15175         case "$cf_add_cflags" in
15176         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15177                 case "$cf_add_cflags" in
15178                 (-D*)
15179                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15180
15181                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15182                                 && test -z "${cf_tst_cflags}" \
15183                                 && cf_fix_cppflags=yes
15184
15185                         if test "$cf_fix_cppflags" = yes ; then
15186
15187         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15188         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15189
15190                                 continue
15191                         elif test "${cf_tst_cflags}" = "\"'" ; then
15192
15193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15195
15196                                 continue
15197                         fi
15198                         ;;
15199                 esac
15200                 case "$CPPFLAGS" in
15201                 (*$cf_add_cflags)
15202                         ;;
15203                 (*)
15204                         case "$cf_add_cflags" in
15205                         (-D*)
15206                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15207
15208 CPPFLAGS=`echo "$CPPFLAGS" | \
15209         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15210                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15211
15212                                 ;;
15213                         esac
15214
15215         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15216         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15217
15218                         ;;
15219                 esac
15220                 ;;
15221         (*)
15222
15223         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15224         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15225
15226                 ;;
15227         esac
15228         ;;
15229 (yes)
15230
15231         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15232         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15233
15234         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15235
15236         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15237                 && test -z "${cf_tst_cflags}" \
15238                 && cf_fix_cppflags=no
15239         ;;
15240 esac
15241 done
15242
15243 if test -n "$cf_new_cflags" ; then
15244
15245         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15246         CFLAGS="${CFLAGS}$cf_new_cflags"
15247
15248 fi
15249
15250 if test -n "$cf_new_cppflags" ; then
15251
15252         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15253         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15254
15255 fi
15256
15257 if test -n "$cf_new_extra_cppflags" ; then
15258
15259         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15260         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15261
15262 fi
15263
15264 cf_add_libs="$LIBS"
15265 # reverse order
15266 cf_add_0lib=
15267 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15268 # filter duplicates
15269 for cf_add_1lib in $cf_add_0lib; do
15270         for cf_add_2lib in $cf_add_libs; do
15271                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15272                         cf_add_1lib=
15273                         break
15274                 fi
15275         done
15276         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15277 done
15278 LIBS="$cf_add_libs"
15279
15280         :
15281 else
15282         cf_pkgconfig_incs=
15283         cf_pkgconfig_libs=
15284
15285 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15286
15287 echo "${as_me:-configure}:15287: testing ...before $LIBS ..." 1>&5
15288
15289 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
15290 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15291
15292 echo "${as_me:-configure}:15292: testing ...after  $LIBS ..." 1>&5
15293
15294 fi
15295
15296                 fi
15297                 ;;
15298         esac
15299
15300 echo "$as_me:15300: checking for usable X Toolkit package" >&5
15301 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
15302 if test "${cf_cv_xt_ice_compat+set}" = set; then
15303   echo $ECHO_N "(cached) $ECHO_C" >&6
15304 else
15305
15306 cat >"conftest.$ac_ext" <<_ACEOF
15307 #line 15307 "configure"
15308 #include "confdefs.h"
15309
15310 $ac_includes_default
15311 #include <X11/Shell.h>
15312
15313 int
15314 main (void)
15315 {
15316 int num = IceConnectionNumber(0); (void) num
15317
15318   ;
15319   return 0;
15320 }
15321 _ACEOF
15322 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15323 if { (eval echo "$as_me:15323: \"$ac_link\"") >&5
15324   (eval $ac_link) 2>&5
15325   ac_status=$?
15326   echo "$as_me:15326: \$? = $ac_status" >&5
15327   (exit "$ac_status"); } &&
15328          { ac_try='test -s "conftest$ac_exeext"'
15329   { (eval echo "$as_me:15329: \"$ac_try\"") >&5
15330   (eval $ac_try) 2>&5
15331   ac_status=$?
15332   echo "$as_me:15332: \$? = $ac_status" >&5
15333   (exit "$ac_status"); }; }; then
15334   cf_cv_xt_ice_compat=yes
15335 else
15336   echo "$as_me: failed program was:" >&5
15337 cat "conftest.$ac_ext" >&5
15338 cf_cv_xt_ice_compat=no
15339 fi
15340 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15341 fi
15342 echo "$as_me:15342: result: $cf_cv_xt_ice_compat" >&5
15343 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
15344
15345         if test "$cf_cv_xt_ice_compat" = no
15346         then
15347                 # workaround for broken ".pc" files used for X Toolkit.
15348                 case "x$X_PRE_LIBS" in
15349                 (*-lICE*)
15350                         case "x$LIBS" in
15351                         (*-lICE*)
15352                                 ;;
15353                         (*)
15354                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
15355
15356 echo "${as_me:-configure}:15356: testing work around broken ICE dependency ..." 1>&5
15357
15358 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
15359         test -n "$verbose" && echo "    found package ice" 1>&6
15360
15361 echo "${as_me:-configure}:15361: testing found package ice ..." 1>&5
15362
15363         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
15364         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
15365         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
15366
15367 echo "${as_me:-configure}:15367: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15368
15369         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
15370
15371 echo "${as_me:-configure}:15371: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
15372
15373 cf_fix_cppflags=no
15374 cf_new_cflags=
15375 cf_new_cppflags=
15376 cf_new_extra_cppflags=
15377
15378 for cf_add_cflags in $cf_pkgconfig_incs
15379 do
15380 case "$cf_fix_cppflags" in
15381 (no)
15382         case "$cf_add_cflags" in
15383         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15384                 case "$cf_add_cflags" in
15385                 (-D*)
15386                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15387
15388                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15389                                 && test -z "${cf_tst_cflags}" \
15390                                 && cf_fix_cppflags=yes
15391
15392                         if test "$cf_fix_cppflags" = yes ; then
15393
15394         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15395         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15396
15397                                 continue
15398                         elif test "${cf_tst_cflags}" = "\"'" ; then
15399
15400         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15401         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15402
15403                                 continue
15404                         fi
15405                         ;;
15406                 esac
15407                 case "$CPPFLAGS" in
15408                 (*$cf_add_cflags)
15409                         ;;
15410                 (*)
15411                         case "$cf_add_cflags" in
15412                         (-D*)
15413                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15414
15415 CPPFLAGS=`echo "$CPPFLAGS" | \
15416         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15417                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15418
15419                                 ;;
15420                         esac
15421
15422         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15423         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15424
15425                         ;;
15426                 esac
15427                 ;;
15428         (*)
15429
15430         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15431         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15432
15433                 ;;
15434         esac
15435         ;;
15436 (yes)
15437
15438         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15439         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15440
15441         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15442
15443         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15444                 && test -z "${cf_tst_cflags}" \
15445                 && cf_fix_cppflags=no
15446         ;;
15447 esac
15448 done
15449
15450 if test -n "$cf_new_cflags" ; then
15451
15452         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15453         CFLAGS="${CFLAGS}$cf_new_cflags"
15454
15455 fi
15456
15457 if test -n "$cf_new_cppflags" ; then
15458
15459         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15460         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15461
15462 fi
15463
15464 if test -n "$cf_new_extra_cppflags" ; then
15465
15466         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15467         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15468
15469 fi
15470
15471 cf_add_libs="$LIBS"
15472 # reverse order
15473 cf_add_0lib=
15474 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15475 # filter duplicates
15476 for cf_add_1lib in $cf_add_0lib; do
15477         for cf_add_2lib in $cf_add_libs; do
15478                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15479                         cf_add_1lib=
15480                         break
15481                 fi
15482         done
15483         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15484 done
15485 LIBS="$cf_add_libs"
15486
15487 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
15488         test -n "$verbose" && echo "    found package sm" 1>&6
15489
15490 echo "${as_me:-configure}:15490: testing found package sm ..." 1>&5
15491
15492         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
15493         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
15494         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
15495
15496 echo "${as_me:-configure}:15496: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15497
15498         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
15499
15500 echo "${as_me:-configure}:15500: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
15501
15502 cf_fix_cppflags=no
15503 cf_new_cflags=
15504 cf_new_cppflags=
15505 cf_new_extra_cppflags=
15506
15507 for cf_add_cflags in $cf_pkgconfig_incs
15508 do
15509 case "$cf_fix_cppflags" in
15510 (no)
15511         case "$cf_add_cflags" in
15512         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15513                 case "$cf_add_cflags" in
15514                 (-D*)
15515                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15516
15517                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15518                                 && test -z "${cf_tst_cflags}" \
15519                                 && cf_fix_cppflags=yes
15520
15521                         if test "$cf_fix_cppflags" = yes ; then
15522
15523         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15524         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15525
15526                                 continue
15527                         elif test "${cf_tst_cflags}" = "\"'" ; then
15528
15529         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15530         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15531
15532                                 continue
15533                         fi
15534                         ;;
15535                 esac
15536                 case "$CPPFLAGS" in
15537                 (*$cf_add_cflags)
15538                         ;;
15539                 (*)
15540                         case "$cf_add_cflags" in
15541                         (-D*)
15542                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15543
15544 CPPFLAGS=`echo "$CPPFLAGS" | \
15545         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15546                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15547
15548                                 ;;
15549                         esac
15550
15551         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15552         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15553
15554                         ;;
15555                 esac
15556                 ;;
15557         (*)
15558
15559         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15560         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15561
15562                 ;;
15563         esac
15564         ;;
15565 (yes)
15566
15567         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15568         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15569
15570         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15571
15572         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15573                 && test -z "${cf_tst_cflags}" \
15574                 && cf_fix_cppflags=no
15575         ;;
15576 esac
15577 done
15578
15579 if test -n "$cf_new_cflags" ; then
15580
15581         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15582         CFLAGS="${CFLAGS}$cf_new_cflags"
15583
15584 fi
15585
15586 if test -n "$cf_new_cppflags" ; then
15587
15588         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15589         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15590
15591 fi
15592
15593 if test -n "$cf_new_extra_cppflags" ; then
15594
15595         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15596         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15597
15598 fi
15599
15600 cf_add_libs="$LIBS"
15601 # reverse order
15602 cf_add_0lib=
15603 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15604 # filter duplicates
15605 for cf_add_1lib in $cf_add_0lib; do
15606         for cf_add_2lib in $cf_add_libs; do
15607                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15608                         cf_add_1lib=
15609                         break
15610                 fi
15611         done
15612         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15613 done
15614 LIBS="$cf_add_libs"
15615
15616         :
15617 else
15618         cf_pkgconfig_incs=
15619         cf_pkgconfig_libs=
15620         :
15621 fi
15622
15623 else
15624         cf_pkgconfig_incs=
15625         cf_pkgconfig_libs=
15626
15627 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15628
15629 echo "${as_me:-configure}:15629: testing ...before $LIBS ..." 1>&5
15630
15631 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
15632 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15633
15634 echo "${as_me:-configure}:15634: testing ...after  $LIBS ..." 1>&5
15635
15636 fi
15637
15638                                 ;;
15639                         esac
15640                         ;;
15641                 esac
15642         fi
15643
15644         cf_have_X_LIBS=yes
15645
15646 else
15647         cf_pkgconfig_incs=
15648         cf_pkgconfig_libs=
15649
15650         LDFLAGS="$X_LIBS $LDFLAGS"
15651
15652 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15653
15654 echo "${as_me:-configure}:15654: testing checking additions to CFLAGS ..." 1>&5
15655
15656 cf_check_cflags="$CFLAGS"
15657 cf_check_cppflags="$CPPFLAGS"
15658
15659 cf_fix_cppflags=no
15660 cf_new_cflags=
15661 cf_new_cppflags=
15662 cf_new_extra_cppflags=
15663
15664 for cf_add_cflags in $X_CFLAGS
15665 do
15666 case "$cf_fix_cppflags" in
15667 (no)
15668         case "$cf_add_cflags" in
15669         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15670                 case "$cf_add_cflags" in
15671                 (-D*)
15672                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15673
15674                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15675                                 && test -z "${cf_tst_cflags}" \
15676                                 && cf_fix_cppflags=yes
15677
15678                         if test "$cf_fix_cppflags" = yes ; then
15679
15680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15682
15683                                 continue
15684                         elif test "${cf_tst_cflags}" = "\"'" ; then
15685
15686         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15687         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15688
15689                                 continue
15690                         fi
15691                         ;;
15692                 esac
15693                 case "$CPPFLAGS" in
15694                 (*$cf_add_cflags)
15695                         ;;
15696                 (*)
15697                         case "$cf_add_cflags" in
15698                         (-D*)
15699                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15700
15701 CPPFLAGS=`echo "$CPPFLAGS" | \
15702         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15703                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15704
15705                                 ;;
15706                         esac
15707
15708         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15709         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15710
15711                         ;;
15712                 esac
15713                 ;;
15714         (*)
15715
15716         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15717         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15718
15719                 ;;
15720         esac
15721         ;;
15722 (yes)
15723
15724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15726
15727         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15728
15729         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15730                 && test -z "${cf_tst_cflags}" \
15731                 && cf_fix_cppflags=no
15732         ;;
15733 esac
15734 done
15735
15736 if test -n "$cf_new_cflags" ; then
15737         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15738
15739 echo "${as_me:-configure}:15739: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15740
15741         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15742         CFLAGS="${CFLAGS}$cf_new_cflags"
15743
15744 fi
15745
15746 if test -n "$cf_new_cppflags" ; then
15747         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15748
15749 echo "${as_me:-configure}:15749: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15750
15751         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15752         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15753
15754 fi
15755
15756 if test -n "$cf_new_extra_cppflags" ; then
15757         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15758
15759 echo "${as_me:-configure}:15759: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15760
15761         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15762         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15763
15764 fi
15765
15766 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15767 cat >"conftest.$ac_ext" <<_ACEOF
15768 #line 15768 "configure"
15769 #include "confdefs.h"
15770 #include <stdio.h>
15771 int
15772 main (void)
15773 {
15774 printf("Hello world");
15775   ;
15776   return 0;
15777 }
15778 _ACEOF
15779 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15780 if { (eval echo "$as_me:15780: \"$ac_link\"") >&5
15781   (eval $ac_link) 2>&5
15782   ac_status=$?
15783   echo "$as_me:15783: \$? = $ac_status" >&5
15784   (exit "$ac_status"); } &&
15785          { ac_try='test -s "conftest$ac_exeext"'
15786   { (eval echo "$as_me:15786: \"$ac_try\"") >&5
15787   (eval $ac_try) 2>&5
15788   ac_status=$?
15789   echo "$as_me:15789: \$? = $ac_status" >&5
15790   (exit "$ac_status"); }; }; then
15791   :
15792 else
15793   echo "$as_me: failed program was:" >&5
15794 cat "conftest.$ac_ext" >&5
15795 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15796
15797 echo "${as_me:-configure}:15797: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15798
15799          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15800                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15801
15802 echo "${as_me:-configure}:15802: testing but keeping change to \$CPPFLAGS ..." 1>&5
15803
15804          fi
15805          CFLAGS="$cf_check_cflags"
15806 fi
15807 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15808 fi
15809
15810         echo "$as_me:15810: checking for XOpenDisplay" >&5
15811 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15812 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15813   echo $ECHO_N "(cached) $ECHO_C" >&6
15814 else
15815   cat >"conftest.$ac_ext" <<_ACEOF
15816 #line 15816 "configure"
15817 #include "confdefs.h"
15818 #define XOpenDisplay autoconf_temporary
15819 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15820 #undef XOpenDisplay
15821
15822 #ifdef __cplusplus
15823 extern "C"
15824 #endif
15825
15826 /* We use char because int might match the return type of a gcc2
15827    builtin and then its argument prototype would still apply.  */
15828 char XOpenDisplay (void);
15829
15830 int
15831 main (void)
15832 {
15833
15834 /* The GNU C library defines stubs for functions which it implements
15835     to always fail with ENOSYS.  Some functions are actually named
15836     something starting with __ and the normal name is an alias.  */
15837 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15838 #error found stub for XOpenDisplay
15839 #endif
15840
15841         return XOpenDisplay ();
15842   ;
15843   return 0;
15844 }
15845 _ACEOF
15846 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15847 if { (eval echo "$as_me:15847: \"$ac_link\"") >&5
15848   (eval $ac_link) 2>&5
15849   ac_status=$?
15850   echo "$as_me:15850: \$? = $ac_status" >&5
15851   (exit "$ac_status"); } &&
15852          { ac_try='test -s "conftest$ac_exeext"'
15853   { (eval echo "$as_me:15853: \"$ac_try\"") >&5
15854   (eval $ac_try) 2>&5
15855   ac_status=$?
15856   echo "$as_me:15856: \$? = $ac_status" >&5
15857   (exit "$ac_status"); }; }; then
15858   ac_cv_func_XOpenDisplay=yes
15859 else
15860   echo "$as_me: failed program was:" >&5
15861 cat "conftest.$ac_ext" >&5
15862 ac_cv_func_XOpenDisplay=no
15863 fi
15864 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15865 fi
15866 echo "$as_me:15866: result: $ac_cv_func_XOpenDisplay" >&5
15867 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15868 if test "$ac_cv_func_XOpenDisplay" = yes; then
15869   :
15870 else
15871
15872         echo "$as_me:15872: checking for XOpenDisplay in -lX11" >&5
15873 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15874 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15875   echo $ECHO_N "(cached) $ECHO_C" >&6
15876 else
15877   ac_check_lib_save_LIBS=$LIBS
15878 LIBS="-lX11  $LIBS"
15879 cat >"conftest.$ac_ext" <<_ACEOF
15880 #line 15880 "configure"
15881 #include "confdefs.h"
15882
15883 /* Override any gcc2 internal prototype to avoid an error.  */
15884 #ifdef __cplusplus
15885 extern "C"
15886 #endif
15887 /* We use char because int might match the return type of a gcc2
15888    builtin and then its argument prototype would still apply.  */
15889 char XOpenDisplay ();
15890 int
15891 main (void)
15892 {
15893 XOpenDisplay ();
15894   ;
15895   return 0;
15896 }
15897 _ACEOF
15898 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15899 if { (eval echo "$as_me:15899: \"$ac_link\"") >&5
15900   (eval $ac_link) 2>&5
15901   ac_status=$?
15902   echo "$as_me:15902: \$? = $ac_status" >&5
15903   (exit "$ac_status"); } &&
15904          { ac_try='test -s "conftest$ac_exeext"'
15905   { (eval echo "$as_me:15905: \"$ac_try\"") >&5
15906   (eval $ac_try) 2>&5
15907   ac_status=$?
15908   echo "$as_me:15908: \$? = $ac_status" >&5
15909   (exit "$ac_status"); }; }; then
15910   ac_cv_lib_X11_XOpenDisplay=yes
15911 else
15912   echo "$as_me: failed program was:" >&5
15913 cat "conftest.$ac_ext" >&5
15914 ac_cv_lib_X11_XOpenDisplay=no
15915 fi
15916 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15917 LIBS=$ac_check_lib_save_LIBS
15918 fi
15919 echo "$as_me:15919: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15920 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15921 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15922
15923 cf_add_libs="$LIBS"
15924 # reverse order
15925 cf_add_0lib=
15926 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15927 # filter duplicates
15928 for cf_add_1lib in $cf_add_0lib; do
15929         for cf_add_2lib in $cf_add_libs; do
15930                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15931                         cf_add_1lib=
15932                         break
15933                 fi
15934         done
15935         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15936 done
15937 LIBS="$cf_add_libs"
15938
15939 fi
15940
15941 fi
15942
15943         echo "$as_me:15943: checking for XtAppInitialize" >&5
15944 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15945 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15946   echo $ECHO_N "(cached) $ECHO_C" >&6
15947 else
15948   cat >"conftest.$ac_ext" <<_ACEOF
15949 #line 15949 "configure"
15950 #include "confdefs.h"
15951 #define XtAppInitialize autoconf_temporary
15952 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15953 #undef XtAppInitialize
15954
15955 #ifdef __cplusplus
15956 extern "C"
15957 #endif
15958
15959 /* We use char because int might match the return type of a gcc2
15960    builtin and then its argument prototype would still apply.  */
15961 char XtAppInitialize (void);
15962
15963 int
15964 main (void)
15965 {
15966
15967 /* The GNU C library defines stubs for functions which it implements
15968     to always fail with ENOSYS.  Some functions are actually named
15969     something starting with __ and the normal name is an alias.  */
15970 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15971 #error found stub for XtAppInitialize
15972 #endif
15973
15974         return XtAppInitialize ();
15975   ;
15976   return 0;
15977 }
15978 _ACEOF
15979 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15980 if { (eval echo "$as_me:15980: \"$ac_link\"") >&5
15981   (eval $ac_link) 2>&5
15982   ac_status=$?
15983   echo "$as_me:15983: \$? = $ac_status" >&5
15984   (exit "$ac_status"); } &&
15985          { ac_try='test -s "conftest$ac_exeext"'
15986   { (eval echo "$as_me:15986: \"$ac_try\"") >&5
15987   (eval $ac_try) 2>&5
15988   ac_status=$?
15989   echo "$as_me:15989: \$? = $ac_status" >&5
15990   (exit "$ac_status"); }; }; then
15991   ac_cv_func_XtAppInitialize=yes
15992 else
15993   echo "$as_me: failed program was:" >&5
15994 cat "conftest.$ac_ext" >&5
15995 ac_cv_func_XtAppInitialize=no
15996 fi
15997 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15998 fi
15999 echo "$as_me:15999: result: $ac_cv_func_XtAppInitialize" >&5
16000 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
16001 if test "$ac_cv_func_XtAppInitialize" = yes; then
16002   :
16003 else
16004
16005         echo "$as_me:16005: checking for XtAppInitialize in -lXt" >&5
16006 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
16007 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
16008   echo $ECHO_N "(cached) $ECHO_C" >&6
16009 else
16010   ac_check_lib_save_LIBS=$LIBS
16011 LIBS="-lXt  $LIBS"
16012 cat >"conftest.$ac_ext" <<_ACEOF
16013 #line 16013 "configure"
16014 #include "confdefs.h"
16015
16016 /* Override any gcc2 internal prototype to avoid an error.  */
16017 #ifdef __cplusplus
16018 extern "C"
16019 #endif
16020 /* We use char because int might match the return type of a gcc2
16021    builtin and then its argument prototype would still apply.  */
16022 char XtAppInitialize ();
16023 int
16024 main (void)
16025 {
16026 XtAppInitialize ();
16027   ;
16028   return 0;
16029 }
16030 _ACEOF
16031 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16032 if { (eval echo "$as_me:16032: \"$ac_link\"") >&5
16033   (eval $ac_link) 2>&5
16034   ac_status=$?
16035   echo "$as_me:16035: \$? = $ac_status" >&5
16036   (exit "$ac_status"); } &&
16037          { ac_try='test -s "conftest$ac_exeext"'
16038   { (eval echo "$as_me:16038: \"$ac_try\"") >&5
16039   (eval $ac_try) 2>&5
16040   ac_status=$?
16041   echo "$as_me:16041: \$? = $ac_status" >&5
16042   (exit "$ac_status"); }; }; then
16043   ac_cv_lib_Xt_XtAppInitialize=yes
16044 else
16045   echo "$as_me: failed program was:" >&5
16046 cat "conftest.$ac_ext" >&5
16047 ac_cv_lib_Xt_XtAppInitialize=no
16048 fi
16049 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16050 LIBS=$ac_check_lib_save_LIBS
16051 fi
16052 echo "$as_me:16052: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
16053 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
16054 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
16055
16056 cat >>confdefs.h <<\EOF
16057 #define HAVE_LIBXT 1
16058 EOF
16059
16060                  cf_have_X_LIBS=Xt
16061                  LIBS="-lXt $LIBS"
16062 fi
16063
16064 fi
16065
16066 fi
16067
16068 if test "$cf_have_X_LIBS" = no ; then
16069         { echo "$as_me:16069: WARNING: Unable to successfully link X Toolkit library (-lXt) with
16070 test program.  You will have to check and add the proper libraries by hand
16071 to makefile." >&5
16072 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
16073 test program.  You will have to check and add the proper libraries by hand
16074 to makefile." >&2;}
16075 fi
16076
16077 cf_x_athena_root=$cf_x_athena
16078 cf_x_athena_inc=""
16079
16080 for cf_path in default \
16081         /usr/contrib/X11R6 \
16082         /usr/contrib/X11R5 \
16083         /usr/lib/X11R5 \
16084         /usr/local
16085 do
16086         if test -z "$cf_x_athena_inc" ; then
16087
16088 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
16089 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
16090 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
16091 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
16092 for cf_X_CFLAGS in $X_CFLAGS
16093 do
16094         case "x$cf_X_CFLAGS" in
16095         x-[IUD]*)
16096                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
16097                 ;;
16098         *)
16099                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
16100                 ;;
16101         esac
16102 done
16103
16104                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
16105                 if test "$cf_path" != default ; then
16106
16107         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16108         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
16109
16110                         echo "$as_me:16110: checking for $cf_test in $cf_path" >&5
16111 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
16112                 else
16113                         echo "$as_me:16113: checking for $cf_test" >&5
16114 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
16115                 fi
16116                 cat >"conftest.$ac_ext" <<_ACEOF
16117 #line 16117 "configure"
16118 #include "confdefs.h"
16119
16120 #include <X11/Intrinsic.h>
16121 #include <$cf_test>
16122 int
16123 main (void)
16124 {
16125
16126   ;
16127   return 0;
16128 }
16129 _ACEOF
16130 rm -f "conftest.$ac_objext"
16131 if { (eval echo "$as_me:16131: \"$ac_compile\"") >&5
16132   (eval $ac_compile) 2>&5
16133   ac_status=$?
16134   echo "$as_me:16134: \$? = $ac_status" >&5
16135   (exit "$ac_status"); } &&
16136          { ac_try='test -s "conftest.$ac_objext"'
16137   { (eval echo "$as_me:16137: \"$ac_try\"") >&5
16138   (eval $ac_try) 2>&5
16139   ac_status=$?
16140   echo "$as_me:16140: \$? = $ac_status" >&5
16141   (exit "$ac_status"); }; }; then
16142   cf_result=yes
16143 else
16144   echo "$as_me: failed program was:" >&5
16145 cat "conftest.$ac_ext" >&5
16146 cf_result=no
16147 fi
16148 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16149                 echo "$as_me:16149: result: $cf_result" >&5
16150 echo "${ECHO_T}$cf_result" >&6
16151
16152 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
16153 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
16154 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
16155
16156                 if test "$cf_result" = yes ; then
16157                         test "$cf_path"  = default && cf_x_athena_inc=default
16158                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
16159                         break
16160                 fi
16161         fi
16162 done
16163
16164 if test -z "$cf_x_athena_inc" ; then
16165         { echo "$as_me:16165: WARNING: Unable to find Athena header files" >&5
16166 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
16167 elif test "$cf_x_athena_inc" != default ; then
16168
16169         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16170         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
16171
16172 fi
16173
16174 cf_x_athena_root=$cf_x_athena
16175 cf_x_athena_lib=""
16176
16177 for cf_path in default \
16178         /usr/contrib/X11R6 \
16179         /usr/contrib/X11R5 \
16180         /usr/lib/X11R5 \
16181         /usr/local
16182 do
16183         for cf_lib in \
16184                 ${cf_x_athena_root} \
16185                 ${cf_x_athena_root}7 \
16186                 ${cf_x_athena_root}6
16187         do
16188         for cf_libs in \
16189                 "-l$cf_lib -lXmu" \
16190                 "-l$cf_lib -lXpm -lXmu" \
16191                 "-l${cf_lib}_s -lXmu_s"
16192         do
16193                 test -n "$cf_x_athena_lib" && break
16194
16195 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
16196 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
16197 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
16198 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
16199 for cf_X_CFLAGS in $X_CFLAGS
16200 do
16201         case "x$cf_X_CFLAGS" in
16202         x-[IUD]*)
16203                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
16204                 ;;
16205         *)
16206                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
16207                 ;;
16208         esac
16209 done
16210
16211                 cf_test=XawSimpleMenuAddGlobalActions
16212                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
16213
16214 cf_add_libs="$LIBS"
16215 # reverse order
16216 cf_add_0lib=
16217 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16218 # filter duplicates
16219 for cf_add_1lib in $cf_add_0lib; do
16220         for cf_add_2lib in $cf_add_libs; do
16221                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16222                         cf_add_1lib=
16223                         break
16224                 fi
16225         done
16226         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16227 done
16228 LIBS="$cf_add_libs"
16229
16230                 echo "$as_me:16230: checking for $cf_test in $cf_libs" >&5
16231 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
16232                 cat >"conftest.$ac_ext" <<_ACEOF
16233 #line 16233 "configure"
16234 #include "confdefs.h"
16235
16236 $ac_includes_default
16237 #include <X11/Intrinsic.h>
16238 #include <X11/$cf_x_athena_root/SimpleMenu.h>
16239
16240 int
16241 main (void)
16242 {
16243
16244 $cf_test((XtAppContext) 0)
16245   ;
16246   return 0;
16247 }
16248 _ACEOF
16249 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16250 if { (eval echo "$as_me:16250: \"$ac_link\"") >&5
16251   (eval $ac_link) 2>&5
16252   ac_status=$?
16253   echo "$as_me:16253: \$? = $ac_status" >&5
16254   (exit "$ac_status"); } &&
16255          { ac_try='test -s "conftest$ac_exeext"'
16256   { (eval echo "$as_me:16256: \"$ac_try\"") >&5
16257   (eval $ac_try) 2>&5
16258   ac_status=$?
16259   echo "$as_me:16259: \$? = $ac_status" >&5
16260   (exit "$ac_status"); }; }; then
16261   cf_result=yes
16262 else
16263   echo "$as_me: failed program was:" >&5
16264 cat "conftest.$ac_ext" >&5
16265 cf_result=no
16266 fi
16267 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16268                 echo "$as_me:16268: result: $cf_result" >&5
16269 echo "${ECHO_T}$cf_result" >&6
16270
16271 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
16272 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
16273 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
16274
16275                 if test "$cf_result" = yes ; then
16276                         cf_x_athena_lib="$cf_libs"
16277                         break
16278                 fi
16279         done # cf_libs
16280                 test -n "$cf_x_athena_lib" && break
16281         done # cf_lib
16282 done
16283
16284 if test -z "$cf_x_athena_lib" ; then
16285         { { echo "$as_me:16285: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
16286 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
16287    { (exit 1); exit 1; }; }
16288 fi
16289
16290 cf_add_libs="$LIBS"
16291 # reverse order
16292 cf_add_0lib=
16293 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16294 # filter duplicates
16295 for cf_add_1lib in $cf_add_0lib; do
16296         for cf_add_2lib in $cf_add_libs; do
16297                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16298                         cf_add_1lib=
16299                         break
16300                 fi
16301         done
16302         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16303 done
16304 LIBS="$cf_add_libs"
16305
16306 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16307
16308 cat >>confdefs.h <<EOF
16309 #define $cf_x_athena_LIBS 1
16310 EOF
16311
16312 fi
16313
16314 if test -n "$ac_tool_prefix"; then
16315   for ac_prog in xcurses-config
16316   do
16317     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
16318 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
16319 echo "$as_me:16319: checking for $ac_word" >&5
16320 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16321 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
16322   echo $ECHO_N "(cached) $ECHO_C" >&6
16323 else
16324   if test -n "$XCURSES_CONFIG"; then
16325   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
16326 else
16327   ac_save_IFS=$IFS; IFS=$ac_path_separator
16328 ac_dummy="$PATH"
16329 for ac_dir in $ac_dummy; do
16330   IFS=$ac_save_IFS
16331   test -z "$ac_dir" && ac_dir=.
16332   $as_executable_p "$ac_dir/$ac_word" || continue
16333 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
16334 echo "$as_me:16334: found $ac_dir/$ac_word" >&5
16335 break
16336 done
16337
16338 fi
16339 fi
16340 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
16341 if test -n "$XCURSES_CONFIG"; then
16342   echo "$as_me:16342: result: $XCURSES_CONFIG" >&5
16343 echo "${ECHO_T}$XCURSES_CONFIG" >&6
16344 else
16345   echo "$as_me:16345: result: no" >&5
16346 echo "${ECHO_T}no" >&6
16347 fi
16348
16349     test -n "$XCURSES_CONFIG" && break
16350   done
16351 fi
16352 if test -z "$XCURSES_CONFIG"; then
16353   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
16354   for ac_prog in xcurses-config
16355 do
16356   # Extract the first word of "$ac_prog", so it can be a program name with args.
16357 set dummy $ac_prog; ac_word=$2
16358 echo "$as_me:16358: checking for $ac_word" >&5
16359 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16360 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
16361   echo $ECHO_N "(cached) $ECHO_C" >&6
16362 else
16363   if test -n "$ac_ct_XCURSES_CONFIG"; then
16364   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
16365 else
16366   ac_save_IFS=$IFS; IFS=$ac_path_separator
16367 ac_dummy="$PATH"
16368 for ac_dir in $ac_dummy; do
16369   IFS=$ac_save_IFS
16370   test -z "$ac_dir" && ac_dir=.
16371   $as_executable_p "$ac_dir/$ac_word" || continue
16372 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
16373 echo "$as_me:16373: found $ac_dir/$ac_word" >&5
16374 break
16375 done
16376
16377 fi
16378 fi
16379 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
16380 if test -n "$ac_ct_XCURSES_CONFIG"; then
16381   echo "$as_me:16381: result: $ac_ct_XCURSES_CONFIG" >&5
16382 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
16383 else
16384   echo "$as_me:16384: result: no" >&5
16385 echo "${ECHO_T}no" >&6
16386 fi
16387
16388   test -n "$ac_ct_XCURSES_CONFIG" && break
16389 done
16390 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
16391
16392   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
16393 fi
16394
16395 if test "$XCURSES_CONFIG" != none ; then
16396
16397 cf_fix_cppflags=no
16398 cf_new_cflags=
16399 cf_new_cppflags=
16400 cf_new_extra_cppflags=
16401
16402 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
16403 do
16404 case "$cf_fix_cppflags" in
16405 (no)
16406         case "$cf_add_cflags" in
16407         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16408                 case "$cf_add_cflags" in
16409                 (-D*)
16410                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16411
16412                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16413                                 && test -z "${cf_tst_cflags}" \
16414                                 && cf_fix_cppflags=yes
16415
16416                         if test "$cf_fix_cppflags" = yes ; 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                         elif test "${cf_tst_cflags}" = "\"'" ; then
16423
16424         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16425         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16426
16427                                 continue
16428                         fi
16429                         ;;
16430                 esac
16431                 case "$CPPFLAGS" in
16432                 (*$cf_add_cflags)
16433                         ;;
16434                 (*)
16435                         case "$cf_add_cflags" in
16436                         (-D*)
16437                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16438
16439 CPPFLAGS=`echo "$CPPFLAGS" | \
16440         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16441                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16442
16443                                 ;;
16444                         esac
16445
16446         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16447         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16448
16449                         ;;
16450                 esac
16451                 ;;
16452         (*)
16453
16454         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16455         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16456
16457                 ;;
16458         esac
16459         ;;
16460 (yes)
16461
16462         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16463         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16464
16465         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16466
16467         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16468                 && test -z "${cf_tst_cflags}" \
16469                 && cf_fix_cppflags=no
16470         ;;
16471 esac
16472 done
16473
16474 if test -n "$cf_new_cflags" ; then
16475
16476         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16477         CFLAGS="${CFLAGS}$cf_new_cflags"
16478
16479 fi
16480
16481 if test -n "$cf_new_cppflags" ; then
16482
16483         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16484         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16485
16486 fi
16487
16488 if test -n "$cf_new_extra_cppflags" ; then
16489
16490         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16491         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16492
16493 fi
16494
16495 cf_add_libs="$LIBS"
16496 # reverse order
16497 cf_add_0lib=
16498 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16499 # filter duplicates
16500 for cf_add_1lib in $cf_add_0lib; do
16501         for cf_add_2lib in $cf_add_libs; do
16502                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16503                         cf_add_1lib=
16504                         break
16505                 fi
16506         done
16507         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16508 done
16509 LIBS="$cf_add_libs"
16510
16511 cf_cv_lib_XCurses=yes
16512
16513 else
16514
16515 LDFLAGS="$LDFLAGS $X_LIBS"
16516
16517 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
16518
16519 echo "${as_me:-configure}:16519: testing checking additions to CFLAGS ..." 1>&5
16520
16521 cf_check_cflags="$CFLAGS"
16522 cf_check_cppflags="$CPPFLAGS"
16523
16524 cf_fix_cppflags=no
16525 cf_new_cflags=
16526 cf_new_cppflags=
16527 cf_new_extra_cppflags=
16528
16529 for cf_add_cflags in $X_CFLAGS
16530 do
16531 case "$cf_fix_cppflags" in
16532 (no)
16533         case "$cf_add_cflags" in
16534         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16535                 case "$cf_add_cflags" in
16536                 (-D*)
16537                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16538
16539                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16540                                 && test -z "${cf_tst_cflags}" \
16541                                 && cf_fix_cppflags=yes
16542
16543                         if test "$cf_fix_cppflags" = yes ; then
16544
16545         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16546         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16547
16548                                 continue
16549                         elif test "${cf_tst_cflags}" = "\"'" ; then
16550
16551         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16552         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16553
16554                                 continue
16555                         fi
16556                         ;;
16557                 esac
16558                 case "$CPPFLAGS" in
16559                 (*$cf_add_cflags)
16560                         ;;
16561                 (*)
16562                         case "$cf_add_cflags" in
16563                         (-D*)
16564                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16565
16566 CPPFLAGS=`echo "$CPPFLAGS" | \
16567         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16568                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16569
16570                                 ;;
16571                         esac
16572
16573         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16574         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16575
16576                         ;;
16577                 esac
16578                 ;;
16579         (*)
16580
16581         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16582         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16583
16584                 ;;
16585         esac
16586         ;;
16587 (yes)
16588
16589         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16590         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16591
16592         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16593
16594         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16595                 && test -z "${cf_tst_cflags}" \
16596                 && cf_fix_cppflags=no
16597         ;;
16598 esac
16599 done
16600
16601 if test -n "$cf_new_cflags" ; then
16602         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
16603
16604 echo "${as_me:-configure}:16604: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
16605
16606         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16607         CFLAGS="${CFLAGS}$cf_new_cflags"
16608
16609 fi
16610
16611 if test -n "$cf_new_cppflags" ; then
16612         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16613
16614 echo "${as_me:-configure}:16614: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
16615
16616         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16617         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16618
16619 fi
16620
16621 if test -n "$cf_new_extra_cppflags" ; then
16622         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16623
16624 echo "${as_me:-configure}:16624: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
16625
16626         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16627         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16628
16629 fi
16630
16631 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
16632 cat >"conftest.$ac_ext" <<_ACEOF
16633 #line 16633 "configure"
16634 #include "confdefs.h"
16635 #include <stdio.h>
16636 int
16637 main (void)
16638 {
16639 printf("Hello world");
16640   ;
16641   return 0;
16642 }
16643 _ACEOF
16644 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16645 if { (eval echo "$as_me:16645: \"$ac_link\"") >&5
16646   (eval $ac_link) 2>&5
16647   ac_status=$?
16648   echo "$as_me:16648: \$? = $ac_status" >&5
16649   (exit "$ac_status"); } &&
16650          { ac_try='test -s "conftest$ac_exeext"'
16651   { (eval echo "$as_me:16651: \"$ac_try\"") >&5
16652   (eval $ac_try) 2>&5
16653   ac_status=$?
16654   echo "$as_me:16654: \$? = $ac_status" >&5
16655   (exit "$ac_status"); }; }; then
16656   :
16657 else
16658   echo "$as_me: failed program was:" >&5
16659 cat "conftest.$ac_ext" >&5
16660 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16661
16662 echo "${as_me:-configure}:16662: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16663
16664          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16665                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16666
16667 echo "${as_me:-configure}:16667: testing but keeping change to \$CPPFLAGS ..." 1>&5
16668
16669          fi
16670          CFLAGS="$cf_check_cflags"
16671 fi
16672 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16673 fi
16674
16675 echo "$as_me:16675: checking for XOpenDisplay in -lX11" >&5
16676 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16677 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16678   echo $ECHO_N "(cached) $ECHO_C" >&6
16679 else
16680   ac_check_lib_save_LIBS=$LIBS
16681 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16682 cat >"conftest.$ac_ext" <<_ACEOF
16683 #line 16683 "configure"
16684 #include "confdefs.h"
16685
16686 /* Override any gcc2 internal prototype to avoid an error.  */
16687 #ifdef __cplusplus
16688 extern "C"
16689 #endif
16690 /* We use char because int might match the return type of a gcc2
16691    builtin and then its argument prototype would still apply.  */
16692 char XOpenDisplay ();
16693 int
16694 main (void)
16695 {
16696 XOpenDisplay ();
16697   ;
16698   return 0;
16699 }
16700 _ACEOF
16701 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16702 if { (eval echo "$as_me:16702: \"$ac_link\"") >&5
16703   (eval $ac_link) 2>&5
16704   ac_status=$?
16705   echo "$as_me:16705: \$? = $ac_status" >&5
16706   (exit "$ac_status"); } &&
16707          { ac_try='test -s "conftest$ac_exeext"'
16708   { (eval echo "$as_me:16708: \"$ac_try\"") >&5
16709   (eval $ac_try) 2>&5
16710   ac_status=$?
16711   echo "$as_me:16711: \$? = $ac_status" >&5
16712   (exit "$ac_status"); }; }; then
16713   ac_cv_lib_X11_XOpenDisplay=yes
16714 else
16715   echo "$as_me: failed program was:" >&5
16716 cat "conftest.$ac_ext" >&5
16717 ac_cv_lib_X11_XOpenDisplay=no
16718 fi
16719 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16720 LIBS=$ac_check_lib_save_LIBS
16721 fi
16722 echo "$as_me:16722: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16723 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16724 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16725
16726 cf_add_libs="$LIBS"
16727 # reverse order
16728 cf_add_0lib=
16729 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16730 # filter duplicates
16731 for cf_add_1lib in $cf_add_0lib; do
16732         for cf_add_2lib in $cf_add_libs; do
16733                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16734                         cf_add_1lib=
16735                         break
16736                 fi
16737         done
16738         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16739 done
16740 LIBS="$cf_add_libs"
16741
16742 fi
16743
16744 echo "$as_me:16744: checking for XCurses library" >&5
16745 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16746 if test "${cf_cv_lib_XCurses+set}" = set; then
16747   echo $ECHO_N "(cached) $ECHO_C" >&6
16748 else
16749
16750 cf_add_libs="$LIBS"
16751 # reverse order
16752 cf_add_0lib=
16753 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16754 # filter duplicates
16755 for cf_add_1lib in $cf_add_0lib; do
16756         for cf_add_2lib in $cf_add_libs; do
16757                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16758                         cf_add_1lib=
16759                         break
16760                 fi
16761         done
16762         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16763 done
16764 LIBS="$cf_add_libs"
16765
16766 cat >"conftest.$ac_ext" <<_ACEOF
16767 #line 16767 "configure"
16768 #include "confdefs.h"
16769
16770 #include <xcurses.h>
16771 char *XCursesProgramName = "test";
16772
16773 int
16774 main (void)
16775 {
16776 XCursesExit();
16777   ;
16778   return 0;
16779 }
16780 _ACEOF
16781 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16782 if { (eval echo "$as_me:16782: \"$ac_link\"") >&5
16783   (eval $ac_link) 2>&5
16784   ac_status=$?
16785   echo "$as_me:16785: \$? = $ac_status" >&5
16786   (exit "$ac_status"); } &&
16787          { ac_try='test -s "conftest$ac_exeext"'
16788   { (eval echo "$as_me:16788: \"$ac_try\"") >&5
16789   (eval $ac_try) 2>&5
16790   ac_status=$?
16791   echo "$as_me:16791: \$? = $ac_status" >&5
16792   (exit "$ac_status"); }; }; then
16793   cf_cv_lib_XCurses=yes
16794 else
16795   echo "$as_me: failed program was:" >&5
16796 cat "conftest.$ac_ext" >&5
16797 cf_cv_lib_XCurses=no
16798 fi
16799 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16800
16801 fi
16802 echo "$as_me:16802: result: $cf_cv_lib_XCurses" >&5
16803 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16804
16805 fi
16806
16807 if test "$cf_cv_lib_XCurses" = yes ; then
16808
16809 cat >>confdefs.h <<\EOF
16810 #define UNIX 1
16811 EOF
16812
16813 cat >>confdefs.h <<\EOF
16814 #define XCURSES 1
16815 EOF
16816
16817         echo "$as_me:16817: checking for xcurses.h" >&5
16818 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16819 if test "${ac_cv_header_xcurses_h+set}" = set; then
16820   echo $ECHO_N "(cached) $ECHO_C" >&6
16821 else
16822   cat >"conftest.$ac_ext" <<_ACEOF
16823 #line 16823 "configure"
16824 #include "confdefs.h"
16825 #include <xcurses.h>
16826 _ACEOF
16827 if { (eval echo "$as_me:16827: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16828   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16829   ac_status=$?
16830   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16831   rm -f conftest.er1
16832   cat conftest.err >&5
16833   echo "$as_me:16833: \$? = $ac_status" >&5
16834   (exit "$ac_status"); } >/dev/null; then
16835   if test -s conftest.err; then
16836     ac_cpp_err=$ac_c_preproc_warn_flag
16837   else
16838     ac_cpp_err=
16839   fi
16840 else
16841   ac_cpp_err=yes
16842 fi
16843 if test -z "$ac_cpp_err"; then
16844   ac_cv_header_xcurses_h=yes
16845 else
16846   echo "$as_me: failed program was:" >&5
16847   cat "conftest.$ac_ext" >&5
16848   ac_cv_header_xcurses_h=no
16849 fi
16850 rm -f conftest.err "conftest.$ac_ext"
16851 fi
16852 echo "$as_me:16852: result: $ac_cv_header_xcurses_h" >&5
16853 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16854 if test "$ac_cv_header_xcurses_h" = yes; then
16855
16856 cat >>confdefs.h <<\EOF
16857 #define HAVE_XCURSES 1
16858 EOF
16859
16860 fi
16861
16862 else
16863         { { echo "$as_me:16863: error: Cannot link with XCurses" >&5
16864 echo "$as_me: error: Cannot link with XCurses" >&2;}
16865    { (exit 1); exit 1; }; }
16866 fi
16867
16868         ;;
16869 (*)
16870         { { echo "$as_me:16870: error: unexpected screen-value: $cf_cv_screen" >&5
16871 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16872    { (exit 1); exit 1; }; }
16873         ;;
16874 esac
16875
16876 : ${cf_nculib_root:=$cf_cv_screen}
16877 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16878 echo "$as_me:16878: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16879 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16880 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16881   echo $ECHO_N "(cached) $ECHO_C" >&6
16882 else
16883   ac_check_lib_save_LIBS=$LIBS
16884 LIBS="-l$cf_nculib_root  $LIBS"
16885 cat >"conftest.$ac_ext" <<_ACEOF
16886 #line 16886 "configure"
16887 #include "confdefs.h"
16888
16889 /* Override any gcc2 internal prototype to avoid an error.  */
16890 #ifdef __cplusplus
16891 extern "C"
16892 #endif
16893 /* We use char because int might match the return type of a gcc2
16894    builtin and then its argument prototype would still apply.  */
16895 char _nc_init_pthreads ();
16896 int
16897 main (void)
16898 {
16899 _nc_init_pthreads ();
16900   ;
16901   return 0;
16902 }
16903 _ACEOF
16904 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16905 if { (eval echo "$as_me:16905: \"$ac_link\"") >&5
16906   (eval $ac_link) 2>&5
16907   ac_status=$?
16908   echo "$as_me:16908: \$? = $ac_status" >&5
16909   (exit "$ac_status"); } &&
16910          { ac_try='test -s "conftest$ac_exeext"'
16911   { (eval echo "$as_me:16911: \"$ac_try\"") >&5
16912   (eval $ac_try) 2>&5
16913   ac_status=$?
16914   echo "$as_me:16914: \$? = $ac_status" >&5
16915   (exit "$ac_status"); }; }; then
16916   eval "$as_ac_Lib=yes"
16917 else
16918   echo "$as_me: failed program was:" >&5
16919 cat "conftest.$ac_ext" >&5
16920 eval "$as_ac_Lib=no"
16921 fi
16922 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16923 LIBS=$ac_check_lib_save_LIBS
16924 fi
16925 echo "$as_me:16925: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16926 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16927 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16928   cf_cv_ncurses_pthreads=yes
16929 else
16930   cf_cv_ncurses_pthreads=no
16931 fi
16932
16933 if test "$cf_cv_ncurses_pthreads" = yes
16934 then
16935
16936 cf_add_libs="$LIBS"
16937 # reverse order
16938 cf_add_0lib=
16939 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16940 # filter duplicates
16941 for cf_add_1lib in $cf_add_0lib; do
16942         for cf_add_2lib in $cf_add_libs; do
16943                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16944                         cf_add_1lib=
16945                         break
16946                 fi
16947         done
16948         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16949 done
16950 LIBS="$cf_add_libs"
16951
16952 fi
16953
16954 case $cf_cv_screen in
16955 (ncurses*)
16956         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16957         ;;
16958 esac
16959
16960 echo "$as_me:16960: checking for X11 rgb file" >&5
16961 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16962
16963 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16964 if test "${with_x11_rgb+set}" = set; then
16965   withval="$with_x11_rgb"
16966   RGB_PATH=$withval
16967 else
16968   RGB_PATH=auto
16969 fi;
16970
16971 if test "x$RGB_PATH" = xauto
16972 then
16973         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16974         for cf_path in \
16975                 /opt/local/share/X11/rgb.txt \
16976                 /opt/X11/share/X11/rgb.txt \
16977                 /usr/share/X11/rgb.txt \
16978                 /usr/X11/share/X11/rgb.txt \
16979                 /usr/X11/lib/X11/rgb.txt \
16980                 /usr/lib/X11/rgb.txt \
16981                 /etc/X11/rgb.txt \
16982                 /usr/pkg/lib/X11/rgb.txt \
16983                 /usr/X11R7/lib/X11/rgb.txt \
16984                 /usr/X11R6/lib/X11/rgb.txt \
16985                 /usr/X11R5/lib/X11/rgb.txt \
16986                 /usr/X11R4/lib/X11/rgb.txt \
16987                 /usr/local/lib/X11/rgb.txt \
16988                 /usr/local/share/X11/rgb.txt \
16989                 /usr/lib64/X11/rgb.txt
16990         do
16991                 if test -f "$cf_path" ; then
16992                         RGB_PATH="$cf_path"
16993                         break
16994                 fi
16995         done
16996 else
16997         cf_path=$RGB_PATH
16998
16999 if test "x$prefix" != xNONE; then
17000         cf_path_syntax="$prefix"
17001 else
17002         cf_path_syntax="$ac_default_prefix"
17003 fi
17004
17005 case ".$cf_path" in
17006 (.\$\(*\)*|.\'*\'*)
17007         ;;
17008 (..|./*|.\\*)
17009         ;;
17010 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17011         ;;
17012 (.\$\{*prefix\}*|.\$\{*dir\}*)
17013         eval cf_path="$cf_path"
17014         case ".$cf_path" in
17015         (.NONE/*)
17016                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
17017                 ;;
17018         esac
17019         ;;
17020 (.no|.NONE/*)
17021         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
17022         ;;
17023 (*)
17024         { { echo "$as_me:17024: error: expected a pathname, not \"$cf_path\"" >&5
17025 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
17026    { (exit 1); exit 1; }; }
17027         ;;
17028 esac
17029
17030 fi
17031
17032 echo "$as_me:17032: result: $RGB_PATH" >&5
17033 echo "${ECHO_T}$RGB_PATH" >&6
17034
17035 cat >>confdefs.h <<EOF
17036 #define RGB_PATH "$cf_path"
17037 EOF
17038
17039 no_x11_rgb=
17040 if test "$RGB_PATH" = no
17041 then
17042         no_x11_rgb="#"
17043 fi
17044
17045 cf_curses_headers=
17046
17047 case $cf_cv_screen in
17048 (pdcurses)
17049         cf_default_panel=no
17050         cf_default_form=no
17051         cf_default_menu=no
17052         cf_default_tinfo=no
17053         ;;
17054 (xcurses|bsdcurses)
17055         cf_default_panel=no
17056         cf_default_form=no
17057         cf_default_menu=no
17058         cf_default_tinfo=yes
17059         ;;
17060 (*)
17061         cf_default_panel=yes
17062         cf_default_form=yes
17063         cf_default_menu=yes
17064         cf_default_tinfo=yes
17065         case $cf_cv_screen in
17066         (ncurses*)
17067                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
17068                 ;;
17069         esac
17070         ;;
17071 esac
17072
17073 echo "$as_me:17073: checking for desired basename for form library" >&5
17074 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
17075
17076 # Check whether --with-form-libname or --without-form-libname was given.
17077 if test "${with_form_libname+set}" = set; then
17078   withval="$with_form_libname"
17079   with_lib_basename=$withval
17080 else
17081   with_lib_basename=form
17082 fi;
17083 FORM_NAME="$with_lib_basename"
17084
17085 case "x$FORM_NAME" in
17086 (x|xno|xnone|xyes)
17087         FORM_NAME=form
17088         ;;
17089 (*)
17090         ;;
17091 esac
17092
17093 echo "$as_me:17093: result: $FORM_NAME" >&5
17094 echo "${ECHO_T}$FORM_NAME" >&6
17095
17096 echo "$as_me:17096: checking for desired basename for menu library" >&5
17097 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
17098
17099 # Check whether --with-menu-libname or --without-menu-libname was given.
17100 if test "${with_menu_libname+set}" = set; then
17101   withval="$with_menu_libname"
17102   with_lib_basename=$withval
17103 else
17104   with_lib_basename=menu
17105 fi;
17106 MENU_NAME="$with_lib_basename"
17107
17108 case "x$MENU_NAME" in
17109 (x|xno|xnone|xyes)
17110         MENU_NAME=menu
17111         ;;
17112 (*)
17113         ;;
17114 esac
17115
17116 echo "$as_me:17116: result: $MENU_NAME" >&5
17117 echo "${ECHO_T}$MENU_NAME" >&6
17118
17119 echo "$as_me:17119: checking for desired basename for panel library" >&5
17120 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
17121
17122 # Check whether --with-panel-libname or --without-panel-libname was given.
17123 if test "${with_panel_libname+set}" = set; then
17124   withval="$with_panel_libname"
17125   with_lib_basename=$withval
17126 else
17127   with_lib_basename=panel
17128 fi;
17129 PANEL_NAME="$with_lib_basename"
17130
17131 case "x$PANEL_NAME" in
17132 (x|xno|xnone|xyes)
17133         PANEL_NAME=panel
17134         ;;
17135 (*)
17136         ;;
17137 esac
17138
17139 echo "$as_me:17139: result: $PANEL_NAME" >&5
17140 echo "${ECHO_T}$PANEL_NAME" >&6
17141
17142 echo "$as_me:17142: checking if you want to check for panel functions" >&5
17143 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
17144
17145 # Check whether --enable-panel or --disable-panel was given.
17146 if test "${enable_panel+set}" = set; then
17147   enableval="$enable_panel"
17148   test "$enableval" != no && enableval=yes
17149         if test "$enableval" != "yes" ; then
17150     cf_enable_panel=no
17151         else
17152                 cf_enable_panel=$cf_default_panel
17153         fi
17154 else
17155   enableval=yes
17156         cf_enable_panel=$cf_default_panel
17157
17158 fi;
17159 echo "$as_me:17159: result: $cf_enable_panel" >&5
17160 echo "${ECHO_T}$cf_enable_panel" >&6
17161 if test $cf_enable_panel = yes
17162 then
17163
17164 cf_have_curses_lib=no
17165
17166 : ${NCURSES_CONFIG_PKG:=none}
17167 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17168         :
17169 elif test "x${PKG_CONFIG:=none}" != xnone; then
17170         echo "$as_me:17170: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
17171 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17172         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
17173                 echo "$as_me:17173: result: yes" >&5
17174 echo "${ECHO_T}yes" >&6
17175
17176                 echo "$as_me:17176: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
17177 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17178
17179                 cf_save_CFLAGS="$CFLAGS"
17180                 cf_save_CPPFLAGS="$CPPFLAGS"
17181                 cf_save_LIBS="$LIBS"
17182
17183 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
17184 do
17185         case "x$cf_add_cflags" in
17186         (x-[DU]*)
17187
17188 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17189 while true
17190 do
17191         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17192         test "$CFLAGS" != "$cf_old_cflag" || break
17193
17194         CFLAGS="$cf_old_cflag"
17195 done
17196
17197 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17198 while true
17199 do
17200         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17201         test "$CPPFLAGS" != "$cf_old_cflag" || break
17202
17203         CPPFLAGS="$cf_old_cflag"
17204 done
17205
17206                 ;;
17207         esac
17208
17209 cf_fix_cppflags=no
17210 cf_new_cflags=
17211 cf_new_cppflags=
17212 cf_new_extra_cppflags=
17213
17214 for cf_add_cflags in $cf_add_cflags
17215 do
17216 case "$cf_fix_cppflags" in
17217 (no)
17218         case "$cf_add_cflags" in
17219         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17220                 case "$cf_add_cflags" in
17221                 (-D*)
17222                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17223
17224                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17225                                 && test -z "${cf_tst_cflags}" \
17226                                 && cf_fix_cppflags=yes
17227
17228                         if test "$cf_fix_cppflags" = yes ; then
17229
17230         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17231         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17232
17233                                 continue
17234                         elif test "${cf_tst_cflags}" = "\"'" ; then
17235
17236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17238
17239                                 continue
17240                         fi
17241                         ;;
17242                 esac
17243                 case "$CPPFLAGS" in
17244                 (*$cf_add_cflags)
17245                         ;;
17246                 (*)
17247                         case "$cf_add_cflags" in
17248                         (-D*)
17249                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17250
17251 CPPFLAGS=`echo "$CPPFLAGS" | \
17252         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17253                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17254
17255                                 ;;
17256                         esac
17257
17258         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17259         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17260
17261                         ;;
17262                 esac
17263                 ;;
17264         (*)
17265
17266         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17267         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17268
17269                 ;;
17270         esac
17271         ;;
17272 (yes)
17273
17274         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17275         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17276
17277         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17278
17279         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17280                 && test -z "${cf_tst_cflags}" \
17281                 && cf_fix_cppflags=no
17282         ;;
17283 esac
17284 done
17285
17286 if test -n "$cf_new_cflags" ; then
17287
17288         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17289         CFLAGS="${CFLAGS}$cf_new_cflags"
17290
17291 fi
17292
17293 if test -n "$cf_new_cppflags" ; then
17294
17295         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17296         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17297
17298 fi
17299
17300 if test -n "$cf_new_extra_cppflags" ; then
17301
17302         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17303         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17304
17305 fi
17306
17307 done
17308
17309 cf_add_libs="$LIBS"
17310 # reverse order
17311 cf_add_0lib=
17312 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17313 # filter duplicates
17314 for cf_add_1lib in $cf_add_0lib; do
17315         for cf_add_2lib in $cf_add_libs; do
17316                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17317                         cf_add_1lib=
17318                         break
17319                 fi
17320         done
17321         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17322 done
17323 LIBS="$cf_add_libs"
17324
17325                 cat >"conftest.$ac_ext" <<_ACEOF
17326 #line 17326 "configure"
17327 #include "confdefs.h"
17328 #include <$PANEL_NAME.h>
17329 int
17330 main (void)
17331 {
17332 (void) new_panel ( 0 );
17333   ;
17334   return 0;
17335 }
17336 _ACEOF
17337 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17338 if { (eval echo "$as_me:17338: \"$ac_link\"") >&5
17339   (eval $ac_link) 2>&5
17340   ac_status=$?
17341   echo "$as_me:17341: \$? = $ac_status" >&5
17342   (exit "$ac_status"); } &&
17343          { ac_try='test -s "conftest$ac_exeext"'
17344   { (eval echo "$as_me:17344: \"$ac_try\"") >&5
17345   (eval $ac_try) 2>&5
17346   ac_status=$?
17347   echo "$as_me:17347: \$? = $ac_status" >&5
17348   (exit "$ac_status"); }; }; then
17349   if test "$cross_compiling" = yes; then
17350   cf_have_curses_lib=maybe
17351 else
17352   cat >"conftest.$ac_ext" <<_ACEOF
17353 #line 17353 "configure"
17354 #include "confdefs.h"
17355 #include <$PANEL_NAME.h>
17356                                 int main(void)
17357                                 { (void) new_panel ( 0 ); return 0; }
17358 _ACEOF
17359 rm -f "conftest$ac_exeext"
17360 if { (eval echo "$as_me:17360: \"$ac_link\"") >&5
17361   (eval $ac_link) 2>&5
17362   ac_status=$?
17363   echo "$as_me:17363: \$? = $ac_status" >&5
17364   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17365   { (eval echo "$as_me:17365: \"$ac_try\"") >&5
17366   (eval $ac_try) 2>&5
17367   ac_status=$?
17368   echo "$as_me:17368: \$? = $ac_status" >&5
17369   (exit "$ac_status"); }; }; then
17370   cf_have_curses_lib=yes
17371 else
17372   echo "$as_me: program exited with status $ac_status" >&5
17373 echo "$as_me: failed program was:" >&5
17374 cat "conftest.$ac_ext" >&5
17375 cf_have_curses_lib=no
17376 fi
17377 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17378 fi
17379 else
17380   echo "$as_me: failed program was:" >&5
17381 cat "conftest.$ac_ext" >&5
17382 cf_have_curses_lib=no
17383 fi
17384 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17385                 echo "$as_me:17385: result: $cf_have_curses_lib" >&5
17386 echo "${ECHO_T}$cf_have_curses_lib" >&6
17387                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17388                 if test "$cf_have_curses_lib" = "yes"
17389                 then
17390
17391 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17392
17393                         cat >>confdefs.h <<EOF
17394 #define $cf_upper 1
17395 EOF
17396
17397                 else
17398                         CFLAGS="$cf_save_CFLAGS"
17399                         CPPFLAGS="$cf_save_CPPFLAGS"
17400                         LIBS="$cf_save_LIBS"
17401                 fi
17402         fi
17403 fi
17404 if test "$cf_have_curses_lib" = no; then
17405         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
17406 echo "$as_me:17406: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
17407 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17408 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17409   echo $ECHO_N "(cached) $ECHO_C" >&6
17410 else
17411   ac_check_lib_save_LIBS=$LIBS
17412 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
17413 cat >"conftest.$ac_ext" <<_ACEOF
17414 #line 17414 "configure"
17415 #include "confdefs.h"
17416
17417 /* Override any gcc2 internal prototype to avoid an error.  */
17418 #ifdef __cplusplus
17419 extern "C"
17420 #endif
17421 /* We use char because int might match the return type of a gcc2
17422    builtin and then its argument prototype would still apply.  */
17423 char new_panel ();
17424 int
17425 main (void)
17426 {
17427 new_panel ();
17428   ;
17429   return 0;
17430 }
17431 _ACEOF
17432 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17433 if { (eval echo "$as_me:17433: \"$ac_link\"") >&5
17434   (eval $ac_link) 2>&5
17435   ac_status=$?
17436   echo "$as_me:17436: \$? = $ac_status" >&5
17437   (exit "$ac_status"); } &&
17438          { ac_try='test -s "conftest$ac_exeext"'
17439   { (eval echo "$as_me:17439: \"$ac_try\"") >&5
17440   (eval $ac_try) 2>&5
17441   ac_status=$?
17442   echo "$as_me:17442: \$? = $ac_status" >&5
17443   (exit "$ac_status"); }; }; then
17444   eval "$as_ac_Lib=yes"
17445 else
17446   echo "$as_me: failed program was:" >&5
17447 cat "conftest.$ac_ext" >&5
17448 eval "$as_ac_Lib=no"
17449 fi
17450 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17451 LIBS=$ac_check_lib_save_LIBS
17452 fi
17453 echo "$as_me:17453: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17454 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17455 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17456
17457 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17458
17459 cf_add_libs="$LIBS"
17460 # reverse order
17461 cf_add_0lib=
17462 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17463 # filter duplicates
17464 for cf_add_1lib in $cf_add_0lib; do
17465         for cf_add_2lib in $cf_add_libs; do
17466                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17467                         cf_add_1lib=
17468                         break
17469                 fi
17470         done
17471         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17472 done
17473 LIBS="$cf_add_libs"
17474
17475                 cat >>confdefs.h <<EOF
17476 #define $cf_upper 1
17477 EOF
17478
17479 fi
17480
17481 fi
17482
17483         cf_curses_headers="$cf_curses_headers panel.h"
17484 fi
17485
17486 echo "$as_me:17486: checking if you want to check for menu functions" >&5
17487 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
17488
17489 # Check whether --enable-menu or --disable-menu was given.
17490 if test "${enable_menu+set}" = set; then
17491   enableval="$enable_menu"
17492   test "$enableval" != no && enableval=yes
17493         if test "$enableval" != "yes" ; then
17494     cf_enable_menu=no
17495         else
17496                 cf_enable_menu=$cf_default_menu
17497         fi
17498 else
17499   enableval=yes
17500         cf_enable_menu=$cf_default_menu
17501
17502 fi;
17503 echo "$as_me:17503: result: $cf_enable_menu" >&5
17504 echo "${ECHO_T}$cf_enable_menu" >&6
17505 if test $cf_enable_menu = yes
17506 then
17507         case $cf_cv_screen in
17508         (ncurses*)
17509                 ;;
17510         (curses*)
17511
17512 echo "$as_me:17512: checking for NetBSD menu.h" >&5
17513 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
17514 if test "${cf_cv_netbsd_menu_h+set}" = set; then
17515   echo $ECHO_N "(cached) $ECHO_C" >&6
17516 else
17517
17518 cat >"conftest.$ac_ext" <<_ACEOF
17519 #line 17519 "configure"
17520 #include "confdefs.h"
17521
17522 #include <${cf_cv_ncurses_header:-curses.h}>
17523 #include <menu.h>
17524
17525 int
17526 main (void)
17527 {
17528
17529         MENU *menu;
17530         int y = menu->max_item_width;
17531
17532   ;
17533   return 0;
17534 }
17535 _ACEOF
17536 rm -f "conftest.$ac_objext"
17537 if { (eval echo "$as_me:17537: \"$ac_compile\"") >&5
17538   (eval $ac_compile) 2>&5
17539   ac_status=$?
17540   echo "$as_me:17540: \$? = $ac_status" >&5
17541   (exit "$ac_status"); } &&
17542          { ac_try='test -s "conftest.$ac_objext"'
17543   { (eval echo "$as_me:17543: \"$ac_try\"") >&5
17544   (eval $ac_try) 2>&5
17545   ac_status=$?
17546   echo "$as_me:17546: \$? = $ac_status" >&5
17547   (exit "$ac_status"); }; }; then
17548   cf_cv_netbsd_menu_h=yes
17549
17550 else
17551   echo "$as_me: failed program was:" >&5
17552 cat "conftest.$ac_ext" >&5
17553 cf_cv_netbsd_menu_h=no
17554 fi
17555 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17556
17557 fi
17558 echo "$as_me:17558: result: $cf_cv_netbsd_menu_h" >&5
17559 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
17560
17561 test "$cf_cv_netbsd_menu_h" = yes &&
17562 cat >>confdefs.h <<\EOF
17563 #define HAVE_NETBSD_MENU_H 1
17564 EOF
17565
17566                 ;;
17567         esac
17568
17569 cf_have_curses_lib=no
17570
17571 : ${NCURSES_CONFIG_PKG:=none}
17572 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17573         :
17574 elif test "x${PKG_CONFIG:=none}" != xnone; then
17575         echo "$as_me:17575: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
17576 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17577         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
17578                 echo "$as_me:17578: result: yes" >&5
17579 echo "${ECHO_T}yes" >&6
17580
17581                 echo "$as_me:17581: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
17582 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17583
17584                 cf_save_CFLAGS="$CFLAGS"
17585                 cf_save_CPPFLAGS="$CPPFLAGS"
17586                 cf_save_LIBS="$LIBS"
17587
17588 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
17589 do
17590         case "x$cf_add_cflags" in
17591         (x-[DU]*)
17592
17593 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17594 while true
17595 do
17596         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17597         test "$CFLAGS" != "$cf_old_cflag" || break
17598
17599         CFLAGS="$cf_old_cflag"
17600 done
17601
17602 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17603 while true
17604 do
17605         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17606         test "$CPPFLAGS" != "$cf_old_cflag" || break
17607
17608         CPPFLAGS="$cf_old_cflag"
17609 done
17610
17611                 ;;
17612         esac
17613
17614 cf_fix_cppflags=no
17615 cf_new_cflags=
17616 cf_new_cppflags=
17617 cf_new_extra_cppflags=
17618
17619 for cf_add_cflags in $cf_add_cflags
17620 do
17621 case "$cf_fix_cppflags" in
17622 (no)
17623         case "$cf_add_cflags" in
17624         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17625                 case "$cf_add_cflags" in
17626                 (-D*)
17627                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17628
17629                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17630                                 && test -z "${cf_tst_cflags}" \
17631                                 && cf_fix_cppflags=yes
17632
17633                         if test "$cf_fix_cppflags" = yes ; then
17634
17635         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17636         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17637
17638                                 continue
17639                         elif test "${cf_tst_cflags}" = "\"'" ; then
17640
17641         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17642         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17643
17644                                 continue
17645                         fi
17646                         ;;
17647                 esac
17648                 case "$CPPFLAGS" in
17649                 (*$cf_add_cflags)
17650                         ;;
17651                 (*)
17652                         case "$cf_add_cflags" in
17653                         (-D*)
17654                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17655
17656 CPPFLAGS=`echo "$CPPFLAGS" | \
17657         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17658                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17659
17660                                 ;;
17661                         esac
17662
17663         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17664         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17665
17666                         ;;
17667                 esac
17668                 ;;
17669         (*)
17670
17671         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17672         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17673
17674                 ;;
17675         esac
17676         ;;
17677 (yes)
17678
17679         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17680         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17681
17682         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17683
17684         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17685                 && test -z "${cf_tst_cflags}" \
17686                 && cf_fix_cppflags=no
17687         ;;
17688 esac
17689 done
17690
17691 if test -n "$cf_new_cflags" ; then
17692
17693         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17694         CFLAGS="${CFLAGS}$cf_new_cflags"
17695
17696 fi
17697
17698 if test -n "$cf_new_cppflags" ; then
17699
17700         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17701         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17702
17703 fi
17704
17705 if test -n "$cf_new_extra_cppflags" ; then
17706
17707         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17708         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17709
17710 fi
17711
17712 done
17713
17714 cf_add_libs="$LIBS"
17715 # reverse order
17716 cf_add_0lib=
17717 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17718 # filter duplicates
17719 for cf_add_1lib in $cf_add_0lib; do
17720         for cf_add_2lib in $cf_add_libs; do
17721                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17722                         cf_add_1lib=
17723                         break
17724                 fi
17725         done
17726         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17727 done
17728 LIBS="$cf_add_libs"
17729
17730                 cat >"conftest.$ac_ext" <<_ACEOF
17731 #line 17731 "configure"
17732 #include "confdefs.h"
17733 #include <$MENU_NAME.h>
17734 int
17735 main (void)
17736 {
17737 (void) menu_driver ( 0,0 );
17738   ;
17739   return 0;
17740 }
17741 _ACEOF
17742 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17743 if { (eval echo "$as_me:17743: \"$ac_link\"") >&5
17744   (eval $ac_link) 2>&5
17745   ac_status=$?
17746   echo "$as_me:17746: \$? = $ac_status" >&5
17747   (exit "$ac_status"); } &&
17748          { ac_try='test -s "conftest$ac_exeext"'
17749   { (eval echo "$as_me:17749: \"$ac_try\"") >&5
17750   (eval $ac_try) 2>&5
17751   ac_status=$?
17752   echo "$as_me:17752: \$? = $ac_status" >&5
17753   (exit "$ac_status"); }; }; then
17754   if test "$cross_compiling" = yes; then
17755   cf_have_curses_lib=maybe
17756 else
17757   cat >"conftest.$ac_ext" <<_ACEOF
17758 #line 17758 "configure"
17759 #include "confdefs.h"
17760 #include <$MENU_NAME.h>
17761                                 int main(void)
17762                                 { (void) menu_driver ( 0,0 ); return 0; }
17763 _ACEOF
17764 rm -f "conftest$ac_exeext"
17765 if { (eval echo "$as_me:17765: \"$ac_link\"") >&5
17766   (eval $ac_link) 2>&5
17767   ac_status=$?
17768   echo "$as_me:17768: \$? = $ac_status" >&5
17769   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17770   { (eval echo "$as_me:17770: \"$ac_try\"") >&5
17771   (eval $ac_try) 2>&5
17772   ac_status=$?
17773   echo "$as_me:17773: \$? = $ac_status" >&5
17774   (exit "$ac_status"); }; }; then
17775   cf_have_curses_lib=yes
17776 else
17777   echo "$as_me: program exited with status $ac_status" >&5
17778 echo "$as_me: failed program was:" >&5
17779 cat "conftest.$ac_ext" >&5
17780 cf_have_curses_lib=no
17781 fi
17782 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17783 fi
17784 else
17785   echo "$as_me: failed program was:" >&5
17786 cat "conftest.$ac_ext" >&5
17787 cf_have_curses_lib=no
17788 fi
17789 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17790                 echo "$as_me:17790: result: $cf_have_curses_lib" >&5
17791 echo "${ECHO_T}$cf_have_curses_lib" >&6
17792                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17793                 if test "$cf_have_curses_lib" = "yes"
17794                 then
17795
17796 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17797
17798                         cat >>confdefs.h <<EOF
17799 #define $cf_upper 1
17800 EOF
17801
17802                 else
17803                         CFLAGS="$cf_save_CFLAGS"
17804                         CPPFLAGS="$cf_save_CPPFLAGS"
17805                         LIBS="$cf_save_LIBS"
17806                 fi
17807         fi
17808 fi
17809 if test "$cf_have_curses_lib" = no; then
17810         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17811 echo "$as_me:17811: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17812 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17813 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17814   echo $ECHO_N "(cached) $ECHO_C" >&6
17815 else
17816   ac_check_lib_save_LIBS=$LIBS
17817 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17818 cat >"conftest.$ac_ext" <<_ACEOF
17819 #line 17819 "configure"
17820 #include "confdefs.h"
17821
17822 /* Override any gcc2 internal prototype to avoid an error.  */
17823 #ifdef __cplusplus
17824 extern "C"
17825 #endif
17826 /* We use char because int might match the return type of a gcc2
17827    builtin and then its argument prototype would still apply.  */
17828 char menu_driver ();
17829 int
17830 main (void)
17831 {
17832 menu_driver ();
17833   ;
17834   return 0;
17835 }
17836 _ACEOF
17837 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17838 if { (eval echo "$as_me:17838: \"$ac_link\"") >&5
17839   (eval $ac_link) 2>&5
17840   ac_status=$?
17841   echo "$as_me:17841: \$? = $ac_status" >&5
17842   (exit "$ac_status"); } &&
17843          { ac_try='test -s "conftest$ac_exeext"'
17844   { (eval echo "$as_me:17844: \"$ac_try\"") >&5
17845   (eval $ac_try) 2>&5
17846   ac_status=$?
17847   echo "$as_me:17847: \$? = $ac_status" >&5
17848   (exit "$ac_status"); }; }; then
17849   eval "$as_ac_Lib=yes"
17850 else
17851   echo "$as_me: failed program was:" >&5
17852 cat "conftest.$ac_ext" >&5
17853 eval "$as_ac_Lib=no"
17854 fi
17855 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17856 LIBS=$ac_check_lib_save_LIBS
17857 fi
17858 echo "$as_me:17858: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17859 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17860 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17861
17862 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17863
17864 cf_add_libs="$LIBS"
17865 # reverse order
17866 cf_add_0lib=
17867 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17868 # filter duplicates
17869 for cf_add_1lib in $cf_add_0lib; do
17870         for cf_add_2lib in $cf_add_libs; do
17871                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17872                         cf_add_1lib=
17873                         break
17874                 fi
17875         done
17876         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17877 done
17878 LIBS="$cf_add_libs"
17879
17880                 cat >>confdefs.h <<EOF
17881 #define $cf_upper 1
17882 EOF
17883
17884 fi
17885
17886 fi
17887
17888         cf_curses_headers="$cf_curses_headers menu.h"
17889 fi
17890
17891 echo "$as_me:17891: checking if you want to check for form functions" >&5
17892 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17893
17894 # Check whether --enable-form or --disable-form was given.
17895 if test "${enable_form+set}" = set; then
17896   enableval="$enable_form"
17897   test "$enableval" != no && enableval=yes
17898         if test "$enableval" != "yes" ; then
17899     cf_enable_form=no
17900         else
17901                 cf_enable_form=$cf_default_form
17902         fi
17903 else
17904   enableval=yes
17905         cf_enable_form=$cf_default_form
17906
17907 fi;
17908 echo "$as_me:17908: result: $cf_enable_form" >&5
17909 echo "${ECHO_T}$cf_enable_form" >&6
17910 if test $cf_enable_form = yes
17911 then
17912         case $cf_cv_screen in
17913         (ncurses*)
17914                 ;;
17915         (curses*)
17916
17917 echo "$as_me:17917: checking for NetBSD form.h" >&5
17918 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17919 if test "${cf_cv_netbsd_form_h+set}" = set; then
17920   echo $ECHO_N "(cached) $ECHO_C" >&6
17921 else
17922
17923 cat >"conftest.$ac_ext" <<_ACEOF
17924 #line 17924 "configure"
17925 #include "confdefs.h"
17926
17927 #include <${cf_cv_ncurses_header:-curses.h}>
17928 #include <form.h>
17929
17930 int
17931 main (void)
17932 {
17933
17934         FORM *form;
17935         int y = current_field(form)->cursor_ypos;
17936         int x = current_field(form)->cursor_xpos;
17937
17938   ;
17939   return 0;
17940 }
17941 _ACEOF
17942 rm -f "conftest.$ac_objext"
17943 if { (eval echo "$as_me:17943: \"$ac_compile\"") >&5
17944   (eval $ac_compile) 2>&5
17945   ac_status=$?
17946   echo "$as_me:17946: \$? = $ac_status" >&5
17947   (exit "$ac_status"); } &&
17948          { ac_try='test -s "conftest.$ac_objext"'
17949   { (eval echo "$as_me:17949: \"$ac_try\"") >&5
17950   (eval $ac_try) 2>&5
17951   ac_status=$?
17952   echo "$as_me:17952: \$? = $ac_status" >&5
17953   (exit "$ac_status"); }; }; then
17954   cf_cv_netbsd_form_h=yes
17955
17956 else
17957   echo "$as_me: failed program was:" >&5
17958 cat "conftest.$ac_ext" >&5
17959 cf_cv_netbsd_form_h=no
17960 fi
17961 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17962
17963 fi
17964 echo "$as_me:17964: result: $cf_cv_netbsd_form_h" >&5
17965 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17966
17967 test "$cf_cv_netbsd_form_h" = yes &&
17968 cat >>confdefs.h <<\EOF
17969 #define HAVE_NETBSD_FORM_H 1
17970 EOF
17971
17972                 ;;
17973         esac
17974
17975 cf_have_curses_lib=no
17976
17977 : ${NCURSES_CONFIG_PKG:=none}
17978 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17979         :
17980 elif test "x${PKG_CONFIG:=none}" != xnone; then
17981         echo "$as_me:17981: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17982 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17983         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17984                 echo "$as_me:17984: result: yes" >&5
17985 echo "${ECHO_T}yes" >&6
17986
17987                 echo "$as_me:17987: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17988 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17989
17990                 cf_save_CFLAGS="$CFLAGS"
17991                 cf_save_CPPFLAGS="$CPPFLAGS"
17992                 cf_save_LIBS="$LIBS"
17993
17994 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17995 do
17996         case "x$cf_add_cflags" in
17997         (x-[DU]*)
17998
17999 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
18000 while true
18001 do
18002         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
18003         test "$CFLAGS" != "$cf_old_cflag" || break
18004
18005         CFLAGS="$cf_old_cflag"
18006 done
18007
18008 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
18009 while true
18010 do
18011         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
18012         test "$CPPFLAGS" != "$cf_old_cflag" || break
18013
18014         CPPFLAGS="$cf_old_cflag"
18015 done
18016
18017                 ;;
18018         esac
18019
18020 cf_fix_cppflags=no
18021 cf_new_cflags=
18022 cf_new_cppflags=
18023 cf_new_extra_cppflags=
18024
18025 for cf_add_cflags in $cf_add_cflags
18026 do
18027 case "$cf_fix_cppflags" in
18028 (no)
18029         case "$cf_add_cflags" in
18030         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18031                 case "$cf_add_cflags" in
18032                 (-D*)
18033                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18034
18035                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18036                                 && test -z "${cf_tst_cflags}" \
18037                                 && cf_fix_cppflags=yes
18038
18039                         if test "$cf_fix_cppflags" = yes ; then
18040
18041         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18042         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18043
18044                                 continue
18045                         elif test "${cf_tst_cflags}" = "\"'" ; then
18046
18047         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18048         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18049
18050                                 continue
18051                         fi
18052                         ;;
18053                 esac
18054                 case "$CPPFLAGS" in
18055                 (*$cf_add_cflags)
18056                         ;;
18057                 (*)
18058                         case "$cf_add_cflags" in
18059                         (-D*)
18060                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18061
18062 CPPFLAGS=`echo "$CPPFLAGS" | \
18063         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18064                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18065
18066                                 ;;
18067                         esac
18068
18069         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18070         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18071
18072                         ;;
18073                 esac
18074                 ;;
18075         (*)
18076
18077         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18078         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18079
18080                 ;;
18081         esac
18082         ;;
18083 (yes)
18084
18085         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18086         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18087
18088         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
18089
18090         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18091                 && test -z "${cf_tst_cflags}" \
18092                 && cf_fix_cppflags=no
18093         ;;
18094 esac
18095 done
18096
18097 if test -n "$cf_new_cflags" ; then
18098
18099         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18100         CFLAGS="${CFLAGS}$cf_new_cflags"
18101
18102 fi
18103
18104 if test -n "$cf_new_cppflags" ; then
18105
18106         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18107         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18108
18109 fi
18110
18111 if test -n "$cf_new_extra_cppflags" ; then
18112
18113         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18114         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18115
18116 fi
18117
18118 done
18119
18120 cf_add_libs="$LIBS"
18121 # reverse order
18122 cf_add_0lib=
18123 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18124 # filter duplicates
18125 for cf_add_1lib in $cf_add_0lib; do
18126         for cf_add_2lib in $cf_add_libs; do
18127                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18128                         cf_add_1lib=
18129                         break
18130                 fi
18131         done
18132         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18133 done
18134 LIBS="$cf_add_libs"
18135
18136                 cat >"conftest.$ac_ext" <<_ACEOF
18137 #line 18137 "configure"
18138 #include "confdefs.h"
18139 #include <$FORM_NAME.h>
18140 int
18141 main (void)
18142 {
18143 (void) form_driver ( 0,0 );
18144   ;
18145   return 0;
18146 }
18147 _ACEOF
18148 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18149 if { (eval echo "$as_me:18149: \"$ac_link\"") >&5
18150   (eval $ac_link) 2>&5
18151   ac_status=$?
18152   echo "$as_me:18152: \$? = $ac_status" >&5
18153   (exit "$ac_status"); } &&
18154          { ac_try='test -s "conftest$ac_exeext"'
18155   { (eval echo "$as_me:18155: \"$ac_try\"") >&5
18156   (eval $ac_try) 2>&5
18157   ac_status=$?
18158   echo "$as_me:18158: \$? = $ac_status" >&5
18159   (exit "$ac_status"); }; }; then
18160   if test "$cross_compiling" = yes; then
18161   cf_have_curses_lib=maybe
18162 else
18163   cat >"conftest.$ac_ext" <<_ACEOF
18164 #line 18164 "configure"
18165 #include "confdefs.h"
18166 #include <$FORM_NAME.h>
18167                                 int main(void)
18168                                 { (void) form_driver ( 0,0 ); return 0; }
18169 _ACEOF
18170 rm -f "conftest$ac_exeext"
18171 if { (eval echo "$as_me:18171: \"$ac_link\"") >&5
18172   (eval $ac_link) 2>&5
18173   ac_status=$?
18174   echo "$as_me:18174: \$? = $ac_status" >&5
18175   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
18176   { (eval echo "$as_me:18176: \"$ac_try\"") >&5
18177   (eval $ac_try) 2>&5
18178   ac_status=$?
18179   echo "$as_me:18179: \$? = $ac_status" >&5
18180   (exit "$ac_status"); }; }; then
18181   cf_have_curses_lib=yes
18182 else
18183   echo "$as_me: program exited with status $ac_status" >&5
18184 echo "$as_me: failed program was:" >&5
18185 cat "conftest.$ac_ext" >&5
18186 cf_have_curses_lib=no
18187 fi
18188 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
18189 fi
18190 else
18191   echo "$as_me: failed program was:" >&5
18192 cat "conftest.$ac_ext" >&5
18193 cf_have_curses_lib=no
18194 fi
18195 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18196                 echo "$as_me:18196: result: $cf_have_curses_lib" >&5
18197 echo "${ECHO_T}$cf_have_curses_lib" >&6
18198                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
18199                 if test "$cf_have_curses_lib" = "yes"
18200                 then
18201
18202 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18203
18204                         cat >>confdefs.h <<EOF
18205 #define $cf_upper 1
18206 EOF
18207
18208                 else
18209                         CFLAGS="$cf_save_CFLAGS"
18210                         CPPFLAGS="$cf_save_CPPFLAGS"
18211                         LIBS="$cf_save_LIBS"
18212                 fi
18213         fi
18214 fi
18215 if test "$cf_have_curses_lib" = no; then
18216         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
18217 echo "$as_me:18217: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
18218 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
18219 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
18220   echo $ECHO_N "(cached) $ECHO_C" >&6
18221 else
18222   ac_check_lib_save_LIBS=$LIBS
18223 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
18224 cat >"conftest.$ac_ext" <<_ACEOF
18225 #line 18225 "configure"
18226 #include "confdefs.h"
18227
18228 /* Override any gcc2 internal prototype to avoid an error.  */
18229 #ifdef __cplusplus
18230 extern "C"
18231 #endif
18232 /* We use char because int might match the return type of a gcc2
18233    builtin and then its argument prototype would still apply.  */
18234 char form_driver ();
18235 int
18236 main (void)
18237 {
18238 form_driver ();
18239   ;
18240   return 0;
18241 }
18242 _ACEOF
18243 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18244 if { (eval echo "$as_me:18244: \"$ac_link\"") >&5
18245   (eval $ac_link) 2>&5
18246   ac_status=$?
18247   echo "$as_me:18247: \$? = $ac_status" >&5
18248   (exit "$ac_status"); } &&
18249          { ac_try='test -s "conftest$ac_exeext"'
18250   { (eval echo "$as_me:18250: \"$ac_try\"") >&5
18251   (eval $ac_try) 2>&5
18252   ac_status=$?
18253   echo "$as_me:18253: \$? = $ac_status" >&5
18254   (exit "$ac_status"); }; }; then
18255   eval "$as_ac_Lib=yes"
18256 else
18257   echo "$as_me: failed program was:" >&5
18258 cat "conftest.$ac_ext" >&5
18259 eval "$as_ac_Lib=no"
18260 fi
18261 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18262 LIBS=$ac_check_lib_save_LIBS
18263 fi
18264 echo "$as_me:18264: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
18265 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
18266 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
18267
18268 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18269
18270 cf_add_libs="$LIBS"
18271 # reverse order
18272 cf_add_0lib=
18273 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18274 # filter duplicates
18275 for cf_add_1lib in $cf_add_0lib; do
18276         for cf_add_2lib in $cf_add_libs; do
18277                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18278                         cf_add_1lib=
18279                         break
18280                 fi
18281         done
18282         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18283 done
18284 LIBS="$cf_add_libs"
18285
18286                 cat >>confdefs.h <<EOF
18287 #define $cf_upper 1
18288 EOF
18289
18290 fi
18291
18292 fi
18293
18294         cf_curses_headers="$cf_curses_headers form.h"
18295 fi
18296
18297 # look for curses-related headers
18298
18299 for ac_header in $cf_curses_headers
18300 do
18301 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18302 echo "$as_me:18302: checking for $ac_header" >&5
18303 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18304 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18305   echo $ECHO_N "(cached) $ECHO_C" >&6
18306 else
18307   cat >"conftest.$ac_ext" <<_ACEOF
18308 #line 18308 "configure"
18309 #include "confdefs.h"
18310 #include <$ac_header>
18311 _ACEOF
18312 if { (eval echo "$as_me:18312: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18313   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18314   ac_status=$?
18315   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18316   rm -f conftest.er1
18317   cat conftest.err >&5
18318   echo "$as_me:18318: \$? = $ac_status" >&5
18319   (exit "$ac_status"); } >/dev/null; then
18320   if test -s conftest.err; then
18321     ac_cpp_err=$ac_c_preproc_warn_flag
18322   else
18323     ac_cpp_err=
18324   fi
18325 else
18326   ac_cpp_err=yes
18327 fi
18328 if test -z "$ac_cpp_err"; then
18329   eval "$as_ac_Header=yes"
18330 else
18331   echo "$as_me: failed program was:" >&5
18332   cat "conftest.$ac_ext" >&5
18333   eval "$as_ac_Header=no"
18334 fi
18335 rm -f conftest.err "conftest.$ac_ext"
18336 fi
18337 echo "$as_me:18337: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18338 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18339 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18340   cat >>confdefs.h <<EOF
18341 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18342 EOF
18343
18344 fi
18345 done
18346
18347 echo "$as_me:18347: checking whether time.h and sys/time.h may both be included" >&5
18348 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
18349 if test "${ac_cv_header_time+set}" = set; then
18350   echo $ECHO_N "(cached) $ECHO_C" >&6
18351 else
18352   cat >"conftest.$ac_ext" <<_ACEOF
18353 #line 18353 "configure"
18354 #include "confdefs.h"
18355 #include <sys/types.h>
18356 #include <sys/time.h>
18357 #include <time.h>
18358
18359 int
18360 main (void)
18361 {
18362 if ((struct tm *) 0)
18363 return 0;
18364   ;
18365   return 0;
18366 }
18367 _ACEOF
18368 rm -f "conftest.$ac_objext"
18369 if { (eval echo "$as_me:18369: \"$ac_compile\"") >&5
18370   (eval $ac_compile) 2>&5
18371   ac_status=$?
18372   echo "$as_me:18372: \$? = $ac_status" >&5
18373   (exit "$ac_status"); } &&
18374          { ac_try='test -s "conftest.$ac_objext"'
18375   { (eval echo "$as_me:18375: \"$ac_try\"") >&5
18376   (eval $ac_try) 2>&5
18377   ac_status=$?
18378   echo "$as_me:18378: \$? = $ac_status" >&5
18379   (exit "$ac_status"); }; }; then
18380   ac_cv_header_time=yes
18381 else
18382   echo "$as_me: failed program was:" >&5
18383 cat "conftest.$ac_ext" >&5
18384 ac_cv_header_time=no
18385 fi
18386 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18387 fi
18388 echo "$as_me:18388: result: $ac_cv_header_time" >&5
18389 echo "${ECHO_T}$ac_cv_header_time" >&6
18390 if test $ac_cv_header_time = yes; then
18391
18392 cat >>confdefs.h <<\EOF
18393 #define TIME_WITH_SYS_TIME 1
18394 EOF
18395
18396 fi
18397
18398 for ac_header in \
18399 getopt.h \
18400 locale.h \
18401 math.h \
18402 stdarg.h \
18403 sys/ioctl.h \
18404 sys/select.h \
18405 sys/time.h \
18406 termios.h \
18407 unistd.h \
18408
18409 do
18410 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18411 echo "$as_me:18411: checking for $ac_header" >&5
18412 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18413 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18414   echo $ECHO_N "(cached) $ECHO_C" >&6
18415 else
18416   cat >"conftest.$ac_ext" <<_ACEOF
18417 #line 18417 "configure"
18418 #include "confdefs.h"
18419 #include <$ac_header>
18420 _ACEOF
18421 if { (eval echo "$as_me:18421: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18422   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18423   ac_status=$?
18424   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18425   rm -f conftest.er1
18426   cat conftest.err >&5
18427   echo "$as_me:18427: \$? = $ac_status" >&5
18428   (exit "$ac_status"); } >/dev/null; then
18429   if test -s conftest.err; then
18430     ac_cpp_err=$ac_c_preproc_warn_flag
18431   else
18432     ac_cpp_err=
18433   fi
18434 else
18435   ac_cpp_err=yes
18436 fi
18437 if test -z "$ac_cpp_err"; then
18438   eval "$as_ac_Header=yes"
18439 else
18440   echo "$as_me: failed program was:" >&5
18441   cat "conftest.$ac_ext" >&5
18442   eval "$as_ac_Header=no"
18443 fi
18444 rm -f conftest.err "conftest.$ac_ext"
18445 fi
18446 echo "$as_me:18446: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18447 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18448 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18449   cat >>confdefs.h <<EOF
18450 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18451 EOF
18452
18453 fi
18454 done
18455
18456 for ac_header in unistd.h getopt.h
18457 do
18458 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18459 echo "$as_me:18459: checking for $ac_header" >&5
18460 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18461 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18462   echo $ECHO_N "(cached) $ECHO_C" >&6
18463 else
18464   cat >"conftest.$ac_ext" <<_ACEOF
18465 #line 18465 "configure"
18466 #include "confdefs.h"
18467 #include <$ac_header>
18468 _ACEOF
18469 if { (eval echo "$as_me:18469: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18470   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18471   ac_status=$?
18472   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18473   rm -f conftest.er1
18474   cat conftest.err >&5
18475   echo "$as_me:18475: \$? = $ac_status" >&5
18476   (exit "$ac_status"); } >/dev/null; then
18477   if test -s conftest.err; then
18478     ac_cpp_err=$ac_c_preproc_warn_flag
18479   else
18480     ac_cpp_err=
18481   fi
18482 else
18483   ac_cpp_err=yes
18484 fi
18485 if test -z "$ac_cpp_err"; then
18486   eval "$as_ac_Header=yes"
18487 else
18488   echo "$as_me: failed program was:" >&5
18489   cat "conftest.$ac_ext" >&5
18490   eval "$as_ac_Header=no"
18491 fi
18492 rm -f conftest.err "conftest.$ac_ext"
18493 fi
18494 echo "$as_me:18494: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18495 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18496 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18497   cat >>confdefs.h <<EOF
18498 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18499 EOF
18500
18501 fi
18502 done
18503
18504 echo "$as_me:18504: checking for header declaring getopt variables" >&5
18505 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
18506 if test "${cf_cv_getopt_header+set}" = set; then
18507   echo $ECHO_N "(cached) $ECHO_C" >&6
18508 else
18509
18510 cf_cv_getopt_header=none
18511 for cf_header in stdio.h stdlib.h unistd.h getopt.h
18512 do
18513 cat >"conftest.$ac_ext" <<_ACEOF
18514 #line 18514 "configure"
18515 #include "confdefs.h"
18516
18517 #include <$cf_header>
18518 int
18519 main (void)
18520 {
18521 int x = optind; char *y = optarg; (void)x; (void)y
18522   ;
18523   return 0;
18524 }
18525 _ACEOF
18526 rm -f "conftest.$ac_objext"
18527 if { (eval echo "$as_me:18527: \"$ac_compile\"") >&5
18528   (eval $ac_compile) 2>&5
18529   ac_status=$?
18530   echo "$as_me:18530: \$? = $ac_status" >&5
18531   (exit "$ac_status"); } &&
18532          { ac_try='test -s "conftest.$ac_objext"'
18533   { (eval echo "$as_me:18533: \"$ac_try\"") >&5
18534   (eval $ac_try) 2>&5
18535   ac_status=$?
18536   echo "$as_me:18536: \$? = $ac_status" >&5
18537   (exit "$ac_status"); }; }; then
18538   cf_cv_getopt_header=$cf_header
18539  break
18540 else
18541   echo "$as_me: failed program was:" >&5
18542 cat "conftest.$ac_ext" >&5
18543 fi
18544 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18545 done
18546
18547 fi
18548 echo "$as_me:18548: result: $cf_cv_getopt_header" >&5
18549 echo "${ECHO_T}$cf_cv_getopt_header" >&6
18550 if test "$cf_cv_getopt_header" != none ; then
18551
18552 cat >>confdefs.h <<\EOF
18553 #define HAVE_GETOPT_HEADER 1
18554 EOF
18555
18556 fi
18557 if test "$cf_cv_getopt_header" = getopt.h ; then
18558
18559 cat >>confdefs.h <<\EOF
18560 #define NEED_GETOPT_H 1
18561 EOF
18562
18563 fi
18564
18565 echo "$as_me:18565: checking for clock_gettime" >&5
18566 echo $ECHO_N "checking for clock_gettime... $ECHO_C" >&6
18567 if test "${cf_cv_func_clock_gettime+set}" = set; then
18568   echo $ECHO_N "(cached) $ECHO_C" >&6
18569 else
18570
18571                 cat >"conftest.$ac_ext" <<_ACEOF
18572 #line 18572 "configure"
18573 #include "confdefs.h"
18574 #include <time.h>
18575 int
18576 main (void)
18577 {
18578 struct timespec ts;
18579                 int rc = clock_gettime(CLOCK_REALTIME, &ts); (void) rc; (void)ts
18580   ;
18581   return 0;
18582 }
18583 _ACEOF
18584 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18585 if { (eval echo "$as_me:18585: \"$ac_link\"") >&5
18586   (eval $ac_link) 2>&5
18587   ac_status=$?
18588   echo "$as_me:18588: \$? = $ac_status" >&5
18589   (exit "$ac_status"); } &&
18590          { ac_try='test -s "conftest$ac_exeext"'
18591   { (eval echo "$as_me:18591: \"$ac_try\"") >&5
18592   (eval $ac_try) 2>&5
18593   ac_status=$?
18594   echo "$as_me:18594: \$? = $ac_status" >&5
18595   (exit "$ac_status"); }; }; then
18596   cf_cv_func_clock_gettime=yes
18597 else
18598   echo "$as_me: failed program was:" >&5
18599 cat "conftest.$ac_ext" >&5
18600 cf_cv_func_clock_gettime=no
18601 fi
18602 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18603
18604 fi
18605 echo "$as_me:18605: result: $cf_cv_func_clock_gettime" >&5
18606 echo "${ECHO_T}$cf_cv_func_clock_gettime" >&6
18607
18608 if test "$cf_cv_func_clock_gettime" = yes
18609 then
18610
18611 cat >>confdefs.h <<\EOF
18612 #define HAVE_CLOCK_GETTIME 1
18613 EOF
18614
18615 else
18616 echo "$as_me:18616: checking for gettimeofday" >&5
18617 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
18618 if test "${ac_cv_func_gettimeofday+set}" = set; then
18619   echo $ECHO_N "(cached) $ECHO_C" >&6
18620 else
18621   cat >"conftest.$ac_ext" <<_ACEOF
18622 #line 18622 "configure"
18623 #include "confdefs.h"
18624 #define gettimeofday autoconf_temporary
18625 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18626 #undef gettimeofday
18627
18628 #ifdef __cplusplus
18629 extern "C"
18630 #endif
18631
18632 /* We use char because int might match the return type of a gcc2
18633    builtin and then its argument prototype would still apply.  */
18634 char gettimeofday (void);
18635
18636 int
18637 main (void)
18638 {
18639
18640 /* The GNU C library defines stubs for functions which it implements
18641     to always fail with ENOSYS.  Some functions are actually named
18642     something starting with __ and the normal name is an alias.  */
18643 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
18644 #error found stub for gettimeofday
18645 #endif
18646
18647         return gettimeofday ();
18648   ;
18649   return 0;
18650 }
18651 _ACEOF
18652 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18653 if { (eval echo "$as_me:18653: \"$ac_link\"") >&5
18654   (eval $ac_link) 2>&5
18655   ac_status=$?
18656   echo "$as_me:18656: \$? = $ac_status" >&5
18657   (exit "$ac_status"); } &&
18658          { ac_try='test -s "conftest$ac_exeext"'
18659   { (eval echo "$as_me:18659: \"$ac_try\"") >&5
18660   (eval $ac_try) 2>&5
18661   ac_status=$?
18662   echo "$as_me:18662: \$? = $ac_status" >&5
18663   (exit "$ac_status"); }; }; then
18664   ac_cv_func_gettimeofday=yes
18665 else
18666   echo "$as_me: failed program was:" >&5
18667 cat "conftest.$ac_ext" >&5
18668 ac_cv_func_gettimeofday=no
18669 fi
18670 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18671 fi
18672 echo "$as_me:18672: result: $ac_cv_func_gettimeofday" >&5
18673 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
18674 if test "$ac_cv_func_gettimeofday" = yes; then
18675
18676 cat >>confdefs.h <<\EOF
18677 #define HAVE_GETTIMEOFDAY 1
18678 EOF
18679
18680 else
18681
18682 echo "$as_me:18682: checking for gettimeofday in -lbsd" >&5
18683 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
18684 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
18685   echo $ECHO_N "(cached) $ECHO_C" >&6
18686 else
18687   ac_check_lib_save_LIBS=$LIBS
18688 LIBS="-lbsd  $LIBS"
18689 cat >"conftest.$ac_ext" <<_ACEOF
18690 #line 18690 "configure"
18691 #include "confdefs.h"
18692
18693 /* Override any gcc2 internal prototype to avoid an error.  */
18694 #ifdef __cplusplus
18695 extern "C"
18696 #endif
18697 /* We use char because int might match the return type of a gcc2
18698    builtin and then its argument prototype would still apply.  */
18699 char gettimeofday ();
18700 int
18701 main (void)
18702 {
18703 gettimeofday ();
18704   ;
18705   return 0;
18706 }
18707 _ACEOF
18708 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18709 if { (eval echo "$as_me:18709: \"$ac_link\"") >&5
18710   (eval $ac_link) 2>&5
18711   ac_status=$?
18712   echo "$as_me:18712: \$? = $ac_status" >&5
18713   (exit "$ac_status"); } &&
18714          { ac_try='test -s "conftest$ac_exeext"'
18715   { (eval echo "$as_me:18715: \"$ac_try\"") >&5
18716   (eval $ac_try) 2>&5
18717   ac_status=$?
18718   echo "$as_me:18718: \$? = $ac_status" >&5
18719   (exit "$ac_status"); }; }; then
18720   ac_cv_lib_bsd_gettimeofday=yes
18721 else
18722   echo "$as_me: failed program was:" >&5
18723 cat "conftest.$ac_ext" >&5
18724 ac_cv_lib_bsd_gettimeofday=no
18725 fi
18726 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18727 LIBS=$ac_check_lib_save_LIBS
18728 fi
18729 echo "$as_me:18729: result: $ac_cv_lib_bsd_gettimeofday" >&5
18730 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
18731 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
18732
18733 cat >>confdefs.h <<\EOF
18734 #define HAVE_GETTIMEOFDAY 1
18735 EOF
18736
18737 cf_add_libs="$LIBS"
18738 # reverse order
18739 cf_add_0lib=
18740 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18741 # filter duplicates
18742 for cf_add_1lib in $cf_add_0lib; do
18743         for cf_add_2lib in $cf_add_libs; do
18744                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18745                         cf_add_1lib=
18746                         break
18747                 fi
18748         done
18749         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18750 done
18751 LIBS="$cf_add_libs"
18752
18753 fi
18754
18755 fi
18756 fi
18757
18758 for ac_func in \
18759 cfmakeraw \
18760 getopt \
18761 snprintf \
18762 strdup \
18763 strstr \
18764 tsearch \
18765
18766 do
18767 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18768 echo "$as_me:18768: checking for $ac_func" >&5
18769 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18770 if eval "test \"\${$as_ac_var+set}\" = set"; then
18771   echo $ECHO_N "(cached) $ECHO_C" >&6
18772 else
18773   cat >"conftest.$ac_ext" <<_ACEOF
18774 #line 18774 "configure"
18775 #include "confdefs.h"
18776 #define $ac_func autoconf_temporary
18777 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18778 #undef $ac_func
18779
18780 #ifdef __cplusplus
18781 extern "C"
18782 #endif
18783
18784 /* We use char because int might match the return type of a gcc2
18785    builtin and then its argument prototype would still apply.  */
18786 char $ac_func (void);
18787
18788 int
18789 main (void)
18790 {
18791
18792 /* The GNU C library defines stubs for functions which it implements
18793     to always fail with ENOSYS.  Some functions are actually named
18794     something starting with __ and the normal name is an alias.  */
18795 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18796 #error found stub for $ac_func
18797 #endif
18798
18799         return $ac_func ();
18800   ;
18801   return 0;
18802 }
18803 _ACEOF
18804 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18805 if { (eval echo "$as_me:18805: \"$ac_link\"") >&5
18806   (eval $ac_link) 2>&5
18807   ac_status=$?
18808   echo "$as_me:18808: \$? = $ac_status" >&5
18809   (exit "$ac_status"); } &&
18810          { ac_try='test -s "conftest$ac_exeext"'
18811   { (eval echo "$as_me:18811: \"$ac_try\"") >&5
18812   (eval $ac_try) 2>&5
18813   ac_status=$?
18814   echo "$as_me:18814: \$? = $ac_status" >&5
18815   (exit "$ac_status"); }; }; then
18816   eval "$as_ac_var=yes"
18817 else
18818   echo "$as_me: failed program was:" >&5
18819 cat "conftest.$ac_ext" >&5
18820 eval "$as_ac_var=no"
18821 fi
18822 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18823 fi
18824 echo "$as_me:18824: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18825 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18826 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18827   cat >>confdefs.h <<EOF
18828 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18829 EOF
18830
18831 fi
18832 done
18833
18834 # use a compile-check to work with ncurses*-config and subdirectory includes
18835 echo "$as_me:18835: checking if we can use termcap.h" >&5
18836 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18837 if test "${cf_cv_have_termcap_h+set}" = set; then
18838   echo $ECHO_N "(cached) $ECHO_C" >&6
18839 else
18840
18841         cat >"conftest.$ac_ext" <<_ACEOF
18842 #line 18842 "configure"
18843 #include "confdefs.h"
18844
18845 #include <curses.h>
18846 #ifdef NCURSES_VERSION
18847 #undef NCURSES_VERSION
18848 #endif
18849 #include <termcap.h>
18850 #ifndef NCURSES_VERSION
18851 #error wrong header
18852 #endif
18853
18854 int
18855 main (void)
18856 {
18857 return 0;
18858   ;
18859   return 0;
18860 }
18861 _ACEOF
18862 rm -f "conftest.$ac_objext"
18863 if { (eval echo "$as_me:18863: \"$ac_compile\"") >&5
18864   (eval $ac_compile) 2>&5
18865   ac_status=$?
18866   echo "$as_me:18866: \$? = $ac_status" >&5
18867   (exit "$ac_status"); } &&
18868          { ac_try='test -s "conftest.$ac_objext"'
18869   { (eval echo "$as_me:18869: \"$ac_try\"") >&5
18870   (eval $ac_try) 2>&5
18871   ac_status=$?
18872   echo "$as_me:18872: \$? = $ac_status" >&5
18873   (exit "$ac_status"); }; }; then
18874   cf_cv_have_termcap_h=yes
18875 else
18876   echo "$as_me: failed program was:" >&5
18877 cat "conftest.$ac_ext" >&5
18878 cf_cv_have_termcap_h=no
18879 fi
18880 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18881 fi
18882 echo "$as_me:18882: result: $cf_cv_have_termcap_h" >&5
18883 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18884 if test "x$cf_cv_have_termcap_h" = xyes
18885 then
18886
18887 cat >>confdefs.h <<\EOF
18888 #define HAVE_TERMCAP_H 1
18889 EOF
18890
18891 else
18892 echo "$as_me:18892: checking if we can use ncurses/termcap.h" >&5
18893 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18894 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18895   echo $ECHO_N "(cached) $ECHO_C" >&6
18896 else
18897
18898         cat >"conftest.$ac_ext" <<_ACEOF
18899 #line 18899 "configure"
18900 #include "confdefs.h"
18901
18902 #include <ncurses/curses.h>
18903 #ifdef NCURSES_VERSION
18904 #undef NCURSES_VERSION
18905 #endif
18906 #include <ncurses/termcap.h>
18907 #ifndef NCURSES_VERSION
18908 #error wrong header
18909 #endif
18910
18911 int
18912 main (void)
18913 {
18914 return 0;
18915   ;
18916   return 0;
18917 }
18918 _ACEOF
18919 rm -f "conftest.$ac_objext"
18920 if { (eval echo "$as_me:18920: \"$ac_compile\"") >&5
18921   (eval $ac_compile) 2>&5
18922   ac_status=$?
18923   echo "$as_me:18923: \$? = $ac_status" >&5
18924   (exit "$ac_status"); } &&
18925          { ac_try='test -s "conftest.$ac_objext"'
18926   { (eval echo "$as_me:18926: \"$ac_try\"") >&5
18927   (eval $ac_try) 2>&5
18928   ac_status=$?
18929   echo "$as_me:18929: \$? = $ac_status" >&5
18930   (exit "$ac_status"); }; }; then
18931   cf_cv_have_ncurses_termcap_h=yes
18932 else
18933   echo "$as_me: failed program was:" >&5
18934 cat "conftest.$ac_ext" >&5
18935 cf_cv_have_ncurses_termcap_h=no
18936 fi
18937 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18938 fi
18939 echo "$as_me:18939: result: $cf_cv_have_ncurses_termcap_h" >&5
18940 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18941 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18942 cat >>confdefs.h <<\EOF
18943 #define HAVE_NCURSES_TERMCAP_H 1
18944 EOF
18945
18946 fi
18947
18948 if test "x$ac_cv_func_getopt" = xno; then
18949         { { echo "$as_me:18949: error: getopt is required for building programs" >&5
18950 echo "$as_me: error: getopt is required for building programs" >&2;}
18951    { (exit 1); exit 1; }; }
18952 fi
18953
18954 if test "$cf_enable_widec" = yes; then
18955
18956 for ac_func in \
18957 mblen \
18958 mbrlen \
18959 mbrtowc \
18960 mbsrtowcs \
18961 mbstowcs \
18962 mbtowc \
18963 wcsrtombs \
18964 wcstombs \
18965
18966 do
18967 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18968 echo "$as_me:18968: checking for $ac_func" >&5
18969 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18970 if eval "test \"\${$as_ac_var+set}\" = set"; then
18971   echo $ECHO_N "(cached) $ECHO_C" >&6
18972 else
18973   cat >"conftest.$ac_ext" <<_ACEOF
18974 #line 18974 "configure"
18975 #include "confdefs.h"
18976 #define $ac_func autoconf_temporary
18977 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18978 #undef $ac_func
18979
18980 #ifdef __cplusplus
18981 extern "C"
18982 #endif
18983
18984 /* We use char because int might match the return type of a gcc2
18985    builtin and then its argument prototype would still apply.  */
18986 char $ac_func (void);
18987
18988 int
18989 main (void)
18990 {
18991
18992 /* The GNU C library defines stubs for functions which it implements
18993     to always fail with ENOSYS.  Some functions are actually named
18994     something starting with __ and the normal name is an alias.  */
18995 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18996 #error found stub for $ac_func
18997 #endif
18998
18999         return $ac_func ();
19000   ;
19001   return 0;
19002 }
19003 _ACEOF
19004 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19005 if { (eval echo "$as_me:19005: \"$ac_link\"") >&5
19006   (eval $ac_link) 2>&5
19007   ac_status=$?
19008   echo "$as_me:19008: \$? = $ac_status" >&5
19009   (exit "$ac_status"); } &&
19010          { ac_try='test -s "conftest$ac_exeext"'
19011   { (eval echo "$as_me:19011: \"$ac_try\"") >&5
19012   (eval $ac_try) 2>&5
19013   ac_status=$?
19014   echo "$as_me:19014: \$? = $ac_status" >&5
19015   (exit "$ac_status"); }; }; then
19016   eval "$as_ac_var=yes"
19017 else
19018   echo "$as_me: failed program was:" >&5
19019 cat "conftest.$ac_ext" >&5
19020 eval "$as_ac_var=no"
19021 fi
19022 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19023 fi
19024 echo "$as_me:19024: result: `eval echo '${'"$as_ac_var"'}'`" >&5
19025 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
19026 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
19027   cat >>confdefs.h <<EOF
19028 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
19029 EOF
19030
19031 fi
19032 done
19033
19034 fi
19035
19036 echo "$as_me:19036: checking definition to turn on extended curses functions" >&5
19037 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
19038 if test "${cf_cv_need_xopen_extension+set}" = set; then
19039   echo $ECHO_N "(cached) $ECHO_C" >&6
19040 else
19041
19042 cf_cv_need_xopen_extension=unknown
19043 cat >"conftest.$ac_ext" <<_ACEOF
19044 #line 19044 "configure"
19045 #include "confdefs.h"
19046
19047 $ac_includes_default
19048 #include <${cf_cv_ncurses_header:-curses.h}>
19049 int
19050 main (void)
19051 {
19052
19053 #if defined(NCURSES_VERSION_PATCH)
19054 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
19055         make an error
19056 #endif
19057 #endif
19058 #ifdef NCURSES_WIDECHAR
19059 make an error   /* prefer to fall-through on the second checks */
19060 #endif
19061         cchar_t check;
19062         int check2 = curs_set((int)sizeof(check));
19063         long x = winnstr(stdscr, "", 0);
19064         int x1, y1;
19065         (void)check2;
19066         getbegyx(stdscr, y1, x1);
19067         (void)x;
19068         (void)y1;
19069         (void)x1;
19070
19071   ;
19072   return 0;
19073 }
19074 _ACEOF
19075 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19076 if { (eval echo "$as_me:19076: \"$ac_link\"") >&5
19077   (eval $ac_link) 2>&5
19078   ac_status=$?
19079   echo "$as_me:19079: \$? = $ac_status" >&5
19080   (exit "$ac_status"); } &&
19081          { ac_try='test -s "conftest$ac_exeext"'
19082   { (eval echo "$as_me:19082: \"$ac_try\"") >&5
19083   (eval $ac_try) 2>&5
19084   ac_status=$?
19085   echo "$as_me:19085: \$? = $ac_status" >&5
19086   (exit "$ac_status"); }; }; then
19087   cf_cv_need_xopen_extension=none
19088 else
19089   echo "$as_me: failed program was:" >&5
19090 cat "conftest.$ac_ext" >&5
19091
19092         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
19093         do
19094                 cat >"conftest.$ac_ext" <<_ACEOF
19095 #line 19095 "configure"
19096 #include "confdefs.h"
19097
19098 #define $cf_try_xopen_extension 1
19099 $ac_includes_default
19100 #include <${cf_cv_ncurses_header:-curses.h}>
19101 int
19102 main (void)
19103 {
19104
19105                 cchar_t check;
19106                 int check2 = curs_set((int)sizeof(check));
19107                 long x = winnstr(stdscr, "", 0);
19108                 int x1, y1;
19109                 getbegyx(stdscr, y1, x1);
19110                 (void)check2;
19111                 (void)x;
19112                 (void)y1;
19113                 (void)x1;
19114
19115   ;
19116   return 0;
19117 }
19118 _ACEOF
19119 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19120 if { (eval echo "$as_me:19120: \"$ac_link\"") >&5
19121   (eval $ac_link) 2>&5
19122   ac_status=$?
19123   echo "$as_me:19123: \$? = $ac_status" >&5
19124   (exit "$ac_status"); } &&
19125          { ac_try='test -s "conftest$ac_exeext"'
19126   { (eval echo "$as_me:19126: \"$ac_try\"") >&5
19127   (eval $ac_try) 2>&5
19128   ac_status=$?
19129   echo "$as_me:19129: \$? = $ac_status" >&5
19130   (exit "$ac_status"); }; }; then
19131   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
19132 else
19133   echo "$as_me: failed program was:" >&5
19134 cat "conftest.$ac_ext" >&5
19135 fi
19136 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19137         done
19138
19139 fi
19140 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19141
19142 fi
19143 echo "$as_me:19143: result: $cf_cv_need_xopen_extension" >&5
19144 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
19145
19146 case "$cf_cv_need_xopen_extension" in
19147 (*_*)
19148
19149         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19150         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
19151
19152         ;;
19153 esac
19154
19155 echo "$as_me:19155: checking for term.h" >&5
19156 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
19157 if test "${cf_cv_term_header+set}" = set; then
19158   echo $ECHO_N "(cached) $ECHO_C" >&6
19159 else
19160
19161 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
19162 # for <term.h> if we do not find the variant.
19163
19164 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
19165
19166 case "${cf_cv_ncurses_header:-curses.h}" in
19167 (*/*)
19168         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
19169         cf_header_list="$cf_header_item $cf_header_list"
19170         ;;
19171 esac
19172
19173 for cf_header in $cf_header_list
19174 do
19175         cat >"conftest.$ac_ext" <<_ACEOF
19176 #line 19176 "configure"
19177 #include "confdefs.h"
19178
19179 #include <${cf_cv_ncurses_header:-curses.h}>
19180 #include <${cf_header}>
19181 int
19182 main (void)
19183 {
19184 WINDOW *x; (void)x
19185   ;
19186   return 0;
19187 }
19188 _ACEOF
19189 rm -f "conftest.$ac_objext"
19190 if { (eval echo "$as_me:19190: \"$ac_compile\"") >&5
19191   (eval $ac_compile) 2>&5
19192   ac_status=$?
19193   echo "$as_me:19193: \$? = $ac_status" >&5
19194   (exit "$ac_status"); } &&
19195          { ac_try='test -s "conftest.$ac_objext"'
19196   { (eval echo "$as_me:19196: \"$ac_try\"") >&5
19197   (eval $ac_try) 2>&5
19198   ac_status=$?
19199   echo "$as_me:19199: \$? = $ac_status" >&5
19200   (exit "$ac_status"); }; }; then
19201   cf_cv_term_header=$cf_header
19202          break
19203 else
19204   echo "$as_me: failed program was:" >&5
19205 cat "conftest.$ac_ext" >&5
19206 cf_cv_term_header=no
19207 fi
19208 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19209 done
19210
19211 case "$cf_cv_term_header" in
19212 (no)
19213         # If curses is ncurses, some packagers still mess it up by trying to make
19214         # us use GNU termcap.  This handles the most common case.
19215         for cf_header in ncurses/term.h ncursesw/term.h
19216         do
19217                 cat >"conftest.$ac_ext" <<_ACEOF
19218 #line 19218 "configure"
19219 #include "confdefs.h"
19220
19221 #include <${cf_cv_ncurses_header:-curses.h}>
19222 #ifdef NCURSES_VERSION
19223 #include <${cf_header}>
19224 #else
19225 make an error
19226 #endif
19227 int
19228 main (void)
19229 {
19230 WINDOW *x; (void)x
19231   ;
19232   return 0;
19233 }
19234 _ACEOF
19235 rm -f "conftest.$ac_objext"
19236 if { (eval echo "$as_me:19236: \"$ac_compile\"") >&5
19237   (eval $ac_compile) 2>&5
19238   ac_status=$?
19239   echo "$as_me:19239: \$? = $ac_status" >&5
19240   (exit "$ac_status"); } &&
19241          { ac_try='test -s "conftest.$ac_objext"'
19242   { (eval echo "$as_me:19242: \"$ac_try\"") >&5
19243   (eval $ac_try) 2>&5
19244   ac_status=$?
19245   echo "$as_me:19245: \$? = $ac_status" >&5
19246   (exit "$ac_status"); }; }; then
19247   cf_cv_term_header=$cf_header
19248                          break
19249 else
19250   echo "$as_me: failed program was:" >&5
19251 cat "conftest.$ac_ext" >&5
19252 cf_cv_term_header=no
19253 fi
19254 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19255         done
19256         ;;
19257 esac
19258
19259 fi
19260 echo "$as_me:19260: result: $cf_cv_term_header" >&5
19261 echo "${ECHO_T}$cf_cv_term_header" >&6
19262
19263 case "$cf_cv_term_header" in
19264 (term.h)
19265
19266 cat >>confdefs.h <<\EOF
19267 #define HAVE_TERM_H 1
19268 EOF
19269
19270         ;;
19271 (ncurses/term.h)
19272
19273 cat >>confdefs.h <<\EOF
19274 #define HAVE_NCURSES_TERM_H 1
19275 EOF
19276
19277         ;;
19278 (ncursesw/term.h)
19279
19280 cat >>confdefs.h <<\EOF
19281 #define HAVE_NCURSESW_TERM_H 1
19282 EOF
19283
19284         ;;
19285 esac
19286
19287 echo "$as_me:19287: checking for unctrl.h" >&5
19288 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
19289 if test "${cf_cv_unctrl_header+set}" = set; then
19290   echo $ECHO_N "(cached) $ECHO_C" >&6
19291 else
19292
19293 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
19294 # for <unctrl.h> if we do not find the variant.
19295
19296 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
19297
19298 case "${cf_cv_ncurses_header:-curses.h}" in
19299 (*/*)
19300         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
19301         cf_header_list="$cf_header_item $cf_header_list"
19302         ;;
19303 esac
19304
19305 for cf_header in $cf_header_list
19306 do
19307         cat >"conftest.$ac_ext" <<_ACEOF
19308 #line 19308 "configure"
19309 #include "confdefs.h"
19310
19311 #include <${cf_cv_ncurses_header:-curses.h}>
19312 #include <${cf_header}>
19313 int
19314 main (void)
19315 {
19316 WINDOW *x; (void)x
19317   ;
19318   return 0;
19319 }
19320 _ACEOF
19321 rm -f "conftest.$ac_objext"
19322 if { (eval echo "$as_me:19322: \"$ac_compile\"") >&5
19323   (eval $ac_compile) 2>&5
19324   ac_status=$?
19325   echo "$as_me:19325: \$? = $ac_status" >&5
19326   (exit "$ac_status"); } &&
19327          { ac_try='test -s "conftest.$ac_objext"'
19328   { (eval echo "$as_me:19328: \"$ac_try\"") >&5
19329   (eval $ac_try) 2>&5
19330   ac_status=$?
19331   echo "$as_me:19331: \$? = $ac_status" >&5
19332   (exit "$ac_status"); }; }; then
19333   cf_cv_unctrl_header=$cf_header
19334          break
19335 else
19336   echo "$as_me: failed program was:" >&5
19337 cat "conftest.$ac_ext" >&5
19338 cf_cv_unctrl_header=no
19339 fi
19340 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19341 done
19342
19343 fi
19344 echo "$as_me:19344: result: $cf_cv_unctrl_header" >&5
19345 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
19346
19347 case "$cf_cv_unctrl_header" in
19348 (no)
19349         { echo "$as_me:19349: WARNING: unctrl.h header not found" >&5
19350 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
19351         ;;
19352 esac
19353
19354 case "$cf_cv_unctrl_header" in
19355 (unctrl.h)
19356
19357 cat >>confdefs.h <<\EOF
19358 #define HAVE_UNCTRL_H 1
19359 EOF
19360
19361         ;;
19362 (ncurses/unctrl.h)
19363
19364 cat >>confdefs.h <<\EOF
19365 #define HAVE_NCURSES_UNCTRL_H 1
19366 EOF
19367
19368         ;;
19369 (ncursesw/unctrl.h)
19370
19371 cat >>confdefs.h <<\EOF
19372 #define HAVE_NCURSESW_UNCTRL_H 1
19373 EOF
19374
19375         ;;
19376 esac
19377
19378 for cf_func in \
19379 alloc_pair \
19380 assume_default_colors \
19381 chgat \
19382 color_content \
19383 color_set \
19384 copywin \
19385 curses_trace \
19386 delscreen \
19387 dupwin \
19388 exit_curses \
19389 exit_terminfo \
19390 filter \
19391 getbegx \
19392 getcurx \
19393 getmaxx \
19394 getnstr \
19395 getparx \
19396 getwin \
19397 halfdelay \
19398 init_extended_color \
19399 mvderwin \
19400 mvvline \
19401 mvwin \
19402 mvwvline \
19403 napms \
19404 newpad \
19405 putwin \
19406 reset_color_pairs \
19407 resize_term \
19408 resizeterm \
19409 restartterm \
19410 ripoffline \
19411 scr_dump \
19412 setupterm \
19413 slk_color \
19414 slk_init \
19415 termattrs \
19416 termname \
19417 tgetent \
19418 tigetnum \
19419 tigetstr \
19420 tputs_sp \
19421 typeahead \
19422 unget_wch \
19423 use_default_colors \
19424 use_env \
19425 use_extended_names \
19426 use_screen \
19427 use_window \
19428 vid_puts \
19429 vidputs \
19430 vsscanf \
19431 vw_printw \
19432 wchgat \
19433 winsdelln \
19434 winsstr \
19435 wresize \
19436 wsyncdown \
19437 _tracef \
19438
19439 do
19440
19441 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19442
19443         echo "$as_me:19443: checking for ${cf_func}" >&5
19444 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19445
19446 echo "${as_me:-configure}:19446: testing ${cf_func} ..." 1>&5
19447
19448         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19449   echo $ECHO_N "(cached) $ECHO_C" >&6
19450 else
19451
19452                 eval cf_result='$ac_cv_func_'$cf_func
19453                 if test ".$cf_result" != ".no"; then
19454                         cat >"conftest.$ac_ext" <<_ACEOF
19455 #line 19455 "configure"
19456 #include "confdefs.h"
19457
19458 #ifdef HAVE_XCURSES
19459 #include <xcurses.h>
19460 char * XCursesProgramName = "test";
19461 #else
19462 #include <${cf_cv_ncurses_header:-curses.h}>
19463 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19464 #include <ncursesw/term.h>
19465 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19466 #include <ncurses/term.h>
19467 #elif defined(HAVE_TERM_H)
19468 #include <term.h>
19469 #endif
19470 #endif
19471
19472 int
19473 main (void)
19474 {
19475
19476 #ifndef ${cf_func}
19477 long foo = (long)(&${cf_func});
19478 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19479 if (foo + 1234L > 5678L)
19480         ${cf_cv_main_return:-return}(foo != 0);
19481 #endif
19482
19483   ;
19484   return 0;
19485 }
19486 _ACEOF
19487 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19488 if { (eval echo "$as_me:19488: \"$ac_link\"") >&5
19489   (eval $ac_link) 2>&5
19490   ac_status=$?
19491   echo "$as_me:19491: \$? = $ac_status" >&5
19492   (exit "$ac_status"); } &&
19493          { ac_try='test -s "conftest$ac_exeext"'
19494   { (eval echo "$as_me:19494: \"$ac_try\"") >&5
19495   (eval $ac_try) 2>&5
19496   ac_status=$?
19497   echo "$as_me:19497: \$? = $ac_status" >&5
19498   (exit "$ac_status"); }; }; then
19499   cf_result=yes
19500 else
19501   echo "$as_me: failed program was:" >&5
19502 cat "conftest.$ac_ext" >&5
19503 cf_result=no
19504 fi
19505 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19506                 fi
19507                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19508
19509 fi
19510
19511         # use the computed/retrieved cache-value:
19512         eval 'cf_result=$cf_cv_func_'$cf_func
19513         echo "$as_me:19513: result: $cf_result" >&5
19514 echo "${ECHO_T}$cf_result" >&6
19515         if test "$cf_result" != no; then
19516                 cat >>confdefs.h <<EOF
19517 #define HAVE_${cf_tr_func} 1
19518 EOF
19519
19520         fi
19521 done
19522
19523 for cf_func in tputs
19524 do
19525
19526 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19527
19528         echo "$as_me:19528: checking for ${cf_func}" >&5
19529 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19530
19531 echo "${as_me:-configure}:19531: testing ${cf_func} ..." 1>&5
19532
19533         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19534   echo $ECHO_N "(cached) $ECHO_C" >&6
19535 else
19536
19537                 eval cf_result='$ac_cv_func_'$cf_func
19538                 if test ".$cf_result" != ".no"; then
19539                         cat >"conftest.$ac_ext" <<_ACEOF
19540 #line 19540 "configure"
19541 #include "confdefs.h"
19542
19543 #ifdef HAVE_XCURSES
19544 #include <xcurses.h>
19545 char * XCursesProgramName = "test";
19546 #else
19547 #include <${cf_cv_ncurses_header:-curses.h}>
19548 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19549 #include <ncursesw/term.h>
19550 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19551 #include <ncurses/term.h>
19552 #elif defined(HAVE_TERM_H)
19553 #include <term.h>
19554 #endif
19555 #endif
19556
19557 int
19558 main (void)
19559 {
19560
19561 #ifndef ${cf_func}
19562 long foo = (long)(&${cf_func});
19563 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19564 if (foo + 1234L > 5678L)
19565         ${cf_cv_main_return:-return}(foo != 0);
19566 #endif
19567
19568   ;
19569   return 0;
19570 }
19571 _ACEOF
19572 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19573 if { (eval echo "$as_me:19573: \"$ac_link\"") >&5
19574   (eval $ac_link) 2>&5
19575   ac_status=$?
19576   echo "$as_me:19576: \$? = $ac_status" >&5
19577   (exit "$ac_status"); } &&
19578          { ac_try='test -s "conftest$ac_exeext"'
19579   { (eval echo "$as_me:19579: \"$ac_try\"") >&5
19580   (eval $ac_try) 2>&5
19581   ac_status=$?
19582   echo "$as_me:19582: \$? = $ac_status" >&5
19583   (exit "$ac_status"); }; }; then
19584   cf_result=yes
19585 else
19586   echo "$as_me: failed program was:" >&5
19587 cat "conftest.$ac_ext" >&5
19588 cf_result=no
19589 fi
19590 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19591                 fi
19592                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19593
19594 fi
19595
19596         # use the computed/retrieved cache-value:
19597         eval 'cf_result=$cf_cv_func_'$cf_func
19598         echo "$as_me:19598: result: $cf_result" >&5
19599 echo "${ECHO_T}$cf_result" >&6
19600         if test "$cf_result" != no; then
19601                 cat >>confdefs.h <<EOF
19602 #define HAVE_${cf_tr_func} 1
19603 EOF
19604
19605         fi
19606 done
19607
19608 if test "x$cf_cv_func_tputs" = xyes
19609 then
19610         cf_done=no
19611         for cf_arg in int char
19612         do
19613                 for cf_ret in int void
19614                 do
19615                         if test "$cf_ret" = void
19616                         then
19617                                 cf_return="/* nothing */"
19618                         else
19619                                 cf_return="return value"
19620                         fi
19621                         cat >"conftest.$ac_ext" <<_ACEOF
19622 #line 19622 "configure"
19623 #include "confdefs.h"
19624
19625 #include <${cf_cv_ncurses_header:-curses.h}>
19626 #include <$cf_cv_term_header>
19627
19628 static $cf_ret outc($cf_arg value) { $cf_return; }
19629
19630 int
19631 main (void)
19632 {
19633
19634         tputs("hello", 0, outc);
19635         ${cf_cv_main_return:-return}(0);
19636
19637   ;
19638   return 0;
19639 }
19640 _ACEOF
19641 rm -f "conftest.$ac_objext"
19642 if { (eval echo "$as_me:19642: \"$ac_compile\"") >&5
19643   (eval $ac_compile) 2>&5
19644   ac_status=$?
19645   echo "$as_me:19645: \$? = $ac_status" >&5
19646   (exit "$ac_status"); } &&
19647          { ac_try='test -s "conftest.$ac_objext"'
19648   { (eval echo "$as_me:19648: \"$ac_try\"") >&5
19649   (eval $ac_try) 2>&5
19650   ac_status=$?
19651   echo "$as_me:19651: \$? = $ac_status" >&5
19652   (exit "$ac_status"); }; }; then
19653
19654                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
19655
19656 echo "${as_me:-configure}:19656: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
19657
19658                 cat >>confdefs.h <<EOF
19659 #define TPUTS_ARG               $cf_arg
19660 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
19661 #define TPUTS_RETURN(value)     $cf_return
19662 EOF
19663                 cf_done=yes
19664                 break
19665
19666 else
19667   echo "$as_me: failed program was:" >&5
19668 cat "conftest.$ac_ext" >&5
19669 fi
19670 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19671                 done
19672                 test "$cf_done" = yes && break
19673         done
19674 fi
19675
19676 echo "$as_me:19676: checking for ncurses extended functions" >&5
19677 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
19678 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
19679   echo $ECHO_N "(cached) $ECHO_C" >&6
19680 else
19681
19682 cat >"conftest.$ac_ext" <<_ACEOF
19683 #line 19683 "configure"
19684 #include "confdefs.h"
19685
19686 #include <${cf_cv_ncurses_header:-curses.h}>
19687 int
19688 main (void)
19689 {
19690
19691 int x = NCURSES_EXT_FUNCS
19692
19693   ;
19694   return 0;
19695 }
19696 _ACEOF
19697 rm -f "conftest.$ac_objext"
19698 if { (eval echo "$as_me:19698: \"$ac_compile\"") >&5
19699   (eval $ac_compile) 2>&5
19700   ac_status=$?
19701   echo "$as_me:19701: \$? = $ac_status" >&5
19702   (exit "$ac_status"); } &&
19703          { ac_try='test -s "conftest.$ac_objext"'
19704   { (eval echo "$as_me:19704: \"$ac_try\"") >&5
19705   (eval $ac_try) 2>&5
19706   ac_status=$?
19707   echo "$as_me:19707: \$? = $ac_status" >&5
19708   (exit "$ac_status"); }; }; then
19709   cf_cv_ncurses_ext_funcs=defined
19710 else
19711   echo "$as_me: failed program was:" >&5
19712 cat "conftest.$ac_ext" >&5
19713
19714 cat >"conftest.$ac_ext" <<_ACEOF
19715 #line 19715 "configure"
19716 #include "confdefs.h"
19717
19718 #include <${cf_cv_ncurses_header:-curses.h}>
19719 int
19720 main (void)
19721 {
19722
19723         (void) assume_default_colors (0, 0);
19724         (void) curses_version ();
19725         (void) define_key (0, 0);
19726         (void) is_term_resized (0, 0);
19727         (void) key_defined (0);
19728         (void) keybound (0, 0);
19729         (void) keyok (0, 0);
19730         (void) resize_term (0, 0);
19731         (void) resizeterm (0, 0);
19732         (void) use_default_colors ();
19733         (void) use_extended_names (0);
19734         (void) wresize (0, 0, 0);
19735   ;
19736   return 0;
19737 }
19738 _ACEOF
19739 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19740 if { (eval echo "$as_me:19740: \"$ac_link\"") >&5
19741   (eval $ac_link) 2>&5
19742   ac_status=$?
19743   echo "$as_me:19743: \$? = $ac_status" >&5
19744   (exit "$ac_status"); } &&
19745          { ac_try='test -s "conftest$ac_exeext"'
19746   { (eval echo "$as_me:19746: \"$ac_try\"") >&5
19747   (eval $ac_try) 2>&5
19748   ac_status=$?
19749   echo "$as_me:19749: \$? = $ac_status" >&5
19750   (exit "$ac_status"); }; }; then
19751   cf_cv_ncurses_ext_funcs=yes
19752 else
19753   echo "$as_me: failed program was:" >&5
19754 cat "conftest.$ac_ext" >&5
19755 cf_cv_ncurses_ext_funcs=no
19756 fi
19757 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19758
19759 fi
19760 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19761
19762 fi
19763 echo "$as_me:19763: result: $cf_cv_ncurses_ext_funcs" >&5
19764 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19765 test "$cf_cv_ncurses_ext_funcs" = yes &&
19766 cat >>confdefs.h <<\EOF
19767 #define NCURSES_EXT_FUNCS 1
19768 EOF
19769
19770 if test "$cf_enable_widec" = yes
19771 then
19772         # workaround for systems with ncurses before 20111029, due to change of
19773         # feature test macro from _XPG5 to _XOPEN_SOURCE
19774         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19775         then
19776                 cf_define_xpg5=no
19777                 echo "$as_me:19777: checking if _XPG5 should be defined to enable wide-characters" >&5
19778 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19779
19780                 cat >"conftest.$ac_ext" <<_ACEOF
19781 #line 19781 "configure"
19782 #include "confdefs.h"
19783
19784 #include <${cf_cv_ncurses_header:-curses.h}>
19785 int
19786 main (void)
19787 {
19788 int x = _XPG5
19789   ;
19790   return 0;
19791 }
19792 _ACEOF
19793 rm -f "conftest.$ac_objext"
19794 if { (eval echo "$as_me:19794: \"$ac_compile\"") >&5
19795   (eval $ac_compile) 2>&5
19796   ac_status=$?
19797   echo "$as_me:19797: \$? = $ac_status" >&5
19798   (exit "$ac_status"); } &&
19799          { ac_try='test -s "conftest.$ac_objext"'
19800   { (eval echo "$as_me:19800: \"$ac_try\"") >&5
19801   (eval $ac_try) 2>&5
19802   ac_status=$?
19803   echo "$as_me:19803: \$? = $ac_status" >&5
19804   (exit "$ac_status"); }; }; then
19805   :
19806 else
19807   echo "$as_me: failed program was:" >&5
19808 cat "conftest.$ac_ext" >&5
19809 cf_save_cppflags="$CPPFLAGS"
19810                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19811                          cat >"conftest.$ac_ext" <<_ACEOF
19812 #line 19812 "configure"
19813 #include "confdefs.h"
19814
19815 #include <${cf_cv_ncurses_header:-curses.h}>
19816 int
19817 main (void)
19818 {
19819 int x = _XPG5
19820   ;
19821   return 0;
19822 }
19823 _ACEOF
19824 rm -f "conftest.$ac_objext"
19825 if { (eval echo "$as_me:19825: \"$ac_compile\"") >&5
19826   (eval $ac_compile) 2>&5
19827   ac_status=$?
19828   echo "$as_me:19828: \$? = $ac_status" >&5
19829   (exit "$ac_status"); } &&
19830          { ac_try='test -s "conftest.$ac_objext"'
19831   { (eval echo "$as_me:19831: \"$ac_try\"") >&5
19832   (eval $ac_try) 2>&5
19833   ac_status=$?
19834   echo "$as_me:19834: \$? = $ac_status" >&5
19835   (exit "$ac_status"); }; }; then
19836   cf_define_xpg5=yes
19837 else
19838   echo "$as_me: failed program was:" >&5
19839 cat "conftest.$ac_ext" >&5
19840 fi
19841 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19842                          CPPFLAGS="$cf_save_cppflags"
19843 fi
19844 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19845                 echo "$as_me:19845: result: $cf_define_xpg5" >&5
19846 echo "${ECHO_T}$cf_define_xpg5" >&6
19847
19848                 if test "$cf_define_xpg5" = yes
19849                 then
19850                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19851                 fi
19852         fi
19853
19854         echo "$as_me:19854: checking for wide-character functions" >&5
19855 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19856 if test "${cf_cv_widechar_funcs+set}" = set; then
19857   echo $ECHO_N "(cached) $ECHO_C" >&6
19858 else
19859
19860         cat >"conftest.$ac_ext" <<_ACEOF
19861 #line 19861 "configure"
19862 #include "confdefs.h"
19863
19864 #include <${cf_cv_ncurses_header:-curses.h}>
19865 int
19866 main (void)
19867 {
19868
19869                 static wchar_t src_wchar[2];
19870                 static cchar_t dst_cchar;
19871                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19872
19873   ;
19874   return 0;
19875 }
19876 _ACEOF
19877 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19878 if { (eval echo "$as_me:19878: \"$ac_link\"") >&5
19879   (eval $ac_link) 2>&5
19880   ac_status=$?
19881   echo "$as_me:19881: \$? = $ac_status" >&5
19882   (exit "$ac_status"); } &&
19883          { ac_try='test -s "conftest$ac_exeext"'
19884   { (eval echo "$as_me:19884: \"$ac_try\"") >&5
19885   (eval $ac_try) 2>&5
19886   ac_status=$?
19887   echo "$as_me:19887: \$? = $ac_status" >&5
19888   (exit "$ac_status"); }; }; then
19889   cf_cv_widechar_funcs=yes
19890 else
19891   echo "$as_me: failed program was:" >&5
19892 cat "conftest.$ac_ext" >&5
19893 cf_cv_widechar_funcs=no
19894 fi
19895 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19896
19897 fi
19898 echo "$as_me:19898: result: $cf_cv_widechar_funcs" >&5
19899 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19900         if test "$cf_cv_widechar_funcs" != no ; then
19901
19902 cat >>confdefs.h <<\EOF
19903 #define USE_WIDEC_SUPPORT 1
19904 EOF
19905
19906         else
19907                 cat >>confdefs.h <<\EOF
19908 #define USE_WIDEC_SUPPORT 0
19909 EOF
19910
19911         fi
19912 else
19913         cat >>confdefs.h <<\EOF
19914 #define USE_WIDEC_SUPPORT 0
19915 EOF
19916
19917 fi
19918
19919 echo "$as_me:19919: checking if $cf_cv_screen library uses pthreads" >&5
19920 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19921 if test "${cf_cv_use_pthreads+set}" = set; then
19922   echo $ECHO_N "(cached) $ECHO_C" >&6
19923 else
19924
19925 cat >"conftest.$ac_ext" <<_ACEOF
19926 #line 19926 "configure"
19927 #include "confdefs.h"
19928
19929 #include <${cf_cv_ncurses_header:-curses.h}>
19930 extern void _nc_init_pthreads(void);
19931
19932 int
19933 main (void)
19934 {
19935
19936         initscr();
19937         _nc_init_pthreads();
19938
19939   ;
19940   return 0;
19941 }
19942 _ACEOF
19943 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19944 if { (eval echo "$as_me:19944: \"$ac_link\"") >&5
19945   (eval $ac_link) 2>&5
19946   ac_status=$?
19947   echo "$as_me:19947: \$? = $ac_status" >&5
19948   (exit "$ac_status"); } &&
19949          { ac_try='test -s "conftest$ac_exeext"'
19950   { (eval echo "$as_me:19950: \"$ac_try\"") >&5
19951   (eval $ac_try) 2>&5
19952   ac_status=$?
19953   echo "$as_me:19953: \$? = $ac_status" >&5
19954   (exit "$ac_status"); }; }; then
19955   cf_cv_use_pthreads=yes
19956 else
19957   echo "$as_me: failed program was:" >&5
19958 cat "conftest.$ac_ext" >&5
19959 cf_cv_use_pthreads=no
19960 fi
19961 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19962
19963 fi
19964 echo "$as_me:19964: result: $cf_cv_use_pthreads" >&5
19965 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19966 test $cf_cv_use_pthreads = yes &&
19967 cat >>confdefs.h <<\EOF
19968 #define USE_PTHREADS 1
19969 EOF
19970
19971 echo "$as_me:19971: checking if sys/time.h works with sys/select.h" >&5
19972 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19973 if test "${cf_cv_sys_time_select+set}" = set; then
19974   echo $ECHO_N "(cached) $ECHO_C" >&6
19975 else
19976
19977 cat >"conftest.$ac_ext" <<_ACEOF
19978 #line 19978 "configure"
19979 #include "confdefs.h"
19980
19981 #include <sys/types.h>
19982 #ifdef HAVE_SYS_TIME_H
19983 #include <sys/time.h>
19984 #endif
19985 #ifdef HAVE_SYS_SELECT_H
19986 #include <sys/select.h>
19987 #endif
19988
19989 int
19990 main (void)
19991 {
19992
19993   ;
19994   return 0;
19995 }
19996 _ACEOF
19997 rm -f "conftest.$ac_objext"
19998 if { (eval echo "$as_me:19998: \"$ac_compile\"") >&5
19999   (eval $ac_compile) 2>&5
20000   ac_status=$?
20001   echo "$as_me:20001: \$? = $ac_status" >&5
20002   (exit "$ac_status"); } &&
20003          { ac_try='test -s "conftest.$ac_objext"'
20004   { (eval echo "$as_me:20004: \"$ac_try\"") >&5
20005   (eval $ac_try) 2>&5
20006   ac_status=$?
20007   echo "$as_me:20007: \$? = $ac_status" >&5
20008   (exit "$ac_status"); }; }; then
20009   cf_cv_sys_time_select=yes
20010 else
20011   echo "$as_me: failed program was:" >&5
20012 cat "conftest.$ac_ext" >&5
20013 cf_cv_sys_time_select=no
20014 fi
20015 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20016
20017 fi
20018
20019 echo "$as_me:20019: result: $cf_cv_sys_time_select" >&5
20020 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
20021 test "$cf_cv_sys_time_select" = yes &&
20022 cat >>confdefs.h <<\EOF
20023 #define HAVE_SYS_TIME_SELECT 1
20024 EOF
20025
20026 # special check for test/ditto.c
20027
20028 echo "$as_me:20028: checking for openpty in -lutil" >&5
20029 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
20030 if test "${ac_cv_lib_util_openpty+set}" = set; then
20031   echo $ECHO_N "(cached) $ECHO_C" >&6
20032 else
20033   ac_check_lib_save_LIBS=$LIBS
20034 LIBS="-lutil  $LIBS"
20035 cat >"conftest.$ac_ext" <<_ACEOF
20036 #line 20036 "configure"
20037 #include "confdefs.h"
20038
20039 /* Override any gcc2 internal prototype to avoid an error.  */
20040 #ifdef __cplusplus
20041 extern "C"
20042 #endif
20043 /* We use char because int might match the return type of a gcc2
20044    builtin and then its argument prototype would still apply.  */
20045 char openpty ();
20046 int
20047 main (void)
20048 {
20049 openpty ();
20050   ;
20051   return 0;
20052 }
20053 _ACEOF
20054 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20055 if { (eval echo "$as_me:20055: \"$ac_link\"") >&5
20056   (eval $ac_link) 2>&5
20057   ac_status=$?
20058   echo "$as_me:20058: \$? = $ac_status" >&5
20059   (exit "$ac_status"); } &&
20060          { ac_try='test -s "conftest$ac_exeext"'
20061   { (eval echo "$as_me:20061: \"$ac_try\"") >&5
20062   (eval $ac_try) 2>&5
20063   ac_status=$?
20064   echo "$as_me:20064: \$? = $ac_status" >&5
20065   (exit "$ac_status"); }; }; then
20066   ac_cv_lib_util_openpty=yes
20067 else
20068   echo "$as_me: failed program was:" >&5
20069 cat "conftest.$ac_ext" >&5
20070 ac_cv_lib_util_openpty=no
20071 fi
20072 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20073 LIBS=$ac_check_lib_save_LIBS
20074 fi
20075 echo "$as_me:20075: result: $ac_cv_lib_util_openpty" >&5
20076 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
20077 if test "$ac_cv_lib_util_openpty" = yes; then
20078   cf_cv_lib_util=yes
20079 else
20080   cf_cv_lib_util=no
20081 fi
20082
20083 echo "$as_me:20083: checking for openpty header" >&5
20084 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
20085 if test "${cf_cv_func_openpty+set}" = set; then
20086   echo $ECHO_N "(cached) $ECHO_C" >&6
20087 else
20088
20089         cf_save_LIBS="$LIBS"
20090         test "$cf_cv_lib_util" = yes && {
20091 cf_add_libs="$LIBS"
20092 # reverse order
20093 cf_add_0lib=
20094 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
20095 # filter duplicates
20096 for cf_add_1lib in $cf_add_0lib; do
20097         for cf_add_2lib in $cf_add_libs; do
20098                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
20099                         cf_add_1lib=
20100                         break
20101                 fi
20102         done
20103         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
20104 done
20105 LIBS="$cf_add_libs"
20106  }
20107         for cf_header in pty.h libutil.h util.h
20108         do
20109         cat >"conftest.$ac_ext" <<_ACEOF
20110 #line 20110 "configure"
20111 #include "confdefs.h"
20112
20113 #include <$cf_header>
20114
20115 int
20116 main (void)
20117 {
20118
20119         int x = openpty((int *)0, (int *)0, (char *)0,
20120                                    (struct termios *)0, (struct winsize *)0);
20121
20122   ;
20123   return 0;
20124 }
20125 _ACEOF
20126 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20127 if { (eval echo "$as_me:20127: \"$ac_link\"") >&5
20128   (eval $ac_link) 2>&5
20129   ac_status=$?
20130   echo "$as_me:20130: \$? = $ac_status" >&5
20131   (exit "$ac_status"); } &&
20132          { ac_try='test -s "conftest$ac_exeext"'
20133   { (eval echo "$as_me:20133: \"$ac_try\"") >&5
20134   (eval $ac_try) 2>&5
20135   ac_status=$?
20136   echo "$as_me:20136: \$? = $ac_status" >&5
20137   (exit "$ac_status"); }; }; then
20138
20139                 cf_cv_func_openpty=$cf_header
20140                 break
20141
20142 else
20143   echo "$as_me: failed program was:" >&5
20144 cat "conftest.$ac_ext" >&5
20145
20146                 cf_cv_func_openpty=no
20147
20148 fi
20149 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20150         done
20151         LIBS="$cf_save_LIBS"
20152
20153 fi
20154 echo "$as_me:20154: result: $cf_cv_func_openpty" >&5
20155 echo "${ECHO_T}$cf_cv_func_openpty" >&6
20156
20157 if test "$cf_cv_func_openpty" != no ; then
20158
20159 cat >>confdefs.h <<EOF
20160 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
20161 EOF
20162
20163 cat >>confdefs.h <<\EOF
20164 #define USE_XTERM_PTY 1
20165 EOF
20166
20167         if test "x$cf_cv_lib_util" = xyes ; then
20168
20169 cf_add_libs="$TEST_LIBS"
20170 # reverse order
20171 cf_add_0lib=
20172 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
20173 # filter duplicates
20174 for cf_add_1lib in $cf_add_0lib; do
20175         for cf_add_2lib in $cf_add_libs; do
20176                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
20177                         cf_add_1lib=
20178                         break
20179                 fi
20180         done
20181         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
20182 done
20183 TEST_LIBS="$cf_add_libs"
20184
20185         fi
20186 fi
20187
20188 echo "$as_me:20188: checking for function curses_version" >&5
20189 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
20190 if test "${cf_cv_func_curses_version+set}" = set; then
20191   echo $ECHO_N "(cached) $ECHO_C" >&6
20192 else
20193
20194 if test "$cross_compiling" = yes; then
20195   cf_cv_func_curses_version=unknown
20196 else
20197   cat >"conftest.$ac_ext" <<_ACEOF
20198 #line 20198 "configure"
20199 #include "confdefs.h"
20200
20201 $ac_includes_default
20202
20203 #include <${cf_cv_ncurses_header:-curses.h}>
20204
20205 int main(void)
20206 {
20207         char temp[1024];
20208         sprintf(temp, "%.999s\\n", curses_version());
20209         ${cf_cv_main_return:-return}(0);
20210 }
20211
20212 _ACEOF
20213 rm -f "conftest$ac_exeext"
20214 if { (eval echo "$as_me:20214: \"$ac_link\"") >&5
20215   (eval $ac_link) 2>&5
20216   ac_status=$?
20217   echo "$as_me:20217: \$? = $ac_status" >&5
20218   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20219   { (eval echo "$as_me:20219: \"$ac_try\"") >&5
20220   (eval $ac_try) 2>&5
20221   ac_status=$?
20222   echo "$as_me:20222: \$? = $ac_status" >&5
20223   (exit "$ac_status"); }; }; then
20224   cf_cv_func_curses_version=yes
20225
20226 else
20227   echo "$as_me: program exited with status $ac_status" >&5
20228 echo "$as_me: failed program was:" >&5
20229 cat "conftest.$ac_ext" >&5
20230 cf_cv_func_curses_version=no
20231
20232 fi
20233 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20234 fi
20235 rm -f core
20236 fi
20237 echo "$as_me:20237: result: $cf_cv_func_curses_version" >&5
20238 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
20239 test "$cf_cv_func_curses_version" = yes &&
20240 cat >>confdefs.h <<\EOF
20241 #define HAVE_CURSES_VERSION 1
20242 EOF
20243
20244 echo "$as_me:20244: checking for alternate character set array" >&5
20245 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
20246 if test "${cf_cv_curses_acs_map+set}" = set; then
20247   echo $ECHO_N "(cached) $ECHO_C" >&6
20248 else
20249
20250 cf_cv_curses_acs_map=unknown
20251 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
20252 do
20253 cat >"conftest.$ac_ext" <<_ACEOF
20254 #line 20254 "configure"
20255 #include "confdefs.h"
20256
20257 #include <${cf_cv_ncurses_header:-curses.h}>
20258
20259 int
20260 main (void)
20261 {
20262
20263 ${name}['k'] = ACS_PLUS
20264
20265   ;
20266   return 0;
20267 }
20268 _ACEOF
20269 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20270 if { (eval echo "$as_me:20270: \"$ac_link\"") >&5
20271   (eval $ac_link) 2>&5
20272   ac_status=$?
20273   echo "$as_me:20273: \$? = $ac_status" >&5
20274   (exit "$ac_status"); } &&
20275          { ac_try='test -s "conftest$ac_exeext"'
20276   { (eval echo "$as_me:20276: \"$ac_try\"") >&5
20277   (eval $ac_try) 2>&5
20278   ac_status=$?
20279   echo "$as_me:20279: \$? = $ac_status" >&5
20280   (exit "$ac_status"); }; }; then
20281   cf_cv_curses_acs_map=$name; break
20282 else
20283   echo "$as_me: failed program was:" >&5
20284 cat "conftest.$ac_ext" >&5
20285 fi
20286 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20287 done
20288
20289 fi
20290 echo "$as_me:20290: result: $cf_cv_curses_acs_map" >&5
20291 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
20292
20293 test "$cf_cv_curses_acs_map" != unknown &&
20294 cat >>confdefs.h <<EOF
20295 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
20296 EOF
20297
20298 if test "$cf_enable_widec" = yes; then
20299
20300 echo "$as_me:20300: checking for wide alternate character set array" >&5
20301 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
20302 if test "${cf_cv_curses_wacs_map+set}" = set; then
20303   echo $ECHO_N "(cached) $ECHO_C" >&6
20304 else
20305
20306         cf_cv_curses_wacs_map=unknown
20307         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
20308         do
20309         cat >"conftest.$ac_ext" <<_ACEOF
20310 #line 20310 "configure"
20311 #include "confdefs.h"
20312
20313 #ifndef _XOPEN_SOURCE_EXTENDED
20314 #define _XOPEN_SOURCE_EXTENDED
20315 #endif
20316 #include <${cf_cv_ncurses_header:-curses.h}>
20317 int
20318 main (void)
20319 {
20320 void *foo = &(${name}['k']); (void)foo
20321   ;
20322   return 0;
20323 }
20324 _ACEOF
20325 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20326 if { (eval echo "$as_me:20326: \"$ac_link\"") >&5
20327   (eval $ac_link) 2>&5
20328   ac_status=$?
20329   echo "$as_me:20329: \$? = $ac_status" >&5
20330   (exit "$ac_status"); } &&
20331          { ac_try='test -s "conftest$ac_exeext"'
20332   { (eval echo "$as_me:20332: \"$ac_try\"") >&5
20333   (eval $ac_try) 2>&5
20334   ac_status=$?
20335   echo "$as_me:20335: \$? = $ac_status" >&5
20336   (exit "$ac_status"); }; }; then
20337   cf_cv_curses_wacs_map=$name
20338          break
20339 else
20340   echo "$as_me: failed program was:" >&5
20341 cat "conftest.$ac_ext" >&5
20342 fi
20343 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20344         done
20345 fi
20346 echo "$as_me:20346: result: $cf_cv_curses_wacs_map" >&5
20347 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
20348
20349 test "$cf_cv_curses_wacs_map" != unknown &&
20350 cat >>confdefs.h <<EOF
20351 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
20352 EOF
20353
20354 echo "$as_me:20354: checking for wide alternate character constants" >&5
20355 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
20356 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
20357   echo $ECHO_N "(cached) $ECHO_C" >&6
20358 else
20359
20360 cf_cv_curses_wacs_symbols=no
20361 if test "$cf_cv_curses_wacs_map" != unknown
20362 then
20363         cat >"conftest.$ac_ext" <<_ACEOF
20364 #line 20364 "configure"
20365 #include "confdefs.h"
20366
20367 #ifndef _XOPEN_SOURCE_EXTENDED
20368 #define _XOPEN_SOURCE_EXTENDED
20369 #endif
20370 #include <${cf_cv_ncurses_header:-curses.h}>
20371 int
20372 main (void)
20373 {
20374 cchar_t *foo = WACS_PLUS;
20375          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
20376   ;
20377   return 0;
20378 }
20379 _ACEOF
20380 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20381 if { (eval echo "$as_me:20381: \"$ac_link\"") >&5
20382   (eval $ac_link) 2>&5
20383   ac_status=$?
20384   echo "$as_me:20384: \$? = $ac_status" >&5
20385   (exit "$ac_status"); } &&
20386          { ac_try='test -s "conftest$ac_exeext"'
20387   { (eval echo "$as_me:20387: \"$ac_try\"") >&5
20388   (eval $ac_try) 2>&5
20389   ac_status=$?
20390   echo "$as_me:20390: \$? = $ac_status" >&5
20391   (exit "$ac_status"); }; }; then
20392   cf_cv_curses_wacs_symbols=yes
20393 else
20394   echo "$as_me: failed program was:" >&5
20395 cat "conftest.$ac_ext" >&5
20396 fi
20397 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20398 else
20399         cat >"conftest.$ac_ext" <<_ACEOF
20400 #line 20400 "configure"
20401 #include "confdefs.h"
20402
20403 #ifndef _XOPEN_SOURCE_EXTENDED
20404 #define _XOPEN_SOURCE_EXTENDED
20405 #endif
20406 #include <${cf_cv_ncurses_header:-curses.h}>
20407 int
20408 main (void)
20409 {
20410 cchar_t *foo = WACS_PLUS; (void)foo
20411   ;
20412   return 0;
20413 }
20414 _ACEOF
20415 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20416 if { (eval echo "$as_me:20416: \"$ac_link\"") >&5
20417   (eval $ac_link) 2>&5
20418   ac_status=$?
20419   echo "$as_me:20419: \$? = $ac_status" >&5
20420   (exit "$ac_status"); } &&
20421          { ac_try='test -s "conftest$ac_exeext"'
20422   { (eval echo "$as_me:20422: \"$ac_try\"") >&5
20423   (eval $ac_try) 2>&5
20424   ac_status=$?
20425   echo "$as_me:20425: \$? = $ac_status" >&5
20426   (exit "$ac_status"); }; }; then
20427   cf_cv_curses_wacs_symbols=yes
20428 else
20429   echo "$as_me: failed program was:" >&5
20430 cat "conftest.$ac_ext" >&5
20431 fi
20432 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20433 fi
20434
20435 fi
20436 echo "$as_me:20436: result: $cf_cv_curses_wacs_symbols" >&5
20437 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
20438
20439 test "$cf_cv_curses_wacs_symbols" != no &&
20440 cat >>confdefs.h <<\EOF
20441 #define CURSES_WACS_SYMBOLS 1
20442 EOF
20443
20444 fi
20445
20446 echo "$as_me:20446: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20447 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20448 cat >"conftest.$ac_ext" <<_ACEOF
20449 #line 20449 "configure"
20450 #include "confdefs.h"
20451
20452 #ifndef _XOPEN_SOURCE_EXTENDED
20453 #define _XOPEN_SOURCE_EXTENDED
20454 #endif
20455 #include <${cf_cv_ncurses_header:-curses.h}>
20456 int
20457 main (void)
20458 {
20459
20460 attr_t foo
20461
20462   ;
20463   return 0;
20464 }
20465 _ACEOF
20466 rm -f "conftest.$ac_objext"
20467 if { (eval echo "$as_me:20467: \"$ac_compile\"") >&5
20468   (eval $ac_compile) 2>&5
20469   ac_status=$?
20470   echo "$as_me:20470: \$? = $ac_status" >&5
20471   (exit "$ac_status"); } &&
20472          { ac_try='test -s "conftest.$ac_objext"'
20473   { (eval echo "$as_me:20473: \"$ac_try\"") >&5
20474   (eval $ac_try) 2>&5
20475   ac_status=$?
20476   echo "$as_me:20476: \$? = $ac_status" >&5
20477   (exit "$ac_status"); }; }; then
20478   cf_result=yes
20479 else
20480   echo "$as_me: failed program was:" >&5
20481 cat "conftest.$ac_ext" >&5
20482 cf_result=no
20483 fi
20484 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20485 echo "$as_me:20485: result: $cf_result" >&5
20486 echo "${ECHO_T}$cf_result" >&6
20487 if test "$cf_result" = yes ; then
20488
20489 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20490
20491 cat >>confdefs.h <<EOF
20492 #define $cf_result 1
20493 EOF
20494
20495 else
20496
20497 cat >>confdefs.h <<EOF
20498 #define attr_t long
20499 EOF
20500
20501 fi
20502
20503 if test "$cf_enable_widec" = yes; then
20504
20505 # This is needed on Tru64 5.0 to declare mbstate_t
20506 echo "$as_me:20506: checking if we must include wchar.h to declare mbstate_t" >&5
20507 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
20508 if test "${cf_cv_mbstate_t+set}" = set; then
20509   echo $ECHO_N "(cached) $ECHO_C" >&6
20510 else
20511
20512 cat >"conftest.$ac_ext" <<_ACEOF
20513 #line 20513 "configure"
20514 #include "confdefs.h"
20515
20516 #include <stdlib.h>
20517 #include <stdarg.h>
20518 #include <stdio.h>
20519 #ifdef HAVE_LIBUTF8_H
20520 #include <libutf8.h>
20521 #endif
20522 int
20523 main (void)
20524 {
20525 mbstate_t state
20526   ;
20527   return 0;
20528 }
20529 _ACEOF
20530 rm -f "conftest.$ac_objext"
20531 if { (eval echo "$as_me:20531: \"$ac_compile\"") >&5
20532   (eval $ac_compile) 2>&5
20533   ac_status=$?
20534   echo "$as_me:20534: \$? = $ac_status" >&5
20535   (exit "$ac_status"); } &&
20536          { ac_try='test -s "conftest.$ac_objext"'
20537   { (eval echo "$as_me:20537: \"$ac_try\"") >&5
20538   (eval $ac_try) 2>&5
20539   ac_status=$?
20540   echo "$as_me:20540: \$? = $ac_status" >&5
20541   (exit "$ac_status"); }; }; then
20542   cf_cv_mbstate_t=no
20543 else
20544   echo "$as_me: failed program was:" >&5
20545 cat "conftest.$ac_ext" >&5
20546 cat >"conftest.$ac_ext" <<_ACEOF
20547 #line 20547 "configure"
20548 #include "confdefs.h"
20549
20550 #include <stdlib.h>
20551 #include <stdarg.h>
20552 #include <stdio.h>
20553 #include <wchar.h>
20554 #ifdef HAVE_LIBUTF8_H
20555 #include <libutf8.h>
20556 #endif
20557 int
20558 main (void)
20559 {
20560 mbstate_t value
20561   ;
20562   return 0;
20563 }
20564 _ACEOF
20565 rm -f "conftest.$ac_objext"
20566 if { (eval echo "$as_me:20566: \"$ac_compile\"") >&5
20567   (eval $ac_compile) 2>&5
20568   ac_status=$?
20569   echo "$as_me:20569: \$? = $ac_status" >&5
20570   (exit "$ac_status"); } &&
20571          { ac_try='test -s "conftest.$ac_objext"'
20572   { (eval echo "$as_me:20572: \"$ac_try\"") >&5
20573   (eval $ac_try) 2>&5
20574   ac_status=$?
20575   echo "$as_me:20575: \$? = $ac_status" >&5
20576   (exit "$ac_status"); }; }; then
20577   cf_cv_mbstate_t=yes
20578 else
20579   echo "$as_me: failed program was:" >&5
20580 cat "conftest.$ac_ext" >&5
20581 cf_cv_mbstate_t=unknown
20582 fi
20583 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20584 fi
20585 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20586 fi
20587 echo "$as_me:20587: result: $cf_cv_mbstate_t" >&5
20588 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
20589
20590 if test "$cf_cv_mbstate_t" = yes ; then
20591
20592 cat >>confdefs.h <<\EOF
20593 #define NEED_WCHAR_H 1
20594 EOF
20595
20596         NEED_WCHAR_H=1
20597 fi
20598
20599 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
20600 if test "$cf_cv_mbstate_t" = unknown ; then
20601         NCURSES_MBSTATE_T=1
20602 fi
20603
20604 # if we find mbstate_t in either place, use substitution to provide a fallback.
20605 if test "$cf_cv_mbstate_t" != unknown ; then
20606         NCURSES_OK_MBSTATE_T=1
20607 fi
20608
20609 # This is needed on Tru64 5.0 to declare wchar_t
20610 echo "$as_me:20610: checking if we must include wchar.h to declare wchar_t" >&5
20611 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
20612 if test "${cf_cv_wchar_t+set}" = set; then
20613   echo $ECHO_N "(cached) $ECHO_C" >&6
20614 else
20615
20616 cat >"conftest.$ac_ext" <<_ACEOF
20617 #line 20617 "configure"
20618 #include "confdefs.h"
20619
20620 #include <stdlib.h>
20621 #include <stdarg.h>
20622 #include <stdio.h>
20623 #ifdef HAVE_LIBUTF8_H
20624 #include <libutf8.h>
20625 #endif
20626 int
20627 main (void)
20628 {
20629 wchar_t state
20630   ;
20631   return 0;
20632 }
20633 _ACEOF
20634 rm -f "conftest.$ac_objext"
20635 if { (eval echo "$as_me:20635: \"$ac_compile\"") >&5
20636   (eval $ac_compile) 2>&5
20637   ac_status=$?
20638   echo "$as_me:20638: \$? = $ac_status" >&5
20639   (exit "$ac_status"); } &&
20640          { ac_try='test -s "conftest.$ac_objext"'
20641   { (eval echo "$as_me:20641: \"$ac_try\"") >&5
20642   (eval $ac_try) 2>&5
20643   ac_status=$?
20644   echo "$as_me:20644: \$? = $ac_status" >&5
20645   (exit "$ac_status"); }; }; then
20646   cf_cv_wchar_t=no
20647 else
20648   echo "$as_me: failed program was:" >&5
20649 cat "conftest.$ac_ext" >&5
20650 cat >"conftest.$ac_ext" <<_ACEOF
20651 #line 20651 "configure"
20652 #include "confdefs.h"
20653
20654 #include <stdlib.h>
20655 #include <stdarg.h>
20656 #include <stdio.h>
20657 #include <wchar.h>
20658 #ifdef HAVE_LIBUTF8_H
20659 #include <libutf8.h>
20660 #endif
20661 int
20662 main (void)
20663 {
20664 wchar_t value
20665   ;
20666   return 0;
20667 }
20668 _ACEOF
20669 rm -f "conftest.$ac_objext"
20670 if { (eval echo "$as_me:20670: \"$ac_compile\"") >&5
20671   (eval $ac_compile) 2>&5
20672   ac_status=$?
20673   echo "$as_me:20673: \$? = $ac_status" >&5
20674   (exit "$ac_status"); } &&
20675          { ac_try='test -s "conftest.$ac_objext"'
20676   { (eval echo "$as_me:20676: \"$ac_try\"") >&5
20677   (eval $ac_try) 2>&5
20678   ac_status=$?
20679   echo "$as_me:20679: \$? = $ac_status" >&5
20680   (exit "$ac_status"); }; }; then
20681   cf_cv_wchar_t=yes
20682 else
20683   echo "$as_me: failed program was:" >&5
20684 cat "conftest.$ac_ext" >&5
20685 cf_cv_wchar_t=unknown
20686 fi
20687 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20688 fi
20689 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20690 fi
20691 echo "$as_me:20691: result: $cf_cv_wchar_t" >&5
20692 echo "${ECHO_T}$cf_cv_wchar_t" >&6
20693
20694 if test "$cf_cv_wchar_t" = yes ; then
20695
20696 cat >>confdefs.h <<\EOF
20697 #define NEED_WCHAR_H 1
20698 EOF
20699
20700         NEED_WCHAR_H=1
20701 fi
20702
20703 # if we do not find wchar_t in either place, use substitution to provide a fallback.
20704 if test "$cf_cv_wchar_t" = unknown ; then
20705         NCURSES_WCHAR_T=1
20706 fi
20707
20708 # if we find wchar_t in either place, use substitution to provide a fallback.
20709 if test "$cf_cv_wchar_t" != unknown ; then
20710         NCURSES_OK_WCHAR_T=1
20711 fi
20712
20713 # This is needed on Tru64 5.0 to declare wint_t
20714 echo "$as_me:20714: checking if we must include wchar.h to declare wint_t" >&5
20715 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
20716 if test "${cf_cv_wint_t+set}" = set; then
20717   echo $ECHO_N "(cached) $ECHO_C" >&6
20718 else
20719
20720 cat >"conftest.$ac_ext" <<_ACEOF
20721 #line 20721 "configure"
20722 #include "confdefs.h"
20723
20724 #include <stdlib.h>
20725 #include <stdarg.h>
20726 #include <stdio.h>
20727 #ifdef HAVE_LIBUTF8_H
20728 #include <libutf8.h>
20729 #endif
20730 int
20731 main (void)
20732 {
20733 wint_t state
20734   ;
20735   return 0;
20736 }
20737 _ACEOF
20738 rm -f "conftest.$ac_objext"
20739 if { (eval echo "$as_me:20739: \"$ac_compile\"") >&5
20740   (eval $ac_compile) 2>&5
20741   ac_status=$?
20742   echo "$as_me:20742: \$? = $ac_status" >&5
20743   (exit "$ac_status"); } &&
20744          { ac_try='test -s "conftest.$ac_objext"'
20745   { (eval echo "$as_me:20745: \"$ac_try\"") >&5
20746   (eval $ac_try) 2>&5
20747   ac_status=$?
20748   echo "$as_me:20748: \$? = $ac_status" >&5
20749   (exit "$ac_status"); }; }; then
20750   cf_cv_wint_t=no
20751 else
20752   echo "$as_me: failed program was:" >&5
20753 cat "conftest.$ac_ext" >&5
20754 cat >"conftest.$ac_ext" <<_ACEOF
20755 #line 20755 "configure"
20756 #include "confdefs.h"
20757
20758 #include <stdlib.h>
20759 #include <stdarg.h>
20760 #include <stdio.h>
20761 #include <wchar.h>
20762 #ifdef HAVE_LIBUTF8_H
20763 #include <libutf8.h>
20764 #endif
20765 int
20766 main (void)
20767 {
20768 wint_t value
20769   ;
20770   return 0;
20771 }
20772 _ACEOF
20773 rm -f "conftest.$ac_objext"
20774 if { (eval echo "$as_me:20774: \"$ac_compile\"") >&5
20775   (eval $ac_compile) 2>&5
20776   ac_status=$?
20777   echo "$as_me:20777: \$? = $ac_status" >&5
20778   (exit "$ac_status"); } &&
20779          { ac_try='test -s "conftest.$ac_objext"'
20780   { (eval echo "$as_me:20780: \"$ac_try\"") >&5
20781   (eval $ac_try) 2>&5
20782   ac_status=$?
20783   echo "$as_me:20783: \$? = $ac_status" >&5
20784   (exit "$ac_status"); }; }; then
20785   cf_cv_wint_t=yes
20786 else
20787   echo "$as_me: failed program was:" >&5
20788 cat "conftest.$ac_ext" >&5
20789 cf_cv_wint_t=unknown
20790 fi
20791 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20792 fi
20793 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20794 fi
20795 echo "$as_me:20795: result: $cf_cv_wint_t" >&5
20796 echo "${ECHO_T}$cf_cv_wint_t" >&6
20797
20798 if test "$cf_cv_wint_t" = yes ; then
20799
20800 cat >>confdefs.h <<\EOF
20801 #define NEED_WCHAR_H 1
20802 EOF
20803
20804         NEED_WCHAR_H=1
20805 fi
20806
20807 # if we do not find wint_t in either place, use substitution to provide a fallback.
20808 if test "$cf_cv_wint_t" = unknown ; then
20809         NCURSES_WINT_T=1
20810 fi
20811
20812 # if we find wint_t in either place, use substitution to provide a fallback.
20813 if test "$cf_cv_wint_t" != unknown ; then
20814         NCURSES_OK_WINT_T=1
20815 fi
20816
20817         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20818
20819 echo "$as_me:20819: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20820 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20821 cat >"conftest.$ac_ext" <<_ACEOF
20822 #line 20822 "configure"
20823 #include "confdefs.h"
20824
20825 #ifndef _XOPEN_SOURCE_EXTENDED
20826 #define _XOPEN_SOURCE_EXTENDED
20827 #endif
20828 #include <${cf_cv_ncurses_header:-curses.h}>
20829 int
20830 main (void)
20831 {
20832
20833 mbstate_t foo
20834
20835   ;
20836   return 0;
20837 }
20838 _ACEOF
20839 rm -f "conftest.$ac_objext"
20840 if { (eval echo "$as_me:20840: \"$ac_compile\"") >&5
20841   (eval $ac_compile) 2>&5
20842   ac_status=$?
20843   echo "$as_me:20843: \$? = $ac_status" >&5
20844   (exit "$ac_status"); } &&
20845          { ac_try='test -s "conftest.$ac_objext"'
20846   { (eval echo "$as_me:20846: \"$ac_try\"") >&5
20847   (eval $ac_try) 2>&5
20848   ac_status=$?
20849   echo "$as_me:20849: \$? = $ac_status" >&5
20850   (exit "$ac_status"); }; }; then
20851   cf_result=yes
20852 else
20853   echo "$as_me: failed program was:" >&5
20854 cat "conftest.$ac_ext" >&5
20855 cf_result=no
20856 fi
20857 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20858 echo "$as_me:20858: result: $cf_result" >&5
20859 echo "${ECHO_T}$cf_result" >&6
20860 if test "$cf_result" = yes ; then
20861
20862 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20863
20864 cat >>confdefs.h <<EOF
20865 #define $cf_result 1
20866 EOF
20867
20868 else
20869
20870 cat >>confdefs.h <<EOF
20871 #define mbstate_t long
20872 EOF
20873
20874 fi
20875
20876         fi
20877
20878         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20879
20880 echo "$as_me:20880: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20881 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20882 cat >"conftest.$ac_ext" <<_ACEOF
20883 #line 20883 "configure"
20884 #include "confdefs.h"
20885
20886 #ifndef _XOPEN_SOURCE_EXTENDED
20887 #define _XOPEN_SOURCE_EXTENDED
20888 #endif
20889 #include <${cf_cv_ncurses_header:-curses.h}>
20890 int
20891 main (void)
20892 {
20893
20894 wchar_t foo
20895
20896   ;
20897   return 0;
20898 }
20899 _ACEOF
20900 rm -f "conftest.$ac_objext"
20901 if { (eval echo "$as_me:20901: \"$ac_compile\"") >&5
20902   (eval $ac_compile) 2>&5
20903   ac_status=$?
20904   echo "$as_me:20904: \$? = $ac_status" >&5
20905   (exit "$ac_status"); } &&
20906          { ac_try='test -s "conftest.$ac_objext"'
20907   { (eval echo "$as_me:20907: \"$ac_try\"") >&5
20908   (eval $ac_try) 2>&5
20909   ac_status=$?
20910   echo "$as_me:20910: \$? = $ac_status" >&5
20911   (exit "$ac_status"); }; }; then
20912   cf_result=yes
20913 else
20914   echo "$as_me: failed program was:" >&5
20915 cat "conftest.$ac_ext" >&5
20916 cf_result=no
20917 fi
20918 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20919 echo "$as_me:20919: result: $cf_result" >&5
20920 echo "${ECHO_T}$cf_result" >&6
20921 if test "$cf_result" = yes ; then
20922
20923 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20924
20925 cat >>confdefs.h <<EOF
20926 #define $cf_result 1
20927 EOF
20928
20929 else
20930
20931 cat >>confdefs.h <<EOF
20932 #define wchar_t long
20933 EOF
20934
20935 fi
20936
20937         fi
20938
20939         if test "$NCURSES_OK_WINT_T" = 0 ; then
20940
20941 echo "$as_me:20941: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20942 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20943 cat >"conftest.$ac_ext" <<_ACEOF
20944 #line 20944 "configure"
20945 #include "confdefs.h"
20946
20947 #ifndef _XOPEN_SOURCE_EXTENDED
20948 #define _XOPEN_SOURCE_EXTENDED
20949 #endif
20950 #include <${cf_cv_ncurses_header:-curses.h}>
20951 int
20952 main (void)
20953 {
20954
20955 wint_t foo
20956
20957   ;
20958   return 0;
20959 }
20960 _ACEOF
20961 rm -f "conftest.$ac_objext"
20962 if { (eval echo "$as_me:20962: \"$ac_compile\"") >&5
20963   (eval $ac_compile) 2>&5
20964   ac_status=$?
20965   echo "$as_me:20965: \$? = $ac_status" >&5
20966   (exit "$ac_status"); } &&
20967          { ac_try='test -s "conftest.$ac_objext"'
20968   { (eval echo "$as_me:20968: \"$ac_try\"") >&5
20969   (eval $ac_try) 2>&5
20970   ac_status=$?
20971   echo "$as_me:20971: \$? = $ac_status" >&5
20972   (exit "$ac_status"); }; }; then
20973   cf_result=yes
20974 else
20975   echo "$as_me: failed program was:" >&5
20976 cat "conftest.$ac_ext" >&5
20977 cf_result=no
20978 fi
20979 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20980 echo "$as_me:20980: result: $cf_result" >&5
20981 echo "${ECHO_T}$cf_result" >&6
20982 if test "$cf_result" = yes ; then
20983
20984 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20985
20986 cat >>confdefs.h <<EOF
20987 #define $cf_result 1
20988 EOF
20989
20990 else
20991
20992 cat >>confdefs.h <<EOF
20993 #define wint_t long
20994 EOF
20995
20996 fi
20997
20998         fi
20999 fi
21000
21001 for cf_data in \
21002 TABSIZE \
21003 curscr \
21004 ospeed \
21005 boolnames \
21006 boolfnames \
21007 ttytype
21008 do
21009 echo "$as_me:21009: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
21010 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
21011
21012 cat >"conftest.$ac_ext" <<_ACEOF
21013 #line 21013 "configure"
21014 #include "confdefs.h"
21015
21016 #ifdef HAVE_XCURSES
21017 #include <xcurses.h>
21018 char * XCursesProgramName = "test";
21019 #else
21020 #include <${cf_cv_ncurses_header:-curses.h}>
21021 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
21022 #include <ncursesw/term.h>
21023 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
21024 #include <ncurses/term.h>
21025 #elif defined(HAVE_TERM_H)
21026 #include <term.h>
21027 #endif
21028 #endif
21029
21030 int
21031 main (void)
21032 {
21033
21034 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
21035         const void *foo = (const void *)($cf_data);
21036 #else
21037         const void *foo = &($cf_data);
21038 #endif
21039         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
21040
21041   ;
21042   return 0;
21043 }
21044 _ACEOF
21045 rm -f "conftest.$ac_objext"
21046 if { (eval echo "$as_me:21046: \"$ac_compile\"") >&5
21047   (eval $ac_compile) 2>&5
21048   ac_status=$?
21049   echo "$as_me:21049: \$? = $ac_status" >&5
21050   (exit "$ac_status"); } &&
21051          { ac_try='test -s "conftest.$ac_objext"'
21052   { (eval echo "$as_me:21052: \"$ac_try\"") >&5
21053   (eval $ac_try) 2>&5
21054   ac_status=$?
21055   echo "$as_me:21055: \$? = $ac_status" >&5
21056   (exit "$ac_status"); }; }; then
21057   cf_result=yes
21058
21059 else
21060   echo "$as_me: failed program was:" >&5
21061 cat "conftest.$ac_ext" >&5
21062 cf_result=no
21063 fi
21064 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21065 echo "$as_me:21065: result: $cf_result" >&5
21066 echo "${ECHO_T}$cf_result" >&6
21067
21068 if test "$cf_result" = yes ; then
21069
21070 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21071
21072         cat >>confdefs.h <<EOF
21073 #define $cf_result 1
21074 EOF
21075
21076 else
21077         echo "$as_me:21077: checking for data $cf_data in library" >&5
21078 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
21079         # BSD linkers insist on making weak linkage, but resolve at runtime.
21080         if test "$cross_compiling" = yes; then
21081
21082         # cross-compiling
21083         cat >"conftest.$ac_ext" <<_ACEOF
21084 #line 21084 "configure"
21085 #include "confdefs.h"
21086
21087 #ifdef HAVE_XCURSES
21088 #include <xcurses.h>
21089 char * XCursesProgramName = "test";
21090 #else
21091 #include <${cf_cv_ncurses_header:-curses.h}>
21092 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
21093 #include <ncursesw/term.h>
21094 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
21095 #include <ncurses/term.h>
21096 #elif defined(HAVE_TERM_H)
21097 #include <term.h>
21098 #endif
21099 #endif
21100
21101 extern char $cf_data;
21102 int
21103 main (void)
21104 {
21105
21106         do {
21107
21108 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
21109         const void *foo = (const void *)($cf_data);
21110 #else
21111         const void *foo = &($cf_data);
21112 #endif
21113         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
21114
21115                 ${cf_cv_main_return:-return}(foo == 0);
21116         } while (0)
21117
21118   ;
21119   return 0;
21120 }
21121 _ACEOF
21122 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21123 if { (eval echo "$as_me:21123: \"$ac_link\"") >&5
21124   (eval $ac_link) 2>&5
21125   ac_status=$?
21126   echo "$as_me:21126: \$? = $ac_status" >&5
21127   (exit "$ac_status"); } &&
21128          { ac_try='test -s "conftest$ac_exeext"'
21129   { (eval echo "$as_me:21129: \"$ac_try\"") >&5
21130   (eval $ac_try) 2>&5
21131   ac_status=$?
21132   echo "$as_me:21132: \$? = $ac_status" >&5
21133   (exit "$ac_status"); }; }; then
21134   cf_result=yes
21135 else
21136   echo "$as_me: failed program was:" >&5
21137 cat "conftest.$ac_ext" >&5
21138 cf_result=no
21139 fi
21140 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21141
21142 else
21143   cat >"conftest.$ac_ext" <<_ACEOF
21144 #line 21144 "configure"
21145 #include "confdefs.h"
21146
21147 #ifdef HAVE_XCURSES
21148 #include <xcurses.h>
21149 char * XCursesProgramName = "test";
21150 #else
21151 #include <${cf_cv_ncurses_header:-curses.h}>
21152 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
21153 #include <ncursesw/term.h>
21154 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
21155 #include <ncurses/term.h>
21156 #elif defined(HAVE_TERM_H)
21157 #include <term.h>
21158 #endif
21159 #endif
21160
21161 extern char $cf_data;
21162 int main(void)
21163 {
21164
21165 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
21166         const void *foo = (const void *)($cf_data);
21167 #else
21168         const void *foo = &($cf_data);
21169 #endif
21170         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
21171
21172         ${cf_cv_main_return:-return}(foo == 0);
21173 }
21174 _ACEOF
21175 rm -f "conftest$ac_exeext"
21176 if { (eval echo "$as_me:21176: \"$ac_link\"") >&5
21177   (eval $ac_link) 2>&5
21178   ac_status=$?
21179   echo "$as_me:21179: \$? = $ac_status" >&5
21180   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
21181   { (eval echo "$as_me:21181: \"$ac_try\"") >&5
21182   (eval $ac_try) 2>&5
21183   ac_status=$?
21184   echo "$as_me:21184: \$? = $ac_status" >&5
21185   (exit "$ac_status"); }; }; then
21186   cf_result=yes
21187
21188 else
21189   echo "$as_me: program exited with status $ac_status" >&5
21190 echo "$as_me: failed program was:" >&5
21191 cat "conftest.$ac_ext" >&5
21192 cf_result=no
21193 fi
21194 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
21195 fi
21196         echo "$as_me:21196: result: $cf_result" >&5
21197 echo "${ECHO_T}$cf_result" >&6
21198         if test "$cf_result" = yes ; then
21199
21200 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21201
21202                 cat >>confdefs.h <<EOF
21203 #define $cf_result 1
21204 EOF
21205
21206                 # do not exit loop here, since we prefer system's declarations
21207         fi
21208 fi
21209 done
21210
21211 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
21212 then
21213         echo "$as_me:21213: checking for X" >&5
21214 echo $ECHO_N "checking for X... $ECHO_C" >&6
21215
21216 # Check whether --with-x or --without-x was given.
21217 if test "${with_x+set}" = set; then
21218   withval="$with_x"
21219
21220 fi;
21221 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
21222 if test "x$with_x" = xno; then
21223   # The user explicitly disabled X.
21224   have_x=disabled
21225 else
21226   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
21227     # Both variables are already set.
21228     have_x=yes
21229   else
21230     if test "${ac_cv_have_x+set}" = set; then
21231   echo $ECHO_N "(cached) $ECHO_C" >&6
21232 else
21233   # One or both of the vars are not set, and there is no cached value.
21234 ac_x_includes=no ac_x_libraries=no
21235 rm -fr conftest.dir
21236 if mkdir conftest.dir; then
21237   cd conftest.dir
21238   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
21239   cat >Imakefile <<'EOF'
21240 acfindx:
21241         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
21242 EOF
21243   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
21244     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
21245     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
21246     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
21247     for ac_extension in a so sl dylib dll; do
21248       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
21249          test -f "$ac_im_libdir/libX11.$ac_extension"; then
21250         ac_im_usrlibdir=$ac_im_libdir; break
21251       fi
21252     done
21253     # Screen out bogus values from the imake configuration.  They are
21254     # bogus both because they are the default anyway, and because
21255     # using them would break gcc on systems where it needs fixed includes.
21256     case $ac_im_incroot in
21257         /usr/include) ;;
21258         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
21259     esac
21260     case $ac_im_usrlibdir in
21261         /usr/lib | /lib) ;;
21262         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
21263     esac
21264   fi
21265   cd ..
21266   rm -fr conftest.dir
21267 fi
21268
21269 # Standard set of common directories for X headers.
21270 # Check X11 before X11Rn because it is often a symlink to the current release.
21271 ac_x_header_dirs='
21272 /usr/X11/include
21273 /usr/X11R7/include
21274 /usr/X11R6/include
21275 /usr/X11R5/include
21276 /usr/X11R4/include
21277
21278 /opt/local/include
21279 /opt/X11/include
21280
21281 /usr/include/X11
21282 /usr/include/X11R7
21283 /usr/include/X11R6
21284 /usr/include/X11R5
21285 /usr/include/X11R4
21286
21287 /usr/local/X11/include
21288 /usr/local/X11R7/include
21289 /usr/local/X11R6/include
21290 /usr/local/X11R5/include
21291 /usr/local/X11R4/include
21292
21293 /usr/local/include/X11
21294 /usr/local/include/X11R7
21295 /usr/local/include/X11R6
21296 /usr/local/include/X11R5
21297 /usr/local/include/X11R4
21298
21299 /usr/X386/include
21300 /usr/x386/include
21301 /usr/XFree86/include/X11
21302
21303 /usr/include
21304 /usr/local/include
21305 /usr/unsupported/include
21306 /usr/athena/include
21307 /usr/local/x11r5/include
21308 /usr/lpp/Xamples/include
21309
21310 /usr/openwin/include
21311 /usr/openwin/share/include'
21312
21313 if test "$ac_x_includes" = no; then
21314   # Guess where to find include files, by looking for Intrinsic.h.
21315   # First, try using that file with no special directory specified.
21316   cat >"conftest.$ac_ext" <<_ACEOF
21317 #line 21317 "configure"
21318 #include "confdefs.h"
21319 #include <X11/Intrinsic.h>
21320 _ACEOF
21321 if { (eval echo "$as_me:21321: \"$ac_cpp "conftest.$ac_ext"\"") >&5
21322   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
21323   ac_status=$?
21324   $EGREP -v '^ *\+' conftest.er1 >conftest.err
21325   rm -f conftest.er1
21326   cat conftest.err >&5
21327   echo "$as_me:21327: \$? = $ac_status" >&5
21328   (exit "$ac_status"); } >/dev/null; then
21329   if test -s conftest.err; then
21330     ac_cpp_err=$ac_c_preproc_warn_flag
21331   else
21332     ac_cpp_err=
21333   fi
21334 else
21335   ac_cpp_err=yes
21336 fi
21337 if test -z "$ac_cpp_err"; then
21338   # We can compile using X headers with no special include directory.
21339 ac_x_includes=
21340 else
21341   echo "$as_me: failed program was:" >&5
21342   cat "conftest.$ac_ext" >&5
21343   for ac_dir in $ac_x_header_dirs; do
21344   if test -r "$ac_dir/X11/Intrinsic.h"; then
21345     ac_x_includes=$ac_dir
21346     break
21347   fi
21348 done
21349 fi
21350 rm -f conftest.err "conftest.$ac_ext"
21351 fi # $ac_x_includes = no
21352
21353 if test "$ac_x_libraries" = no; then
21354   # Check for the libraries.
21355   # See if we find them without any special options.
21356   # Don't add to $LIBS permanently.
21357   ac_save_LIBS=$LIBS
21358   LIBS="-lXt $LIBS"
21359   cat >"conftest.$ac_ext" <<_ACEOF
21360 #line 21360 "configure"
21361 #include "confdefs.h"
21362 #include <X11/Intrinsic.h>
21363 int
21364 main (void)
21365 {
21366 XtMalloc (0)
21367   ;
21368   return 0;
21369 }
21370 _ACEOF
21371 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21372 if { (eval echo "$as_me:21372: \"$ac_link\"") >&5
21373   (eval $ac_link) 2>&5
21374   ac_status=$?
21375   echo "$as_me:21375: \$? = $ac_status" >&5
21376   (exit "$ac_status"); } &&
21377          { ac_try='test -s "conftest$ac_exeext"'
21378   { (eval echo "$as_me:21378: \"$ac_try\"") >&5
21379   (eval $ac_try) 2>&5
21380   ac_status=$?
21381   echo "$as_me:21381: \$? = $ac_status" >&5
21382   (exit "$ac_status"); }; }; then
21383   LIBS=$ac_save_LIBS
21384 # We can link X programs with no special library path.
21385 ac_x_libraries=
21386 else
21387   echo "$as_me: failed program was:" >&5
21388 cat "conftest.$ac_ext" >&5
21389 LIBS=$ac_save_LIBS
21390 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
21391 do
21392   # Don't even attempt the hair of trying to link an X program!
21393   for ac_extension in a so sl dylib dll; do
21394     if test -r "$ac_dir/libXt.$ac_extension"; then
21395       ac_x_libraries=$ac_dir
21396       break 2
21397     fi
21398   done
21399 done
21400 fi
21401 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21402 fi # $ac_x_libraries = no
21403
21404 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
21405   # Didn't find X anywhere.  Cache the known absence of X.
21406   ac_cv_have_x="have_x=no"
21407 else
21408   # Record where we found X for the cache.
21409   ac_cv_have_x="have_x=yes \
21410                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
21411 fi
21412 fi
21413
21414   fi
21415   eval "$ac_cv_have_x"
21416 fi # $with_x != no
21417
21418 if test "$have_x" != yes; then
21419   echo "$as_me:21419: result: $have_x" >&5
21420 echo "${ECHO_T}$have_x" >&6
21421   no_x=yes
21422 else
21423   # If each of the values was on the command line, it overrides each guess.
21424   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
21425   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
21426   # Update the cache value to reflect the command line values.
21427   ac_cv_have_x="have_x=yes \
21428                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
21429   echo "$as_me:21429: result: libraries $x_libraries, headers $x_includes" >&5
21430 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
21431 fi
21432
21433         if test "$no_x" = yes; then
21434   # Not all programs may use this symbol, but it does not hurt to define it.
21435
21436 cat >>confdefs.h <<\EOF
21437 #define X_DISPLAY_MISSING 1
21438 EOF
21439
21440   X_CFLAGS=
21441   X_PRE_LIBS=
21442   X_LIBS=
21443   X_EXTRA_LIBS=
21444 else
21445   if test -n "$x_includes"; then
21446     X_CFLAGS="$X_CFLAGS -I$x_includes"
21447   fi
21448
21449   # It would also be nice to do this for all -L options, not just this one.
21450   if test -n "$x_libraries"; then
21451     X_LIBS="$X_LIBS -L$x_libraries"
21452     # For Solaris; some versions of Sun CC require a space after -R and
21453     # others require no space.  Words are not sufficient . . . .
21454     case `(uname -sr) 2>/dev/null` in
21455     "SunOS 5"*)
21456       echo "$as_me:21456: checking whether -R must be followed by a space" >&5
21457 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
21458       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
21459       cat >"conftest.$ac_ext" <<_ACEOF
21460 #line 21460 "configure"
21461 #include "confdefs.h"
21462
21463 int
21464 main (void)
21465 {
21466
21467   ;
21468   return 0;
21469 }
21470 _ACEOF
21471 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21472 if { (eval echo "$as_me:21472: \"$ac_link\"") >&5
21473   (eval $ac_link) 2>&5
21474   ac_status=$?
21475   echo "$as_me:21475: \$? = $ac_status" >&5
21476   (exit "$ac_status"); } &&
21477          { ac_try='test -s "conftest$ac_exeext"'
21478   { (eval echo "$as_me:21478: \"$ac_try\"") >&5
21479   (eval $ac_try) 2>&5
21480   ac_status=$?
21481   echo "$as_me:21481: \$? = $ac_status" >&5
21482   (exit "$ac_status"); }; }; then
21483   ac_R_nospace=yes
21484 else
21485   echo "$as_me: failed program was:" >&5
21486 cat "conftest.$ac_ext" >&5
21487 ac_R_nospace=no
21488 fi
21489 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21490       if test $ac_R_nospace = yes; then
21491         echo "$as_me:21491: result: no" >&5
21492 echo "${ECHO_T}no" >&6
21493         X_LIBS="$X_LIBS -R$x_libraries"
21494       else
21495         LIBS="$ac_xsave_LIBS -R $x_libraries"
21496         cat >"conftest.$ac_ext" <<_ACEOF
21497 #line 21497 "configure"
21498 #include "confdefs.h"
21499
21500 int
21501 main (void)
21502 {
21503
21504   ;
21505   return 0;
21506 }
21507 _ACEOF
21508 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21509 if { (eval echo "$as_me:21509: \"$ac_link\"") >&5
21510   (eval $ac_link) 2>&5
21511   ac_status=$?
21512   echo "$as_me:21512: \$? = $ac_status" >&5
21513   (exit "$ac_status"); } &&
21514          { ac_try='test -s "conftest$ac_exeext"'
21515   { (eval echo "$as_me:21515: \"$ac_try\"") >&5
21516   (eval $ac_try) 2>&5
21517   ac_status=$?
21518   echo "$as_me:21518: \$? = $ac_status" >&5
21519   (exit "$ac_status"); }; }; then
21520   ac_R_space=yes
21521 else
21522   echo "$as_me: failed program was:" >&5
21523 cat "conftest.$ac_ext" >&5
21524 ac_R_space=no
21525 fi
21526 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21527         if test $ac_R_space = yes; then
21528           echo "$as_me:21528: result: yes" >&5
21529 echo "${ECHO_T}yes" >&6
21530           X_LIBS="$X_LIBS -R $x_libraries"
21531         else
21532           echo "$as_me:21532: result: neither works" >&5
21533 echo "${ECHO_T}neither works" >&6
21534         fi
21535       fi
21536       LIBS=$ac_xsave_LIBS
21537     esac
21538   fi
21539
21540   # Check for system-dependent libraries X programs must link with.
21541   # Do this before checking for the system-independent R6 libraries
21542   # (-lICE), since we may need -lsocket or whatever for X linking.
21543
21544   if test "$ISC" = yes; then
21545     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
21546   else
21547     # Martyn Johnson says this is needed for Ultrix, if the X
21548     # libraries were built with DECnet support.  And Karl Berry says
21549     # the Alpha needs dnet_stub (dnet does not exist).
21550     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
21551     cat >"conftest.$ac_ext" <<_ACEOF
21552 #line 21552 "configure"
21553 #include "confdefs.h"
21554
21555 /* Override any gcc2 internal prototype to avoid an error.  */
21556 #ifdef __cplusplus
21557 extern "C"
21558 #endif
21559 /* We use char because int might match the return type of a gcc2
21560    builtin and then its argument prototype would still apply.  */
21561 char XOpenDisplay ();
21562 int
21563 main (void)
21564 {
21565 XOpenDisplay ();
21566   ;
21567   return 0;
21568 }
21569 _ACEOF
21570 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21571 if { (eval echo "$as_me:21571: \"$ac_link\"") >&5
21572   (eval $ac_link) 2>&5
21573   ac_status=$?
21574   echo "$as_me:21574: \$? = $ac_status" >&5
21575   (exit "$ac_status"); } &&
21576          { ac_try='test -s "conftest$ac_exeext"'
21577   { (eval echo "$as_me:21577: \"$ac_try\"") >&5
21578   (eval $ac_try) 2>&5
21579   ac_status=$?
21580   echo "$as_me:21580: \$? = $ac_status" >&5
21581   (exit "$ac_status"); }; }; then
21582   :
21583 else
21584   echo "$as_me: failed program was:" >&5
21585 cat "conftest.$ac_ext" >&5
21586 echo "$as_me:21586: checking for dnet_ntoa in -ldnet" >&5
21587 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
21588 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
21589   echo $ECHO_N "(cached) $ECHO_C" >&6
21590 else
21591   ac_check_lib_save_LIBS=$LIBS
21592 LIBS="-ldnet  $LIBS"
21593 cat >"conftest.$ac_ext" <<_ACEOF
21594 #line 21594 "configure"
21595 #include "confdefs.h"
21596
21597 /* Override any gcc2 internal prototype to avoid an error.  */
21598 #ifdef __cplusplus
21599 extern "C"
21600 #endif
21601 /* We use char because int might match the return type of a gcc2
21602    builtin and then its argument prototype would still apply.  */
21603 char dnet_ntoa ();
21604 int
21605 main (void)
21606 {
21607 dnet_ntoa ();
21608   ;
21609   return 0;
21610 }
21611 _ACEOF
21612 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21613 if { (eval echo "$as_me:21613: \"$ac_link\"") >&5
21614   (eval $ac_link) 2>&5
21615   ac_status=$?
21616   echo "$as_me:21616: \$? = $ac_status" >&5
21617   (exit "$ac_status"); } &&
21618          { ac_try='test -s "conftest$ac_exeext"'
21619   { (eval echo "$as_me:21619: \"$ac_try\"") >&5
21620   (eval $ac_try) 2>&5
21621   ac_status=$?
21622   echo "$as_me:21622: \$? = $ac_status" >&5
21623   (exit "$ac_status"); }; }; then
21624   ac_cv_lib_dnet_dnet_ntoa=yes
21625 else
21626   echo "$as_me: failed program was:" >&5
21627 cat "conftest.$ac_ext" >&5
21628 ac_cv_lib_dnet_dnet_ntoa=no
21629 fi
21630 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21631 LIBS=$ac_check_lib_save_LIBS
21632 fi
21633 echo "$as_me:21633: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
21634 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
21635 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
21636   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
21637 fi
21638
21639     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
21640       echo "$as_me:21640: checking for dnet_ntoa in -ldnet_stub" >&5
21641 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
21642 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
21643   echo $ECHO_N "(cached) $ECHO_C" >&6
21644 else
21645   ac_check_lib_save_LIBS=$LIBS
21646 LIBS="-ldnet_stub  $LIBS"
21647 cat >"conftest.$ac_ext" <<_ACEOF
21648 #line 21648 "configure"
21649 #include "confdefs.h"
21650
21651 /* Override any gcc2 internal prototype to avoid an error.  */
21652 #ifdef __cplusplus
21653 extern "C"
21654 #endif
21655 /* We use char because int might match the return type of a gcc2
21656    builtin and then its argument prototype would still apply.  */
21657 char dnet_ntoa ();
21658 int
21659 main (void)
21660 {
21661 dnet_ntoa ();
21662   ;
21663   return 0;
21664 }
21665 _ACEOF
21666 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21667 if { (eval echo "$as_me:21667: \"$ac_link\"") >&5
21668   (eval $ac_link) 2>&5
21669   ac_status=$?
21670   echo "$as_me:21670: \$? = $ac_status" >&5
21671   (exit "$ac_status"); } &&
21672          { ac_try='test -s "conftest$ac_exeext"'
21673   { (eval echo "$as_me:21673: \"$ac_try\"") >&5
21674   (eval $ac_try) 2>&5
21675   ac_status=$?
21676   echo "$as_me:21676: \$? = $ac_status" >&5
21677   (exit "$ac_status"); }; }; then
21678   ac_cv_lib_dnet_stub_dnet_ntoa=yes
21679 else
21680   echo "$as_me: failed program was:" >&5
21681 cat "conftest.$ac_ext" >&5
21682 ac_cv_lib_dnet_stub_dnet_ntoa=no
21683 fi
21684 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21685 LIBS=$ac_check_lib_save_LIBS
21686 fi
21687 echo "$as_me:21687: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
21688 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
21689 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
21690   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
21691 fi
21692
21693     fi
21694 fi
21695 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21696     LIBS="$ac_xsave_LIBS"
21697
21698     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
21699     # to get the SysV transport functions.
21700     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
21701     # needs -lnsl.
21702     # The nsl library prevents programs from opening the X display
21703     # on Irix 5.2, according to T.E. Dickey.
21704     # The functions gethostbyname, getservbyname, and inet_addr are
21705     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
21706     echo "$as_me:21706: checking for gethostbyname" >&5
21707 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
21708 if test "${ac_cv_func_gethostbyname+set}" = set; then
21709   echo $ECHO_N "(cached) $ECHO_C" >&6
21710 else
21711   cat >"conftest.$ac_ext" <<_ACEOF
21712 #line 21712 "configure"
21713 #include "confdefs.h"
21714 #define gethostbyname autoconf_temporary
21715 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21716 #undef gethostbyname
21717
21718 #ifdef __cplusplus
21719 extern "C"
21720 #endif
21721
21722 /* We use char because int might match the return type of a gcc2
21723    builtin and then its argument prototype would still apply.  */
21724 char gethostbyname (void);
21725
21726 int
21727 main (void)
21728 {
21729
21730 /* The GNU C library defines stubs for functions which it implements
21731     to always fail with ENOSYS.  Some functions are actually named
21732     something starting with __ and the normal name is an alias.  */
21733 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21734 #error found stub for gethostbyname
21735 #endif
21736
21737         return gethostbyname ();
21738   ;
21739   return 0;
21740 }
21741 _ACEOF
21742 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21743 if { (eval echo "$as_me:21743: \"$ac_link\"") >&5
21744   (eval $ac_link) 2>&5
21745   ac_status=$?
21746   echo "$as_me:21746: \$? = $ac_status" >&5
21747   (exit "$ac_status"); } &&
21748          { ac_try='test -s "conftest$ac_exeext"'
21749   { (eval echo "$as_me:21749: \"$ac_try\"") >&5
21750   (eval $ac_try) 2>&5
21751   ac_status=$?
21752   echo "$as_me:21752: \$? = $ac_status" >&5
21753   (exit "$ac_status"); }; }; then
21754   ac_cv_func_gethostbyname=yes
21755 else
21756   echo "$as_me: failed program was:" >&5
21757 cat "conftest.$ac_ext" >&5
21758 ac_cv_func_gethostbyname=no
21759 fi
21760 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21761 fi
21762 echo "$as_me:21762: result: $ac_cv_func_gethostbyname" >&5
21763 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21764
21765     if test $ac_cv_func_gethostbyname = no; then
21766       echo "$as_me:21766: checking for gethostbyname in -lnsl" >&5
21767 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21768 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21769   echo $ECHO_N "(cached) $ECHO_C" >&6
21770 else
21771   ac_check_lib_save_LIBS=$LIBS
21772 LIBS="-lnsl  $LIBS"
21773 cat >"conftest.$ac_ext" <<_ACEOF
21774 #line 21774 "configure"
21775 #include "confdefs.h"
21776
21777 /* Override any gcc2 internal prototype to avoid an error.  */
21778 #ifdef __cplusplus
21779 extern "C"
21780 #endif
21781 /* We use char because int might match the return type of a gcc2
21782    builtin and then its argument prototype would still apply.  */
21783 char gethostbyname ();
21784 int
21785 main (void)
21786 {
21787 gethostbyname ();
21788   ;
21789   return 0;
21790 }
21791 _ACEOF
21792 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21793 if { (eval echo "$as_me:21793: \"$ac_link\"") >&5
21794   (eval $ac_link) 2>&5
21795   ac_status=$?
21796   echo "$as_me:21796: \$? = $ac_status" >&5
21797   (exit "$ac_status"); } &&
21798          { ac_try='test -s "conftest$ac_exeext"'
21799   { (eval echo "$as_me:21799: \"$ac_try\"") >&5
21800   (eval $ac_try) 2>&5
21801   ac_status=$?
21802   echo "$as_me:21802: \$? = $ac_status" >&5
21803   (exit "$ac_status"); }; }; then
21804   ac_cv_lib_nsl_gethostbyname=yes
21805 else
21806   echo "$as_me: failed program was:" >&5
21807 cat "conftest.$ac_ext" >&5
21808 ac_cv_lib_nsl_gethostbyname=no
21809 fi
21810 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21811 LIBS=$ac_check_lib_save_LIBS
21812 fi
21813 echo "$as_me:21813: result: $ac_cv_lib_nsl_gethostbyname" >&5
21814 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21815 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21816   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21817 fi
21818
21819       if test $ac_cv_lib_nsl_gethostbyname = no; then
21820         echo "$as_me:21820: checking for gethostbyname in -lbsd" >&5
21821 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21822 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21823   echo $ECHO_N "(cached) $ECHO_C" >&6
21824 else
21825   ac_check_lib_save_LIBS=$LIBS
21826 LIBS="-lbsd  $LIBS"
21827 cat >"conftest.$ac_ext" <<_ACEOF
21828 #line 21828 "configure"
21829 #include "confdefs.h"
21830
21831 /* Override any gcc2 internal prototype to avoid an error.  */
21832 #ifdef __cplusplus
21833 extern "C"
21834 #endif
21835 /* We use char because int might match the return type of a gcc2
21836    builtin and then its argument prototype would still apply.  */
21837 char gethostbyname ();
21838 int
21839 main (void)
21840 {
21841 gethostbyname ();
21842   ;
21843   return 0;
21844 }
21845 _ACEOF
21846 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21847 if { (eval echo "$as_me:21847: \"$ac_link\"") >&5
21848   (eval $ac_link) 2>&5
21849   ac_status=$?
21850   echo "$as_me:21850: \$? = $ac_status" >&5
21851   (exit "$ac_status"); } &&
21852          { ac_try='test -s "conftest$ac_exeext"'
21853   { (eval echo "$as_me:21853: \"$ac_try\"") >&5
21854   (eval $ac_try) 2>&5
21855   ac_status=$?
21856   echo "$as_me:21856: \$? = $ac_status" >&5
21857   (exit "$ac_status"); }; }; then
21858   ac_cv_lib_bsd_gethostbyname=yes
21859 else
21860   echo "$as_me: failed program was:" >&5
21861 cat "conftest.$ac_ext" >&5
21862 ac_cv_lib_bsd_gethostbyname=no
21863 fi
21864 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21865 LIBS=$ac_check_lib_save_LIBS
21866 fi
21867 echo "$as_me:21867: result: $ac_cv_lib_bsd_gethostbyname" >&5
21868 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21869 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21870   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21871 fi
21872
21873       fi
21874     fi
21875
21876     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21877     # socket/setsockopt and other routines are undefined under SCO ODT
21878     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21879     # on later versions), says Simon Leinen: it contains gethostby*
21880     # variants that don't use the nameserver (or something).  -lsocket
21881     # must be given before -lnsl if both are needed.  We assume that
21882     # if connect needs -lnsl, so does gethostbyname.
21883     echo "$as_me:21883: checking for connect" >&5
21884 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21885 if test "${ac_cv_func_connect+set}" = set; then
21886   echo $ECHO_N "(cached) $ECHO_C" >&6
21887 else
21888   cat >"conftest.$ac_ext" <<_ACEOF
21889 #line 21889 "configure"
21890 #include "confdefs.h"
21891 #define connect autoconf_temporary
21892 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21893 #undef connect
21894
21895 #ifdef __cplusplus
21896 extern "C"
21897 #endif
21898
21899 /* We use char because int might match the return type of a gcc2
21900    builtin and then its argument prototype would still apply.  */
21901 char connect (void);
21902
21903 int
21904 main (void)
21905 {
21906
21907 /* The GNU C library defines stubs for functions which it implements
21908     to always fail with ENOSYS.  Some functions are actually named
21909     something starting with __ and the normal name is an alias.  */
21910 #if defined (__stub_connect) || defined (__stub___connect)
21911 #error found stub for connect
21912 #endif
21913
21914         return connect ();
21915   ;
21916   return 0;
21917 }
21918 _ACEOF
21919 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21920 if { (eval echo "$as_me:21920: \"$ac_link\"") >&5
21921   (eval $ac_link) 2>&5
21922   ac_status=$?
21923   echo "$as_me:21923: \$? = $ac_status" >&5
21924   (exit "$ac_status"); } &&
21925          { ac_try='test -s "conftest$ac_exeext"'
21926   { (eval echo "$as_me:21926: \"$ac_try\"") >&5
21927   (eval $ac_try) 2>&5
21928   ac_status=$?
21929   echo "$as_me:21929: \$? = $ac_status" >&5
21930   (exit "$ac_status"); }; }; then
21931   ac_cv_func_connect=yes
21932 else
21933   echo "$as_me: failed program was:" >&5
21934 cat "conftest.$ac_ext" >&5
21935 ac_cv_func_connect=no
21936 fi
21937 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21938 fi
21939 echo "$as_me:21939: result: $ac_cv_func_connect" >&5
21940 echo "${ECHO_T}$ac_cv_func_connect" >&6
21941
21942     if test $ac_cv_func_connect = no; then
21943       echo "$as_me:21943: checking for connect in -lsocket" >&5
21944 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21945 if test "${ac_cv_lib_socket_connect+set}" = set; then
21946   echo $ECHO_N "(cached) $ECHO_C" >&6
21947 else
21948   ac_check_lib_save_LIBS=$LIBS
21949 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21950 cat >"conftest.$ac_ext" <<_ACEOF
21951 #line 21951 "configure"
21952 #include "confdefs.h"
21953
21954 /* Override any gcc2 internal prototype to avoid an error.  */
21955 #ifdef __cplusplus
21956 extern "C"
21957 #endif
21958 /* We use char because int might match the return type of a gcc2
21959    builtin and then its argument prototype would still apply.  */
21960 char connect ();
21961 int
21962 main (void)
21963 {
21964 connect ();
21965   ;
21966   return 0;
21967 }
21968 _ACEOF
21969 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21970 if { (eval echo "$as_me:21970: \"$ac_link\"") >&5
21971   (eval $ac_link) 2>&5
21972   ac_status=$?
21973   echo "$as_me:21973: \$? = $ac_status" >&5
21974   (exit "$ac_status"); } &&
21975          { ac_try='test -s "conftest$ac_exeext"'
21976   { (eval echo "$as_me:21976: \"$ac_try\"") >&5
21977   (eval $ac_try) 2>&5
21978   ac_status=$?
21979   echo "$as_me:21979: \$? = $ac_status" >&5
21980   (exit "$ac_status"); }; }; then
21981   ac_cv_lib_socket_connect=yes
21982 else
21983   echo "$as_me: failed program was:" >&5
21984 cat "conftest.$ac_ext" >&5
21985 ac_cv_lib_socket_connect=no
21986 fi
21987 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21988 LIBS=$ac_check_lib_save_LIBS
21989 fi
21990 echo "$as_me:21990: result: $ac_cv_lib_socket_connect" >&5
21991 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21992 if test "$ac_cv_lib_socket_connect" = yes; then
21993   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21994 fi
21995
21996     fi
21997
21998     # Guillermo Gomez says -lposix is necessary on A/UX.
21999     echo "$as_me:21999: checking for remove" >&5
22000 echo $ECHO_N "checking for remove... $ECHO_C" >&6
22001 if test "${ac_cv_func_remove+set}" = set; then
22002   echo $ECHO_N "(cached) $ECHO_C" >&6
22003 else
22004   cat >"conftest.$ac_ext" <<_ACEOF
22005 #line 22005 "configure"
22006 #include "confdefs.h"
22007 #define remove autoconf_temporary
22008 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
22009 #undef remove
22010
22011 #ifdef __cplusplus
22012 extern "C"
22013 #endif
22014
22015 /* We use char because int might match the return type of a gcc2
22016    builtin and then its argument prototype would still apply.  */
22017 char remove (void);
22018
22019 int
22020 main (void)
22021 {
22022
22023 /* The GNU C library defines stubs for functions which it implements
22024     to always fail with ENOSYS.  Some functions are actually named
22025     something starting with __ and the normal name is an alias.  */
22026 #if defined (__stub_remove) || defined (__stub___remove)
22027 #error found stub for remove
22028 #endif
22029
22030         return remove ();
22031   ;
22032   return 0;
22033 }
22034 _ACEOF
22035 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22036 if { (eval echo "$as_me:22036: \"$ac_link\"") >&5
22037   (eval $ac_link) 2>&5
22038   ac_status=$?
22039   echo "$as_me:22039: \$? = $ac_status" >&5
22040   (exit "$ac_status"); } &&
22041          { ac_try='test -s "conftest$ac_exeext"'
22042   { (eval echo "$as_me:22042: \"$ac_try\"") >&5
22043   (eval $ac_try) 2>&5
22044   ac_status=$?
22045   echo "$as_me:22045: \$? = $ac_status" >&5
22046   (exit "$ac_status"); }; }; then
22047   ac_cv_func_remove=yes
22048 else
22049   echo "$as_me: failed program was:" >&5
22050 cat "conftest.$ac_ext" >&5
22051 ac_cv_func_remove=no
22052 fi
22053 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22054 fi
22055 echo "$as_me:22055: result: $ac_cv_func_remove" >&5
22056 echo "${ECHO_T}$ac_cv_func_remove" >&6
22057
22058     if test $ac_cv_func_remove = no; then
22059       echo "$as_me:22059: checking for remove in -lposix" >&5
22060 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
22061 if test "${ac_cv_lib_posix_remove+set}" = set; then
22062   echo $ECHO_N "(cached) $ECHO_C" >&6
22063 else
22064   ac_check_lib_save_LIBS=$LIBS
22065 LIBS="-lposix  $LIBS"
22066 cat >"conftest.$ac_ext" <<_ACEOF
22067 #line 22067 "configure"
22068 #include "confdefs.h"
22069
22070 /* Override any gcc2 internal prototype to avoid an error.  */
22071 #ifdef __cplusplus
22072 extern "C"
22073 #endif
22074 /* We use char because int might match the return type of a gcc2
22075    builtin and then its argument prototype would still apply.  */
22076 char remove ();
22077 int
22078 main (void)
22079 {
22080 remove ();
22081   ;
22082   return 0;
22083 }
22084 _ACEOF
22085 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22086 if { (eval echo "$as_me:22086: \"$ac_link\"") >&5
22087   (eval $ac_link) 2>&5
22088   ac_status=$?
22089   echo "$as_me:22089: \$? = $ac_status" >&5
22090   (exit "$ac_status"); } &&
22091          { ac_try='test -s "conftest$ac_exeext"'
22092   { (eval echo "$as_me:22092: \"$ac_try\"") >&5
22093   (eval $ac_try) 2>&5
22094   ac_status=$?
22095   echo "$as_me:22095: \$? = $ac_status" >&5
22096   (exit "$ac_status"); }; }; then
22097   ac_cv_lib_posix_remove=yes
22098 else
22099   echo "$as_me: failed program was:" >&5
22100 cat "conftest.$ac_ext" >&5
22101 ac_cv_lib_posix_remove=no
22102 fi
22103 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22104 LIBS=$ac_check_lib_save_LIBS
22105 fi
22106 echo "$as_me:22106: result: $ac_cv_lib_posix_remove" >&5
22107 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
22108 if test "$ac_cv_lib_posix_remove" = yes; then
22109   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
22110 fi
22111
22112     fi
22113
22114     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
22115     echo "$as_me:22115: checking for shmat" >&5
22116 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
22117 if test "${ac_cv_func_shmat+set}" = set; then
22118   echo $ECHO_N "(cached) $ECHO_C" >&6
22119 else
22120   cat >"conftest.$ac_ext" <<_ACEOF
22121 #line 22121 "configure"
22122 #include "confdefs.h"
22123 #define shmat autoconf_temporary
22124 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
22125 #undef shmat
22126
22127 #ifdef __cplusplus
22128 extern "C"
22129 #endif
22130
22131 /* We use char because int might match the return type of a gcc2
22132    builtin and then its argument prototype would still apply.  */
22133 char shmat (void);
22134
22135 int
22136 main (void)
22137 {
22138
22139 /* The GNU C library defines stubs for functions which it implements
22140     to always fail with ENOSYS.  Some functions are actually named
22141     something starting with __ and the normal name is an alias.  */
22142 #if defined (__stub_shmat) || defined (__stub___shmat)
22143 #error found stub for shmat
22144 #endif
22145
22146         return shmat ();
22147   ;
22148   return 0;
22149 }
22150 _ACEOF
22151 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22152 if { (eval echo "$as_me:22152: \"$ac_link\"") >&5
22153   (eval $ac_link) 2>&5
22154   ac_status=$?
22155   echo "$as_me:22155: \$? = $ac_status" >&5
22156   (exit "$ac_status"); } &&
22157          { ac_try='test -s "conftest$ac_exeext"'
22158   { (eval echo "$as_me:22158: \"$ac_try\"") >&5
22159   (eval $ac_try) 2>&5
22160   ac_status=$?
22161   echo "$as_me:22161: \$? = $ac_status" >&5
22162   (exit "$ac_status"); }; }; then
22163   ac_cv_func_shmat=yes
22164 else
22165   echo "$as_me: failed program was:" >&5
22166 cat "conftest.$ac_ext" >&5
22167 ac_cv_func_shmat=no
22168 fi
22169 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22170 fi
22171 echo "$as_me:22171: result: $ac_cv_func_shmat" >&5
22172 echo "${ECHO_T}$ac_cv_func_shmat" >&6
22173
22174     if test $ac_cv_func_shmat = no; then
22175       echo "$as_me:22175: checking for shmat in -lipc" >&5
22176 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
22177 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
22178   echo $ECHO_N "(cached) $ECHO_C" >&6
22179 else
22180   ac_check_lib_save_LIBS=$LIBS
22181 LIBS="-lipc  $LIBS"
22182 cat >"conftest.$ac_ext" <<_ACEOF
22183 #line 22183 "configure"
22184 #include "confdefs.h"
22185
22186 /* Override any gcc2 internal prototype to avoid an error.  */
22187 #ifdef __cplusplus
22188 extern "C"
22189 #endif
22190 /* We use char because int might match the return type of a gcc2
22191    builtin and then its argument prototype would still apply.  */
22192 char shmat ();
22193 int
22194 main (void)
22195 {
22196 shmat ();
22197   ;
22198   return 0;
22199 }
22200 _ACEOF
22201 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22202 if { (eval echo "$as_me:22202: \"$ac_link\"") >&5
22203   (eval $ac_link) 2>&5
22204   ac_status=$?
22205   echo "$as_me:22205: \$? = $ac_status" >&5
22206   (exit "$ac_status"); } &&
22207          { ac_try='test -s "conftest$ac_exeext"'
22208   { (eval echo "$as_me:22208: \"$ac_try\"") >&5
22209   (eval $ac_try) 2>&5
22210   ac_status=$?
22211   echo "$as_me:22211: \$? = $ac_status" >&5
22212   (exit "$ac_status"); }; }; then
22213   ac_cv_lib_ipc_shmat=yes
22214 else
22215   echo "$as_me: failed program was:" >&5
22216 cat "conftest.$ac_ext" >&5
22217 ac_cv_lib_ipc_shmat=no
22218 fi
22219 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22220 LIBS=$ac_check_lib_save_LIBS
22221 fi
22222 echo "$as_me:22222: result: $ac_cv_lib_ipc_shmat" >&5
22223 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
22224 if test "$ac_cv_lib_ipc_shmat" = yes; then
22225   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
22226 fi
22227
22228     fi
22229   fi
22230
22231   # Check for libraries that X11R6 Xt/Xaw programs need.
22232   ac_save_LDFLAGS=$LDFLAGS
22233   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
22234   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
22235   # check for ICE first), but we must link in the order -lSM -lICE or
22236   # we get undefined symbols.  So assume we have SM if we have ICE.
22237   # These have to be linked with before -lX11, unlike the other
22238   # libraries we check for below, so use a different variable.
22239   # John Interrante, Karl Berry
22240   echo "$as_me:22240: checking for IceConnectionNumber in -lICE" >&5
22241 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
22242 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
22243   echo $ECHO_N "(cached) $ECHO_C" >&6
22244 else
22245   ac_check_lib_save_LIBS=$LIBS
22246 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
22247 cat >"conftest.$ac_ext" <<_ACEOF
22248 #line 22248 "configure"
22249 #include "confdefs.h"
22250
22251 /* Override any gcc2 internal prototype to avoid an error.  */
22252 #ifdef __cplusplus
22253 extern "C"
22254 #endif
22255 /* We use char because int might match the return type of a gcc2
22256    builtin and then its argument prototype would still apply.  */
22257 char IceConnectionNumber ();
22258 int
22259 main (void)
22260 {
22261 IceConnectionNumber ();
22262   ;
22263   return 0;
22264 }
22265 _ACEOF
22266 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22267 if { (eval echo "$as_me:22267: \"$ac_link\"") >&5
22268   (eval $ac_link) 2>&5
22269   ac_status=$?
22270   echo "$as_me:22270: \$? = $ac_status" >&5
22271   (exit "$ac_status"); } &&
22272          { ac_try='test -s "conftest$ac_exeext"'
22273   { (eval echo "$as_me:22273: \"$ac_try\"") >&5
22274   (eval $ac_try) 2>&5
22275   ac_status=$?
22276   echo "$as_me:22276: \$? = $ac_status" >&5
22277   (exit "$ac_status"); }; }; then
22278   ac_cv_lib_ICE_IceConnectionNumber=yes
22279 else
22280   echo "$as_me: failed program was:" >&5
22281 cat "conftest.$ac_ext" >&5
22282 ac_cv_lib_ICE_IceConnectionNumber=no
22283 fi
22284 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22285 LIBS=$ac_check_lib_save_LIBS
22286 fi
22287 echo "$as_me:22287: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
22288 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
22289 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
22290   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
22291 fi
22292
22293   LDFLAGS=$ac_save_LDFLAGS
22294
22295 fi
22296
22297 fi
22298
22299 if test "$GCC" = yes || test "$GXX" = yes
22300 then
22301
22302 if test "$GCC" = yes || test "$GXX" = yes
22303 then
22304         case $CFLAGS in
22305         (*-Werror=*)
22306                 cf_temp_flags=
22307                 for cf_temp_scan in $CFLAGS
22308                 do
22309                         case "x$cf_temp_scan" in
22310                         (x-Werror=format*)
22311
22312         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22313         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22314
22315                                 ;;
22316                         (x-Werror=*)
22317
22318         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22319         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22320
22321                                 ;;
22322                         (*)
22323
22324         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22325         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22326
22327                                 ;;
22328                         esac
22329                 done
22330                 if test "x$CFLAGS" != "x$cf_temp_flags"
22331                 then
22332                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
22333
22334 echo "${as_me:-configure}:22334: testing repairing CFLAGS: $CFLAGS ..." 1>&5
22335
22336                         CFLAGS="$cf_temp_flags"
22337                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
22338
22339 echo "${as_me:-configure}:22339: testing ... fixed $CFLAGS ..." 1>&5
22340
22341                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22342
22343 echo "${as_me:-configure}:22343: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22344
22345                 fi
22346                 ;;
22347         esac
22348 fi
22349
22350 if test "$GCC" = yes || test "$GXX" = yes
22351 then
22352         case $CPPFLAGS in
22353         (*-Werror=*)
22354                 cf_temp_flags=
22355                 for cf_temp_scan in $CPPFLAGS
22356                 do
22357                         case "x$cf_temp_scan" in
22358                         (x-Werror=format*)
22359
22360         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22361         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22362
22363                                 ;;
22364                         (x-Werror=*)
22365
22366         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22367         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22368
22369                                 ;;
22370                         (*)
22371
22372         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22373         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22374
22375                                 ;;
22376                         esac
22377                 done
22378                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
22379                 then
22380                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
22381
22382 echo "${as_me:-configure}:22382: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
22383
22384                         CPPFLAGS="$cf_temp_flags"
22385                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
22386
22387 echo "${as_me:-configure}:22387: testing ... fixed $CPPFLAGS ..." 1>&5
22388
22389                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22390
22391 echo "${as_me:-configure}:22391: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22392
22393                 fi
22394                 ;;
22395         esac
22396 fi
22397
22398 if test "$GCC" = yes || test "$GXX" = yes
22399 then
22400         case $LDFLAGS in
22401         (*-Werror=*)
22402                 cf_temp_flags=
22403                 for cf_temp_scan in $LDFLAGS
22404                 do
22405                         case "x$cf_temp_scan" in
22406                         (x-Werror=format*)
22407
22408         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22409         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22410
22411                                 ;;
22412                         (x-Werror=*)
22413
22414         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22415         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22416
22417                                 ;;
22418                         (*)
22419
22420         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22421         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22422
22423                                 ;;
22424                         esac
22425                 done
22426                 if test "x$LDFLAGS" != "x$cf_temp_flags"
22427                 then
22428                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
22429
22430 echo "${as_me:-configure}:22430: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
22431
22432                         LDFLAGS="$cf_temp_flags"
22433                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
22434
22435 echo "${as_me:-configure}:22435: testing ... fixed $LDFLAGS ..." 1>&5
22436
22437                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22438
22439 echo "${as_me:-configure}:22439: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22440
22441                 fi
22442                 ;;
22443         esac
22444 fi
22445
22446 echo "$as_me:22446: checking if you want to turn on gcc warnings" >&5
22447 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
22448
22449 # Check whether --enable-warnings or --disable-warnings was given.
22450 if test "${enable_warnings+set}" = set; then
22451   enableval="$enable_warnings"
22452   test "$enableval" != yes && enableval=no
22453         if test "$enableval" != "no" ; then
22454     enable_warnings=yes
22455         else
22456                 enable_warnings=no
22457         fi
22458 else
22459   enableval=no
22460         enable_warnings=no
22461
22462 fi;
22463 echo "$as_me:22463: result: $enable_warnings" >&5
22464 echo "${ECHO_T}$enable_warnings" >&6
22465 if test "$enable_warnings" = "yes"
22466 then
22467
22468 if test "$GCC" = yes || test "$GXX" = yes
22469 then
22470 cat > conftest.i <<EOF
22471 #ifndef GCC_PRINTF
22472 #define GCC_PRINTF 0
22473 #endif
22474 #ifndef GCC_SCANF
22475 #define GCC_SCANF 0
22476 #endif
22477 #ifndef GCC_NORETURN
22478 #define GCC_NORETURN /* nothing */
22479 #endif
22480 #ifndef GCC_UNUSED
22481 #define GCC_UNUSED /* nothing */
22482 #endif
22483 EOF
22484 if test "$GCC" = yes
22485 then
22486         { echo "$as_me:22486: checking for $CC __attribute__ directives..." >&5
22487 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
22488 cat > "conftest.$ac_ext" <<EOF
22489 #line 22489 "${as_me:-configure}"
22490 #include <stdio.h>
22491 #include "confdefs.h"
22492 #include "conftest.h"
22493 #include "conftest.i"
22494 #if     GCC_PRINTF
22495 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
22496 #else
22497 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
22498 #endif
22499 #if     GCC_SCANF
22500 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
22501 #else
22502 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
22503 #endif
22504 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
22505 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
22506 extern GCC_NORETURN void foo(void);
22507 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
22508 EOF
22509         cf_printf_attribute=no
22510         cf_scanf_attribute=no
22511         for cf_attribute in scanf printf unused noreturn
22512         do
22513
22514 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
22515
22516                 cf_directive="__attribute__(($cf_attribute))"
22517                 echo "checking for $CC $cf_directive" 1>&5
22518
22519                 case "$cf_attribute" in
22520                 (printf)
22521                         cf_printf_attribute=yes
22522                         cat >conftest.h <<EOF
22523 #define GCC_$cf_ATTRIBUTE 1
22524 EOF
22525                         ;;
22526                 (scanf)
22527                         cf_scanf_attribute=yes
22528                         cat >conftest.h <<EOF
22529 #define GCC_$cf_ATTRIBUTE 1
22530 EOF
22531                         ;;
22532                 (*)
22533                         cat >conftest.h <<EOF
22534 #define GCC_$cf_ATTRIBUTE $cf_directive
22535 EOF
22536                         ;;
22537                 esac
22538
22539                 if { (eval echo "$as_me:22539: \"$ac_compile\"") >&5
22540   (eval $ac_compile) 2>&5
22541   ac_status=$?
22542   echo "$as_me:22542: \$? = $ac_status" >&5
22543   (exit "$ac_status"); }; then
22544                         test -n "$verbose" && echo "$as_me:22544: result: ... $cf_attribute" >&5
22545 echo "${ECHO_T}... $cf_attribute" >&6
22546                         cat conftest.h >>confdefs.h
22547                         case "$cf_attribute" in
22548                         (noreturn)
22549
22550 cat >>confdefs.h <<EOF
22551 #define GCC_NORETURN $cf_directive
22552 EOF
22553
22554                                 ;;
22555                         (printf)
22556                                 cf_value='/* nothing */'
22557                                 if test "$cf_printf_attribute" != no ; then
22558                                         cf_value='__attribute__((format(printf,fmt,var)))'
22559
22560 cat >>confdefs.h <<\EOF
22561 #define GCC_PRINTF 1
22562 EOF
22563
22564                                 fi
22565
22566 cat >>confdefs.h <<EOF
22567 #define GCC_PRINTFLIKE(fmt,var) $cf_value
22568 EOF
22569
22570                                 ;;
22571                         (scanf)
22572                                 cf_value='/* nothing */'
22573                                 if test "$cf_scanf_attribute" != no ; then
22574                                         cf_value='__attribute__((format(scanf,fmt,var)))'
22575
22576 cat >>confdefs.h <<\EOF
22577 #define GCC_SCANF 1
22578 EOF
22579
22580                                 fi
22581
22582 cat >>confdefs.h <<EOF
22583 #define GCC_SCANFLIKE(fmt,var) $cf_value
22584 EOF
22585
22586                                 ;;
22587                         (unused)
22588
22589 cat >>confdefs.h <<EOF
22590 #define GCC_UNUSED $cf_directive
22591 EOF
22592
22593                                 ;;
22594                         esac
22595                 fi
22596         done
22597 else
22598         ${FGREP-fgrep} define conftest.i >>confdefs.h
22599 fi
22600 rm -rf ./conftest*
22601 fi
22602
22603 if test "x$have_x" = xyes; then
22604
22605 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
22606 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
22607 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
22608 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
22609 for cf_X_CFLAGS in $X_CFLAGS
22610 do
22611         case "x$cf_X_CFLAGS" in
22612         x-[IUD]*)
22613                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
22614                 ;;
22615         *)
22616                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
22617                 ;;
22618         esac
22619 done
22620
22621 cat >"conftest.$ac_ext" <<_ACEOF
22622 #line 22622 "configure"
22623 #include "confdefs.h"
22624
22625 #include <stdlib.h>
22626 #include <X11/Intrinsic.h>
22627
22628 int
22629 main (void)
22630 {
22631 String foo = malloc(1); free((void*)foo)
22632   ;
22633   return 0;
22634 }
22635 _ACEOF
22636 rm -f "conftest.$ac_objext"
22637 if { (eval echo "$as_me:22637: \"$ac_compile\"") >&5
22638   (eval $ac_compile) 2>&5
22639   ac_status=$?
22640   echo "$as_me:22640: \$? = $ac_status" >&5
22641   (exit "$ac_status"); } &&
22642          { ac_try='test -s "conftest.$ac_objext"'
22643   { (eval echo "$as_me:22643: \"$ac_try\"") >&5
22644   (eval $ac_try) 2>&5
22645   ac_status=$?
22646   echo "$as_me:22646: \$? = $ac_status" >&5
22647   (exit "$ac_status"); }; }; then
22648
22649 echo "$as_me:22649: checking for X11/Xt const-feature" >&5
22650 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
22651 if test "${cf_cv_const_x_string+set}" = set; then
22652   echo $ECHO_N "(cached) $ECHO_C" >&6
22653 else
22654
22655         cat >"conftest.$ac_ext" <<_ACEOF
22656 #line 22656 "configure"
22657 #include "confdefs.h"
22658
22659 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
22660 #undef  XTSTRINGDEFINES /* X11R5 and later */
22661 #include <stdlib.h>
22662 #include <X11/Intrinsic.h>
22663
22664 int
22665 main (void)
22666 {
22667 String foo = malloc(1); *foo = 0
22668   ;
22669   return 0;
22670 }
22671 _ACEOF
22672 rm -f "conftest.$ac_objext"
22673 if { (eval echo "$as_me:22673: \"$ac_compile\"") >&5
22674   (eval $ac_compile) 2>&5
22675   ac_status=$?
22676   echo "$as_me:22676: \$? = $ac_status" >&5
22677   (exit "$ac_status"); } &&
22678          { ac_try='test -s "conftest.$ac_objext"'
22679   { (eval echo "$as_me:22679: \"$ac_try\"") >&5
22680   (eval $ac_try) 2>&5
22681   ac_status=$?
22682   echo "$as_me:22682: \$? = $ac_status" >&5
22683   (exit "$ac_status"); }; }; then
22684
22685                         cf_cv_const_x_string=no
22686
22687 else
22688   echo "$as_me: failed program was:" >&5
22689 cat "conftest.$ac_ext" >&5
22690
22691                         cf_cv_const_x_string=yes
22692
22693 fi
22694 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22695
22696 fi
22697 echo "$as_me:22697: result: $cf_cv_const_x_string" >&5
22698 echo "${ECHO_T}$cf_cv_const_x_string" >&6
22699
22700 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
22701 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
22702 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
22703
22704 case "$cf_cv_const_x_string" in
22705 (no)
22706
22707         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22708         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
22709
22710         ;;
22711 (*)
22712
22713         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22714         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
22715
22716         ;;
22717 esac
22718
22719 else
22720   echo "$as_me: failed program was:" >&5
22721 cat "conftest.$ac_ext" >&5
22722 fi
22723 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22724  fi
22725 cat > "conftest.$ac_ext" <<EOF
22726 #line 22726 "${as_me:-configure}"
22727 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
22728 EOF
22729 if test "$INTEL_COMPILER" = yes
22730 then
22731 # The "-wdXXX" options suppress warnings:
22732 # remark #1419: external declaration in primary source file
22733 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
22734 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
22735 # remark #193: zero used for undefined preprocessing identifier
22736 # remark #593: variable "curs_sb_left_arrow" was set but never used
22737 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
22738 # remark #869: parameter "tw" was never referenced
22739 # remark #981: operands are evaluated in unspecified order
22740 # warning #279: controlling expression is constant
22741
22742         { echo "$as_me:22742: checking for $CC warning options..." >&5
22743 echo "$as_me: checking for $CC warning options..." >&6;}
22744         cf_save_CFLAGS="$CFLAGS"
22745         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
22746         for cf_opt in \
22747                 wd1419 \
22748                 wd1683 \
22749                 wd1684 \
22750                 wd193 \
22751                 wd593 \
22752                 wd279 \
22753                 wd810 \
22754                 wd869 \
22755                 wd981
22756         do
22757                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22758                 if { (eval echo "$as_me:22758: \"$ac_compile\"") >&5
22759   (eval $ac_compile) 2>&5
22760   ac_status=$?
22761   echo "$as_me:22761: \$? = $ac_status" >&5
22762   (exit "$ac_status"); }; then
22763                         test -n "$verbose" && echo "$as_me:22763: result: ... -$cf_opt" >&5
22764 echo "${ECHO_T}... -$cf_opt" >&6
22765                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22766                 fi
22767         done
22768         CFLAGS="$cf_save_CFLAGS"
22769 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22770 then
22771         { echo "$as_me:22771: checking for $CC warning options..." >&5
22772 echo "$as_me: checking for $CC warning options..." >&6;}
22773         cf_save_CFLAGS="$CFLAGS"
22774         cf_warn_CONST=""
22775         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22776         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22777         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22778         for cf_opt in W Wall \
22779                 Wbad-function-cast \
22780                 Wcast-align \
22781                 Wcast-qual \
22782                 Wdeclaration-after-statement \
22783                 Wextra \
22784                 Winline \
22785                 Wmissing-declarations \
22786                 Wmissing-prototypes \
22787                 Wnested-externs \
22788                 Wpointer-arith \
22789                 Wshadow \
22790                 Wstrict-prototypes \
22791                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22792         do
22793                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22794                 if { (eval echo "$as_me:22794: \"$ac_compile\"") >&5
22795   (eval $ac_compile) 2>&5
22796   ac_status=$?
22797   echo "$as_me:22797: \$? = $ac_status" >&5
22798   (exit "$ac_status"); }; then
22799                         test -n "$verbose" && echo "$as_me:22799: result: ... -$cf_opt" >&5
22800 echo "${ECHO_T}... -$cf_opt" >&6
22801                         case "$cf_opt" in
22802                         (Winline)
22803                                 case "$GCC_VERSION" in
22804                                 ([34].*)
22805                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22806
22807 echo "${as_me:-configure}:22807: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22808
22809                                         continue;;
22810                                 esac
22811                                 ;;
22812                         (Wpointer-arith)
22813                                 case "$GCC_VERSION" in
22814                                 ([12].*)
22815                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22816
22817 echo "${as_me:-configure}:22817: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22818
22819                                         continue;;
22820                                 esac
22821                                 ;;
22822                         esac
22823                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22824                 fi
22825         done
22826         CFLAGS="$cf_save_CFLAGS"
22827 fi
22828 rm -rf ./conftest*
22829
22830 fi
22831
22832 fi
22833
22834 echo "$as_me:22834: checking if you want to use dmalloc for testing" >&5
22835 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22836
22837 # Check whether --with-dmalloc or --without-dmalloc was given.
22838 if test "${with_dmalloc+set}" = set; then
22839   withval="$with_dmalloc"
22840   case "x$withval" in
22841         (x|xno) ;;
22842         (*)
22843                 : "${with_cflags:=-g}"
22844                 : "${enable_leaks:=no}"
22845                 with_dmalloc=yes
22846
22847 cat >>confdefs.h <<EOF
22848 #define USE_DMALLOC 1
22849 EOF
22850
22851                 ;;
22852         esac
22853 else
22854   with_dmalloc=
22855 fi;
22856 echo "$as_me:22856: result: ${with_dmalloc:-no}" >&5
22857 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22858
22859 case ".$with_cflags" in
22860 (.*-g*)
22861         case .$CFLAGS in
22862         (.*-g*)
22863                 ;;
22864         (*)
22865
22866 cf_fix_cppflags=no
22867 cf_new_cflags=
22868 cf_new_cppflags=
22869 cf_new_extra_cppflags=
22870
22871 for cf_add_cflags in -g
22872 do
22873 case "$cf_fix_cppflags" in
22874 (no)
22875         case "$cf_add_cflags" in
22876         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22877                 case "$cf_add_cflags" in
22878                 (-D*)
22879                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22880
22881                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22882                                 && test -z "${cf_tst_cflags}" \
22883                                 && cf_fix_cppflags=yes
22884
22885                         if test "$cf_fix_cppflags" = yes ; then
22886
22887         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22888         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22889
22890                                 continue
22891                         elif test "${cf_tst_cflags}" = "\"'" ; then
22892
22893         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22894         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22895
22896                                 continue
22897                         fi
22898                         ;;
22899                 esac
22900                 case "$CPPFLAGS" in
22901                 (*$cf_add_cflags)
22902                         ;;
22903                 (*)
22904                         case "$cf_add_cflags" in
22905                         (-D*)
22906                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22907
22908 CPPFLAGS=`echo "$CPPFLAGS" | \
22909         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22910                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22911
22912                                 ;;
22913                         esac
22914
22915         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22916         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22917
22918                         ;;
22919                 esac
22920                 ;;
22921         (*)
22922
22923         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22924         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22925
22926                 ;;
22927         esac
22928         ;;
22929 (yes)
22930
22931         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22932         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22933
22934         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22935
22936         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22937                 && test -z "${cf_tst_cflags}" \
22938                 && cf_fix_cppflags=no
22939         ;;
22940 esac
22941 done
22942
22943 if test -n "$cf_new_cflags" ; then
22944
22945         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22946         CFLAGS="${CFLAGS}$cf_new_cflags"
22947
22948 fi
22949
22950 if test -n "$cf_new_cppflags" ; then
22951
22952         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22953         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22954
22955 fi
22956
22957 if test -n "$cf_new_extra_cppflags" ; then
22958
22959         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22960         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22961
22962 fi
22963
22964                 ;;
22965         esac
22966         ;;
22967 esac
22968
22969 if test "$with_dmalloc" = yes ; then
22970         echo "$as_me:22970: checking for dmalloc.h" >&5
22971 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22972 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22973   echo $ECHO_N "(cached) $ECHO_C" >&6
22974 else
22975   cat >"conftest.$ac_ext" <<_ACEOF
22976 #line 22976 "configure"
22977 #include "confdefs.h"
22978 #include <dmalloc.h>
22979 _ACEOF
22980 if { (eval echo "$as_me:22980: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22981   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22982   ac_status=$?
22983   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22984   rm -f conftest.er1
22985   cat conftest.err >&5
22986   echo "$as_me:22986: \$? = $ac_status" >&5
22987   (exit "$ac_status"); } >/dev/null; then
22988   if test -s conftest.err; then
22989     ac_cpp_err=$ac_c_preproc_warn_flag
22990   else
22991     ac_cpp_err=
22992   fi
22993 else
22994   ac_cpp_err=yes
22995 fi
22996 if test -z "$ac_cpp_err"; then
22997   ac_cv_header_dmalloc_h=yes
22998 else
22999   echo "$as_me: failed program was:" >&5
23000   cat "conftest.$ac_ext" >&5
23001   ac_cv_header_dmalloc_h=no
23002 fi
23003 rm -f conftest.err "conftest.$ac_ext"
23004 fi
23005 echo "$as_me:23005: result: $ac_cv_header_dmalloc_h" >&5
23006 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
23007 if test "$ac_cv_header_dmalloc_h" = yes; then
23008
23009 echo "$as_me:23009: checking for dmalloc_debug in -ldmalloc" >&5
23010 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
23011 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
23012   echo $ECHO_N "(cached) $ECHO_C" >&6
23013 else
23014   ac_check_lib_save_LIBS=$LIBS
23015 LIBS="-ldmalloc  $LIBS"
23016 cat >"conftest.$ac_ext" <<_ACEOF
23017 #line 23017 "configure"
23018 #include "confdefs.h"
23019
23020 /* Override any gcc2 internal prototype to avoid an error.  */
23021 #ifdef __cplusplus
23022 extern "C"
23023 #endif
23024 /* We use char because int might match the return type of a gcc2
23025    builtin and then its argument prototype would still apply.  */
23026 char dmalloc_debug ();
23027 int
23028 main (void)
23029 {
23030 dmalloc_debug ();
23031   ;
23032   return 0;
23033 }
23034 _ACEOF
23035 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23036 if { (eval echo "$as_me:23036: \"$ac_link\"") >&5
23037   (eval $ac_link) 2>&5
23038   ac_status=$?
23039   echo "$as_me:23039: \$? = $ac_status" >&5
23040   (exit "$ac_status"); } &&
23041          { ac_try='test -s "conftest$ac_exeext"'
23042   { (eval echo "$as_me:23042: \"$ac_try\"") >&5
23043   (eval $ac_try) 2>&5
23044   ac_status=$?
23045   echo "$as_me:23045: \$? = $ac_status" >&5
23046   (exit "$ac_status"); }; }; then
23047   ac_cv_lib_dmalloc_dmalloc_debug=yes
23048 else
23049   echo "$as_me: failed program was:" >&5
23050 cat "conftest.$ac_ext" >&5
23051 ac_cv_lib_dmalloc_dmalloc_debug=no
23052 fi
23053 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23054 LIBS=$ac_check_lib_save_LIBS
23055 fi
23056 echo "$as_me:23056: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
23057 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
23058 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
23059   cat >>confdefs.h <<EOF
23060 #define HAVE_LIBDMALLOC 1
23061 EOF
23062
23063   LIBS="-ldmalloc $LIBS"
23064
23065 fi
23066
23067 fi
23068
23069 fi
23070
23071 echo "$as_me:23071: checking if you want to use dbmalloc for testing" >&5
23072 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
23073
23074 # Check whether --with-dbmalloc or --without-dbmalloc was given.
23075 if test "${with_dbmalloc+set}" = set; then
23076   withval="$with_dbmalloc"
23077   case "x$withval" in
23078         (x|xno) ;;
23079         (*)
23080                 : "${with_cflags:=-g}"
23081                 : "${enable_leaks:=no}"
23082                 with_dbmalloc=yes
23083
23084 cat >>confdefs.h <<EOF
23085 #define USE_DBMALLOC 1
23086 EOF
23087
23088                 ;;
23089         esac
23090 else
23091   with_dbmalloc=
23092 fi;
23093 echo "$as_me:23093: result: ${with_dbmalloc:-no}" >&5
23094 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
23095
23096 case ".$with_cflags" in
23097 (.*-g*)
23098         case .$CFLAGS in
23099         (.*-g*)
23100                 ;;
23101         (*)
23102
23103 cf_fix_cppflags=no
23104 cf_new_cflags=
23105 cf_new_cppflags=
23106 cf_new_extra_cppflags=
23107
23108 for cf_add_cflags in -g
23109 do
23110 case "$cf_fix_cppflags" in
23111 (no)
23112         case "$cf_add_cflags" in
23113         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
23114                 case "$cf_add_cflags" in
23115                 (-D*)
23116                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
23117
23118                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23119                                 && test -z "${cf_tst_cflags}" \
23120                                 && cf_fix_cppflags=yes
23121
23122                         if test "$cf_fix_cppflags" = yes ; then
23123
23124         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23125         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23126
23127                                 continue
23128                         elif test "${cf_tst_cflags}" = "\"'" ; then
23129
23130         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23131         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23132
23133                                 continue
23134                         fi
23135                         ;;
23136                 esac
23137                 case "$CPPFLAGS" in
23138                 (*$cf_add_cflags)
23139                         ;;
23140                 (*)
23141                         case "$cf_add_cflags" in
23142                         (-D*)
23143                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
23144
23145 CPPFLAGS=`echo "$CPPFLAGS" | \
23146         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
23147                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
23148
23149                                 ;;
23150                         esac
23151
23152         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
23153         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
23154
23155                         ;;
23156                 esac
23157                 ;;
23158         (*)
23159
23160         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
23161         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
23162
23163                 ;;
23164         esac
23165         ;;
23166 (yes)
23167
23168         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23169         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23170
23171         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
23172
23173         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23174                 && test -z "${cf_tst_cflags}" \
23175                 && cf_fix_cppflags=no
23176         ;;
23177 esac
23178 done
23179
23180 if test -n "$cf_new_cflags" ; then
23181
23182         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23183         CFLAGS="${CFLAGS}$cf_new_cflags"
23184
23185 fi
23186
23187 if test -n "$cf_new_cppflags" ; then
23188
23189         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23190         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23191
23192 fi
23193
23194 if test -n "$cf_new_extra_cppflags" ; then
23195
23196         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23197         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23198
23199 fi
23200
23201                 ;;
23202         esac
23203         ;;
23204 esac
23205
23206 if test "$with_dbmalloc" = yes ; then
23207         echo "$as_me:23207: checking for dbmalloc.h" >&5
23208 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
23209 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
23210   echo $ECHO_N "(cached) $ECHO_C" >&6
23211 else
23212   cat >"conftest.$ac_ext" <<_ACEOF
23213 #line 23213 "configure"
23214 #include "confdefs.h"
23215 #include <dbmalloc.h>
23216 _ACEOF
23217 if { (eval echo "$as_me:23217: \"$ac_cpp "conftest.$ac_ext"\"") >&5
23218   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
23219   ac_status=$?
23220   $EGREP -v '^ *\+' conftest.er1 >conftest.err
23221   rm -f conftest.er1
23222   cat conftest.err >&5
23223   echo "$as_me:23223: \$? = $ac_status" >&5
23224   (exit "$ac_status"); } >/dev/null; then
23225   if test -s conftest.err; then
23226     ac_cpp_err=$ac_c_preproc_warn_flag
23227   else
23228     ac_cpp_err=
23229   fi
23230 else
23231   ac_cpp_err=yes
23232 fi
23233 if test -z "$ac_cpp_err"; then
23234   ac_cv_header_dbmalloc_h=yes
23235 else
23236   echo "$as_me: failed program was:" >&5
23237   cat "conftest.$ac_ext" >&5
23238   ac_cv_header_dbmalloc_h=no
23239 fi
23240 rm -f conftest.err "conftest.$ac_ext"
23241 fi
23242 echo "$as_me:23242: result: $ac_cv_header_dbmalloc_h" >&5
23243 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
23244 if test "$ac_cv_header_dbmalloc_h" = yes; then
23245
23246 echo "$as_me:23246: checking for debug_malloc in -ldbmalloc" >&5
23247 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
23248 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
23249   echo $ECHO_N "(cached) $ECHO_C" >&6
23250 else
23251   ac_check_lib_save_LIBS=$LIBS
23252 LIBS="-ldbmalloc  $LIBS"
23253 cat >"conftest.$ac_ext" <<_ACEOF
23254 #line 23254 "configure"
23255 #include "confdefs.h"
23256
23257 /* Override any gcc2 internal prototype to avoid an error.  */
23258 #ifdef __cplusplus
23259 extern "C"
23260 #endif
23261 /* We use char because int might match the return type of a gcc2
23262    builtin and then its argument prototype would still apply.  */
23263 char debug_malloc ();
23264 int
23265 main (void)
23266 {
23267 debug_malloc ();
23268   ;
23269   return 0;
23270 }
23271 _ACEOF
23272 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23273 if { (eval echo "$as_me:23273: \"$ac_link\"") >&5
23274   (eval $ac_link) 2>&5
23275   ac_status=$?
23276   echo "$as_me:23276: \$? = $ac_status" >&5
23277   (exit "$ac_status"); } &&
23278          { ac_try='test -s "conftest$ac_exeext"'
23279   { (eval echo "$as_me:23279: \"$ac_try\"") >&5
23280   (eval $ac_try) 2>&5
23281   ac_status=$?
23282   echo "$as_me:23282: \$? = $ac_status" >&5
23283   (exit "$ac_status"); }; }; then
23284   ac_cv_lib_dbmalloc_debug_malloc=yes
23285 else
23286   echo "$as_me: failed program was:" >&5
23287 cat "conftest.$ac_ext" >&5
23288 ac_cv_lib_dbmalloc_debug_malloc=no
23289 fi
23290 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23291 LIBS=$ac_check_lib_save_LIBS
23292 fi
23293 echo "$as_me:23293: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
23294 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
23295 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
23296   cat >>confdefs.h <<EOF
23297 #define HAVE_LIBDBMALLOC 1
23298 EOF
23299
23300   LIBS="-ldbmalloc $LIBS"
23301
23302 fi
23303
23304 fi
23305
23306 fi
23307
23308 echo "$as_me:23308: checking if you want to use valgrind for testing" >&5
23309 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
23310
23311 # Check whether --with-valgrind or --without-valgrind was given.
23312 if test "${with_valgrind+set}" = set; then
23313   withval="$with_valgrind"
23314   case "x$withval" in
23315         (x|xno) ;;
23316         (*)
23317                 : "${with_cflags:=-g}"
23318                 : "${enable_leaks:=no}"
23319                 with_valgrind=yes
23320
23321 cat >>confdefs.h <<EOF
23322 #define USE_VALGRIND 1
23323 EOF
23324
23325                 ;;
23326         esac
23327 else
23328   with_valgrind=
23329 fi;
23330 echo "$as_me:23330: result: ${with_valgrind:-no}" >&5
23331 echo "${ECHO_T}${with_valgrind:-no}" >&6
23332
23333 case ".$with_cflags" in
23334 (.*-g*)
23335         case .$CFLAGS in
23336         (.*-g*)
23337                 ;;
23338         (*)
23339
23340 cf_fix_cppflags=no
23341 cf_new_cflags=
23342 cf_new_cppflags=
23343 cf_new_extra_cppflags=
23344
23345 for cf_add_cflags in -g
23346 do
23347 case "$cf_fix_cppflags" in
23348 (no)
23349         case "$cf_add_cflags" in
23350         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
23351                 case "$cf_add_cflags" in
23352                 (-D*)
23353                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
23354
23355                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23356                                 && test -z "${cf_tst_cflags}" \
23357                                 && cf_fix_cppflags=yes
23358
23359                         if test "$cf_fix_cppflags" = yes ; then
23360
23361         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23362         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23363
23364                                 continue
23365                         elif test "${cf_tst_cflags}" = "\"'" ; then
23366
23367         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23368         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23369
23370                                 continue
23371                         fi
23372                         ;;
23373                 esac
23374                 case "$CPPFLAGS" in
23375                 (*$cf_add_cflags)
23376                         ;;
23377                 (*)
23378                         case "$cf_add_cflags" in
23379                         (-D*)
23380                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
23381
23382 CPPFLAGS=`echo "$CPPFLAGS" | \
23383         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
23384                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
23385
23386                                 ;;
23387                         esac
23388
23389         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
23390         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
23391
23392                         ;;
23393                 esac
23394                 ;;
23395         (*)
23396
23397         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
23398         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
23399
23400                 ;;
23401         esac
23402         ;;
23403 (yes)
23404
23405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23407
23408         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
23409
23410         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23411                 && test -z "${cf_tst_cflags}" \
23412                 && cf_fix_cppflags=no
23413         ;;
23414 esac
23415 done
23416
23417 if test -n "$cf_new_cflags" ; then
23418
23419         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23420         CFLAGS="${CFLAGS}$cf_new_cflags"
23421
23422 fi
23423
23424 if test -n "$cf_new_cppflags" ; then
23425
23426         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23427         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23428
23429 fi
23430
23431 if test -n "$cf_new_extra_cppflags" ; then
23432
23433         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23434         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23435
23436 fi
23437
23438                 ;;
23439         esac
23440         ;;
23441 esac
23442
23443 echo "$as_me:23443: checking if you want to perform memory-leak testing" >&5
23444 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
23445
23446 # Check whether --enable-leaks or --disable-leaks was given.
23447 if test "${enable_leaks+set}" = set; then
23448   enableval="$enable_leaks"
23449   enable_leaks=$enableval
23450 else
23451   enable_leaks=yes
23452 fi;
23453 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
23454 echo "$as_me:23454: result: $with_no_leaks" >&5
23455 echo "${ECHO_T}$with_no_leaks" >&6
23456
23457 if test "$enable_leaks" = no ; then
23458
23459 cat >>confdefs.h <<\EOF
23460 #define NO_LEAKS 1
23461 EOF
23462
23463 cat >>confdefs.h <<\EOF
23464 #define YY_NO_LEAKS 1
23465 EOF
23466
23467 fi
23468
23469 LD_RPATH_OPT=
23470 if test "x$cf_cv_enable_rpath" != xno
23471 then
23472         echo "$as_me:23472: checking for an rpath option" >&5
23473 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
23474         case "$cf_cv_system_name" in
23475         (irix*)
23476                 if test "$GCC" = yes; then
23477                         LD_RPATH_OPT="-Wl,-rpath,"
23478                 else
23479                         LD_RPATH_OPT="-rpath "
23480                 fi
23481                 ;;
23482         (linux*|gnu*|k*bsd*-gnu|freebsd*)
23483                 LD_RPATH_OPT="-Wl,-rpath,"
23484                 ;;
23485         (openbsd[2-9].*|mirbsd*)
23486                 LD_RPATH_OPT="-Wl,-rpath,"
23487                 ;;
23488         (dragonfly*)
23489                 LD_RPATH_OPT="-rpath "
23490                 ;;
23491         (netbsd*)
23492                 LD_RPATH_OPT="-Wl,-rpath,"
23493                 ;;
23494         (osf*|mls+*)
23495                 LD_RPATH_OPT="-rpath "
23496                 ;;
23497         (solaris2*)
23498                 LD_RPATH_OPT="-R"
23499                 ;;
23500         (*)
23501                 ;;
23502         esac
23503         echo "$as_me:23503: result: $LD_RPATH_OPT" >&5
23504 echo "${ECHO_T}$LD_RPATH_OPT" >&6
23505
23506         case "x$LD_RPATH_OPT" in
23507         (x-R*)
23508                 echo "$as_me:23508: checking if we need a space after rpath option" >&5
23509 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
23510                 cf_save_LIBS="$LIBS"
23511
23512 cf_add_libs="$LIBS"
23513 # reverse order
23514 cf_add_0lib=
23515 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
23516 # filter duplicates
23517 for cf_add_1lib in $cf_add_0lib; do
23518         for cf_add_2lib in $cf_add_libs; do
23519                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
23520                         cf_add_1lib=
23521                         break
23522                 fi
23523         done
23524         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
23525 done
23526 LIBS="$cf_add_libs"
23527
23528                 cat >"conftest.$ac_ext" <<_ACEOF
23529 #line 23529 "configure"
23530 #include "confdefs.h"
23531
23532 int
23533 main (void)
23534 {
23535
23536   ;
23537   return 0;
23538 }
23539 _ACEOF
23540 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23541 if { (eval echo "$as_me:23541: \"$ac_link\"") >&5
23542   (eval $ac_link) 2>&5
23543   ac_status=$?
23544   echo "$as_me:23544: \$? = $ac_status" >&5
23545   (exit "$ac_status"); } &&
23546          { ac_try='test -s "conftest$ac_exeext"'
23547   { (eval echo "$as_me:23547: \"$ac_try\"") >&5
23548   (eval $ac_try) 2>&5
23549   ac_status=$?
23550   echo "$as_me:23550: \$? = $ac_status" >&5
23551   (exit "$ac_status"); }; }; then
23552   cf_rpath_space=no
23553 else
23554   echo "$as_me: failed program was:" >&5
23555 cat "conftest.$ac_ext" >&5
23556 cf_rpath_space=yes
23557 fi
23558 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23559                 LIBS="$cf_save_LIBS"
23560                 echo "$as_me:23560: result: $cf_rpath_space" >&5
23561 echo "${ECHO_T}$cf_rpath_space" >&6
23562                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
23563                 ;;
23564         esac
23565 fi
23566
23567 echo "$as_me:23567: checking if rpath-hack should be disabled" >&5
23568 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
23569
23570 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
23571 if test "${enable_rpath_hack+set}" = set; then
23572   enableval="$enable_rpath_hack"
23573   test "$enableval" != no && enableval=yes
23574         if test "$enableval" != "yes" ; then
23575     enable_rpath_hack=no
23576         else
23577                 enable_rpath_hack=yes
23578         fi
23579 else
23580   enableval=yes
23581         enable_rpath_hack=yes
23582
23583 fi;
23584 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
23585 echo "$as_me:23585: result: $cf_disable_rpath_hack" >&5
23586 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
23587
23588 if test "$enable_rpath_hack" = yes ; then
23589
23590 echo "$as_me:23590: checking for updated LDFLAGS" >&5
23591 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
23592 if test -n "$LD_RPATH_OPT" ; then
23593         echo "$as_me:23593: result: maybe" >&5
23594 echo "${ECHO_T}maybe" >&6
23595
23596         for ac_prog in ldd
23597 do
23598   # Extract the first word of "$ac_prog", so it can be a program name with args.
23599 set dummy $ac_prog; ac_word=$2
23600 echo "$as_me:23600: checking for $ac_word" >&5
23601 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23602 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
23603   echo $ECHO_N "(cached) $ECHO_C" >&6
23604 else
23605   if test -n "$cf_ldd_prog"; then
23606   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
23607 else
23608   ac_save_IFS=$IFS; IFS=$ac_path_separator
23609 ac_dummy="$PATH"
23610 for ac_dir in $ac_dummy; do
23611   IFS=$ac_save_IFS
23612   test -z "$ac_dir" && ac_dir=.
23613   $as_executable_p "$ac_dir/$ac_word" || continue
23614 ac_cv_prog_cf_ldd_prog="$ac_prog"
23615 echo "$as_me:23615: found $ac_dir/$ac_word" >&5
23616 break
23617 done
23618
23619 fi
23620 fi
23621 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
23622 if test -n "$cf_ldd_prog"; then
23623   echo "$as_me:23623: result: $cf_ldd_prog" >&5
23624 echo "${ECHO_T}$cf_ldd_prog" >&6
23625 else
23626   echo "$as_me:23626: result: no" >&5
23627 echo "${ECHO_T}no" >&6
23628 fi
23629
23630   test -n "$cf_ldd_prog" && break
23631 done
23632 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
23633
23634         cf_rpath_list="/usr/lib /lib"
23635         if test "$cf_ldd_prog" != no
23636         then
23637                 cf_rpath_oops=
23638
23639 cat >"conftest.$ac_ext" <<_ACEOF
23640 #line 23640 "configure"
23641 #include "confdefs.h"
23642 #include <stdio.h>
23643 int
23644 main (void)
23645 {
23646 printf("Hello");
23647   ;
23648   return 0;
23649 }
23650 _ACEOF
23651 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23652 if { (eval echo "$as_me:23652: \"$ac_link\"") >&5
23653   (eval $ac_link) 2>&5
23654   ac_status=$?
23655   echo "$as_me:23655: \$? = $ac_status" >&5
23656   (exit "$ac_status"); } &&
23657          { ac_try='test -s "conftest$ac_exeext"'
23658   { (eval echo "$as_me:23658: \"$ac_try\"") >&5
23659   (eval $ac_try) 2>&5
23660   ac_status=$?
23661   echo "$as_me:23661: \$? = $ac_status" >&5
23662   (exit "$ac_status"); }; }; then
23663   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
23664                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
23665 else
23666   echo "$as_me: failed program was:" >&5
23667 cat "conftest.$ac_ext" >&5
23668 fi
23669 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23670
23671                 # If we passed the link-test, but get a "not found" on a given library,
23672                 # this could be due to inept reconfiguration of gcc to make it only
23673                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
23674                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
23675                 # /usr/local libraries.
23676                 if test -n "$cf_rpath_oops"
23677                 then
23678                         for cf_rpath_src in $cf_rpath_oops
23679                         do
23680                                 for cf_rpath_dir in \
23681                                         /usr/local \
23682                                         /usr/pkg \
23683                                         /opt/sfw
23684                                 do
23685                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
23686                                         then
23687                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
23688
23689 echo "${as_me:-configure}:23689: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
23690
23691                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
23692                                                 break
23693                                         fi
23694                                 done
23695                         done
23696                 fi
23697         fi
23698
23699         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23700
23701 echo "${as_me:-configure}:23701: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23702
23703 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
23704
23705 echo "${as_me:-configure}:23705: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
23706
23707 cf_rpath_dst=
23708 for cf_rpath_src in $LDFLAGS
23709 do
23710         case "$cf_rpath_src" in
23711         (-L*)
23712
23713                 # check if this refers to a directory which we will ignore
23714                 cf_rpath_skip=no
23715                 if test -n "$cf_rpath_list"
23716                 then
23717                         for cf_rpath_item in $cf_rpath_list
23718                         do
23719                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23720                                 then
23721                                         cf_rpath_skip=yes
23722                                         break
23723                                 fi
23724                         done
23725                 fi
23726
23727                 if test "$cf_rpath_skip" = no
23728                 then
23729                         # transform the option
23730                         if test "$LD_RPATH_OPT" = "-R " ; then
23731                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23732                         else
23733                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23734                         fi
23735
23736                         # if we have not already added this, add it now
23737                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23738                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23739                         then
23740                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23741
23742 echo "${as_me:-configure}:23742: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23743
23744                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23745                         fi
23746                 fi
23747                 ;;
23748         esac
23749         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23750 done
23751 LDFLAGS=$cf_rpath_dst
23752
23753 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
23754
23755 echo "${as_me:-configure}:23755: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
23756
23757 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23758
23759 echo "${as_me:-configure}:23759: testing ...checking LIBS $LIBS ..." 1>&5
23760
23761 cf_rpath_dst=
23762 for cf_rpath_src in $LIBS
23763 do
23764         case "$cf_rpath_src" in
23765         (-L*)
23766
23767                 # check if this refers to a directory which we will ignore
23768                 cf_rpath_skip=no
23769                 if test -n "$cf_rpath_list"
23770                 then
23771                         for cf_rpath_item in $cf_rpath_list
23772                         do
23773                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23774                                 then
23775                                         cf_rpath_skip=yes
23776                                         break
23777                                 fi
23778                         done
23779                 fi
23780
23781                 if test "$cf_rpath_skip" = no
23782                 then
23783                         # transform the option
23784                         if test "$LD_RPATH_OPT" = "-R " ; then
23785                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23786                         else
23787                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23788                         fi
23789
23790                         # if we have not already added this, add it now
23791                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23792                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23793                         then
23794                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23795
23796 echo "${as_me:-configure}:23796: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23797
23798                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23799                         fi
23800                 fi
23801                 ;;
23802         esac
23803         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23804 done
23805 LIBS=$cf_rpath_dst
23806
23807 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23808
23809 echo "${as_me:-configure}:23809: testing ...checked LIBS $LIBS ..." 1>&5
23810
23811         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23812
23813 echo "${as_me:-configure}:23813: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23814
23815 else
23816         echo "$as_me:23816: result: no" >&5
23817 echo "${ECHO_T}no" >&6
23818 fi
23819
23820 fi
23821
23822 TEST_ARGS="$LIBS"
23823 LIBS=
23824
23825 ac_config_files="$ac_config_files Makefile"
23826 ac_config_commands="$ac_config_commands default"
23827 cat >confcache <<\_ACEOF
23828 # This file is a shell script that caches the results of configure
23829 # tests run on this system so they can be shared between configure
23830 # scripts and configure runs, see configure's option --config-cache.
23831 # It is not useful on other systems.  If it contains results you don't
23832 # want to keep, you may remove or edit it.
23833 #
23834 # config.status only pays attention to the cache file if you give it
23835 # the --recheck option to rerun configure.
23836 #
23837 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23838 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23839 # following values.
23840
23841 _ACEOF
23842
23843 # The following way of writing the cache mishandles newlines in values,
23844 # but we know of no workaround that is simple, portable, and efficient.
23845 # So, don't put newlines in cache variables' values.
23846 # Ultrix sh set writes to stderr and can't be redirected directly,
23847 # and sets the high bit in the cache file unless we assign to the vars.
23848 {
23849   (set) 2>&1 |
23850     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23851     *ac_space=\ *)
23852       # `set' does not quote correctly, so add quotes (double-quote
23853       # substitution turns \\\\ into \\, and sed turns \\ into \).
23854       sed -n \
23855         "s/'/'\\\\''/g;
23856           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23857       ;;
23858     *)
23859       # `set' quotes correctly as required by POSIX, so do not add quotes.
23860       sed -n \
23861         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23862       ;;
23863     esac;
23864 } |
23865   sed '
23866      t clear
23867      : clear
23868      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23869      t end
23870      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23871      : end' >>confcache
23872 if cmp -s $cache_file confcache; then :; else
23873   if test -w $cache_file; then
23874     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23875     cat confcache >$cache_file
23876   else
23877     echo "not updating unwritable cache $cache_file"
23878   fi
23879 fi
23880 rm -f confcache
23881
23882 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23883 # Let make expand exec_prefix.
23884 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23885
23886 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23887 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23888 # trailing colons and then remove the whole line if VPATH becomes empty
23889 # (actually we leave an empty line to preserve line numbers).
23890 if test "x$srcdir" = x.; then
23891   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23892 s/:*\$(srcdir):*/:/;
23893 s/:*\${srcdir}:*/:/;
23894 s/:*@srcdir@:*/:/;
23895 s/^\([^=]*=[    ]*\):*/\1/;
23896 s/:*$//;
23897 s/^[^=]*=[      ]*$//;
23898 }'
23899 fi
23900
23901 DEFS=-DHAVE_CONFIG_H
23902
23903 : "${CONFIG_STATUS=./config.status}"
23904 ac_clean_files_save=$ac_clean_files
23905 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23906 { echo "$as_me:23906: creating $CONFIG_STATUS" >&5
23907 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23908 cat >"$CONFIG_STATUS" <<_ACEOF
23909 #! $SHELL
23910 # Generated automatically by configure.
23911 # Run this file to recreate the current configuration.
23912 # Compiler output produced by configure, useful for debugging
23913 # configure, is in config.log if it exists.
23914
23915 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
23916
23917 debug=false
23918 SHELL=\${CONFIG_SHELL-$SHELL}
23919 ac_cs_invocation="\$0 \$@"
23920
23921 CLICOLOR_FORCE= GREP_OPTIONS=
23922 unset CLICOLOR_FORCE GREP_OPTIONS
23923 _ACEOF
23924
23925 cat >>"$CONFIG_STATUS" <<\_ACEOF
23926 # Be Bourne compatible
23927 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23928   emulate sh
23929   NULLCMD=:
23930 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23931   set -o posix
23932 fi
23933
23934 # Name of the executable.
23935 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23936
23937 if expr a : '\(a\)' >/dev/null 2>&1; then
23938   as_expr="expr"
23939 else
23940   as_expr="false"
23941 fi
23942
23943 rm -f conf$$ conf$$.exe conf$$.file
23944 echo >conf$$.file
23945 if ln -s conf$$.file conf$$ 2>/dev/null; then
23946   # We could just check for DJGPP; but this test a) works b) is more generic
23947   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23948   if test -f conf$$.exe; then
23949     # Don't use ln at all; we don't have any links
23950     as_ln_s='cp -p'
23951   else
23952     as_ln_s='ln -s'
23953   fi
23954 elif ln conf$$.file conf$$ 2>/dev/null; then
23955   as_ln_s='ln'
23956 else
23957   as_ln_s='cp -p'
23958 fi
23959 rm -f conf$$ conf$$.exe conf$$.file
23960
23961 as_executable_p="test -f"
23962
23963 # Support unset when possible.
23964 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23965   as_unset="unset"
23966 else
23967   as_unset="false"
23968 fi
23969
23970 # NLS nuisances.
23971 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23972 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23973 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23974 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23975 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23976 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23977 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23978 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23979
23980 # IFS
23981 # We need space, tab and new line, in precisely that order.
23982 as_nl='
23983 '
23984 IFS="   $as_nl"
23985
23986 # CDPATH.
23987 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23988
23989 exec 6>&1
23990
23991 _ACEOF
23992
23993 # Files that config.status was made for.
23994 if test -n "$ac_config_files"; then
23995   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23996 fi
23997
23998 if test -n "$ac_config_headers"; then
23999   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
24000 fi
24001
24002 if test -n "$ac_config_links"; then
24003   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
24004 fi
24005
24006 if test -n "$ac_config_commands"; then
24007   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
24008 fi
24009
24010 cat >>"$CONFIG_STATUS" <<\EOF
24011
24012 ac_cs_usage="\
24013 \`$as_me' instantiates files from templates according to the
24014 current configuration.
24015
24016 Usage: $0 [OPTIONS] [FILE]...
24017
24018   -h, --help       print this help, then exit
24019   -V, --version    print version number, then exit
24020   -d, --debug      don't remove temporary files
24021       --recheck    update $as_me by reconfiguring in the same conditions
24022   --file=FILE[:TEMPLATE]
24023                    instantiate the configuration file FILE
24024   --header=FILE[:TEMPLATE]
24025                    instantiate the configuration header FILE
24026
24027 Configuration files:
24028 $config_files
24029
24030 Configuration headers:
24031 $config_headers
24032
24033 Configuration commands:
24034 $config_commands
24035
24036 Report bugs to <dickey@invisible-island.net>."
24037 EOF
24038
24039 cat >>"$CONFIG_STATUS" <<EOF
24040 ac_cs_version="\\
24041 config.status
24042 configured by $0, generated by GNU Autoconf 2.52.20230114,
24043   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
24044
24045 Copyright 2003-2022,2023        Thomas E. Dickey
24046 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
24047 Free Software Foundation, Inc.
24048 This config.status script is free software; the Free Software Foundation
24049 gives unlimited permission to copy, distribute and modify it."
24050 srcdir="$srcdir"
24051 INSTALL="$INSTALL"
24052 EOF
24053
24054 cat >>"$CONFIG_STATUS" <<\EOF
24055 # If no file are specified by the user, then we need to provide default
24056 # value.  By we need to know if files were specified by the user.
24057 ac_need_defaults=:
24058 while test $# != 0
24059 do
24060   case $1 in
24061   --*=*)
24062     ac_option=`expr "x$1" : 'x\([^=]*\)='`
24063     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
24064     shift
24065     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
24066     shift
24067     ;;
24068   -*);;
24069   *) # This is not an option, so the user has probably given explicit
24070      # arguments.
24071      ac_need_defaults=false;;
24072   esac
24073
24074   case $1 in
24075   # Handling of the options.
24076 EOF
24077 cat >>"$CONFIG_STATUS" <<EOF
24078   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
24079     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
24080     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
24081 EOF
24082 cat >>"$CONFIG_STATUS" <<\EOF
24083   --version | --vers* | -V )
24084     echo "$ac_cs_version"; exit 0 ;;
24085   --he | --h)
24086     # Conflict between --help and --header
24087     { { echo "$as_me:24087: error: ambiguous option: $1
24088 Try \`$0 --help' for more information." >&5
24089 echo "$as_me: error: ambiguous option: $1
24090 Try \`$0 --help' for more information." >&2;}
24091    { (exit 1); exit 1; }; };;
24092   --help | --hel | -h )
24093     echo "$ac_cs_usage"; exit 0 ;;
24094   --debug | --d* | -d )
24095     debug=: ;;
24096   --file | --fil | --fi | --f )
24097     shift
24098     CONFIG_FILES="$CONFIG_FILES $1"
24099     ac_need_defaults=false;;
24100   --header | --heade | --head | --hea )
24101     shift
24102     CONFIG_HEADERS="$CONFIG_HEADERS $1"
24103     ac_need_defaults=false;;
24104
24105   # This is an error.
24106   -*) { { echo "$as_me:24106: error: unrecognized option: $1
24107 Try \`$0 --help' for more information." >&5
24108 echo "$as_me: error: unrecognized option: $1
24109 Try \`$0 --help' for more information." >&2;}
24110    { (exit 1); exit 1; }; } ;;
24111
24112   *) ac_config_targets="$ac_config_targets $1" ;;
24113
24114   esac
24115   shift
24116 done
24117
24118 exec 5>>config.log
24119 cat >&5 << _ACEOF
24120
24121 ## ----------------------- ##
24122 ## Running config.status.  ##
24123 ## ----------------------- ##
24124
24125 This file was extended by $as_me 2.52.20230114, executed with
24126   CONFIG_FILES    = $CONFIG_FILES
24127   CONFIG_HEADERS  = $CONFIG_HEADERS
24128   CONFIG_LINKS    = $CONFIG_LINKS
24129   CONFIG_COMMANDS = $CONFIG_COMMANDS
24130   > "$ac_cs_invocation"
24131 on `(hostname || uname -n) 2>/dev/null | sed 1q`
24132
24133 _ACEOF
24134 EOF
24135
24136 cat >>"$CONFIG_STATUS" <<EOF
24137 #
24138 # INIT-COMMANDS section.
24139 #
24140
24141 AWK="$AWK"
24142 ECHO_CC="$ECHO_CC"
24143 ECHO_LD="$ECHO_LD"
24144 SHOW_CC="$SHOW_LD"
24145
24146 EOF
24147
24148 cat >>"$CONFIG_STATUS" <<\EOF
24149 for ac_config_target in $ac_config_targets
24150 do
24151   case "$ac_config_target" in
24152   # Handling of arguments.
24153   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
24154   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
24155   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
24156   *) { { echo "$as_me:24156: error: invalid argument: $ac_config_target" >&5
24157 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
24158    { (exit 1); exit 1; }; };;
24159   esac
24160 done
24161
24162 # If the user did not use the arguments to specify the items to instantiate,
24163 # then the envvar interface is used.  Set only those that are not.
24164 # We use the long form for the default assignment because of an extremely
24165 # bizarre bug on SunOS 4.1.3.
24166 if "$ac_need_defaults"; then
24167   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
24168   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
24169   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
24170 fi
24171
24172 # Create a temporary directory, and hook for its removal unless debugging.
24173 $debug ||
24174 {
24175   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
24176   trap '{ (exit 1); exit 1; }' 1 2 13 15
24177 }
24178
24179 # Create a (secure) tmp directory for tmp files.
24180 : "${TMPDIR=/tmp}"
24181 {
24182   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
24183   test -n "$tmp" && test -d "$tmp"
24184 }  ||
24185 {
24186   tmp=$TMPDIR/cs$$-$RANDOM
24187   (umask 077 && mkdir "$tmp")
24188 } ||
24189 {
24190    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
24191    { (exit 1); exit 1; }
24192 }
24193
24194 EOF
24195
24196 cat >>"$CONFIG_STATUS" <<EOF
24197
24198 #
24199 # CONFIG_FILES section.
24200 #
24201
24202 # No need to generate the scripts if there are no CONFIG_FILES.
24203 # This happens for instance when ./config.status config.h
24204 if test -n "\$CONFIG_FILES"; then
24205   # Protect against being on the right side of a sed subst in config.status.
24206   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
24207    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
24208 s,@SHELL@,$SHELL,;t t
24209 s,@exec_prefix@,$exec_prefix,;t t
24210 s,@prefix@,$prefix,;t t
24211 s,@program_transform_name@,$program_transform_name,;t t
24212 s,@bindir@,$bindir,;t t
24213 s,@sbindir@,$sbindir,;t t
24214 s,@libexecdir@,$libexecdir,;t t
24215 s,@datarootdir@,$datarootdir,;t t
24216 s,@datadir@,$datadir,;t t
24217 s,@sysconfdir@,$sysconfdir,;t t
24218 s,@sharedstatedir@,$sharedstatedir,;t t
24219 s,@localstatedir@,$localstatedir,;t t
24220 s,@runstatedir@,$runstatedir,;t t
24221 s,@libdir@,$libdir,;t t
24222 s,@includedir@,$includedir,;t t
24223 s,@oldincludedir@,$oldincludedir,;t t
24224 s,@infodir@,$infodir,;t t
24225 s,@mandir@,$mandir,;t t
24226 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
24227 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
24228 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
24229 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
24230 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
24231 s,@build_alias@,$build_alias,;t t
24232 s,@host_alias@,$host_alias,;t t
24233 s,@target_alias@,$target_alias,;t t
24234 s,@ECHO_C@,$ECHO_C,;t t
24235 s,@ECHO_N@,$ECHO_N,;t t
24236 s,@ECHO_T@,$ECHO_T,;t t
24237 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
24238 s,@DEFS@,$DEFS,;t t
24239 s,@LIBS@,$LIBS,;t t
24240 s,@build@,$build,;t t
24241 s,@build_cpu@,$build_cpu,;t t
24242 s,@build_vendor@,$build_vendor,;t t
24243 s,@build_os@,$build_os,;t t
24244 s,@host@,$host,;t t
24245 s,@host_cpu@,$host_cpu,;t t
24246 s,@host_vendor@,$host_vendor,;t t
24247 s,@host_os@,$host_os,;t t
24248 s,@SET_MAKE@,$SET_MAKE,;t t
24249 s,@CC@,$CC,;t t
24250 s,@CFLAGS@,$CFLAGS,;t t
24251 s,@LDFLAGS@,$LDFLAGS,;t t
24252 s,@CPPFLAGS@,$CPPFLAGS,;t t
24253 s,@ac_ct_CC@,$ac_ct_CC,;t t
24254 s,@EXEEXT@,$EXEEXT,;t t
24255 s,@OBJEXT@,$OBJEXT,;t t
24256 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
24257 s,@CPP@,$CPP,;t t
24258 s,@GREP@,$GREP,;t t
24259 s,@EGREP@,$EGREP,;t t
24260 s,@AWK@,$AWK,;t t
24261 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
24262 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
24263 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
24264 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
24265 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
24266 s,@LINT@,$LINT,;t t
24267 s,@LINT_OPTS@,$LINT_OPTS,;t t
24268 s,@LINT_LIBS@,$LINT_LIBS,;t t
24269 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
24270 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
24271 s,@CTAGS@,$CTAGS,;t t
24272 s,@ETAGS@,$ETAGS,;t t
24273 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
24274 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
24275 s,@MATH_LIB@,$MATH_LIB,;t t
24276 s,@top_builddir@,$top_builddir,;t t
24277 s,@CC_G_OPT@,$CC_G_OPT,;t t
24278 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
24279 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
24280 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
24281 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
24282 s,@LD@,$LD,;t t
24283 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
24284 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
24285 s,@LD_MODEL@,$LD_MODEL,;t t
24286 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
24287 s,@LIBTOOL@,$LIBTOOL,;t t
24288 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
24289 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
24290 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
24291 s,@LIB_LINK@,$LIB_LINK,;t t
24292 s,@LINK_TESTS@,$LINK_TESTS,;t t
24293 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
24294 s,@PACKAGE@,$PACKAGE,;t t
24295 s,@PTHREAD@,$PTHREAD,;t t
24296 s,@TEST_ARGS@,$TEST_ARGS,;t t
24297 s,@TEST_DEPS@,$TEST_DEPS,;t t
24298 s,@TEST_LIBS@,$TEST_LIBS,;t t
24299 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
24300 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
24301 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
24302 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
24303 s,@includesubdir@,$includesubdir,;t t
24304 s,@FGREP@,$FGREP,;t t
24305 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
24306 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
24307 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
24308 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
24309 s,@ECHO_LT@,$ECHO_LT,;t t
24310 s,@ECHO_LD@,$ECHO_LD,;t t
24311 s,@RULE_CC@,$RULE_CC,;t t
24312 s,@SHOW_CC@,$SHOW_CC,;t t
24313 s,@ECHO_CC@,$ECHO_CC,;t t
24314 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
24315 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
24316 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
24317 s,@X_CFLAGS@,$X_CFLAGS,;t t
24318 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
24319 s,@X_LIBS@,$X_LIBS,;t t
24320 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
24321 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
24322 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
24323 s,@cf_cv_screen@,$cf_cv_screen,;t t
24324 s,@RGB_PATH@,$RGB_PATH,;t t
24325 s,@no_x11_rgb@,$no_x11_rgb,;t t
24326 s,@FORM_NAME@,$FORM_NAME,;t t
24327 s,@MENU_NAME@,$MENU_NAME,;t t
24328 s,@PANEL_NAME@,$PANEL_NAME,;t t
24329 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
24330 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
24331 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
24332 CEOF
24333
24334 EOF
24335
24336   cat >>"$CONFIG_STATUS" <<\EOF
24337   # Split the substitutions into bite-sized pieces for seds with
24338   # small command number limits, like on Digital OSF/1 and HP-UX.
24339   ac_max_sed_lines=48
24340   ac_sed_frag=1 # Number of current file.
24341   ac_beg=1 # First line for current file.
24342   ac_end=$ac_max_sed_lines # Line after last line for current file.
24343   ac_more_lines=:
24344   ac_sed_cmds=
24345   while "$ac_more_lines"; do
24346     if test "$ac_beg" -gt 1; then
24347       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
24348     else
24349       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
24350     fi
24351     if test ! -s "$tmp"/subs.frag; then
24352       ac_more_lines=false
24353     else
24354       # The purpose of the label and of the branching condition is to
24355       # speed up the sed processing (if there are no `@' at all, there
24356       # is no need to browse any of the substitutions).
24357       # These are the two extra sed commands mentioned above.
24358       (echo ':t
24359   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
24360       # It is possible to make a multiline substitution using escaped newlines.
24361       # Ensure that we do not split the substitution between script fragments.
24362       ac_BEG=$ac_end
24363       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
24364       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
24365       if test -s "$tmp"/subs.next; then
24366         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
24367         if test ! -s "$tmp"/subs.edit; then
24368           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
24369           if test ! -s "$tmp"/subs.edit; then
24370             if test "$ac_beg" -gt 1; then
24371               ac_end=`expr "$ac_end" - 1`
24372               continue
24373             fi
24374           fi
24375         fi
24376       fi
24377
24378       if test -z "$ac_sed_cmds"; then
24379         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
24380       else
24381         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
24382       fi
24383       ac_sed_frag=`expr "$ac_sed_frag" + 1`
24384       ac_beg=$ac_end
24385       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
24386     fi
24387   done
24388   if test -z "$ac_sed_cmds"; then
24389     ac_sed_cmds="cat"
24390   fi
24391 fi # test -n "$CONFIG_FILES"
24392
24393 EOF
24394 cat >>"$CONFIG_STATUS" <<\EOF
24395 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
24396   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24397   case "$ac_file" in
24398   - | *:- | *:-:* ) # input from stdin
24399         cat >"$tmp"/stdin
24400         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24401         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24402   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24403         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24404   * )   ac_file_in=$ac_file.in ;;
24405   esac
24406
24407   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
24408   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24409          X"$ac_file" : 'X\(//\)[^/]' \| \
24410          X"$ac_file" : 'X\(//\)$' \| \
24411          X"$ac_file" : 'X\(/\)' \| \
24412          .     : '\(.\)' 2>/dev/null ||
24413 echo X"$ac_file" |
24414     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24415           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24416           /^X\(\/\/\)$/{ s//\1/; q; }
24417           /^X\(\/\).*/{ s//\1/; q; }
24418           s/.*/./; q'`
24419   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24420     { case "$ac_dir" in
24421   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24422   *)                      as_incr_dir=.;;
24423 esac
24424 as_dummy="$ac_dir"
24425 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24426   case $as_mkdir_dir in
24427     # Skip DOS drivespec
24428     ?:) as_incr_dir=$as_mkdir_dir ;;
24429     *)
24430       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24431       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24432     ;;
24433   esac
24434 done; }
24435
24436     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
24437     # A "../" for each directory in $ac_dir_suffix.
24438     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
24439   else
24440     ac_dir_suffix= ac_dots=
24441   fi
24442
24443   case "$srcdir" in
24444   .)  ac_srcdir=.
24445       if test -z "$ac_dots"; then
24446          ac_top_srcdir=.
24447       else
24448          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
24449       fi ;;
24450   [\\/]* | ?:[\\/]* )
24451       ac_srcdir="$srcdir$ac_dir_suffix";
24452       ac_top_srcdir="$srcdir" ;;
24453   *) # Relative path.
24454     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
24455     ac_top_srcdir="$ac_dots$srcdir" ;;
24456   esac
24457
24458   case $INSTALL in
24459   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
24460   *) ac_INSTALL=$ac_dots$INSTALL ;;
24461   esac
24462
24463   if test x"$ac_file" != x-; then
24464     { echo "$as_me:24464: creating $ac_file" >&5
24465 echo "$as_me: creating $ac_file" >&6;}
24466     rm -f "$ac_file"
24467   fi
24468   # Let's still pretend it is `configure' which instantiates (i.e., don't
24469   # use $as_me), people would be surprised to read:
24470   #    /* config.h.  Generated automatically by config.status.  */
24471   configure_input="Generated automatically from `echo $ac_file_in |
24472                                                  sed 's,.*/,,'` by configure."
24473
24474   # First look for the input files in the build tree, otherwise in the
24475   # src tree.
24476   ac_file_inputs=`IFS=:
24477     for f in $ac_file_in; do
24478       case $f in
24479       -) echo "$tmp"/stdin ;;
24480       [\\/$]*)
24481          # Absolute (can't be DOS-style, as IFS=:)
24482          test -f "$f" || { { echo "$as_me:24482: error: cannot find input file: $f" >&5
24483 echo "$as_me: error: cannot find input file: $f" >&2;}
24484    { (exit 1); exit 1; }; }
24485          echo "$f";;
24486       *) # Relative
24487          if test -f "$f"; then
24488            # Build tree
24489            echo "$f"
24490          elif test -f "$srcdir/$f"; then
24491            # Source tree
24492            echo "$srcdir/$f"
24493          else
24494            # /dev/null tree
24495            { { echo "$as_me:24495: error: cannot find input file: $f" >&5
24496 echo "$as_me: error: cannot find input file: $f" >&2;}
24497    { (exit 1); exit 1; }; }
24498          fi;;
24499       esac
24500     done` || { (exit 1); exit 1; }
24501 EOF
24502 cat >>"$CONFIG_STATUS" <<\EOF
24503   ac_warn_datarootdir=no
24504   if test x"$ac_file" != x-; then
24505     for ac_item in $ac_file_inputs
24506     do
24507       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
24508       if test -n "$ac_seen"; then
24509         ac_used=`grep '@datarootdir@' "$ac_item"`
24510         if test -z "$ac_used"; then
24511           { echo "$as_me:24511: WARNING: datarootdir was used implicitly but not set:
24512 $ac_seen" >&5
24513 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
24514 $ac_seen" >&2;}
24515           ac_warn_datarootdir=yes
24516         fi
24517       fi
24518       ac_seen=`grep '${datarootdir}' "$ac_item"`
24519       if test -n "$ac_seen"; then
24520         { echo "$as_me:24520: WARNING: datarootdir was used explicitly but not set:
24521 $ac_seen" >&5
24522 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
24523 $ac_seen" >&2;}
24524         ac_warn_datarootdir=yes
24525       fi
24526     done
24527   fi
24528
24529 if test "x$ac_warn_datarootdir" = xyes; then
24530   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
24531 fi
24532
24533 EOF
24534 cat >>"$CONFIG_STATUS" <<EOF
24535   sed "$ac_vpsub
24536 $extrasub
24537 EOF
24538 cat >>"$CONFIG_STATUS" <<\EOF
24539 :t
24540 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
24541 s,@configure_input@,$configure_input,;t t
24542 s,@srcdir@,$ac_srcdir,;t t
24543 s,@top_srcdir@,$ac_top_srcdir,;t t
24544 s,@INSTALL@,$ac_INSTALL,;t t
24545 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
24546   rm -f "$tmp"/stdin
24547 EOF
24548 : "${FGREP:=grep -F}"
24549 : "${EGREP:=grep -E}"
24550 cat >>"$CONFIG_STATUS" <<EOF
24551   : "\${FGREP:=$FGREP}"
24552   : "\${EGREP:=$EGREP}"
24553 EOF
24554 cat >>"$CONFIG_STATUS" <<\EOF
24555   if test x"$ac_file" != x-; then
24556     cp "$tmp/out" "$ac_file"
24557
24558     for ac_name in prefix exec_prefix datarootdir
24559     do
24560         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
24561         if test -n "$ac_seen"; then
24562             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
24563             if test -z "$ac_init"; then
24564               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
24565               { echo "$as_me:24565: WARNING: Variable $ac_name is used but was not set:
24566 $ac_seen" >&5
24567 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
24568 $ac_seen" >&2;}
24569             fi
24570         fi
24571     done
24572     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
24573     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
24574     if test -s "$tmp"/out; then
24575       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
24576       { echo "$as_me:24576: WARNING: Some variables may not be substituted:
24577 $ac_seen" >&5
24578 echo "$as_me: WARNING: Some variables may not be substituted:
24579 $ac_seen" >&2;}
24580     fi
24581   else
24582     cat "$tmp"/out
24583   fi
24584   rm -f "$tmp"/out
24585
24586 done
24587 EOF
24588 cat >>"$CONFIG_STATUS" <<\EOF
24589
24590 #
24591 # CONFIG_HEADER section.
24592 #
24593
24594 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24595 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24596 #
24597 # ac_d sets the value in "#define NAME VALUE" lines.
24598 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24599 ac_dB='[        ].*$,\1#\2'
24600 ac_dC=' '
24601 ac_dD=',;t'
24602 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24603 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24604 ac_iB='\([      ]\),\1#\2define\3'
24605 ac_iC=' '
24606 ac_iD='\4,;t'
24607 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24608 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24609 ac_uB='$,\1#\2define\3'
24610 ac_uC=' '
24611 ac_uD=',;t'
24612
24613 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
24614   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24615   case "$ac_file" in
24616   - | *:- | *:-:* ) # input from stdin
24617         cat >"$tmp"/stdin
24618         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24619         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24620   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24621         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24622   * )   ac_file_in=$ac_file.in ;;
24623   esac
24624
24625   test x"$ac_file" != x- && { echo "$as_me:24625: creating $ac_file" >&5
24626 echo "$as_me: creating $ac_file" >&6;}
24627
24628   # First look for the input files in the build tree, otherwise in the
24629   # src tree.
24630   ac_file_inputs=`IFS=:
24631     for f in $ac_file_in; do
24632       case $f in
24633       -) echo "$tmp"/stdin ;;
24634       [\\/$]*)
24635          # Absolute (can't be DOS-style, as IFS=:)
24636          test -f "$f" || { { echo "$as_me:24636: error: cannot find input file: $f" >&5
24637 echo "$as_me: error: cannot find input file: $f" >&2;}
24638    { (exit 1); exit 1; }; }
24639          echo $f;;
24640       *) # Relative
24641          if test -f "$f"; then
24642            # Build tree
24643            echo $f
24644          elif test -f "$srcdir/$f"; then
24645            # Source tree
24646            echo "$srcdir/$f"
24647          else
24648            # /dev/null tree
24649            { { echo "$as_me:24649: error: cannot find input file: $f" >&5
24650 echo "$as_me: error: cannot find input file: $f" >&2;}
24651    { (exit 1); exit 1; }; }
24652          fi;;
24653       esac
24654     done` || { (exit 1); exit 1; }
24655   # Remove the trailing spaces.
24656   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
24657
24658 EOF
24659
24660 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
24661 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
24662 # be either 'cat' or 'sort'.
24663 cat confdefs.h | uniq >conftest.vals
24664
24665 # Break up conftest.vals because some shells have a limit on
24666 # the size of here documents, and old seds have small limits too.
24667
24668 rm -f conftest.tail
24669 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
24670 while grep . conftest.vals >/dev/null
24671 do
24672   # Write chunks of a limited-size here document to conftest.frag.
24673   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
24674   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
24675   echo 'CEOF' >> "$CONFIG_STATUS"
24676   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
24677   rm -f conftest.vals
24678   mv conftest.tail conftest.vals
24679 done
24680 rm -f conftest.vals
24681
24682 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
24683 # marker @DEFS@.
24684 echo '  cat >> conftest.edit <<CEOF
24685 /@DEFS@/r conftest.frag
24686 /@DEFS@/d
24687 CEOF
24688 sed -f conftest.edit "$tmp"/in > "$tmp"/out
24689 rm -f "$tmp"/in
24690 mv "$tmp"/out "$tmp"/in
24691 rm -f conftest.edit conftest.frag
24692 ' >> "$CONFIG_STATUS"
24693
24694 cat >>"$CONFIG_STATUS" <<\EOF
24695   # Let's still pretend it is `configure' which instantiates (i.e., don't
24696   # use $as_me), people would be surprised to read:
24697   #    /* config.h.  Generated automatically by config.status.  */
24698   if test x"$ac_file" = x-; then
24699     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
24700   else
24701     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
24702   fi
24703   cat "$tmp"/in >>"$tmp"/config.h
24704   rm -f "$tmp"/in
24705   if test x"$ac_file" != x-; then
24706     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
24707       { echo "$as_me:24707: $ac_file is unchanged" >&5
24708 echo "$as_me: $ac_file is unchanged" >&6;}
24709     else
24710       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24711          X"$ac_file" : 'X\(//\)[^/]' \| \
24712          X"$ac_file" : 'X\(//\)$' \| \
24713          X"$ac_file" : 'X\(/\)' \| \
24714          .     : '\(.\)' 2>/dev/null ||
24715 echo X"$ac_file" |
24716     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24717           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24718           /^X\(\/\/\)$/{ s//\1/; q; }
24719           /^X\(\/\).*/{ s//\1/; q; }
24720           s/.*/./; q'`
24721       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24722         { case "$ac_dir" in
24723   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24724   *)                      as_incr_dir=.;;
24725 esac
24726 as_dummy="$ac_dir"
24727 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24728   case $as_mkdir_dir in
24729     # Skip DOS drivespec
24730     ?:) as_incr_dir=$as_mkdir_dir ;;
24731     *)
24732       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24733       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24734     ;;
24735   esac
24736 done; }
24737
24738       fi
24739       rm -f "$ac_file"
24740       mv "$tmp/config.h" "$ac_file"
24741     fi
24742   else
24743     cat "$tmp"/config.h
24744     rm -f "$tmp"/config.h
24745   fi
24746 done
24747 EOF
24748 cat >>"$CONFIG_STATUS" <<\EOF
24749 #
24750 # CONFIG_COMMANDS section.
24751 #
24752 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
24753   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
24754   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
24755
24756   case "$ac_dest" in
24757     default )
24758
24759 for cf_dir in .
24760 do
24761         if test ! -d "$srcdir/$cf_dir" ; then
24762                 continue
24763         elif test -f "$srcdir/$cf_dir/programs" ; then
24764                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
24765         fi
24766 done
24767
24768         cat >>Makefile <<TEST_EOF
24769
24770 # These rules are generated so we do not rely on suffix rules, which do not
24771 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24772 # some, and the '\$x' confuses others).
24773 TEST_EOF
24774
24775 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24776 for N in $LIST
24777 do
24778         cat >>Makefile <<TEST_EOF
24779
24780 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24781         \$(srcdir)/test.priv.h \\
24782         ncurses_cfg.h
24783         $SHOW_CC
24784         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24785 TEST_EOF
24786 done
24787
24788 if test -f ../config.guess && test -f ../config.sub
24789 then
24790         cat >>Makefile <<TEST_EOF
24791
24792 # if we used CF_INHERIT for getting these files, we can remove them
24793 distclean::
24794         rm -f config.guess config.sub
24795 TEST_EOF
24796 fi
24797  ;;
24798   esac
24799 done
24800 EOF
24801
24802 cat >>"$CONFIG_STATUS" <<\EOF
24803
24804 { (exit 0); exit 0; }
24805 EOF
24806 chmod +x "$CONFIG_STATUS"
24807 ac_clean_files=$ac_clean_files_save
24808
24809 # configure is writing to config.log, and then calls config.status.
24810 # config.status does its own redirection, appending to config.log.
24811 # Unfortunately, on DOS this fails, as config.log is still kept open
24812 # by configure, so config.status won't be able to write to it; its
24813 # output is simply discarded.  So we exec the FD to /dev/null,
24814 # effectively closing config.log, so it can be properly (re)opened and
24815 # appended to by config.status.  When coming back to configure, we
24816 # need to make the FD available again.
24817 if test "$no_create" != yes; then
24818   ac_cs_success=:
24819   exec 5>/dev/null
24820   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24821   exec 5>>config.log
24822   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24823   # would make configure fail if this is the last instruction.
24824   "$ac_cs_success" || { (exit 1); exit 1; }
24825 fi
24826