]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.4 - patch 20240414
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20210509.
4 #
5 # Copyright 2003-2020,2021      Thomas E. Dickey
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset="unset"
64 else
65   as_unset="false"
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS=
101 MAKEFLAGS=
102 SHELL=${CONFIG_SHELL-/bin/sh}
103
104 # Maximum number of lines to put in a shell here document.
105 # This variable seems obsolete.  It should probably be removed, and
106 # only ac_max_sed_lines should be used.
107 : "${ac_max_here_lines=38}"
108
109 ac_unique_file="ncurses.c"
110
111 # Initialize some variables set by options.
112 ac_init_help=
113 ac_init_version=false
114 # The variables have the same names as the options, with
115 # dashes changed to underlines.
116 cache_file=/dev/null
117 exec_prefix=NONE
118 no_create=
119 no_recursion=
120 prefix=NONE
121 program_prefix=NONE
122 program_suffix=NONE
123 program_transform_name=s,x,x,
124 silent=
125 site=
126 srcdir=
127 verbose=
128 x_includes=NONE
129 x_libraries=NONE
130
131 # Installation directory options.
132 # These are left unexpanded so users can "make install exec_prefix=/foo"
133 # and all the variables that are supposed to be based on exec_prefix
134 # by default will actually change.
135 # Use braces instead of parens because sh, perl, etc. also accept them.
136 bindir='${exec_prefix}/bin'
137 sbindir='${exec_prefix}/sbin'
138 libexecdir='${exec_prefix}/libexec'
139 datarootdir='${prefix}/share'
140 datadir='${datarootdir}'
141 sysconfdir='${prefix}/etc'
142 sharedstatedir='${prefix}/com'
143 localstatedir='${prefix}/var'
144 runstatedir='${localstatedir}/run'
145 libdir='${exec_prefix}/lib'
146 includedir='${prefix}/include'
147 oldincludedir='/usr/include'
148 infodir='${datarootdir}/info'
149 mandir='${datarootdir}/man'
150
151 # Identity of this package.
152 PACKAGE_NAME=
153 PACKAGE_TARNAME=
154 PACKAGE_VERSION=
155 PACKAGE_STRING=
156 PACKAGE_BUGREPORT=
157
158 ac_prev=
159 for ac_option
160 do
161   # If the previous option needs an argument, assign it.
162   if test -n "$ac_prev"; then
163     eval "$ac_prev=\$ac_option"
164     ac_prev=
165     continue
166   fi
167
168   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
169
170   # Accept the important Cygnus configure options, so we can diagnose typos.
171
172   case "$ac_option" in
173
174   -bindir | --bindir | --bindi | --bind | --bin | --bi)
175     ac_prev=bindir ;;
176   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
177     bindir=$ac_optarg ;;
178
179   -build | --build | --buil | --bui | --bu)
180     ac_prev=build_alias ;;
181   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
182     build_alias=$ac_optarg ;;
183
184   -cache-file | --cache-file | --cache-fil | --cache-fi \
185   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
186     ac_prev=cache_file ;;
187   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
188   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
189     cache_file=$ac_optarg ;;
190
191   --config-cache | -C)
192     cache_file=config.cache ;;
193
194   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
195     ac_prev=datadir ;;
196   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
197   | --da=*)
198     datadir=$ac_optarg ;;
199
200   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
201   | --dataroo | --dataro | --datar)
202     ac_prev=datarootdir ;;
203   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
204   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
205     datarootdir=$ac_optarg ;;
206
207   -disable-* | --disable-*)
208     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
209     # Reject names that are not valid shell variable names.
210     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
211       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
212    { (exit 1); exit 1; }; }
213     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
214     eval "enable_$ac_feature=no" ;;
215
216   -enable-* | --enable-*)
217     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
218     # Reject names that are not valid shell variable names.
219     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
220       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
221    { (exit 1); exit 1; }; }
222     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
223     case "$ac_option" in
224       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
225       *) ac_optarg=yes ;;
226     esac
227     eval "enable_$ac_feature='$ac_optarg'" ;;
228
229   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
230   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
231   | --exec | --exe | --ex)
232     ac_prev=exec_prefix ;;
233   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
234   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
235   | --exec=* | --exe=* | --ex=*)
236     exec_prefix=$ac_optarg ;;
237
238   -gas | --gas | --ga | --g)
239     # Obsolete; use --with-gas.
240     with_gas=yes ;;
241
242   -help | --help | --hel | --he | -h)
243     ac_init_help=long ;;
244   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
245     ac_init_help=recursive ;;
246   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
247     ac_init_help=short ;;
248
249   -host | --host | --hos | --ho)
250     ac_prev=host_alias ;;
251   -host=* | --host=* | --hos=* | --ho=*)
252     host_alias=$ac_optarg ;;
253
254   -includedir | --includedir | --includedi | --included | --include \
255   | --includ | --inclu | --incl | --inc)
256     ac_prev=includedir ;;
257   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
258   | --includ=* | --inclu=* | --incl=* | --inc=*)
259     includedir=$ac_optarg ;;
260
261   -infodir | --infodir | --infodi | --infod | --info | --inf)
262     ac_prev=infodir ;;
263   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
264     infodir=$ac_optarg ;;
265
266   -libdir | --libdir | --libdi | --libd)
267     ac_prev=libdir ;;
268   -libdir=* | --libdir=* | --libdi=* | --libd=*)
269     libdir=$ac_optarg ;;
270
271   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
272   | --libexe | --libex | --libe)
273     ac_prev=libexecdir ;;
274   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
275   | --libexe=* | --libex=* | --libe=*)
276     libexecdir=$ac_optarg ;;
277
278   -localstatedir | --localstatedir | --localstatedi | --localstated \
279   | --localstate | --localstat | --localsta | --localst \
280   | --locals | --local | --loca | --loc | --lo)
281     ac_prev=localstatedir ;;
282   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
283   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
284   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
285     localstatedir=$ac_optarg ;;
286
287   -runstatedir | --runstatedir | --runstatedi | --runstated \
288   | --runstate | --runstat | --runsta | --runst \
289   | --runs | --run | --ru)
290     ac_prev=runstatedir ;;
291   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
292   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
293   | --runs=* | --run=* | --ru=*)
294     runstatedir=$ac_optarg ;;
295
296   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
297     ac_prev=mandir ;;
298   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
299     mandir=$ac_optarg ;;
300
301   -nfp | --nfp | --nf)
302     # Obsolete; use --without-fp.
303     with_fp=no ;;
304
305   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
306   | --no-cr | --no-c)
307     no_create=yes ;;
308
309   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
310   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
311     no_recursion=yes ;;
312
313   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
314   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
315   | --oldin | --oldi | --old | --ol | --o)
316     ac_prev=oldincludedir ;;
317   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
318   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
319   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
320     oldincludedir=$ac_optarg ;;
321
322   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
323     ac_prev=prefix ;;
324   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
325     prefix=$ac_optarg ;;
326
327   -program-prefix | --program-prefix | --program-prefi | --program-pref \
328   | --program-pre | --program-pr | --program-p)
329     ac_prev=program_prefix ;;
330   -program-prefix=* | --program-prefix=* | --program-prefi=* \
331   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
332     program_prefix=$ac_optarg ;;
333
334   -program-suffix | --program-suffix | --program-suffi | --program-suff \
335   | --program-suf | --program-su | --program-s)
336     ac_prev=program_suffix ;;
337   -program-suffix=* | --program-suffix=* | --program-suffi=* \
338   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
339     program_suffix=$ac_optarg ;;
340
341   -program-transform-name | --program-transform-name \
342   | --program-transform-nam | --program-transform-na \
343   | --program-transform-n | --program-transform- \
344   | --program-transform | --program-transfor \
345   | --program-transfo | --program-transf \
346   | --program-trans | --program-tran \
347   | --progr-tra | --program-tr | --program-t)
348     ac_prev=program_transform_name ;;
349   -program-transform-name=* | --program-transform-name=* \
350   | --program-transform-nam=* | --program-transform-na=* \
351   | --program-transform-n=* | --program-transform-=* \
352   | --program-transform=* | --program-transfor=* \
353   | --program-transfo=* | --program-transf=* \
354   | --program-trans=* | --program-tran=* \
355   | --progr-tra=* | --program-tr=* | --program-t=*)
356     program_transform_name=$ac_optarg ;;
357
358   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
359   | -silent | --silent | --silen | --sile | --sil)
360     silent=yes ;;
361
362   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
363     ac_prev=sbindir ;;
364   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
365   | --sbi=* | --sb=*)
366     sbindir=$ac_optarg ;;
367
368   -sharedstatedir | --sharedstatedir | --sharedstatedi \
369   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
370   | --sharedst | --shareds | --shared | --share | --shar \
371   | --sha | --sh)
372     ac_prev=sharedstatedir ;;
373   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
374   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
375   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
376   | --sha=* | --sh=*)
377     sharedstatedir=$ac_optarg ;;
378
379   -site | --site | --sit)
380     ac_prev=site ;;
381   -site=* | --site=* | --sit=*)
382     site=$ac_optarg ;;
383
384   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
385     ac_prev=srcdir ;;
386   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
387     srcdir=$ac_optarg ;;
388
389   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
390   | --syscon | --sysco | --sysc | --sys | --sy)
391     ac_prev=sysconfdir ;;
392   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
393   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
394     sysconfdir=$ac_optarg ;;
395
396   -target | --target | --targe | --targ | --tar | --ta | --t)
397     ac_prev=target_alias ;;
398   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
399     target_alias=$ac_optarg ;;
400
401   -v | -verbose | --verbose | --verbos | --verbo | --verb)
402     verbose=yes ;;
403
404   -version | --version | --versio | --versi | --vers | -V)
405     ac_init_version=: ;;
406
407   -with-* | --with-*)
408     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
409     # Reject names that are not valid shell variable names.
410     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
411       { echo "$as_me: error: invalid package name: $ac_package" >&2
412    { (exit 1); exit 1; }; }
413     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
414     case "$ac_option" in
415       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
416       *) ac_optarg=yes ;;
417     esac
418     eval "with_$ac_package='$ac_optarg'" ;;
419
420   -without-* | --without-*)
421     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
422     # Reject names that are not valid shell variable names.
423     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
424       { echo "$as_me: error: invalid package name: $ac_package" >&2
425    { (exit 1); exit 1; }; }
426     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
427     eval "with_$ac_package=no" ;;
428
429   --x)
430     # Obsolete; use --with-x.
431     with_x=yes ;;
432
433   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
434   | --x-incl | --x-inc | --x-in | --x-i)
435     ac_prev=x_includes ;;
436   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
437   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
438     x_includes=$ac_optarg ;;
439
440   -x-libraries | --x-libraries | --x-librarie | --x-librari \
441   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
442     ac_prev=x_libraries ;;
443   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
444   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
445     x_libraries=$ac_optarg ;;
446
447   -*) { echo "$as_me: error: unrecognized option: $ac_option
448 Try \`$0 --help' for more information." >&2
449    { (exit 1); exit 1; }; }
450     ;;
451
452   *=*)
453     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
454     # Reject names that are not valid shell variable names.
455     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
456       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
457    { (exit 1); exit 1; }; }
458     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
459     eval "$ac_envvar='$ac_optarg'"
460     export "$ac_envvar" ;;
461
462   *)
463     # FIXME: should be removed in autoconf 3.0.
464     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
465     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
466       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
467     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
468     ;;
469
470   esac
471 done
472
473 if test -n "$ac_prev"; then
474   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
475   { echo "$as_me: error: missing argument to $ac_option" >&2
476    { (exit 1); exit 1; }; }
477 fi
478
479 # Be sure to have absolute paths.
480 for ac_var in exec_prefix prefix
481 do
482   eval ac_val=$`echo "$ac_var"`
483   case "$ac_val" in
484     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # Be sure to have absolute paths.
491 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
492               localstatedir libdir includedir oldincludedir infodir mandir
493 do
494   eval ac_val=$`echo "$ac_var"`
495   case "$ac_val" in
496     [\\/$]* | ?:[\\/]* ) ;;
497     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
498    { (exit 1); exit 1; }; };;
499   esac
500 done
501
502 # There might be people who depend on the old broken behavior: `$host'
503 # used to hold the argument of --host etc.
504 build=$build_alias
505 host=$host_alias
506 target=$target_alias
507
508 # FIXME: should be removed in autoconf 3.0.
509 if test "x$host_alias" != x; then
510   if test "x$build_alias" = x; then
511     cross_compiling=maybe
512     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
513     If a cross compiler is detected then cross compile mode will be used." >&2
514   elif test "x$build_alias" != "x$host_alias"; then
515     cross_compiling=yes
516   fi
517 fi
518
519 ac_tool_prefix=
520 test -n "$host_alias" && ac_tool_prefix=$host_alias-
521
522 test "$silent" = yes && exec 6>/dev/null
523
524 # Find the source files, if location was not specified.
525 if test -z "$srcdir"; then
526   ac_srcdir_defaulted=yes
527   # Try the directory containing this script, then its parent.
528   ac_prog=$0
529   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
530   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
531   srcdir=$ac_confdir
532   if test ! -r "$srcdir/$ac_unique_file"; then
533     srcdir=..
534   fi
535 else
536   ac_srcdir_defaulted=no
537 fi
538 if test ! -r "$srcdir/$ac_unique_file"; then
539   if test "$ac_srcdir_defaulted" = yes; then
540     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
541    { (exit 1); exit 1; }; }
542   else
543     { echo "$as_me: error: cannot find sources in $srcdir" >&2
544    { (exit 1); exit 1; }; }
545   fi
546 fi
547 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
548 ac_env_build_alias_set=${build_alias+set}
549 ac_env_build_alias_value=$build_alias
550 ac_cv_env_build_alias_set=${build_alias+set}
551 ac_cv_env_build_alias_value=$build_alias
552 ac_env_host_alias_set=${host_alias+set}
553 ac_env_host_alias_value=$host_alias
554 ac_cv_env_host_alias_set=${host_alias+set}
555 ac_cv_env_host_alias_value=$host_alias
556 ac_env_target_alias_set=${target_alias+set}
557 ac_env_target_alias_value=$target_alias
558 ac_cv_env_target_alias_set=${target_alias+set}
559 ac_cv_env_target_alias_value=$target_alias
560 ac_env_CC_set=${CC+set}
561 ac_env_CC_value=$CC
562 ac_cv_env_CC_set=${CC+set}
563 ac_cv_env_CC_value=$CC
564 ac_env_CFLAGS_set=${CFLAGS+set}
565 ac_env_CFLAGS_value=$CFLAGS
566 ac_cv_env_CFLAGS_set=${CFLAGS+set}
567 ac_cv_env_CFLAGS_value=$CFLAGS
568 ac_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_env_LDFLAGS_value=$LDFLAGS
570 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
571 ac_cv_env_LDFLAGS_value=$LDFLAGS
572 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_env_CPPFLAGS_value=$CPPFLAGS
574 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
575 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
576 ac_env_CPP_set=${CPP+set}
577 ac_env_CPP_value=$CPP
578 ac_cv_env_CPP_set=${CPP+set}
579 ac_cv_env_CPP_value=$CPP
580
581 #
582 # Report the --help message.
583 #
584 if test "$ac_init_help" = "long"; then
585   # Omit some internal or obsolete options to make the list less imposing.
586   # This message is too long to be a string in the A/UX 3.1 sh.
587   cat <<EOF
588 \`configure' configures this package to adapt to many kinds of systems.
589
590 Usage: $0 [OPTION]... [VAR=VALUE]...
591
592 To assign environment variables (e.g., CC, CFLAGS...), specify them as
593 VAR=VALUE.  See below for descriptions of some of the useful variables.
594
595 Defaults for the options are specified in brackets.
596
597 Configuration:
598   -h, --help              display this help and exit
599       --help=short        display options specific to this package
600       --help=recursive    display the short help of all the included packages
601   -V, --version           display version information and exit
602   -q, --quiet, --silent   do not print \`checking...' messages
603       --cache-file=FILE   cache test results in FILE [disabled]
604   -C, --config-cache      alias for \`--cache-file=config.cache'
605   -n, --no-create         do not create output files
606       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
607
608 EOF
609
610   cat <<EOF
611 Installation directories:
612   --prefix=PREFIX         install architecture-independent files in PREFIX
613                           [$ac_default_prefix]
614   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
615                           [PREFIX]
616
617 By default, \`make install' will install all the files in
618 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
619 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
620 for instance \`--prefix=\$HOME'.
621
622 For better control, use the options below.
623
624 Fine tuning of the installation directories:
625   --bindir=DIR            user executables [EPREFIX/bin]
626   --sbindir=DIR           system admin executables [EPREFIX/sbin]
627   --libexecdir=DIR        program executables [EPREFIX/libexec]
628   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
629   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
630   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
631   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
632   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
633   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
634   --libdir=DIR            object code libraries [EPREFIX/lib]
635   --includedir=DIR        C header files [PREFIX/include]
636   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
637   --infodir=DIR           info documentation [DATAROOTDIR/info]
638   --mandir=DIR            man documentation [DATAROOTDIR/man]
639 EOF
640
641   cat <<\EOF
642
643 Program names:
644   --program-prefix=PREFIX            prepend PREFIX to installed program names
645   --program-suffix=SUFFIX            append SUFFIX to installed program names
646   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
647
648 X features:
649   --x-includes=DIR    X include files are in DIR
650   --x-libraries=DIR   X library files are in DIR
651
652 System types:
653   --build=BUILD           configure for building on BUILD [guessed]
654   --host=HOST       build programs to run on HOST [BUILD]
655 EOF
656 fi
657
658 if test -n "$ac_init_help"; then
659
660   cat <<\EOF
661
662 Optional Features:
663   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
664   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
665
666 Optional Packages:
667   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
668   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
669
670 General Options:
671   --disable-stripping     do not strip (debug info) installed executables
672   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
673   --enable-string-hacks   work around bogus compiler/loader warnings
674   --with-pkg-config{=path} enable/disable use of pkg-config
675   --disable-echo          do not display "compiling" commands
676 Curses Version-dependent Options:
677   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
678   --disable-widec         disable checks for wide-character functions
679   --with-curses-dir=DIR   directory in which (n)curses is installed
680   --with-screen=XXX       use specified curses-libraries
681   --with-ncursesw         use wide ncurses-libraries
682   --with-ncurses          use ncurses-libraries
683   --with-pdcurses         compile/link with pdcurses X11 library
684   --with-curses-colr      compile/link with HPUX 10.x color-curses
685   --with-curses-5lib      compile/link with SunOS 5lib curses
686   --with-Xaw3d            link with Xaw 3d library
687   --with-Xaw3dxft         link with Xaw 3d xft library
688   --with-neXtaw           link with neXT Athena library
689   --with-XawPlus          link with Athena-Plus library
690   --with-x                use the X Window System
691   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
692   --with-form-libname=XXX override form basename of library
693   --with-menu-libname=XXX override menu basename of library
694   --with-panel-libname=XXX override panel basename of library
695   --disable-panel         disable checks for panel functions
696   --disable-menu          disable checks for menu functions
697   --disable-form          disable checks for form functions
698 Testing/development Options:
699   --enable-warnings       test: turn on gcc compiler warnings
700   --with-dmalloc          test: use Gray Watson's dmalloc library
701   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
702   --with-valgrind         test: use valgrind
703   --disable-leaks         test: free permanent memory, analyze leaks
704   --disable-rpath-hack    don't add rpath options for additional libraries
705
706 Some influential environment variables:
707   CC          C compiler command
708   CFLAGS      C compiler flags
709   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
710               nonstandard directory <lib dir>
711   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
712               headers in a nonstandard directory <include dir>
713   CPP         C preprocessor
714
715 Use these variables to override the choices made by `configure' or to help
716 it to find libraries and programs with nonstandard names/locations.
717
718 EOF
719 fi
720
721 if test "$ac_init_help" = "recursive"; then
722   # If there are subdirs, report their specific --help.
723   ac_popdir=`pwd`
724   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
725     cd "$ac_subdir"
726     # A "../" for each directory in /$ac_subdir.
727     ac_dots=`echo "$ac_subdir" |
728              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
729
730     case "$srcdir" in
731     .) # No --srcdir option.  We are building in place.
732       ac_sub_srcdir="$srcdir" ;;
733     [\\/]* | ?:[\\/]* ) # Absolute path.
734       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
735     *) # Relative path.
736       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
737     esac
738
739     # Check for guested configure; otherwise get Cygnus style configure.
740     if test -f "$ac_sub_srcdir/configure.gnu"; then
741       echo
742       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
743     elif test -f "$ac_sub_srcdir/configure"; then
744       echo
745       $SHELL "$ac_sub_srcdir/configure" --help=recursive
746     elif test -f "$ac_sub_srcdir/configure.ac" ||
747            test -f "$ac_sub_srcdir/configure.in"; then
748       echo
749       "$ac_configure" --help
750     else
751       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
752     fi
753     cd "$ac_popdir"
754   done
755 fi
756
757 test -n "$ac_init_help" && exit 0
758 if "$ac_init_version"; then
759   cat <<\EOF
760
761 Copyright 2003-2020,2021        Thomas E. Dickey
762 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
763 Free Software Foundation, Inc.
764 This configure script is free software; the Free Software Foundation
765 gives unlimited permission to copy, distribute and modify it.
766 EOF
767   exit 0
768 fi
769 exec 5>config.log
770 cat >&5 <<EOF
771 This file contains any messages produced by compilers while
772 running configure, to aid debugging if configure makes a mistake.
773
774 It was created by $as_me, which was
775 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
776
777   $ $0 $@
778
779 EOF
780 {
781 cat <<_ASUNAME
782 ## ---------- ##
783 ## Platform.  ##
784 ## ---------- ##
785
786 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
787 uname -m = `(uname -m) 2>/dev/null || echo unknown`
788 uname -r = `(uname -r) 2>/dev/null || echo unknown`
789 uname -s = `(uname -s) 2>/dev/null || echo unknown`
790 uname -v = `(uname -v) 2>/dev/null || echo unknown`
791
792 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
793 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
794
795 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
796 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
797 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
798 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
799 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
800 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
801 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
802
803 PATH = $PATH
804
805 _ASUNAME
806 } >&5
807
808 cat >&5 <<EOF
809 ## ------------ ##
810 ## Core tests.  ##
811 ## ------------ ##
812
813 EOF
814
815 # Keep a trace of the command line.
816 # Strip out --no-create and --no-recursion so they do not pile up.
817 # Also quote any args containing shell meta-characters.
818 ac_configure_args=
819 ac_sep=
820 for ac_arg
821 do
822   case "$ac_arg" in
823   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
824   | --no-cr | --no-c) ;;
825   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
826   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
827   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
828     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
829     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
830     ac_sep=" " ;;
831   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
832      ac_sep=" " ;;
833   esac
834   # Get rid of the leading space.
835 done
836
837 # When interrupted or exit'd, cleanup temporary files, and complete
838 # config.log.  We remove comments because anyway the quotes in there
839 # would cause problems or look ugly.
840 trap 'exit_status=$?
841   # Save into config.log some information that might help in debugging.
842   echo >&5
843   echo "## ----------------- ##" >&5
844   echo "## Cache variables.  ##" >&5
845   echo "## ----------------- ##" >&5
846   echo >&5
847   # The following way of writing the cache mishandles newlines in values,
848 {
849   (set) 2>&1 |
850     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
851     *ac_space=\ *)
852       sed -n \
853         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
854           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
855       ;;
856     *)
857       sed -n \
858         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
859       ;;
860     esac;
861 } >&5
862   sed "/^$/d" confdefs.h >conftest.log
863   if test -s conftest.log; then
864     echo >&5
865     echo "## ------------ ##" >&5
866     echo "## confdefs.h.  ##" >&5
867     echo "## ------------ ##" >&5
868     echo >&5
869     cat conftest.log >&5
870   fi
871   (echo; echo) >&5
872   test "$ac_signal" != 0 &&
873     echo "$as_me: caught signal $ac_signal" >&5
874   echo "$as_me: exit $exit_status" >&5
875   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
876     exit $exit_status
877      ' 0
878 for ac_signal in 1 2 13 15; do
879   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
880 done
881 ac_signal=0
882
883 # confdefs.h avoids OS command line length limits that DEFS can exceed.
884 rm -rf conftest* confdefs.h
885 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
886 echo >confdefs.h
887
888 # Let the site file select an alternate cache file if it wants to.
889 # Prefer explicitly selected file to automatically selected ones.
890 if test -z "$CONFIG_SITE"; then
891   if test "x$prefix" != xNONE; then
892     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
893   else
894     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
895   fi
896 fi
897 for ac_site_file in $CONFIG_SITE; do
898   if test -r "$ac_site_file"; then
899     { echo "$as_me:899: loading site script $ac_site_file" >&5
900 echo "$as_me: loading site script $ac_site_file" >&6;}
901     cat "$ac_site_file" >&5
902     . "$ac_site_file"
903   fi
904 done
905
906 if test -r "$cache_file"; then
907   # Some versions of bash will fail to source /dev/null (special
908   # files actually), so we avoid doing that.
909   if test -f "$cache_file"; then
910     { echo "$as_me:910: loading cache $cache_file" >&5
911 echo "$as_me: loading cache $cache_file" >&6;}
912     case $cache_file in
913       [\\/]* | ?:[\\/]* ) . $cache_file;;
914       *)                      . ./$cache_file;;
915     esac
916   fi
917 else
918   { echo "$as_me:918: creating cache $cache_file" >&5
919 echo "$as_me: creating cache $cache_file" >&6;}
920   >$cache_file
921 fi
922
923 # Check that the precious variables saved in the cache have kept the same
924 # value.
925 ac_cache_corrupted=false
926 for ac_var in `(set) 2>&1 |
927                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
928   eval ac_old_set=\$ac_cv_env_${ac_var}_set
929   eval ac_new_set=\$ac_env_${ac_var}_set
930   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
931   eval ac_new_val="\$ac_env_${ac_var}_value"
932   case "$ac_old_set,$ac_new_set" in
933     set,)
934       { echo "$as_me:934: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,set)
938       { echo "$as_me:938: error: \`$ac_var' was not set in the previous run" >&5
939 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
940       ac_cache_corrupted=: ;;
941     ,);;
942     *)
943       if test "x$ac_old_val" != "x$ac_new_val"; then
944         { echo "$as_me:944: error: \`$ac_var' has changed since the previous run:" >&5
945 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
946         { echo "$as_me:946:   former value:  $ac_old_val" >&5
947 echo "$as_me:   former value:  $ac_old_val" >&2;}
948         { echo "$as_me:948:   current value: $ac_new_val" >&5
949 echo "$as_me:   current value: $ac_new_val" >&2;}
950         ac_cache_corrupted=:
951       fi;;
952   esac
953   # Pass precious variables to config.status.  It doesn't matter if
954   # we pass some twice (in addition to the command line arguments).
955   if test "$ac_new_set" = set; then
956     case "$ac_new_val" in
957     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
958       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
959       ac_configure_args="$ac_configure_args '$ac_arg'"
960       ;;
961     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
962        ;;
963     esac
964   fi
965 done
966 if "$ac_cache_corrupted"; then
967   { echo "$as_me:967: error: changes in the environment can compromise the build" >&5
968 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
969   { { echo "$as_me:969: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
970 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
971    { (exit 1); exit 1; }; }
972 fi
973
974 ac_ext=c
975 ac_cpp='$CPP $CPPFLAGS'
976 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
977 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
978 ac_compiler_gnu=$ac_cv_c_compiler_gnu
979 ac_main_return="return"
980
981 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
982   *c*,-n*) ECHO_N=
983            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
984            ECHO_T='     '
985            ;;
986   *c*,*  ) ECHO_N=-n
987            ECHO_C=
988            ECHO_T=
989            ;;
990   *)       ECHO_N=
991            ECHO_C='\c'
992            ECHO_T=
993            ;;
994 esac
995 echo "#! $SHELL" >conftest.sh
996 echo  "exit 0"   >>conftest.sh
997 chmod +x conftest.sh
998 if { (echo "$as_me:998: PATH=\".;.\"; conftest.sh") >&5
999   (PATH=".;."; conftest.sh) 2>&5
1000   ac_status=$?
1001   echo "$as_me:1001: \$? = $ac_status" >&5
1002   (exit "$ac_status"); }; then
1003   ac_path_separator=';'
1004 else
1005   ac_path_separator=:
1006 fi
1007 PATH_SEPARATOR="$ac_path_separator"
1008 rm -f conftest.sh
1009
1010 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1011
1012 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1013
1014 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1015
1016 ac_aux_dir=
1017 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1018   if test -f "$ac_dir/install-sh"; then
1019     ac_aux_dir=$ac_dir
1020     ac_install_sh="$ac_aux_dir/install-sh -c"
1021     break
1022   elif test -f "$ac_dir/install.sh"; then
1023     ac_aux_dir=$ac_dir
1024     ac_install_sh="$ac_aux_dir/install.sh -c"
1025     break
1026   elif test -f "$ac_dir/shtool"; then
1027     ac_aux_dir=$ac_dir
1028     ac_install_sh="$ac_aux_dir/shtool install -c"
1029     break
1030   fi
1031 done
1032 if test -z "$ac_aux_dir"; then
1033   { { echo "$as_me:1033: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1034 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1035    { (exit 1); exit 1; }; }
1036 fi
1037 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1038 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1039 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1040
1041 # Make sure we can run config.sub.
1042 $ac_config_sub sun4 >/dev/null 2>&1 ||
1043   { { echo "$as_me:1043: error: cannot run $ac_config_sub" >&5
1044 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1045    { (exit 1); exit 1; }; }
1046
1047 echo "$as_me:1047: checking build system type" >&5
1048 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1049 if test "${ac_cv_build+set}" = set; then
1050   echo $ECHO_N "(cached) $ECHO_C" >&6
1051 else
1052   ac_cv_build_alias=$build_alias
1053 test -z "$ac_cv_build_alias" &&
1054   ac_cv_build_alias=`$ac_config_guess`
1055 test -z "$ac_cv_build_alias" &&
1056   { { echo "$as_me:1056: error: cannot guess build type; you must specify one" >&5
1057 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1058    { (exit 1); exit 1; }; }
1059 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1060   { { echo "$as_me:1060: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1061 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1062    { (exit 1); exit 1; }; }
1063
1064 fi
1065 echo "$as_me:1065: result: $ac_cv_build" >&5
1066 echo "${ECHO_T}$ac_cv_build" >&6
1067 build=$ac_cv_build
1068 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1069 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1070 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1071
1072 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1073         echo "$as_me:1073: checking host system type" >&5
1074 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1075 if test "${ac_cv_host+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   ac_cv_host_alias=$host_alias
1079 test -z "$ac_cv_host_alias" &&
1080   ac_cv_host_alias=$ac_cv_build_alias
1081 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1082   { { echo "$as_me:1082: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1083 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1084    { (exit 1); exit 1; }; }
1085
1086 fi
1087 echo "$as_me:1087: result: $ac_cv_host" >&5
1088 echo "${ECHO_T}$ac_cv_host" >&6
1089 host=$ac_cv_host
1090 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1091 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1092 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1093
1094         system_name="$host_os"
1095 else
1096         system_name="`(uname -s -r) 2>/dev/null`"
1097         if test -z "$system_name" ; then
1098                 system_name="`(hostname) 2>/dev/null`"
1099         fi
1100 fi
1101 test -n "$system_name" &&
1102 cat >>confdefs.h <<EOF
1103 #define SYSTEM_NAME "$system_name"
1104 EOF
1105
1106 if test "${cf_cv_system_name+set}" = set; then
1107   echo $ECHO_N "(cached) $ECHO_C" >&6
1108 else
1109   cf_cv_system_name="$system_name"
1110 fi
1111
1112 test -z "$system_name" && system_name="$cf_cv_system_name"
1113 test -n "$cf_cv_system_name" && echo "$as_me:1113: result: Configuring for $cf_cv_system_name" >&5
1114 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1115
1116 if test ".$system_name" != ".$cf_cv_system_name" ; then
1117         echo "$as_me:1117: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1118 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1119         { { echo "$as_me:1119: error: \"Please remove config.cache and try again.\"" >&5
1120 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1121    { (exit 1); exit 1; }; }
1122 fi
1123
1124 test "$program_prefix" != NONE &&
1125   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1126 # Use a double $ so make ignores it.
1127 test "$program_suffix" != NONE &&
1128   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1129 # Double any \ or $.  echo might interpret backslashes.
1130 # By default was `s,x,x', remove it if useless.
1131 cat <<\_ACEOF >conftest.sed
1132 s/[\\$]/&&/g;s/;s,x,x,$//
1133 _ACEOF
1134 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1135 rm conftest.sed
1136
1137 echo "$as_me:1137: checking whether ${MAKE-make} sets \${MAKE}" >&5
1138 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1139 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1140 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1141   echo $ECHO_N "(cached) $ECHO_C" >&6
1142 else
1143   cat >conftest.make <<\EOF
1144 all:
1145         @echo 'ac_maketemp="${MAKE}"'
1146 EOF
1147 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1148 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1149 if test -n "$ac_maketemp"; then
1150   eval ac_cv_prog_make_${ac_make}_set=yes
1151 else
1152   eval ac_cv_prog_make_${ac_make}_set=no
1153 fi
1154 rm -f conftest.make
1155 fi
1156 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1157   echo "$as_me:1157: result: yes" >&5
1158 echo "${ECHO_T}yes" >&6
1159   SET_MAKE=
1160 else
1161   echo "$as_me:1161: result: no" >&5
1162 echo "${ECHO_T}no" >&6
1163   SET_MAKE="MAKE=${MAKE-make}"
1164 fi
1165
1166 ac_ext=c
1167 ac_cpp='$CPP $CPPFLAGS'
1168 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1169 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1170 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1171 ac_main_return="return"
1172 if test -n "$ac_tool_prefix"; then
1173   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1174 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1175 echo "$as_me:1175: checking for $ac_word" >&5
1176 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1177 if test "${ac_cv_prog_CC+set}" = set; then
1178   echo $ECHO_N "(cached) $ECHO_C" >&6
1179 else
1180   if test -n "$CC"; then
1181   ac_cv_prog_CC="$CC" # Let the user override the test.
1182 else
1183   ac_save_IFS=$IFS; IFS=$ac_path_separator
1184 ac_dummy="$PATH"
1185 for ac_dir in $ac_dummy; do
1186   IFS=$ac_save_IFS
1187   test -z "$ac_dir" && ac_dir=.
1188   $as_executable_p "$ac_dir/$ac_word" || continue
1189 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1190 echo "$as_me:1190: found $ac_dir/$ac_word" >&5
1191 break
1192 done
1193
1194 fi
1195 fi
1196 CC=$ac_cv_prog_CC
1197 if test -n "$CC"; then
1198   echo "$as_me:1198: result: $CC" >&5
1199 echo "${ECHO_T}$CC" >&6
1200 else
1201   echo "$as_me:1201: result: no" >&5
1202 echo "${ECHO_T}no" >&6
1203 fi
1204
1205 fi
1206 if test -z "$ac_cv_prog_CC"; then
1207   ac_ct_CC=$CC
1208   # Extract the first word of "gcc", so it can be a program name with args.
1209 set dummy gcc; ac_word=$2
1210 echo "$as_me:1210: checking for $ac_word" >&5
1211 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1212 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1213   echo $ECHO_N "(cached) $ECHO_C" >&6
1214 else
1215   if test -n "$ac_ct_CC"; then
1216   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1217 else
1218   ac_save_IFS=$IFS; IFS=$ac_path_separator
1219 ac_dummy="$PATH"
1220 for ac_dir in $ac_dummy; do
1221   IFS=$ac_save_IFS
1222   test -z "$ac_dir" && ac_dir=.
1223   $as_executable_p "$ac_dir/$ac_word" || continue
1224 ac_cv_prog_ac_ct_CC="gcc"
1225 echo "$as_me:1225: found $ac_dir/$ac_word" >&5
1226 break
1227 done
1228
1229 fi
1230 fi
1231 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1232 if test -n "$ac_ct_CC"; then
1233   echo "$as_me:1233: result: $ac_ct_CC" >&5
1234 echo "${ECHO_T}$ac_ct_CC" >&6
1235 else
1236   echo "$as_me:1236: result: no" >&5
1237 echo "${ECHO_T}no" >&6
1238 fi
1239
1240   CC=$ac_ct_CC
1241 else
1242   CC="$ac_cv_prog_CC"
1243 fi
1244
1245 if test -z "$CC"; then
1246   if test -n "$ac_tool_prefix"; then
1247   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1248 set dummy ${ac_tool_prefix}cc; ac_word=$2
1249 echo "$as_me:1249: checking for $ac_word" >&5
1250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1251 if test "${ac_cv_prog_CC+set}" = set; then
1252   echo $ECHO_N "(cached) $ECHO_C" >&6
1253 else
1254   if test -n "$CC"; then
1255   ac_cv_prog_CC="$CC" # Let the user override the test.
1256 else
1257   ac_save_IFS=$IFS; IFS=$ac_path_separator
1258 ac_dummy="$PATH"
1259 for ac_dir in $ac_dummy; do
1260   IFS=$ac_save_IFS
1261   test -z "$ac_dir" && ac_dir=.
1262   $as_executable_p "$ac_dir/$ac_word" || continue
1263 ac_cv_prog_CC="${ac_tool_prefix}cc"
1264 echo "$as_me:1264: found $ac_dir/$ac_word" >&5
1265 break
1266 done
1267
1268 fi
1269 fi
1270 CC=$ac_cv_prog_CC
1271 if test -n "$CC"; then
1272   echo "$as_me:1272: result: $CC" >&5
1273 echo "${ECHO_T}$CC" >&6
1274 else
1275   echo "$as_me:1275: result: no" >&5
1276 echo "${ECHO_T}no" >&6
1277 fi
1278
1279 fi
1280 if test -z "$ac_cv_prog_CC"; then
1281   ac_ct_CC=$CC
1282   # Extract the first word of "cc", so it can be a program name with args.
1283 set dummy cc; ac_word=$2
1284 echo "$as_me:1284: checking for $ac_word" >&5
1285 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1286 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1287   echo $ECHO_N "(cached) $ECHO_C" >&6
1288 else
1289   if test -n "$ac_ct_CC"; then
1290   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1291 else
1292   ac_save_IFS=$IFS; IFS=$ac_path_separator
1293 ac_dummy="$PATH"
1294 for ac_dir in $ac_dummy; do
1295   IFS=$ac_save_IFS
1296   test -z "$ac_dir" && ac_dir=.
1297   $as_executable_p "$ac_dir/$ac_word" || continue
1298 ac_cv_prog_ac_ct_CC="cc"
1299 echo "$as_me:1299: found $ac_dir/$ac_word" >&5
1300 break
1301 done
1302
1303 fi
1304 fi
1305 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1306 if test -n "$ac_ct_CC"; then
1307   echo "$as_me:1307: result: $ac_ct_CC" >&5
1308 echo "${ECHO_T}$ac_ct_CC" >&6
1309 else
1310   echo "$as_me:1310: result: no" >&5
1311 echo "${ECHO_T}no" >&6
1312 fi
1313
1314   CC=$ac_ct_CC
1315 else
1316   CC="$ac_cv_prog_CC"
1317 fi
1318
1319 fi
1320 if test -z "$CC"; then
1321   # Extract the first word of "cc", so it can be a program name with args.
1322 set dummy cc; ac_word=$2
1323 echo "$as_me:1323: checking for $ac_word" >&5
1324 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1325 if test "${ac_cv_prog_CC+set}" = set; then
1326   echo $ECHO_N "(cached) $ECHO_C" >&6
1327 else
1328   if test -n "$CC"; then
1329   ac_cv_prog_CC="$CC" # Let the user override the test.
1330 else
1331   ac_prog_rejected=no
1332   ac_save_IFS=$IFS; IFS=$ac_path_separator
1333 ac_dummy="$PATH"
1334 for ac_dir in $ac_dummy; do
1335   IFS=$ac_save_IFS
1336   test -z "$ac_dir" && ac_dir=.
1337   $as_executable_p "$ac_dir/$ac_word" || continue
1338 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1339   ac_prog_rejected=yes
1340   continue
1341 fi
1342 ac_cv_prog_CC="cc"
1343 echo "$as_me:1343: found $ac_dir/$ac_word" >&5
1344 break
1345 done
1346
1347 if test "$ac_prog_rejected" = yes; then
1348   # We found a bogon in the path, so make sure we never use it.
1349   set dummy $ac_cv_prog_CC
1350   shift
1351   if test $# != 0; then
1352     # We chose a different compiler from the bogus one.
1353     # However, it has the same basename, so the bogon will be chosen
1354     # first if we set CC to just the basename; use the full file name.
1355     shift
1356     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1357     shift
1358     ac_cv_prog_CC="$@"
1359   fi
1360 fi
1361 fi
1362 fi
1363 CC=$ac_cv_prog_CC
1364 if test -n "$CC"; then
1365   echo "$as_me:1365: result: $CC" >&5
1366 echo "${ECHO_T}$CC" >&6
1367 else
1368   echo "$as_me:1368: result: no" >&5
1369 echo "${ECHO_T}no" >&6
1370 fi
1371
1372 fi
1373 if test -z "$CC"; then
1374   if test -n "$ac_tool_prefix"; then
1375   for ac_prog in cl
1376   do
1377     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1378 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1379 echo "$as_me:1379: checking for $ac_word" >&5
1380 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1381 if test "${ac_cv_prog_CC+set}" = set; then
1382   echo $ECHO_N "(cached) $ECHO_C" >&6
1383 else
1384   if test -n "$CC"; then
1385   ac_cv_prog_CC="$CC" # Let the user override the test.
1386 else
1387   ac_save_IFS=$IFS; IFS=$ac_path_separator
1388 ac_dummy="$PATH"
1389 for ac_dir in $ac_dummy; do
1390   IFS=$ac_save_IFS
1391   test -z "$ac_dir" && ac_dir=.
1392   $as_executable_p "$ac_dir/$ac_word" || continue
1393 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1394 echo "$as_me:1394: found $ac_dir/$ac_word" >&5
1395 break
1396 done
1397
1398 fi
1399 fi
1400 CC=$ac_cv_prog_CC
1401 if test -n "$CC"; then
1402   echo "$as_me:1402: result: $CC" >&5
1403 echo "${ECHO_T}$CC" >&6
1404 else
1405   echo "$as_me:1405: result: no" >&5
1406 echo "${ECHO_T}no" >&6
1407 fi
1408
1409     test -n "$CC" && break
1410   done
1411 fi
1412 if test -z "$CC"; then
1413   ac_ct_CC=$CC
1414   for ac_prog in cl
1415 do
1416   # Extract the first word of "$ac_prog", so it can be a program name with args.
1417 set dummy $ac_prog; ac_word=$2
1418 echo "$as_me:1418: checking for $ac_word" >&5
1419 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1420 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1421   echo $ECHO_N "(cached) $ECHO_C" >&6
1422 else
1423   if test -n "$ac_ct_CC"; then
1424   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1425 else
1426   ac_save_IFS=$IFS; IFS=$ac_path_separator
1427 ac_dummy="$PATH"
1428 for ac_dir in $ac_dummy; do
1429   IFS=$ac_save_IFS
1430   test -z "$ac_dir" && ac_dir=.
1431   $as_executable_p "$ac_dir/$ac_word" || continue
1432 ac_cv_prog_ac_ct_CC="$ac_prog"
1433 echo "$as_me:1433: found $ac_dir/$ac_word" >&5
1434 break
1435 done
1436
1437 fi
1438 fi
1439 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1440 if test -n "$ac_ct_CC"; then
1441   echo "$as_me:1441: result: $ac_ct_CC" >&5
1442 echo "${ECHO_T}$ac_ct_CC" >&6
1443 else
1444   echo "$as_me:1444: result: no" >&5
1445 echo "${ECHO_T}no" >&6
1446 fi
1447
1448   test -n "$ac_ct_CC" && break
1449 done
1450
1451   CC=$ac_ct_CC
1452 fi
1453
1454 fi
1455
1456 test -z "$CC" && { { echo "$as_me:1456: error: no acceptable cc found in \$PATH" >&5
1457 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1458    { (exit 1); exit 1; }; }
1459
1460 # Provide some information about the compiler.
1461 echo "$as_me:1461:" \
1462      "checking for C compiler version" >&5
1463 ac_compiler=`set X $ac_compile; echo "$2"`
1464 { (eval echo "$as_me:1464: \"$ac_compiler --version </dev/null >&5\"") >&5
1465   (eval $ac_compiler --version </dev/null >&5) 2>&5
1466   ac_status=$?
1467   echo "$as_me:1467: \$? = $ac_status" >&5
1468   (exit "$ac_status"); }
1469 { (eval echo "$as_me:1469: \"$ac_compiler -v </dev/null >&5\"") >&5
1470   (eval $ac_compiler -v </dev/null >&5) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit "$ac_status"); }
1474 { (eval echo "$as_me:1474: \"$ac_compiler -V </dev/null >&5\"") >&5
1475   (eval $ac_compiler -V </dev/null >&5) 2>&5
1476   ac_status=$?
1477   echo "$as_me:1477: \$? = $ac_status" >&5
1478   (exit "$ac_status"); }
1479
1480 cat >"conftest.$ac_ext" <<_ACEOF
1481 #line 1481 "configure"
1482 #include "confdefs.h"
1483
1484 int
1485 main (void)
1486 {
1487
1488   ;
1489   return 0;
1490 }
1491 _ACEOF
1492 ac_clean_files_save=$ac_clean_files
1493 ac_clean_files="$ac_clean_files a.out a.exe"
1494 # Try to create an executable without -o first, disregard a.out.
1495 # It will help us diagnose broken compilers, and finding out an intuition
1496 # of exeext.
1497 echo "$as_me:1497: checking for C compiler default output" >&5
1498 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1499 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1500 if { (eval echo "$as_me:1500: \"$ac_link_default\"") >&5
1501   (eval $ac_link_default) 2>&5
1502   ac_status=$?
1503   echo "$as_me:1503: \$? = $ac_status" >&5
1504   (exit "$ac_status"); }; then
1505   # Find the output, starting from the most likely.  This scheme is
1506 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1507 # resort.
1508 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1509                 ls a.out conftest 2>/dev/null;
1510                 ls a.* conftest.* 2>/dev/null`; do
1511   case $ac_file in
1512     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1513     a.out ) # We found the default executable, but exeext='' is most
1514             # certainly right.
1515             break;;
1516     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1517           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1518           export ac_cv_exeext
1519           break;;
1520     * ) break;;
1521   esac
1522 done
1523 else
1524   echo "$as_me: failed program was:" >&5
1525 cat "conftest.$ac_ext" >&5
1526 { { echo "$as_me:1526: error: C compiler cannot create executables" >&5
1527 echo "$as_me: error: C compiler cannot create executables" >&2;}
1528    { (exit 77); exit 77; }; }
1529 fi
1530
1531 ac_exeext=$ac_cv_exeext
1532 echo "$as_me:1532: result: $ac_file" >&5
1533 echo "${ECHO_T}$ac_file" >&6
1534
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether the C compiler works" >&5
1538 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1539 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1540 # If not cross compiling, check that we can run a simple program.
1541 if test "$cross_compiling" != yes; then
1542   if { ac_try='./$ac_file'
1543   { (eval echo "$as_me:1543: \"$ac_try\"") >&5
1544   (eval $ac_try) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit "$ac_status"); }; }; then
1548     cross_compiling=no
1549   else
1550     if test "$cross_compiling" = maybe; then
1551         cross_compiling=yes
1552     else
1553         { { echo "$as_me:1553: error: cannot run C compiled programs.
1554 If you meant to cross compile, use \`--host'." >&5
1555 echo "$as_me: error: cannot run C compiled programs.
1556 If you meant to cross compile, use \`--host'." >&2;}
1557    { (exit 1); exit 1; }; }
1558     fi
1559   fi
1560 fi
1561 echo "$as_me:1561: result: yes" >&5
1562 echo "${ECHO_T}yes" >&6
1563
1564 rm -f a.out a.exe "conftest$ac_cv_exeext"
1565 ac_clean_files=$ac_clean_files_save
1566 # Check the compiler produces executables we can run.  If not, either
1567 # the compiler is broken, or we cross compile.
1568 echo "$as_me:1568: checking whether we are cross compiling" >&5
1569 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1570 echo "$as_me:1570: result: $cross_compiling" >&5
1571 echo "${ECHO_T}$cross_compiling" >&6
1572
1573 echo "$as_me:1573: checking for executable suffix" >&5
1574 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1575 if { (eval echo "$as_me:1575: \"$ac_link\"") >&5
1576   (eval $ac_link) 2>&5
1577   ac_status=$?
1578   echo "$as_me:1578: \$? = $ac_status" >&5
1579   (exit "$ac_status"); }; then
1580   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1581 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1582 # work properly (i.e., refer to `conftest.exe'), while it won't with
1583 # `rm'.
1584 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1585   case $ac_file in
1586     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1587     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1588           export ac_cv_exeext
1589           break;;
1590     * ) break;;
1591   esac
1592 done
1593 else
1594   { { echo "$as_me:1594: error: cannot compute EXEEXT: cannot compile and link" >&5
1595 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1596    { (exit 1); exit 1; }; }
1597 fi
1598
1599 rm -f "conftest$ac_cv_exeext"
1600 echo "$as_me:1600: result: $ac_cv_exeext" >&5
1601 echo "${ECHO_T}$ac_cv_exeext" >&6
1602
1603 rm -f "conftest.$ac_ext"
1604 EXEEXT=$ac_cv_exeext
1605 ac_exeext=$EXEEXT
1606 echo "$as_me:1606: checking for object suffix" >&5
1607 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1608 if test "${ac_cv_objext+set}" = set; then
1609   echo $ECHO_N "(cached) $ECHO_C" >&6
1610 else
1611   cat >"conftest.$ac_ext" <<_ACEOF
1612 #line 1612 "configure"
1613 #include "confdefs.h"
1614
1615 int
1616 main (void)
1617 {
1618
1619   ;
1620   return 0;
1621 }
1622 _ACEOF
1623 rm -f conftest.o conftest.obj
1624 if { (eval echo "$as_me:1624: \"$ac_compile\"") >&5
1625   (eval $ac_compile) 2>&5
1626   ac_status=$?
1627   echo "$as_me:1627: \$? = $ac_status" >&5
1628   (exit "$ac_status"); }; then
1629   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1630   case $ac_file in
1631     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1632     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1633        break;;
1634   esac
1635 done
1636 else
1637   echo "$as_me: failed program was:" >&5
1638 cat "conftest.$ac_ext" >&5
1639 { { echo "$as_me:1639: error: cannot compute OBJEXT: cannot compile" >&5
1640 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1641    { (exit 1); exit 1; }; }
1642 fi
1643
1644 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1645 fi
1646 echo "$as_me:1646: result: $ac_cv_objext" >&5
1647 echo "${ECHO_T}$ac_cv_objext" >&6
1648 OBJEXT=$ac_cv_objext
1649 ac_objext=$OBJEXT
1650 echo "$as_me:1650: checking whether we are using the GNU C compiler" >&5
1651 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1652 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1653   echo $ECHO_N "(cached) $ECHO_C" >&6
1654 else
1655   cat >"conftest.$ac_ext" <<_ACEOF
1656 #line 1656 "configure"
1657 #include "confdefs.h"
1658
1659 int
1660 main (void)
1661 {
1662 #ifndef __GNUC__
1663        choke me
1664 #endif
1665
1666   ;
1667   return 0;
1668 }
1669 _ACEOF
1670 rm -f "conftest.$ac_objext"
1671 if { (eval echo "$as_me:1671: \"$ac_compile\"") >&5
1672   (eval $ac_compile) 2>&5
1673   ac_status=$?
1674   echo "$as_me:1674: \$? = $ac_status" >&5
1675   (exit "$ac_status"); } &&
1676          { ac_try='test -s "conftest.$ac_objext"'
1677   { (eval echo "$as_me:1677: \"$ac_try\"") >&5
1678   (eval $ac_try) 2>&5
1679   ac_status=$?
1680   echo "$as_me:1680: \$? = $ac_status" >&5
1681   (exit "$ac_status"); }; }; then
1682   ac_compiler_gnu=yes
1683 else
1684   echo "$as_me: failed program was:" >&5
1685 cat "conftest.$ac_ext" >&5
1686 ac_compiler_gnu=no
1687 fi
1688 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1689 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1690
1691 fi
1692 echo "$as_me:1692: result: $ac_cv_c_compiler_gnu" >&5
1693 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1694 GCC=`test $ac_compiler_gnu = yes && echo yes`
1695 ac_test_CFLAGS=${CFLAGS+set}
1696 ac_save_CFLAGS=$CFLAGS
1697 CFLAGS="-g"
1698 echo "$as_me:1698: checking whether $CC accepts -g" >&5
1699 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1700 if test "${ac_cv_prog_cc_g+set}" = set; then
1701   echo $ECHO_N "(cached) $ECHO_C" >&6
1702 else
1703   cat >"conftest.$ac_ext" <<_ACEOF
1704 #line 1704 "configure"
1705 #include "confdefs.h"
1706
1707 int
1708 main (void)
1709 {
1710
1711   ;
1712   return 0;
1713 }
1714 _ACEOF
1715 rm -f "conftest.$ac_objext"
1716 if { (eval echo "$as_me:1716: \"$ac_compile\"") >&5
1717   (eval $ac_compile) 2>&5
1718   ac_status=$?
1719   echo "$as_me:1719: \$? = $ac_status" >&5
1720   (exit "$ac_status"); } &&
1721          { ac_try='test -s "conftest.$ac_objext"'
1722   { (eval echo "$as_me:1722: \"$ac_try\"") >&5
1723   (eval $ac_try) 2>&5
1724   ac_status=$?
1725   echo "$as_me:1725: \$? = $ac_status" >&5
1726   (exit "$ac_status"); }; }; then
1727   ac_cv_prog_cc_g=yes
1728 else
1729   echo "$as_me: failed program was:" >&5
1730 cat "conftest.$ac_ext" >&5
1731 ac_cv_prog_cc_g=no
1732 fi
1733 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1734 fi
1735 echo "$as_me:1735: result: $ac_cv_prog_cc_g" >&5
1736 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1737 if test "$ac_test_CFLAGS" = set; then
1738   CFLAGS=$ac_save_CFLAGS
1739 elif test $ac_cv_prog_cc_g = yes; then
1740   if test "$GCC" = yes; then
1741     CFLAGS="-g -O2"
1742   else
1743     CFLAGS="-g"
1744   fi
1745 else
1746   if test "$GCC" = yes; then
1747     CFLAGS="-O2"
1748   else
1749     CFLAGS=
1750   fi
1751 fi
1752 # Some people use a C++ compiler to compile C.  Since we use `exit',
1753 # in C++ we need to declare it.  In case someone uses the same compiler
1754 # for both compiling C and C++ we need to have the C++ compiler decide
1755 # the declaration of exit, since it's the most demanding environment.
1756 cat >"conftest.$ac_ext" <<_ACEOF
1757 #ifndef __cplusplus
1758   choke me
1759 #endif
1760 _ACEOF
1761 rm -f "conftest.$ac_objext"
1762 if { (eval echo "$as_me:1762: \"$ac_compile\"") >&5
1763   (eval $ac_compile) 2>&5
1764   ac_status=$?
1765   echo "$as_me:1765: \$? = $ac_status" >&5
1766   (exit "$ac_status"); } &&
1767          { ac_try='test -s "conftest.$ac_objext"'
1768   { (eval echo "$as_me:1768: \"$ac_try\"") >&5
1769   (eval $ac_try) 2>&5
1770   ac_status=$?
1771   echo "$as_me:1771: \$? = $ac_status" >&5
1772   (exit "$ac_status"); }; }; then
1773   for ac_declaration in \
1774    ''\
1775    '#include <stdlib.h>' \
1776    'extern "C" void std::exit (int) throw (); using std::exit;' \
1777    'extern "C" void std::exit (int); using std::exit;' \
1778    'extern "C" void exit (int) throw ();' \
1779    'extern "C" void exit (int);' \
1780    'void exit (int);'
1781 do
1782   cat >"conftest.$ac_ext" <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 #include <stdlib.h>
1786 $ac_declaration
1787 int
1788 main (void)
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f "conftest.$ac_objext"
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit "$ac_status"); } &&
1801          { ac_try='test -s "conftest.$ac_objext"'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit "$ac_status"); }; }; then
1807   :
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat "conftest.$ac_ext" >&5
1811 continue
1812 fi
1813 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1814   cat >"conftest.$ac_ext" <<_ACEOF
1815 #line 1815 "configure"
1816 #include "confdefs.h"
1817 $ac_declaration
1818 int
1819 main (void)
1820 {
1821 exit (42);
1822   ;
1823   return 0;
1824 }
1825 _ACEOF
1826 rm -f "conftest.$ac_objext"
1827 if { (eval echo "$as_me:1827: \"$ac_compile\"") >&5
1828   (eval $ac_compile) 2>&5
1829   ac_status=$?
1830   echo "$as_me:1830: \$? = $ac_status" >&5
1831   (exit "$ac_status"); } &&
1832          { ac_try='test -s "conftest.$ac_objext"'
1833   { (eval echo "$as_me:1833: \"$ac_try\"") >&5
1834   (eval $ac_try) 2>&5
1835   ac_status=$?
1836   echo "$as_me:1836: \$? = $ac_status" >&5
1837   (exit "$ac_status"); }; }; then
1838   break
1839 else
1840   echo "$as_me: failed program was:" >&5
1841 cat "conftest.$ac_ext" >&5
1842 fi
1843 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1844 done
1845 rm -rf conftest*
1846 if test -n "$ac_declaration"; then
1847   echo '#ifdef __cplusplus' >>confdefs.h
1848   echo "$ac_declaration"    >>confdefs.h
1849   echo '#endif'             >>confdefs.h
1850 fi
1851
1852 else
1853   echo "$as_me: failed program was:" >&5
1854 cat "conftest.$ac_ext" >&5
1855 fi
1856 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1857 ac_ext=c
1858 ac_cpp='$CPP $CPPFLAGS'
1859 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1860 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1861 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1862 ac_main_return="return"
1863
1864 GCC_VERSION=none
1865 if test "$GCC" = yes ; then
1866         echo "$as_me:1866: checking version of $CC" >&5
1867 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1868         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1869         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1870         echo "$as_me:1870: result: $GCC_VERSION" >&5
1871 echo "${ECHO_T}$GCC_VERSION" >&6
1872 fi
1873
1874 INTEL_COMPILER=no
1875
1876 if test "$GCC" = yes ; then
1877         case "$host_os" in
1878         (linux*|gnu*)
1879                 echo "$as_me:1879: checking if this is really Intel C compiler" >&5
1880 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1881                 cf_save_CFLAGS="$CFLAGS"
1882                 CFLAGS="$CFLAGS -no-gcc"
1883                 cat >"conftest.$ac_ext" <<_ACEOF
1884 #line 1884 "configure"
1885 #include "confdefs.h"
1886
1887 int
1888 main (void)
1889 {
1890
1891 #ifdef __INTEL_COMPILER
1892 #else
1893 make an error
1894 #endif
1895
1896   ;
1897   return 0;
1898 }
1899 _ACEOF
1900 rm -f "conftest.$ac_objext"
1901 if { (eval echo "$as_me:1901: \"$ac_compile\"") >&5
1902   (eval $ac_compile) 2>&5
1903   ac_status=$?
1904   echo "$as_me:1904: \$? = $ac_status" >&5
1905   (exit "$ac_status"); } &&
1906          { ac_try='test -s "conftest.$ac_objext"'
1907   { (eval echo "$as_me:1907: \"$ac_try\"") >&5
1908   (eval $ac_try) 2>&5
1909   ac_status=$?
1910   echo "$as_me:1910: \$? = $ac_status" >&5
1911   (exit "$ac_status"); }; }; then
1912   INTEL_COMPILER=yes
1913 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1914
1915 else
1916   echo "$as_me: failed program was:" >&5
1917 cat "conftest.$ac_ext" >&5
1918 fi
1919 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1920                 CFLAGS="$cf_save_CFLAGS"
1921                 echo "$as_me:1921: result: $INTEL_COMPILER" >&5
1922 echo "${ECHO_T}$INTEL_COMPILER" >&6
1923                 ;;
1924         esac
1925 fi
1926
1927 CLANG_COMPILER=no
1928
1929 if test "$GCC" = yes ; then
1930         echo "$as_me:1930: checking if this is really Clang C compiler" >&5
1931 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1932         cf_save_CFLAGS="$CFLAGS"
1933         cat >"conftest.$ac_ext" <<_ACEOF
1934 #line 1934 "configure"
1935 #include "confdefs.h"
1936
1937 int
1938 main (void)
1939 {
1940
1941 #ifdef __clang__
1942 #else
1943 make an error
1944 #endif
1945
1946   ;
1947   return 0;
1948 }
1949 _ACEOF
1950 rm -f "conftest.$ac_objext"
1951 if { (eval echo "$as_me:1951: \"$ac_compile\"") >&5
1952   (eval $ac_compile) 2>&5
1953   ac_status=$?
1954   echo "$as_me:1954: \$? = $ac_status" >&5
1955   (exit "$ac_status"); } &&
1956          { ac_try='test -s "conftest.$ac_objext"'
1957   { (eval echo "$as_me:1957: \"$ac_try\"") >&5
1958   (eval $ac_try) 2>&5
1959   ac_status=$?
1960   echo "$as_me:1960: \$? = $ac_status" >&5
1961   (exit "$ac_status"); }; }; then
1962   CLANG_COMPILER=yes
1963
1964 else
1965   echo "$as_me: failed program was:" >&5
1966 cat "conftest.$ac_ext" >&5
1967 fi
1968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1969         CFLAGS="$cf_save_CFLAGS"
1970         echo "$as_me:1970: result: $CLANG_COMPILER" >&5
1971 echo "${ECHO_T}$CLANG_COMPILER" >&6
1972 fi
1973
1974 CLANG_VERSION=none
1975
1976 if test "x$CLANG_COMPILER" = "xyes" ; then
1977         case "$CC" in
1978         (c[1-9][0-9]|*/c[1-9][0-9])
1979                 { echo "$as_me:1979: WARNING: replacing broken compiler alias $CC" >&5
1980 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1981                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1982                 CC=clang
1983                 ;;
1984         esac
1985
1986         echo "$as_me:1986: checking version of $CC" >&5
1987 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1988         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1989         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1990         echo "$as_me:1990: result: $CLANG_VERSION" >&5
1991 echo "${ECHO_T}$CLANG_VERSION" >&6
1992
1993         for cf_clang_opt in \
1994                 -Qunused-arguments \
1995                 -Wno-error=implicit-function-declaration
1996         do
1997                 echo "$as_me:1997: checking if option $cf_clang_opt works" >&5
1998 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1999                 cf_save_CFLAGS="$CFLAGS"
2000                 CFLAGS="$CFLAGS $cf_clang_opt"
2001                 cat >"conftest.$ac_ext" <<_ACEOF
2002 #line 2002 "configure"
2003 #include "confdefs.h"
2004
2005                         #include <stdio.h>
2006 int
2007 main (void)
2008 {
2009
2010                         printf("hello!\\n");
2011   ;
2012   return 0;
2013 }
2014 _ACEOF
2015 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2016 if { (eval echo "$as_me:2016: \"$ac_link\"") >&5
2017   (eval $ac_link) 2>&5
2018   ac_status=$?
2019   echo "$as_me:2019: \$? = $ac_status" >&5
2020   (exit "$ac_status"); } &&
2021          { ac_try='test -s "conftest$ac_exeext"'
2022   { (eval echo "$as_me:2022: \"$ac_try\"") >&5
2023   (eval $ac_try) 2>&5
2024   ac_status=$?
2025   echo "$as_me:2025: \$? = $ac_status" >&5
2026   (exit "$ac_status"); }; }; then
2027
2028                         cf_clang_optok=yes
2029 else
2030   echo "$as_me: failed program was:" >&5
2031 cat "conftest.$ac_ext" >&5
2032
2033                         cf_clang_optok=no
2034 fi
2035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2036                 echo "$as_me:2036: result: $cf_clang_optok" >&5
2037 echo "${ECHO_T}$cf_clang_optok" >&6
2038                 CFLAGS="$cf_save_CFLAGS"
2039                 if test "$cf_clang_optok" = yes; then
2040                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2041
2042 echo "${as_me:-configure}:2042: testing adding option $cf_clang_opt ..." 1>&5
2043
2044         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2045         CFLAGS="${CFLAGS}$cf_clang_opt"
2046
2047                 fi
2048         done
2049 fi
2050
2051 echo "$as_me:2051: checking for $CC option to accept ANSI C" >&5
2052 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2053 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2054   echo $ECHO_N "(cached) $ECHO_C" >&6
2055 else
2056   ac_cv_prog_cc_stdc=no
2057 ac_save_CC=$CC
2058 cat >"conftest.$ac_ext" <<_ACEOF
2059 #line 2059 "configure"
2060 #include "confdefs.h"
2061 #include <stdarg.h>
2062 #include <stdio.h>
2063 #include <sys/types.h>
2064 #include <sys/stat.h>
2065 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2066 struct buf { int x; };
2067 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2068 static char *e (p, i)
2069      char **p;
2070      int i;
2071 {
2072   return p[i];
2073 }
2074 static char *f (char * (*g) (char **, int), char **p, ...)
2075 {
2076   char *s;
2077   va_list v;
2078   va_start (v,p);
2079   s = g (p, va_arg (v,int));
2080   va_end (v);
2081   return s;
2082 }
2083 int test (int i, double x);
2084 struct s1 {int (*f) (int a);};
2085 struct s2 {int (*f) (double a);};
2086 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2087 int argc;
2088 char **argv;
2089 int
2090 main (void)
2091 {
2092 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2093   ;
2094   return 0;
2095 }
2096 _ACEOF
2097 # Don't try gcc -ansi; that turns off useful extensions and
2098 # breaks some systems' header files.
2099 # AIX                   -qlanglvl=ansi
2100 # Ultrix and OSF/1      -std1
2101 # HP-UX 10.20 and later -Ae
2102 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2103 # SVR4                  -Xc -D__EXTENSIONS__
2104 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2105 do
2106   CC="$ac_save_CC $ac_arg"
2107   rm -f "conftest.$ac_objext"
2108 if { (eval echo "$as_me:2108: \"$ac_compile\"") >&5
2109   (eval $ac_compile) 2>&5
2110   ac_status=$?
2111   echo "$as_me:2111: \$? = $ac_status" >&5
2112   (exit "$ac_status"); } &&
2113          { ac_try='test -s "conftest.$ac_objext"'
2114   { (eval echo "$as_me:2114: \"$ac_try\"") >&5
2115   (eval $ac_try) 2>&5
2116   ac_status=$?
2117   echo "$as_me:2117: \$? = $ac_status" >&5
2118   (exit "$ac_status"); }; }; then
2119   ac_cv_prog_cc_stdc=$ac_arg
2120 break
2121 else
2122   echo "$as_me: failed program was:" >&5
2123 cat "conftest.$ac_ext" >&5
2124 fi
2125 rm -f "conftest.$ac_objext"
2126 done
2127 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2128 CC=$ac_save_CC
2129
2130 fi
2131
2132 case "x$ac_cv_prog_cc_stdc" in
2133   x|xno)
2134     echo "$as_me:2134: result: none needed" >&5
2135 echo "${ECHO_T}none needed" >&6 ;;
2136   *)
2137     echo "$as_me:2137: result: $ac_cv_prog_cc_stdc" >&5
2138 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2139     CC="$CC $ac_cv_prog_cc_stdc" ;;
2140 esac
2141
2142 # This should have been defined by AC_PROG_CC
2143 : "${CC:=cc}"
2144
2145 echo "$as_me:2145: checking \$CFLAGS variable" >&5
2146 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2147 case "x$CFLAGS" in
2148 (*-[IUD]*)
2149         echo "$as_me:2149: result: broken" >&5
2150 echo "${ECHO_T}broken" >&6
2151         { echo "$as_me:2151: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2152 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2153         cf_flags="$CFLAGS"
2154         CFLAGS=
2155         for cf_arg in $cf_flags
2156         do
2157
2158 cf_fix_cppflags=no
2159 cf_new_cflags=
2160 cf_new_cppflags=
2161 cf_new_extra_cppflags=
2162
2163 for cf_add_cflags in $cf_arg
2164 do
2165 case "$cf_fix_cppflags" in
2166 (no)
2167         case "$cf_add_cflags" in
2168         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2169                 case "$cf_add_cflags" in
2170                 (-D*)
2171                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2172
2173                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2174                                 && test -z "${cf_tst_cflags}" \
2175                                 && cf_fix_cppflags=yes
2176
2177                         if test "$cf_fix_cppflags" = yes ; then
2178
2179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2181
2182                                 continue
2183                         elif test "${cf_tst_cflags}" = "\"'" ; then
2184
2185         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2186         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2187
2188                                 continue
2189                         fi
2190                         ;;
2191                 esac
2192                 case "$CPPFLAGS" in
2193                 (*$cf_add_cflags)
2194                         ;;
2195                 (*)
2196                         case "$cf_add_cflags" in
2197                         (-D*)
2198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2199
2200 CPPFLAGS=`echo "$CPPFLAGS" | \
2201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2203
2204                                 ;;
2205                         esac
2206
2207         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2208         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2209
2210                         ;;
2211                 esac
2212                 ;;
2213         (*)
2214
2215         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2216         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2217
2218                 ;;
2219         esac
2220         ;;
2221 (yes)
2222
2223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2225
2226         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2227
2228         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2229                 && test -z "${cf_tst_cflags}" \
2230                 && cf_fix_cppflags=no
2231         ;;
2232 esac
2233 done
2234
2235 if test -n "$cf_new_cflags" ; then
2236
2237         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2238         CFLAGS="${CFLAGS}$cf_new_cflags"
2239
2240 fi
2241
2242 if test -n "$cf_new_cppflags" ; then
2243
2244         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2245         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2246
2247 fi
2248
2249 if test -n "$cf_new_extra_cppflags" ; then
2250
2251         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2252         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2253
2254 fi
2255
2256         done
2257         ;;
2258 (*)
2259         echo "$as_me:2259: result: ok" >&5
2260 echo "${ECHO_T}ok" >&6
2261         ;;
2262 esac
2263
2264 echo "$as_me:2264: checking \$CC variable" >&5
2265 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2266 case "$CC" in
2267 (*[\ \  ]-*)
2268         echo "$as_me:2268: result: broken" >&5
2269 echo "${ECHO_T}broken" >&6
2270         { echo "$as_me:2270: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2271 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2272         # humor him...
2273         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2274         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2275         CC="$cf_prog"
2276         for cf_arg in $cf_flags
2277         do
2278                 case "x$cf_arg" in
2279                 (x-[IUDfgOW]*)
2280
2281 cf_fix_cppflags=no
2282 cf_new_cflags=
2283 cf_new_cppflags=
2284 cf_new_extra_cppflags=
2285
2286 for cf_add_cflags in $cf_arg
2287 do
2288 case "$cf_fix_cppflags" in
2289 (no)
2290         case "$cf_add_cflags" in
2291         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2292                 case "$cf_add_cflags" in
2293                 (-D*)
2294                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2295
2296                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2297                                 && test -z "${cf_tst_cflags}" \
2298                                 && cf_fix_cppflags=yes
2299
2300                         if test "$cf_fix_cppflags" = yes ; then
2301
2302         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2303         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2304
2305                                 continue
2306                         elif test "${cf_tst_cflags}" = "\"'" ; then
2307
2308         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2309         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2310
2311                                 continue
2312                         fi
2313                         ;;
2314                 esac
2315                 case "$CPPFLAGS" in
2316                 (*$cf_add_cflags)
2317                         ;;
2318                 (*)
2319                         case "$cf_add_cflags" in
2320                         (-D*)
2321                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2322
2323 CPPFLAGS=`echo "$CPPFLAGS" | \
2324         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2325                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2326
2327                                 ;;
2328                         esac
2329
2330         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2331         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2332
2333                         ;;
2334                 esac
2335                 ;;
2336         (*)
2337
2338         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2339         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2340
2341                 ;;
2342         esac
2343         ;;
2344 (yes)
2345
2346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2348
2349         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2350
2351         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2352                 && test -z "${cf_tst_cflags}" \
2353                 && cf_fix_cppflags=no
2354         ;;
2355 esac
2356 done
2357
2358 if test -n "$cf_new_cflags" ; then
2359
2360         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2361         CFLAGS="${CFLAGS}$cf_new_cflags"
2362
2363 fi
2364
2365 if test -n "$cf_new_cppflags" ; then
2366
2367         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2368         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2369
2370 fi
2371
2372 if test -n "$cf_new_extra_cppflags" ; then
2373
2374         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2375         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2376
2377 fi
2378
2379                         ;;
2380                 (*)
2381                         CC="$CC $cf_arg"
2382                         ;;
2383                 esac
2384         done
2385         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2386
2387 echo "${as_me:-configure}:2387: testing resulting CC: '$CC' ..." 1>&5
2388
2389         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2390
2391 echo "${as_me:-configure}:2391: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2392
2393         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2394
2395 echo "${as_me:-configure}:2395: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2396
2397         ;;
2398 (*)
2399         echo "$as_me:2399: result: ok" >&5
2400 echo "${ECHO_T}ok" >&6
2401         ;;
2402 esac
2403
2404 echo "$as_me:2404: checking for inline" >&5
2405 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2406 if test "${ac_cv_c_inline+set}" = set; then
2407   echo $ECHO_N "(cached) $ECHO_C" >&6
2408 else
2409   ac_cv_c_inline=no
2410 for ac_kw in inline __inline__ __inline; do
2411   cat >"conftest.$ac_ext" <<_ACEOF
2412 #line 2412 "configure"
2413 #include "confdefs.h"
2414 #ifndef __cplusplus
2415 static $ac_kw int static_foo () {return 0; }
2416 $ac_kw int foo () {return 0; }
2417 #endif
2418
2419 _ACEOF
2420 rm -f "conftest.$ac_objext"
2421 if { (eval echo "$as_me:2421: \"$ac_compile\"") >&5
2422   (eval $ac_compile) 2>&5
2423   ac_status=$?
2424   echo "$as_me:2424: \$? = $ac_status" >&5
2425   (exit "$ac_status"); } &&
2426          { ac_try='test -s "conftest.$ac_objext"'
2427   { (eval echo "$as_me:2427: \"$ac_try\"") >&5
2428   (eval $ac_try) 2>&5
2429   ac_status=$?
2430   echo "$as_me:2430: \$? = $ac_status" >&5
2431   (exit "$ac_status"); }; }; then
2432   ac_cv_c_inline=$ac_kw; break
2433 else
2434   echo "$as_me: failed program was:" >&5
2435 cat "conftest.$ac_ext" >&5
2436 fi
2437 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2438 done
2439
2440 fi
2441 echo "$as_me:2441: result: $ac_cv_c_inline" >&5
2442 echo "${ECHO_T}$ac_cv_c_inline" >&6
2443 case $ac_cv_c_inline in
2444   inline | yes) ;;
2445   no)
2446 cat >>confdefs.h <<\EOF
2447 #define inline
2448 EOF
2449  ;;
2450   *)  cat >>confdefs.h <<EOF
2451 #define inline $ac_cv_c_inline
2452 EOF
2453  ;;
2454 esac
2455
2456 for ac_prog in ggrep grep
2457 do
2458   # Extract the first word of "$ac_prog", so it can be a program name with args.
2459 set dummy $ac_prog; ac_word=$2
2460 echo "$as_me:2460: checking for $ac_word" >&5
2461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2462 if test "${ac_cv_prog_GREP+set}" = set; then
2463   echo $ECHO_N "(cached) $ECHO_C" >&6
2464 else
2465   if test -n "$GREP"; then
2466   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2467 else
2468   ac_save_IFS=$IFS; IFS=$ac_path_separator
2469 ac_dummy="$PATH"
2470 for ac_dir in $ac_dummy; do
2471   IFS=$ac_save_IFS
2472   test -z "$ac_dir" && ac_dir=.
2473   $as_executable_p "$ac_dir/$ac_word" || continue
2474 ac_cv_prog_GREP="$ac_prog"
2475 echo "$as_me:2475: found $ac_dir/$ac_word" >&5
2476 break
2477 done
2478
2479 fi
2480 fi
2481 GREP=$ac_cv_prog_GREP
2482 if test -n "$GREP"; then
2483   echo "$as_me:2483: result: $GREP" >&5
2484 echo "${ECHO_T}$GREP" >&6
2485 else
2486   echo "$as_me:2486: result: no" >&5
2487 echo "${ECHO_T}no" >&6
2488 fi
2489
2490   test -n "$GREP" && break
2491 done
2492 test -n "$GREP" || GREP=": "
2493
2494 echo "$as_me:2494: checking for egrep" >&5
2495 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2496 if test "${ac_cv_path_EGREP+set}" = set; then
2497   echo $ECHO_N "(cached) $ECHO_C" >&6
2498 else
2499   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2500    then ac_cv_path_EGREP="$GREP -E"
2501    else
2502      for ac_prog in gegrep egrep
2503 do
2504   # Extract the first word of "$ac_prog", so it can be a program name with args.
2505 set dummy $ac_prog; ac_word=$2
2506 echo "$as_me:2506: checking for $ac_word" >&5
2507 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2508 if test "${ac_cv_path_EGREP+set}" = set; then
2509   echo $ECHO_N "(cached) $ECHO_C" >&6
2510 else
2511   case $EGREP in
2512   [\\/]* | ?:[\\/]*)
2513   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2514   ;;
2515   *)
2516   ac_save_IFS=$IFS; IFS=$ac_path_separator
2517 ac_dummy="$PATH"
2518 for ac_dir in $ac_dummy; do
2519   IFS=$ac_save_IFS
2520   test -z "$ac_dir" && ac_dir=.
2521   if $as_executable_p "$ac_dir/$ac_word"; then
2522    ac_cv_path_EGREP="$ac_dir/$ac_word"
2523    echo "$as_me:2523: found $ac_dir/$ac_word" >&5
2524    break
2525 fi
2526 done
2527
2528   ;;
2529 esac
2530 fi
2531 EGREP=$ac_cv_path_EGREP
2532
2533 if test -n "$EGREP"; then
2534   echo "$as_me:2534: result: $EGREP" >&5
2535 echo "${ECHO_T}$EGREP" >&6
2536 else
2537   echo "$as_me:2537: result: no" >&5
2538 echo "${ECHO_T}no" >&6
2539 fi
2540
2541   test -n "$EGREP" && break
2542 done
2543 test -n "$EGREP" || EGREP=": "
2544
2545      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2545: error: cannot find workable egrep" >&5
2546 echo "$as_me: error: cannot find workable egrep" >&2;}
2547    { (exit 1); exit 1; }; }
2548    fi
2549 fi
2550 echo "$as_me:2550: result: $ac_cv_path_EGREP" >&5
2551 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2552  EGREP="$ac_cv_path_EGREP"
2553
2554 ac_ext=c
2555 ac_cpp='$CPP $CPPFLAGS'
2556 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2557 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2558 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2559 ac_main_return="return"
2560 echo "$as_me:2560: checking how to run the C preprocessor" >&5
2561 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2562 # On Suns, sometimes $CPP names a directory.
2563 if test -n "$CPP" && test -d "$CPP"; then
2564   CPP=
2565 fi
2566 if test -z "$CPP"; then
2567   if test "${ac_cv_prog_CPP+set}" = set; then
2568   echo $ECHO_N "(cached) $ECHO_C" >&6
2569 else
2570       # Double quotes because CPP needs to be expanded
2571     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2572     do
2573       ac_preproc_ok=false
2574 for ac_c_preproc_warn_flag in '' yes
2575 do
2576   # Use a header file that comes with gcc, so configuring glibc
2577   # with a fresh cross-compiler works.
2578   # On the NeXT, cc -E runs the code through the compiler's parser,
2579   # not just through cpp. "Syntax error" is here to catch this case.
2580   cat >"conftest.$ac_ext" <<_ACEOF
2581 #line 2581 "configure"
2582 #include "confdefs.h"
2583 #include <assert.h>
2584                      Syntax error
2585 _ACEOF
2586 if { (eval echo "$as_me:2586: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2587   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2588   ac_status=$?
2589   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2590   rm -f conftest.er1
2591   cat conftest.err >&5
2592   echo "$as_me:2592: \$? = $ac_status" >&5
2593   (exit "$ac_status"); } >/dev/null; then
2594   if test -s conftest.err; then
2595     ac_cpp_err=$ac_c_preproc_warn_flag
2596   else
2597     ac_cpp_err=
2598   fi
2599 else
2600   ac_cpp_err=yes
2601 fi
2602 if test -z "$ac_cpp_err"; then
2603   :
2604 else
2605   echo "$as_me: failed program was:" >&5
2606   cat "conftest.$ac_ext" >&5
2607   # Broken: fails on valid input.
2608 continue
2609 fi
2610 rm -f conftest.err "conftest.$ac_ext"
2611
2612   # OK, works on sane cases.  Now check whether non-existent headers
2613   # can be detected and how.
2614   cat >"conftest.$ac_ext" <<_ACEOF
2615 #line 2615 "configure"
2616 #include "confdefs.h"
2617 #include <ac_nonexistent.h>
2618 _ACEOF
2619 if { (eval echo "$as_me:2619: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2620   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2621   ac_status=$?
2622   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2623   rm -f conftest.er1
2624   cat conftest.err >&5
2625   echo "$as_me:2625: \$? = $ac_status" >&5
2626   (exit "$ac_status"); } >/dev/null; then
2627   if test -s conftest.err; then
2628     ac_cpp_err=$ac_c_preproc_warn_flag
2629   else
2630     ac_cpp_err=
2631   fi
2632 else
2633   ac_cpp_err=yes
2634 fi
2635 if test -z "$ac_cpp_err"; then
2636   # Broken: success on invalid input.
2637 continue
2638 else
2639   echo "$as_me: failed program was:" >&5
2640   cat "conftest.$ac_ext" >&5
2641   # Passes both tests.
2642 ac_preproc_ok=:
2643 break
2644 fi
2645 rm -f conftest.err "conftest.$ac_ext"
2646
2647 done
2648 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2649 rm -f conftest.err "conftest.$ac_ext"
2650 if $ac_preproc_ok; then
2651   break
2652 fi
2653
2654     done
2655     ac_cv_prog_CPP=$CPP
2656
2657 fi
2658   CPP=$ac_cv_prog_CPP
2659 else
2660   ac_cv_prog_CPP=$CPP
2661 fi
2662 echo "$as_me:2662: result: $CPP" >&5
2663 echo "${ECHO_T}$CPP" >&6
2664 ac_preproc_ok=false
2665 for ac_c_preproc_warn_flag in '' yes
2666 do
2667   # Use a header file that comes with gcc, so configuring glibc
2668   # with a fresh cross-compiler works.
2669   # On the NeXT, cc -E runs the code through the compiler's parser,
2670   # not just through cpp. "Syntax error" is here to catch this case.
2671   cat >"conftest.$ac_ext" <<_ACEOF
2672 #line 2672 "configure"
2673 #include "confdefs.h"
2674 #include <assert.h>
2675                      Syntax error
2676 _ACEOF
2677 if { (eval echo "$as_me:2677: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2678   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2679   ac_status=$?
2680   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2681   rm -f conftest.er1
2682   cat conftest.err >&5
2683   echo "$as_me:2683: \$? = $ac_status" >&5
2684   (exit "$ac_status"); } >/dev/null; then
2685   if test -s conftest.err; then
2686     ac_cpp_err=$ac_c_preproc_warn_flag
2687   else
2688     ac_cpp_err=
2689   fi
2690 else
2691   ac_cpp_err=yes
2692 fi
2693 if test -z "$ac_cpp_err"; then
2694   :
2695 else
2696   echo "$as_me: failed program was:" >&5
2697   cat "conftest.$ac_ext" >&5
2698   # Broken: fails on valid input.
2699 continue
2700 fi
2701 rm -f conftest.err "conftest.$ac_ext"
2702
2703   # OK, works on sane cases.  Now check whether non-existent headers
2704   # can be detected and how.
2705   cat >"conftest.$ac_ext" <<_ACEOF
2706 #line 2706 "configure"
2707 #include "confdefs.h"
2708 #include <ac_nonexistent.h>
2709 _ACEOF
2710 if { (eval echo "$as_me:2710: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2711   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2712   ac_status=$?
2713   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2714   rm -f conftest.er1
2715   cat conftest.err >&5
2716   echo "$as_me:2716: \$? = $ac_status" >&5
2717   (exit "$ac_status"); } >/dev/null; then
2718   if test -s conftest.err; then
2719     ac_cpp_err=$ac_c_preproc_warn_flag
2720   else
2721     ac_cpp_err=
2722   fi
2723 else
2724   ac_cpp_err=yes
2725 fi
2726 if test -z "$ac_cpp_err"; then
2727   # Broken: success on invalid input.
2728 continue
2729 else
2730   echo "$as_me: failed program was:" >&5
2731   cat "conftest.$ac_ext" >&5
2732   # Passes both tests.
2733 ac_preproc_ok=:
2734 break
2735 fi
2736 rm -f conftest.err "conftest.$ac_ext"
2737
2738 done
2739 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2740 rm -f conftest.err "conftest.$ac_ext"
2741 if $ac_preproc_ok; then
2742   :
2743 else
2744   { { echo "$as_me:2744: error: C preprocessor \"$CPP\" fails sanity check" >&5
2745 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2746    { (exit 1); exit 1; }; }
2747 fi
2748
2749 ac_ext=c
2750 ac_cpp='$CPP $CPPFLAGS'
2751 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2752 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2753 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2754 ac_main_return="return"
2755
2756 for ac_prog in mawk gawk nawk awk
2757 do
2758   # Extract the first word of "$ac_prog", so it can be a program name with args.
2759 set dummy $ac_prog; ac_word=$2
2760 echo "$as_me:2760: checking for $ac_word" >&5
2761 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2762 if test "${ac_cv_prog_AWK+set}" = set; then
2763   echo $ECHO_N "(cached) $ECHO_C" >&6
2764 else
2765   if test -n "$AWK"; then
2766   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2767 else
2768   ac_save_IFS=$IFS; IFS=$ac_path_separator
2769 ac_dummy="$PATH"
2770 for ac_dir in $ac_dummy; do
2771   IFS=$ac_save_IFS
2772   test -z "$ac_dir" && ac_dir=.
2773   $as_executable_p "$ac_dir/$ac_word" || continue
2774 ac_cv_prog_AWK="$ac_prog"
2775 echo "$as_me:2775: found $ac_dir/$ac_word" >&5
2776 break
2777 done
2778
2779 fi
2780 fi
2781 AWK=$ac_cv_prog_AWK
2782 if test -n "$AWK"; then
2783   echo "$as_me:2783: result: $AWK" >&5
2784 echo "${ECHO_T}$AWK" >&6
2785 else
2786   echo "$as_me:2786: result: no" >&5
2787 echo "${ECHO_T}no" >&6
2788 fi
2789
2790   test -n "$AWK" && break
2791 done
2792
2793 # Find a good install program.  We prefer a C program (faster),
2794 # so one script is as good as another.  But avoid the broken or
2795 # incompatible versions:
2796 # SysV /etc/install, /usr/sbin/install
2797 # SunOS /usr/etc/install
2798 # IRIX /sbin/install
2799 # AIX /bin/install
2800 # AmigaOS /C/install, which installs bootblocks on floppy discs
2801 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2802 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2803 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2804 # ./install, which can be erroneously created by make from ./install.sh.
2805 echo "$as_me:2805: checking for a BSD compatible install" >&5
2806 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2807 if test -z "$INSTALL"; then
2808 if test "${ac_cv_path_install+set}" = set; then
2809   echo $ECHO_N "(cached) $ECHO_C" >&6
2810 else
2811     ac_save_IFS=$IFS; IFS=$ac_path_separator
2812   for ac_dir in $PATH; do
2813     IFS=$ac_save_IFS
2814     # Account for people who put trailing slashes in PATH elements.
2815     case $ac_dir/ in
2816     / | ./ | .// | /cC/* \
2817     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2818     | /usr/ucb/* ) ;;
2819     *)
2820       # OSF1 and SCO ODT 3.0 have their own names for install.
2821       # Don't use installbsd from OSF since it installs stuff as root
2822       # by default.
2823       for ac_prog in ginstall scoinst install; do
2824         if $as_executable_p "$ac_dir/$ac_prog"; then
2825           if test $ac_prog = install &&
2826             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2827             # AIX install.  It has an incompatible calling convention.
2828             :
2829           elif test $ac_prog = install &&
2830             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2831             # program-specific install script used by HP pwplus--don't use.
2832             :
2833           else
2834             ac_cv_path_install="$ac_dir/$ac_prog -c"
2835             break 2
2836           fi
2837         fi
2838       done
2839       ;;
2840     esac
2841   done
2842
2843 fi
2844   if test "${ac_cv_path_install+set}" = set; then
2845     INSTALL=$ac_cv_path_install
2846   else
2847     # As a last resort, use the slow shell script.  We don't cache a
2848     # path for INSTALL within a source directory, because that will
2849     # break other packages using the cache if that directory is
2850     # removed, or if the path is relative.
2851     INSTALL=$ac_install_sh
2852   fi
2853 fi
2854 echo "$as_me:2854: result: $INSTALL" >&5
2855 echo "${ECHO_T}$INSTALL" >&6
2856
2857 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2858 # It thinks the first close brace ends the variable substitution.
2859 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2860
2861 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2862
2863 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2864
2865 case $INSTALL in
2866 (/*)
2867         ;;
2868 (*)
2869         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2870         test -z "$cf_dir" && cf_dir=.
2871         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2872         ;;
2873 esac
2874
2875 echo "$as_me:2875: checking if you want to install stripped executables" >&5
2876 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2877
2878 # Check whether --enable-stripping or --disable-stripping was given.
2879 if test "${enable_stripping+set}" = set; then
2880   enableval="$enable_stripping"
2881   test "$enableval" != no && enableval=yes
2882         if test "$enableval" != "yes" ; then
2883     enable_stripping=no
2884         else
2885                 enable_stripping=yes
2886         fi
2887 else
2888   enableval=yes
2889         enable_stripping=yes
2890
2891 fi;
2892 echo "$as_me:2892: result: $enable_stripping" >&5
2893 echo "${ECHO_T}$enable_stripping" >&6
2894
2895 if test "$enable_stripping" = yes
2896 then
2897         INSTALL_OPT_S="-s"
2898 else
2899         INSTALL_OPT_S=
2900 fi
2901
2902 : "${INSTALL:=install}"
2903 echo "$as_me:2903: checking if install accepts -p option" >&5
2904 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2905 if test "${cf_cv_install_p+set}" = set; then
2906   echo $ECHO_N "(cached) $ECHO_C" >&6
2907 else
2908
2909         rm -rf ./conftest*
2910         date >conftest.in
2911         mkdir conftest.out
2912         sleep 3
2913         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2914         then
2915                 if test -f conftest.out/conftest.in
2916                 then
2917                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2918                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2919                         if test -s conftest.err
2920                         then
2921                                 cf_cv_install_p=no
2922                         else
2923                                 cf_cv_install_p=yes
2924                         fi
2925                 else
2926                         cf_cv_install_p=no
2927                 fi
2928         else
2929                 cf_cv_install_p=no
2930         fi
2931         rm -rf ./conftest*
2932
2933 fi
2934 echo "$as_me:2934: result: $cf_cv_install_p" >&5
2935 echo "${ECHO_T}$cf_cv_install_p" >&6
2936
2937 echo "$as_me:2937: checking if install needs to be told about ownership" >&5
2938 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2939 case `$ac_config_guess` in
2940 (*minix)
2941         with_install_o=yes
2942         ;;
2943 (*)
2944         with_install_o=no
2945         ;;
2946 esac
2947
2948 echo "$as_me:2948: result: $with_install_o" >&5
2949 echo "${ECHO_T}$with_install_o" >&6
2950 if test "x$with_install_o" = xyes
2951 then
2952         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
2953 else
2954         INSTALL_OPT_O=
2955 fi
2956
2957 for ac_prog in lint cppcheck splint
2958 do
2959   # Extract the first word of "$ac_prog", so it can be a program name with args.
2960 set dummy $ac_prog; ac_word=$2
2961 echo "$as_me:2961: checking for $ac_word" >&5
2962 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2963 if test "${ac_cv_prog_LINT+set}" = set; then
2964   echo $ECHO_N "(cached) $ECHO_C" >&6
2965 else
2966   if test -n "$LINT"; then
2967   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2968 else
2969   ac_save_IFS=$IFS; IFS=$ac_path_separator
2970 ac_dummy="$PATH"
2971 for ac_dir in $ac_dummy; do
2972   IFS=$ac_save_IFS
2973   test -z "$ac_dir" && ac_dir=.
2974   $as_executable_p "$ac_dir/$ac_word" || continue
2975 ac_cv_prog_LINT="$ac_prog"
2976 echo "$as_me:2976: found $ac_dir/$ac_word" >&5
2977 break
2978 done
2979
2980 fi
2981 fi
2982 LINT=$ac_cv_prog_LINT
2983 if test -n "$LINT"; then
2984   echo "$as_me:2984: result: $LINT" >&5
2985 echo "${ECHO_T}$LINT" >&6
2986 else
2987   echo "$as_me:2987: result: no" >&5
2988 echo "${ECHO_T}no" >&6
2989 fi
2990
2991   test -n "$LINT" && break
2992 done
2993
2994 case "x$LINT" in
2995 (xcppcheck|x*/cppcheck)
2996         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2997         ;;
2998 esac
2999
3000 echo "$as_me:3000: checking for \".PHONY\" make-support" >&5
3001 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3002 if test "${cf_cv_make_PHONY+set}" = set; then
3003   echo $ECHO_N "(cached) $ECHO_C" >&6
3004 else
3005
3006         rm -rf conftest*
3007         (
3008                 mkdir conftest || exit 1
3009                 cd conftest
3010                 cat >makefile <<'CF_EOF'
3011 .PHONY: always
3012 DATA=0
3013 always: always.out
3014         @echo "** making $@ $(DATA)"
3015 once: once.out
3016         @echo "** making $@ $(DATA)"
3017 always.out:
3018         @echo "** making $@ $(DATA)"
3019         echo $(DATA) > $@
3020 once.out:
3021         @echo "** making $@ $(DATA)"
3022         echo $(DATA) > $@
3023 CF_EOF
3024                 for cf_data in 1 2 3
3025                 do
3026                         ${MAKE:-make} always DATA=$cf_data
3027                         ${MAKE:-make} once   DATA=$cf_data
3028                         ${MAKE:-make} -t always once
3029                         if test -f always ; then
3030                                 echo "no (case 1)" > ../conftest.tmp
3031                         elif test ! -f always.out ; then
3032                                 echo "no (case 2)" > ../conftest.tmp
3033                         elif test ! -f once.out ; then
3034                                 echo "no (case 3)" > ../conftest.tmp
3035                         elif ! cmp -s always.out once.out ; then
3036                                 echo "no (case 4)" > ../conftest.tmp
3037                                 diff always.out once.out
3038                         else
3039                                 cf_check="`cat always.out`"
3040                                 if test "x$cf_check" != "x$cf_data" ; then
3041                                         echo "no (case 5)" > ../conftest.tmp
3042                                 else
3043                                         echo yes > ../conftest.tmp
3044                                         rm -f ./*.out
3045                                         continue
3046                                 fi
3047                         fi
3048                         break
3049                 done
3050         ) >&5 2>&1
3051         cf_cv_make_PHONY="`cat conftest.tmp`"
3052         rm -rf conftest*
3053
3054 fi
3055 echo "$as_me:3055: result: $cf_cv_make_PHONY" >&5
3056 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3057 MAKE_NO_PHONY="#"
3058 MAKE_PHONY="#"
3059 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3060 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3061
3062 echo "$as_me:3062: checking if filesystem supports mixed-case filenames" >&5
3063 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3064 if test "${cf_cv_mixedcase+set}" = set; then
3065   echo $ECHO_N "(cached) $ECHO_C" >&6
3066 else
3067
3068 if test "$cross_compiling" = yes ; then
3069         case "$target_alias" in
3070         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3071                 cf_cv_mixedcase=no
3072                 ;;
3073         (*)
3074                 cf_cv_mixedcase=yes
3075                 ;;
3076         esac
3077 else
3078         rm -f conftest CONFTEST
3079         echo test >conftest
3080         if test -f CONFTEST ; then
3081                 cf_cv_mixedcase=no
3082         else
3083                 cf_cv_mixedcase=yes
3084         fi
3085         rm -f conftest CONFTEST
3086 fi
3087
3088 fi
3089 echo "$as_me:3089: result: $cf_cv_mixedcase" >&5
3090 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3091 test "$cf_cv_mixedcase" = yes &&
3092 cat >>confdefs.h <<\EOF
3093 #define MIXEDCASE_FILENAMES 1
3094 EOF
3095
3096 for ac_prog in exctags ctags
3097 do
3098   # Extract the first word of "$ac_prog", so it can be a program name with args.
3099 set dummy $ac_prog; ac_word=$2
3100 echo "$as_me:3100: checking for $ac_word" >&5
3101 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3102 if test "${ac_cv_prog_CTAGS+set}" = set; then
3103   echo $ECHO_N "(cached) $ECHO_C" >&6
3104 else
3105   if test -n "$CTAGS"; then
3106   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3107 else
3108   ac_save_IFS=$IFS; IFS=$ac_path_separator
3109 ac_dummy="$PATH"
3110 for ac_dir in $ac_dummy; do
3111   IFS=$ac_save_IFS
3112   test -z "$ac_dir" && ac_dir=.
3113   $as_executable_p "$ac_dir/$ac_word" || continue
3114 ac_cv_prog_CTAGS="$ac_prog"
3115 echo "$as_me:3115: found $ac_dir/$ac_word" >&5
3116 break
3117 done
3118
3119 fi
3120 fi
3121 CTAGS=$ac_cv_prog_CTAGS
3122 if test -n "$CTAGS"; then
3123   echo "$as_me:3123: result: $CTAGS" >&5
3124 echo "${ECHO_T}$CTAGS" >&6
3125 else
3126   echo "$as_me:3126: result: no" >&5
3127 echo "${ECHO_T}no" >&6
3128 fi
3129
3130   test -n "$CTAGS" && break
3131 done
3132
3133 for ac_prog in exetags etags
3134 do
3135   # Extract the first word of "$ac_prog", so it can be a program name with args.
3136 set dummy $ac_prog; ac_word=$2
3137 echo "$as_me:3137: checking for $ac_word" >&5
3138 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3139 if test "${ac_cv_prog_ETAGS+set}" = set; then
3140   echo $ECHO_N "(cached) $ECHO_C" >&6
3141 else
3142   if test -n "$ETAGS"; then
3143   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3144 else
3145   ac_save_IFS=$IFS; IFS=$ac_path_separator
3146 ac_dummy="$PATH"
3147 for ac_dir in $ac_dummy; do
3148   IFS=$ac_save_IFS
3149   test -z "$ac_dir" && ac_dir=.
3150   $as_executable_p "$ac_dir/$ac_word" || continue
3151 ac_cv_prog_ETAGS="$ac_prog"
3152 echo "$as_me:3152: found $ac_dir/$ac_word" >&5
3153 break
3154 done
3155
3156 fi
3157 fi
3158 ETAGS=$ac_cv_prog_ETAGS
3159 if test -n "$ETAGS"; then
3160   echo "$as_me:3160: result: $ETAGS" >&5
3161 echo "${ECHO_T}$ETAGS" >&6
3162 else
3163   echo "$as_me:3163: result: no" >&5
3164 echo "${ECHO_T}no" >&6
3165 fi
3166
3167   test -n "$ETAGS" && break
3168 done
3169
3170 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3171 set dummy ${CTAGS:-ctags}; ac_word=$2
3172 echo "$as_me:3172: checking for $ac_word" >&5
3173 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3174 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3175   echo $ECHO_N "(cached) $ECHO_C" >&6
3176 else
3177   if test -n "$MAKE_LOWER_TAGS"; then
3178   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3179 else
3180   ac_save_IFS=$IFS; IFS=$ac_path_separator
3181 ac_dummy="$PATH"
3182 for ac_dir in $ac_dummy; do
3183   IFS=$ac_save_IFS
3184   test -z "$ac_dir" && ac_dir=.
3185   $as_executable_p "$ac_dir/$ac_word" || continue
3186 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3187 echo "$as_me:3187: found $ac_dir/$ac_word" >&5
3188 break
3189 done
3190
3191   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3192 fi
3193 fi
3194 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3195 if test -n "$MAKE_LOWER_TAGS"; then
3196   echo "$as_me:3196: result: $MAKE_LOWER_TAGS" >&5
3197 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3198 else
3199   echo "$as_me:3199: result: no" >&5
3200 echo "${ECHO_T}no" >&6
3201 fi
3202
3203 if test "$cf_cv_mixedcase" = yes ; then
3204         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3205 set dummy ${ETAGS:-etags}; ac_word=$2
3206 echo "$as_me:3206: checking for $ac_word" >&5
3207 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3208 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3209   echo $ECHO_N "(cached) $ECHO_C" >&6
3210 else
3211   if test -n "$MAKE_UPPER_TAGS"; then
3212   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3213 else
3214   ac_save_IFS=$IFS; IFS=$ac_path_separator
3215 ac_dummy="$PATH"
3216 for ac_dir in $ac_dummy; do
3217   IFS=$ac_save_IFS
3218   test -z "$ac_dir" && ac_dir=.
3219   $as_executable_p "$ac_dir/$ac_word" || continue
3220 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3221 echo "$as_me:3221: found $ac_dir/$ac_word" >&5
3222 break
3223 done
3224
3225   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3226 fi
3227 fi
3228 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3229 if test -n "$MAKE_UPPER_TAGS"; then
3230   echo "$as_me:3230: result: $MAKE_UPPER_TAGS" >&5
3231 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3232 else
3233   echo "$as_me:3233: result: no" >&5
3234 echo "${ECHO_T}no" >&6
3235 fi
3236
3237 else
3238         MAKE_UPPER_TAGS=no
3239 fi
3240
3241 if test "$MAKE_UPPER_TAGS" = yes ; then
3242         MAKE_UPPER_TAGS=
3243 else
3244         MAKE_UPPER_TAGS="#"
3245 fi
3246
3247 if test "$MAKE_LOWER_TAGS" = yes ; then
3248         MAKE_LOWER_TAGS=
3249 else
3250         MAKE_LOWER_TAGS="#"
3251 fi
3252
3253 echo "$as_me:3253: checking if -lm needed for math functions" >&5
3254 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3255 if test "${cf_cv_need_libm+set}" = set; then
3256   echo $ECHO_N "(cached) $ECHO_C" >&6
3257 else
3258
3259         cat >"conftest.$ac_ext" <<_ACEOF
3260 #line 3260 "configure"
3261 #include "confdefs.h"
3262
3263         #include <stdio.h>
3264         #include <stdlib.h>
3265         #include <math.h>
3266
3267 int
3268 main (void)
3269 {
3270 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3271   ;
3272   return 0;
3273 }
3274 _ACEOF
3275 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3276 if { (eval echo "$as_me:3276: \"$ac_link\"") >&5
3277   (eval $ac_link) 2>&5
3278   ac_status=$?
3279   echo "$as_me:3279: \$? = $ac_status" >&5
3280   (exit "$ac_status"); } &&
3281          { ac_try='test -s "conftest$ac_exeext"'
3282   { (eval echo "$as_me:3282: \"$ac_try\"") >&5
3283   (eval $ac_try) 2>&5
3284   ac_status=$?
3285   echo "$as_me:3285: \$? = $ac_status" >&5
3286   (exit "$ac_status"); }; }; then
3287   cf_cv_need_libm=no
3288 else
3289   echo "$as_me: failed program was:" >&5
3290 cat "conftest.$ac_ext" >&5
3291 cf_cv_need_libm=yes
3292 fi
3293 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3294 fi
3295 echo "$as_me:3295: result: $cf_cv_need_libm" >&5
3296 echo "${ECHO_T}$cf_cv_need_libm" >&6
3297 if test "$cf_cv_need_libm" = yes
3298 then
3299 MATH_LIB=-lm
3300 fi
3301
3302 top_builddir=`pwd`
3303
3304 CC_G_OPT="-g"
3305 CC_SHARED_OPTS=unknown
3306 CPPFLAGS="$CPPFLAGS"
3307 DFT_DEP_SUFFIX=""
3308 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3309 DFT_UPR_MODEL="NORMAL"
3310 LD="ld"
3311 LDFLAGS_SHARED=""
3312 LDFLAGS_STATIC=""
3313 LD_MODEL=""
3314 LD_SHARED_OPTS=""
3315 LIBTOOL=""
3316 LIBTOOL_OPTS=""
3317 LIB_CLEAN=""
3318 LIB_COMPILE=""
3319 LIB_LINK='${CC}'
3320 LINK_TESTS=""
3321 LOCAL_LDFLAGS=""
3322 PACKAGE="ncurses-examples"
3323 PTHREAD="-lm"
3324 TEST_ARGS=""
3325 TEST_DEPS=""
3326 TEST_LIBS=""
3327 TINFO_LDFLAGS=''
3328 TINFO_LIBS='$(LIBS_CURSES)'
3329 cf_cv_abi_version=""
3330 cf_cv_rel_version=""
3331 includesubdir=""
3332
3333 cf_cv_screen=curses
3334 cf_cv_libtype=
3335
3336 echo "$as_me:3336: checking for fgrep" >&5
3337 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3338 if test "${ac_cv_path_FGREP+set}" = set; then
3339   echo $ECHO_N "(cached) $ECHO_C" >&6
3340 else
3341   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3342    then ac_cv_path_FGREP="$GREP -F"
3343    else
3344      for ac_prog in gfgrep fgrep
3345 do
3346   # Extract the first word of "$ac_prog", so it can be a program name with args.
3347 set dummy $ac_prog; ac_word=$2
3348 echo "$as_me:3348: checking for $ac_word" >&5
3349 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3350 if test "${ac_cv_path_FGREP+set}" = set; then
3351   echo $ECHO_N "(cached) $ECHO_C" >&6
3352 else
3353   case $FGREP in
3354   [\\/]* | ?:[\\/]*)
3355   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3356   ;;
3357   *)
3358   ac_save_IFS=$IFS; IFS=$ac_path_separator
3359 ac_dummy="$PATH"
3360 for ac_dir in $ac_dummy; do
3361   IFS=$ac_save_IFS
3362   test -z "$ac_dir" && ac_dir=.
3363   if $as_executable_p "$ac_dir/$ac_word"; then
3364    ac_cv_path_FGREP="$ac_dir/$ac_word"
3365    echo "$as_me:3365: found $ac_dir/$ac_word" >&5
3366    break
3367 fi
3368 done
3369
3370   ;;
3371 esac
3372 fi
3373 FGREP=$ac_cv_path_FGREP
3374
3375 if test -n "$FGREP"; then
3376   echo "$as_me:3376: result: $FGREP" >&5
3377 echo "${ECHO_T}$FGREP" >&6
3378 else
3379   echo "$as_me:3379: result: no" >&5
3380 echo "${ECHO_T}no" >&6
3381 fi
3382
3383   test -n "$FGREP" && break
3384 done
3385 test -n "$FGREP" || FGREP=": "
3386
3387      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3387: error: cannot find workable fgrep" >&5
3388 echo "$as_me: error: cannot find workable fgrep" >&2;}
3389    { (exit 1); exit 1; }; }
3390    fi
3391 fi
3392 echo "$as_me:3392: result: $ac_cv_path_FGREP" >&5
3393 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3394  FGREP="$ac_cv_path_FGREP"
3395
3396 echo "$as_me:3396: checking if you want to use C11 _Noreturn feature" >&5
3397 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3398
3399 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3400 if test "${enable_stdnoreturn+set}" = set; then
3401   enableval="$enable_stdnoreturn"
3402   test "$enableval" != yes && enableval=no
3403         if test "$enableval" != "no" ; then
3404     enable_stdnoreturn=yes
3405         else
3406                 enable_stdnoreturn=no
3407         fi
3408 else
3409   enableval=no
3410         enable_stdnoreturn=no
3411
3412 fi;
3413 echo "$as_me:3413: result: $enable_stdnoreturn" >&5
3414 echo "${ECHO_T}$enable_stdnoreturn" >&6
3415
3416 if test $enable_stdnoreturn = yes; then
3417 echo "$as_me:3417: checking for C11 _Noreturn feature" >&5
3418 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3419 if test "${cf_cv_c11_noreturn+set}" = set; then
3420   echo $ECHO_N "(cached) $ECHO_C" >&6
3421 else
3422   cat >"conftest.$ac_ext" <<_ACEOF
3423 #line 3423 "configure"
3424 #include "confdefs.h"
3425
3426 #include <stdio.h>
3427 #include <stdlib.h>
3428 #include <stdnoreturn.h>
3429 static _Noreturn void giveup(void) { exit(0); }
3430
3431 int
3432 main (void)
3433 {
3434 if (feof(stdin)) giveup()
3435   ;
3436   return 0;
3437 }
3438 _ACEOF
3439 rm -f "conftest.$ac_objext"
3440 if { (eval echo "$as_me:3440: \"$ac_compile\"") >&5
3441   (eval $ac_compile) 2>&5
3442   ac_status=$?
3443   echo "$as_me:3443: \$? = $ac_status" >&5
3444   (exit "$ac_status"); } &&
3445          { ac_try='test -s "conftest.$ac_objext"'
3446   { (eval echo "$as_me:3446: \"$ac_try\"") >&5
3447   (eval $ac_try) 2>&5
3448   ac_status=$?
3449   echo "$as_me:3449: \$? = $ac_status" >&5
3450   (exit "$ac_status"); }; }; then
3451   cf_cv_c11_noreturn=yes
3452 else
3453   echo "$as_me: failed program was:" >&5
3454 cat "conftest.$ac_ext" >&5
3455 cf_cv_c11_noreturn=no
3456 fi
3457 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3458
3459 fi
3460 echo "$as_me:3460: result: $cf_cv_c11_noreturn" >&5
3461 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3462 else
3463         cf_cv_c11_noreturn=no,
3464 fi
3465
3466 if test "$cf_cv_c11_noreturn" = yes; then
3467
3468 cat >>confdefs.h <<\EOF
3469 #define HAVE_STDNORETURN_H 1
3470 EOF
3471
3472 cat >>confdefs.h <<EOF
3473 #define STDC_NORETURN _Noreturn
3474 EOF
3475
3476         HAVE_STDNORETURN_H=1
3477 else
3478         HAVE_STDNORETURN_H=0
3479 fi
3480
3481 if test "$GCC" = yes || test "$GXX" = yes
3482 then
3483 cat > conftest.i <<EOF
3484 #ifndef GCC_PRINTF
3485 #define GCC_PRINTF 0
3486 #endif
3487 #ifndef GCC_SCANF
3488 #define GCC_SCANF 0
3489 #endif
3490 #ifndef GCC_NORETURN
3491 #define GCC_NORETURN /* nothing */
3492 #endif
3493 #ifndef GCC_UNUSED
3494 #define GCC_UNUSED /* nothing */
3495 #endif
3496 EOF
3497 if test "$GCC" = yes
3498 then
3499         { echo "$as_me:3499: checking for $CC __attribute__ directives..." >&5
3500 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3501 cat > "conftest.$ac_ext" <<EOF
3502 #line 3502 "${as_me:-configure}"
3503 #include "confdefs.h"
3504 #include "conftest.h"
3505 #include "conftest.i"
3506 #if     GCC_PRINTF
3507 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3508 #else
3509 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3510 #endif
3511 #if     GCC_SCANF
3512 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3513 #else
3514 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3515 #endif
3516 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3517 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3518 extern GCC_NORETURN void foo(void);
3519 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3520 EOF
3521         cf_printf_attribute=no
3522         cf_scanf_attribute=no
3523         for cf_attribute in scanf printf unused noreturn
3524         do
3525
3526 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3527
3528                 cf_directive="__attribute__(($cf_attribute))"
3529                 echo "checking for $CC $cf_directive" 1>&5
3530
3531                 case "$cf_attribute" in
3532                 (printf)
3533                         cf_printf_attribute=yes
3534                         cat >conftest.h <<EOF
3535 #define GCC_$cf_ATTRIBUTE 1
3536 EOF
3537                         ;;
3538                 (scanf)
3539                         cf_scanf_attribute=yes
3540                         cat >conftest.h <<EOF
3541 #define GCC_$cf_ATTRIBUTE 1
3542 EOF
3543                         ;;
3544                 (*)
3545                         cat >conftest.h <<EOF
3546 #define GCC_$cf_ATTRIBUTE $cf_directive
3547 EOF
3548                         ;;
3549                 esac
3550
3551                 if { (eval echo "$as_me:3551: \"$ac_compile\"") >&5
3552   (eval $ac_compile) 2>&5
3553   ac_status=$?
3554   echo "$as_me:3554: \$? = $ac_status" >&5
3555   (exit "$ac_status"); }; then
3556                         test -n "$verbose" && echo "$as_me:3556: result: ... $cf_attribute" >&5
3557 echo "${ECHO_T}... $cf_attribute" >&6
3558                         cat conftest.h >>confdefs.h
3559                         case "$cf_attribute" in
3560                         (noreturn)
3561
3562 cat >>confdefs.h <<EOF
3563 #define GCC_NORETURN $cf_directive
3564 EOF
3565
3566                                 ;;
3567                         (printf)
3568                                 cf_value='/* nothing */'
3569                                 if test "$cf_printf_attribute" != no ; then
3570                                         cf_value='__attribute__((format(printf,fmt,var)))'
3571
3572 cat >>confdefs.h <<\EOF
3573 #define GCC_PRINTF 1
3574 EOF
3575
3576                                 fi
3577
3578 cat >>confdefs.h <<EOF
3579 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3580 EOF
3581
3582                                 ;;
3583                         (scanf)
3584                                 cf_value='/* nothing */'
3585                                 if test "$cf_scanf_attribute" != no ; then
3586                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3587
3588 cat >>confdefs.h <<\EOF
3589 #define GCC_SCANF 1
3590 EOF
3591
3592                                 fi
3593
3594 cat >>confdefs.h <<EOF
3595 #define GCC_SCANFLIKE(fmt,var) $cf_value
3596 EOF
3597
3598                                 ;;
3599                         (unused)
3600
3601 cat >>confdefs.h <<EOF
3602 #define GCC_UNUSED $cf_directive
3603 EOF
3604
3605                                 ;;
3606                         esac
3607                 fi
3608         done
3609 else
3610         ${FGREP-fgrep} define conftest.i >>confdefs.h
3611 fi
3612 rm -rf ./conftest*
3613 fi
3614
3615 echo "$as_me:3615: checking if you want to work around bogus compiler/loader warnings" >&5
3616 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3617
3618 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3619 if test "${enable_string_hacks+set}" = set; then
3620   enableval="$enable_string_hacks"
3621   enable_string_hacks=$enableval
3622 else
3623   enable_string_hacks=no
3624 fi;
3625 echo "$as_me:3625: result: $enable_string_hacks" >&5
3626 echo "${ECHO_T}$enable_string_hacks" >&6
3627
3628 if test "x$enable_string_hacks" = "xyes"; then
3629
3630 cat >>confdefs.h <<\EOF
3631 #define USE_STRING_HACKS 1
3632 EOF
3633
3634         { echo "$as_me:3634: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3635 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3636         echo "$as_me:3636: checking for strlcat" >&5
3637 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3638 if test "${ac_cv_func_strlcat+set}" = set; then
3639   echo $ECHO_N "(cached) $ECHO_C" >&6
3640 else
3641   cat >"conftest.$ac_ext" <<_ACEOF
3642 #line 3642 "configure"
3643 #include "confdefs.h"
3644 #define strlcat autoconf_temporary
3645 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3646 #undef strlcat
3647
3648 #ifdef __cplusplus
3649 extern "C"
3650 #endif
3651
3652 /* We use char because int might match the return type of a gcc2
3653    builtin and then its argument prototype would still apply.  */
3654 char strlcat (void);
3655
3656 int
3657 main (void)
3658 {
3659
3660 /* The GNU C library defines stubs for functions which it implements
3661     to always fail with ENOSYS.  Some functions are actually named
3662     something starting with __ and the normal name is an alias.  */
3663 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3664 #error found stub for strlcat
3665 #endif
3666
3667         return strlcat ();
3668   ;
3669   return 0;
3670 }
3671 _ACEOF
3672 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3673 if { (eval echo "$as_me:3673: \"$ac_link\"") >&5
3674   (eval $ac_link) 2>&5
3675   ac_status=$?
3676   echo "$as_me:3676: \$? = $ac_status" >&5
3677   (exit "$ac_status"); } &&
3678          { ac_try='test -s "conftest$ac_exeext"'
3679   { (eval echo "$as_me:3679: \"$ac_try\"") >&5
3680   (eval $ac_try) 2>&5
3681   ac_status=$?
3682   echo "$as_me:3682: \$? = $ac_status" >&5
3683   (exit "$ac_status"); }; }; then
3684   ac_cv_func_strlcat=yes
3685 else
3686   echo "$as_me: failed program was:" >&5
3687 cat "conftest.$ac_ext" >&5
3688 ac_cv_func_strlcat=no
3689 fi
3690 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3691 fi
3692 echo "$as_me:3692: result: $ac_cv_func_strlcat" >&5
3693 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3694 if test "$ac_cv_func_strlcat" = yes; then
3695
3696 cat >>confdefs.h <<\EOF
3697 #define HAVE_STRLCAT 1
3698 EOF
3699
3700 else
3701
3702                 echo "$as_me:3702: checking for strlcat in -lbsd" >&5
3703 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3704 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3705   echo $ECHO_N "(cached) $ECHO_C" >&6
3706 else
3707   ac_check_lib_save_LIBS=$LIBS
3708 LIBS="-lbsd  $LIBS"
3709 cat >"conftest.$ac_ext" <<_ACEOF
3710 #line 3710 "configure"
3711 #include "confdefs.h"
3712
3713 /* Override any gcc2 internal prototype to avoid an error.  */
3714 #ifdef __cplusplus
3715 extern "C"
3716 #endif
3717 /* We use char because int might match the return type of a gcc2
3718    builtin and then its argument prototype would still apply.  */
3719 char strlcat ();
3720 int
3721 main (void)
3722 {
3723 strlcat ();
3724   ;
3725   return 0;
3726 }
3727 _ACEOF
3728 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3729 if { (eval echo "$as_me:3729: \"$ac_link\"") >&5
3730   (eval $ac_link) 2>&5
3731   ac_status=$?
3732   echo "$as_me:3732: \$? = $ac_status" >&5
3733   (exit "$ac_status"); } &&
3734          { ac_try='test -s "conftest$ac_exeext"'
3735   { (eval echo "$as_me:3735: \"$ac_try\"") >&5
3736   (eval $ac_try) 2>&5
3737   ac_status=$?
3738   echo "$as_me:3738: \$? = $ac_status" >&5
3739   (exit "$ac_status"); }; }; then
3740   ac_cv_lib_bsd_strlcat=yes
3741 else
3742   echo "$as_me: failed program was:" >&5
3743 cat "conftest.$ac_ext" >&5
3744 ac_cv_lib_bsd_strlcat=no
3745 fi
3746 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3747 LIBS=$ac_check_lib_save_LIBS
3748 fi
3749 echo "$as_me:3749: result: $ac_cv_lib_bsd_strlcat" >&5
3750 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3751 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3752
3753 cf_add_libs="$LIBS"
3754 # reverse order
3755 cf_add_0lib=
3756 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3757 # filter duplicates
3758 for cf_add_1lib in $cf_add_0lib; do
3759         for cf_add_2lib in $cf_add_libs; do
3760                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3761                         cf_add_1lib=
3762                         break
3763                 fi
3764         done
3765         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3766 done
3767 LIBS="$cf_add_libs"
3768
3769 for ac_header in bsd/string.h
3770 do
3771 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3772 echo "$as_me:3772: checking for $ac_header" >&5
3773 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3774 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3775   echo $ECHO_N "(cached) $ECHO_C" >&6
3776 else
3777   cat >"conftest.$ac_ext" <<_ACEOF
3778 #line 3778 "configure"
3779 #include "confdefs.h"
3780 #include <$ac_header>
3781 _ACEOF
3782 if { (eval echo "$as_me:3782: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3783   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3784   ac_status=$?
3785   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3786   rm -f conftest.er1
3787   cat conftest.err >&5
3788   echo "$as_me:3788: \$? = $ac_status" >&5
3789   (exit "$ac_status"); } >/dev/null; then
3790   if test -s conftest.err; then
3791     ac_cpp_err=$ac_c_preproc_warn_flag
3792   else
3793     ac_cpp_err=
3794   fi
3795 else
3796   ac_cpp_err=yes
3797 fi
3798 if test -z "$ac_cpp_err"; then
3799   eval "$as_ac_Header=yes"
3800 else
3801   echo "$as_me: failed program was:" >&5
3802   cat "conftest.$ac_ext" >&5
3803   eval "$as_ac_Header=no"
3804 fi
3805 rm -f conftest.err "conftest.$ac_ext"
3806 fi
3807 echo "$as_me:3807: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3808 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3809 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3810   cat >>confdefs.h <<EOF
3811 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3812 EOF
3813
3814 fi
3815 done
3816
3817 cat >>confdefs.h <<\EOF
3818 #define HAVE_STRLCAT 1
3819 EOF
3820
3821 fi
3822
3823 fi
3824
3825 for ac_func in strlcpy snprintf
3826 do
3827 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3828 echo "$as_me:3828: checking for $ac_func" >&5
3829 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3830 if eval "test \"\${$as_ac_var+set}\" = set"; then
3831   echo $ECHO_N "(cached) $ECHO_C" >&6
3832 else
3833   cat >"conftest.$ac_ext" <<_ACEOF
3834 #line 3834 "configure"
3835 #include "confdefs.h"
3836 #define $ac_func autoconf_temporary
3837 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3838 #undef $ac_func
3839
3840 #ifdef __cplusplus
3841 extern "C"
3842 #endif
3843
3844 /* We use char because int might match the return type of a gcc2
3845    builtin and then its argument prototype would still apply.  */
3846 char $ac_func (void);
3847
3848 int
3849 main (void)
3850 {
3851
3852 /* The GNU C library defines stubs for functions which it implements
3853     to always fail with ENOSYS.  Some functions are actually named
3854     something starting with __ and the normal name is an alias.  */
3855 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3856 #error found stub for $ac_func
3857 #endif
3858
3859         return $ac_func ();
3860   ;
3861   return 0;
3862 }
3863 _ACEOF
3864 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3865 if { (eval echo "$as_me:3865: \"$ac_link\"") >&5
3866   (eval $ac_link) 2>&5
3867   ac_status=$?
3868   echo "$as_me:3868: \$? = $ac_status" >&5
3869   (exit "$ac_status"); } &&
3870          { ac_try='test -s "conftest$ac_exeext"'
3871   { (eval echo "$as_me:3871: \"$ac_try\"") >&5
3872   (eval $ac_try) 2>&5
3873   ac_status=$?
3874   echo "$as_me:3874: \$? = $ac_status" >&5
3875   (exit "$ac_status"); }; }; then
3876   eval "$as_ac_var=yes"
3877 else
3878   echo "$as_me: failed program was:" >&5
3879 cat "conftest.$ac_ext" >&5
3880 eval "$as_ac_var=no"
3881 fi
3882 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3883 fi
3884 echo "$as_me:3884: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3885 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3886 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3887   cat >>confdefs.h <<EOF
3888 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3889 EOF
3890
3891 fi
3892 done
3893
3894 fi
3895
3896 echo "$as_me:3896: checking if the POSIX test-macros are already defined" >&5
3897 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3898 if test "${cf_cv_posix_visible+set}" = set; then
3899   echo $ECHO_N "(cached) $ECHO_C" >&6
3900 else
3901
3902 cat >"conftest.$ac_ext" <<_ACEOF
3903 #line 3903 "configure"
3904 #include "confdefs.h"
3905 #include <stdio.h>
3906 int
3907 main (void)
3908 {
3909
3910 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3911         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3912         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3913         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3914 #error conflicting symbols found
3915 #endif
3916
3917   ;
3918   return 0;
3919 }
3920 _ACEOF
3921 rm -f "conftest.$ac_objext"
3922 if { (eval echo "$as_me:3922: \"$ac_compile\"") >&5
3923   (eval $ac_compile) 2>&5
3924   ac_status=$?
3925   echo "$as_me:3925: \$? = $ac_status" >&5
3926   (exit "$ac_status"); } &&
3927          { ac_try='test -s "conftest.$ac_objext"'
3928   { (eval echo "$as_me:3928: \"$ac_try\"") >&5
3929   (eval $ac_try) 2>&5
3930   ac_status=$?
3931   echo "$as_me:3931: \$? = $ac_status" >&5
3932   (exit "$ac_status"); }; }; then
3933   cf_cv_posix_visible=no
3934 else
3935   echo "$as_me: failed program was:" >&5
3936 cat "conftest.$ac_ext" >&5
3937 cf_cv_posix_visible=yes
3938 fi
3939 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3940
3941 fi
3942 echo "$as_me:3942: result: $cf_cv_posix_visible" >&5
3943 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3944
3945 if test "$cf_cv_posix_visible" = no; then
3946
3947 cf_XOPEN_SOURCE=600
3948 cf_POSIX_C_SOURCE=199506L
3949 cf_xopen_source=
3950
3951 case "$host_os" in
3952 (aix[4-7]*)
3953         cf_xopen_source="-D_ALL_SOURCE"
3954         ;;
3955 (msys)
3956         cf_XOPEN_SOURCE=600
3957         ;;
3958 (darwin[0-8].*)
3959         cf_xopen_source="-D_APPLE_C_SOURCE"
3960         ;;
3961 (darwin*)
3962         cf_xopen_source="-D_DARWIN_C_SOURCE"
3963         cf_XOPEN_SOURCE=
3964         ;;
3965 (freebsd*|dragonfly*|midnightbsd*)
3966         # 5.x headers associate
3967         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3968         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3969         cf_POSIX_C_SOURCE=200112L
3970         cf_XOPEN_SOURCE=600
3971         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3972         ;;
3973 (hpux11*)
3974         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3975         ;;
3976 (hpux*)
3977         cf_xopen_source="-D_HPUX_SOURCE"
3978         ;;
3979 (irix[56].*)
3980         cf_xopen_source="-D_SGI_SOURCE"
3981         cf_XOPEN_SOURCE=
3982         ;;
3983 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3984
3985 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3986
3987 echo "$as_me:3987: checking if this is the GNU C library" >&5
3988 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3989 if test "${cf_cv_gnu_library+set}" = set; then
3990   echo $ECHO_N "(cached) $ECHO_C" >&6
3991 else
3992
3993 cat >"conftest.$ac_ext" <<_ACEOF
3994 #line 3994 "configure"
3995 #include "confdefs.h"
3996 #include <sys/types.h>
3997 int
3998 main (void)
3999 {
4000
4001         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
4002                 return 0;
4003         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
4004                 return 0;
4005         #else
4006         #       error not GNU C library
4007         #endif
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f "conftest.$ac_objext"
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit "$ac_status"); } &&
4018          { ac_try='test -s "conftest.$ac_objext"'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit "$ac_status"); }; }; then
4024   cf_cv_gnu_library=yes
4025 else
4026   echo "$as_me: failed program was:" >&5
4027 cat "conftest.$ac_ext" >&5
4028 cf_cv_gnu_library=no
4029 fi
4030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4031
4032 fi
4033 echo "$as_me:4033: result: $cf_cv_gnu_library" >&5
4034 echo "${ECHO_T}$cf_cv_gnu_library" >&6
4035
4036 if test x$cf_cv_gnu_library = xyes; then
4037
4038         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
4039         # was changed to help a little.  newlib incorporated the change about 4
4040         # years later.
4041         echo "$as_me:4041: checking if _DEFAULT_SOURCE can be used as a basis" >&5
4042 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
4043 if test "${cf_cv_gnu_library_219+set}" = set; then
4044   echo $ECHO_N "(cached) $ECHO_C" >&6
4045 else
4046
4047                 cf_save="$CPPFLAGS"
4048
4049         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4050         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4051
4052                 cat >"conftest.$ac_ext" <<_ACEOF
4053 #line 4053 "configure"
4054 #include "confdefs.h"
4055 #include <sys/types.h>
4056 int
4057 main (void)
4058 {
4059
4060                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
4061                                 return 0;
4062                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4063                                 return 0;
4064                         #else
4065                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4066                         #endif
4067   ;
4068   return 0;
4069 }
4070 _ACEOF
4071 rm -f "conftest.$ac_objext"
4072 if { (eval echo "$as_me:4072: \"$ac_compile\"") >&5
4073   (eval $ac_compile) 2>&5
4074   ac_status=$?
4075   echo "$as_me:4075: \$? = $ac_status" >&5
4076   (exit "$ac_status"); } &&
4077          { ac_try='test -s "conftest.$ac_objext"'
4078   { (eval echo "$as_me:4078: \"$ac_try\"") >&5
4079   (eval $ac_try) 2>&5
4080   ac_status=$?
4081   echo "$as_me:4081: \$? = $ac_status" >&5
4082   (exit "$ac_status"); }; }; then
4083   cf_cv_gnu_library_219=yes
4084 else
4085   echo "$as_me: failed program was:" >&5
4086 cat "conftest.$ac_ext" >&5
4087 cf_cv_gnu_library_219=no
4088 fi
4089 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4090                 CPPFLAGS="$cf_save"
4091
4092 fi
4093 echo "$as_me:4093: result: $cf_cv_gnu_library_219" >&5
4094 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4095
4096         if test "x$cf_cv_gnu_library_219" = xyes; then
4097                 cf_save="$CPPFLAGS"
4098                 echo "$as_me:4098: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4099 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4100 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4101   echo $ECHO_N "(cached) $ECHO_C" >&6
4102 else
4103
4104 cf_fix_cppflags=no
4105 cf_new_cflags=
4106 cf_new_cppflags=
4107 cf_new_extra_cppflags=
4108
4109 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4110 do
4111 case "$cf_fix_cppflags" in
4112 (no)
4113         case "$cf_add_cflags" in
4114         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4115                 case "$cf_add_cflags" in
4116                 (-D*)
4117                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4118
4119                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4120                                 && test -z "${cf_tst_cflags}" \
4121                                 && cf_fix_cppflags=yes
4122
4123                         if test "$cf_fix_cppflags" = yes ; then
4124
4125         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4126         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4127
4128                                 continue
4129                         elif test "${cf_tst_cflags}" = "\"'" ; then
4130
4131         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4132         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4133
4134                                 continue
4135                         fi
4136                         ;;
4137                 esac
4138                 case "$CPPFLAGS" in
4139                 (*$cf_add_cflags)
4140                         ;;
4141                 (*)
4142                         case "$cf_add_cflags" in
4143                         (-D*)
4144                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4145
4146 CPPFLAGS=`echo "$CPPFLAGS" | \
4147         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4148                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4149
4150                                 ;;
4151                         esac
4152
4153         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4154         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4155
4156                         ;;
4157                 esac
4158                 ;;
4159         (*)
4160
4161         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4162         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4163
4164                 ;;
4165         esac
4166         ;;
4167 (yes)
4168
4169         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4170         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4171
4172         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4173
4174         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4175                 && test -z "${cf_tst_cflags}" \
4176                 && cf_fix_cppflags=no
4177         ;;
4178 esac
4179 done
4180
4181 if test -n "$cf_new_cflags" ; then
4182
4183         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4184         CFLAGS="${CFLAGS}$cf_new_cflags"
4185
4186 fi
4187
4188 if test -n "$cf_new_cppflags" ; then
4189
4190         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4191         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4192
4193 fi
4194
4195 if test -n "$cf_new_extra_cppflags" ; then
4196
4197         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4198         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4199
4200 fi
4201
4202                         cat >"conftest.$ac_ext" <<_ACEOF
4203 #line 4203 "configure"
4204 #include "confdefs.h"
4205
4206                                 #include <limits.h>
4207                                 #include <sys/types.h>
4208
4209 int
4210 main (void)
4211 {
4212
4213                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4214                                         return 0;
4215                                 #else
4216                                 #       error GNU C library is too old
4217                                 #endif
4218   ;
4219   return 0;
4220 }
4221 _ACEOF
4222 rm -f "conftest.$ac_objext"
4223 if { (eval echo "$as_me:4223: \"$ac_compile\"") >&5
4224   (eval $ac_compile) 2>&5
4225   ac_status=$?
4226   echo "$as_me:4226: \$? = $ac_status" >&5
4227   (exit "$ac_status"); } &&
4228          { ac_try='test -s "conftest.$ac_objext"'
4229   { (eval echo "$as_me:4229: \"$ac_try\"") >&5
4230   (eval $ac_try) 2>&5
4231   ac_status=$?
4232   echo "$as_me:4232: \$? = $ac_status" >&5
4233   (exit "$ac_status"); }; }; then
4234   cf_cv_gnu_dftsrc_219=yes
4235 else
4236   echo "$as_me: failed program was:" >&5
4237 cat "conftest.$ac_ext" >&5
4238 cf_cv_gnu_dftsrc_219=no
4239 fi
4240 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4241
4242 fi
4243 echo "$as_me:4243: result: $cf_cv_gnu_dftsrc_219" >&5
4244 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4245                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4246         else
4247                 cf_cv_gnu_dftsrc_219=maybe
4248         fi
4249
4250         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4251
4252                 echo "$as_me:4252: checking if we must define _GNU_SOURCE" >&5
4253 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4254 if test "${cf_cv_gnu_source+set}" = set; then
4255   echo $ECHO_N "(cached) $ECHO_C" >&6
4256 else
4257
4258                 cat >"conftest.$ac_ext" <<_ACEOF
4259 #line 4259 "configure"
4260 #include "confdefs.h"
4261 #include <sys/types.h>
4262 int
4263 main (void)
4264 {
4265
4266                         #ifndef _XOPEN_SOURCE
4267                         #error  expected _XOPEN_SOURCE to be defined
4268                         #endif
4269   ;
4270   return 0;
4271 }
4272 _ACEOF
4273 rm -f "conftest.$ac_objext"
4274 if { (eval echo "$as_me:4274: \"$ac_compile\"") >&5
4275   (eval $ac_compile) 2>&5
4276   ac_status=$?
4277   echo "$as_me:4277: \$? = $ac_status" >&5
4278   (exit "$ac_status"); } &&
4279          { ac_try='test -s "conftest.$ac_objext"'
4280   { (eval echo "$as_me:4280: \"$ac_try\"") >&5
4281   (eval $ac_try) 2>&5
4282   ac_status=$?
4283   echo "$as_me:4283: \$? = $ac_status" >&5
4284   (exit "$ac_status"); }; }; then
4285   cf_cv_gnu_source=no
4286 else
4287   echo "$as_me: failed program was:" >&5
4288 cat "conftest.$ac_ext" >&5
4289 cf_save="$CPPFLAGS"
4290
4291 cf_fix_cppflags=no
4292 cf_new_cflags=
4293 cf_new_cppflags=
4294 cf_new_extra_cppflags=
4295
4296 for cf_add_cflags in -D_GNU_SOURCE
4297 do
4298 case "$cf_fix_cppflags" in
4299 (no)
4300         case "$cf_add_cflags" in
4301         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4302                 case "$cf_add_cflags" in
4303                 (-D*)
4304                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4305
4306                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4307                                 && test -z "${cf_tst_cflags}" \
4308                                 && cf_fix_cppflags=yes
4309
4310                         if test "$cf_fix_cppflags" = yes ; then
4311
4312         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4313         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4314
4315                                 continue
4316                         elif test "${cf_tst_cflags}" = "\"'" ; then
4317
4318         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4319         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4320
4321                                 continue
4322                         fi
4323                         ;;
4324                 esac
4325                 case "$CPPFLAGS" in
4326                 (*$cf_add_cflags)
4327                         ;;
4328                 (*)
4329                         case "$cf_add_cflags" in
4330                         (-D*)
4331                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4332
4333 CPPFLAGS=`echo "$CPPFLAGS" | \
4334         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4335                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4336
4337                                 ;;
4338                         esac
4339
4340         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4341         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4342
4343                         ;;
4344                 esac
4345                 ;;
4346         (*)
4347
4348         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4349         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4350
4351                 ;;
4352         esac
4353         ;;
4354 (yes)
4355
4356         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4357         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4358
4359         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4360
4361         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4362                 && test -z "${cf_tst_cflags}" \
4363                 && cf_fix_cppflags=no
4364         ;;
4365 esac
4366 done
4367
4368 if test -n "$cf_new_cflags" ; then
4369
4370         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4371         CFLAGS="${CFLAGS}$cf_new_cflags"
4372
4373 fi
4374
4375 if test -n "$cf_new_cppflags" ; then
4376
4377         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4378         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4379
4380 fi
4381
4382 if test -n "$cf_new_extra_cppflags" ; then
4383
4384         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4385         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4386
4387 fi
4388
4389                          cat >"conftest.$ac_ext" <<_ACEOF
4390 #line 4390 "configure"
4391 #include "confdefs.h"
4392 #include <sys/types.h>
4393 int
4394 main (void)
4395 {
4396
4397                                 #ifdef _XOPEN_SOURCE
4398                                 #error  expected _XOPEN_SOURCE to be undefined
4399                                 #endif
4400   ;
4401   return 0;
4402 }
4403 _ACEOF
4404 rm -f "conftest.$ac_objext"
4405 if { (eval echo "$as_me:4405: \"$ac_compile\"") >&5
4406   (eval $ac_compile) 2>&5
4407   ac_status=$?
4408   echo "$as_me:4408: \$? = $ac_status" >&5
4409   (exit "$ac_status"); } &&
4410          { ac_try='test -s "conftest.$ac_objext"'
4411   { (eval echo "$as_me:4411: \"$ac_try\"") >&5
4412   (eval $ac_try) 2>&5
4413   ac_status=$?
4414   echo "$as_me:4414: \$? = $ac_status" >&5
4415   (exit "$ac_status"); }; }; then
4416   cf_cv_gnu_source=no
4417 else
4418   echo "$as_me: failed program was:" >&5
4419 cat "conftest.$ac_ext" >&5
4420 cf_cv_gnu_source=yes
4421 fi
4422 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4423                         CPPFLAGS="$cf_save"
4424
4425 fi
4426 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4427
4428 fi
4429 echo "$as_me:4429: result: $cf_cv_gnu_source" >&5
4430 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4431
4432                 if test "$cf_cv_gnu_source" = yes
4433                 then
4434                 echo "$as_me:4434: checking if we should also define _DEFAULT_SOURCE" >&5
4435 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4436 if test "${cf_cv_default_source+set}" = set; then
4437   echo $ECHO_N "(cached) $ECHO_C" >&6
4438 else
4439
4440         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4441         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4442
4443                         cat >"conftest.$ac_ext" <<_ACEOF
4444 #line 4444 "configure"
4445 #include "confdefs.h"
4446 #include <sys/types.h>
4447 int
4448 main (void)
4449 {
4450
4451                                 #ifdef _DEFAULT_SOURCE
4452                                 #error  expected _DEFAULT_SOURCE to be undefined
4453                                 #endif
4454   ;
4455   return 0;
4456 }
4457 _ACEOF
4458 rm -f "conftest.$ac_objext"
4459 if { (eval echo "$as_me:4459: \"$ac_compile\"") >&5
4460   (eval $ac_compile) 2>&5
4461   ac_status=$?
4462   echo "$as_me:4462: \$? = $ac_status" >&5
4463   (exit "$ac_status"); } &&
4464          { ac_try='test -s "conftest.$ac_objext"'
4465   { (eval echo "$as_me:4465: \"$ac_try\"") >&5
4466   (eval $ac_try) 2>&5
4467   ac_status=$?
4468   echo "$as_me:4468: \$? = $ac_status" >&5
4469   (exit "$ac_status"); }; }; then
4470   cf_cv_default_source=no
4471 else
4472   echo "$as_me: failed program was:" >&5
4473 cat "conftest.$ac_ext" >&5
4474 cf_cv_default_source=yes
4475 fi
4476 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4477
4478 fi
4479 echo "$as_me:4479: result: $cf_cv_default_source" >&5
4480 echo "${ECHO_T}$cf_cv_default_source" >&6
4481                         if test "$cf_cv_default_source" = yes
4482                         then
4483
4484         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4485         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4486
4487                         fi
4488                 fi
4489         fi
4490
4491 fi
4492
4493         ;;
4494 (minix*)
4495         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4496         ;;
4497 (mirbsd*)
4498         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4499         cf_XOPEN_SOURCE=
4500
4501 if test "$cf_cv_posix_visible" = no; then
4502
4503 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4504
4505 cf_save_CFLAGS="$CFLAGS"
4506 cf_save_CPPFLAGS="$CPPFLAGS"
4507
4508 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4509         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4510                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4511
4512 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4513         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4514                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4515
4516 echo "$as_me:4516: checking if we should define _POSIX_C_SOURCE" >&5
4517 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4518 if test "${cf_cv_posix_c_source+set}" = set; then
4519   echo $ECHO_N "(cached) $ECHO_C" >&6
4520 else
4521
4522 echo "${as_me:-configure}:4522: testing if the symbol is already defined go no further ..." 1>&5
4523
4524         cat >"conftest.$ac_ext" <<_ACEOF
4525 #line 4525 "configure"
4526 #include "confdefs.h"
4527 #include <sys/types.h>
4528 int
4529 main (void)
4530 {
4531
4532 #ifndef _POSIX_C_SOURCE
4533 make an error
4534 #endif
4535   ;
4536   return 0;
4537 }
4538 _ACEOF
4539 rm -f "conftest.$ac_objext"
4540 if { (eval echo "$as_me:4540: \"$ac_compile\"") >&5
4541   (eval $ac_compile) 2>&5
4542   ac_status=$?
4543   echo "$as_me:4543: \$? = $ac_status" >&5
4544   (exit "$ac_status"); } &&
4545          { ac_try='test -s "conftest.$ac_objext"'
4546   { (eval echo "$as_me:4546: \"$ac_try\"") >&5
4547   (eval $ac_try) 2>&5
4548   ac_status=$?
4549   echo "$as_me:4549: \$? = $ac_status" >&5
4550   (exit "$ac_status"); }; }; then
4551   cf_cv_posix_c_source=no
4552 else
4553   echo "$as_me: failed program was:" >&5
4554 cat "conftest.$ac_ext" >&5
4555 cf_want_posix_source=no
4556          case .$cf_POSIX_C_SOURCE in
4557          (.[12]??*)
4558                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4559                 ;;
4560          (.2)
4561                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4562                 cf_want_posix_source=yes
4563                 ;;
4564          (.*)
4565                 cf_want_posix_source=yes
4566                 ;;
4567          esac
4568          if test "$cf_want_posix_source" = yes ; then
4569                 cat >"conftest.$ac_ext" <<_ACEOF
4570 #line 4570 "configure"
4571 #include "confdefs.h"
4572 #include <sys/types.h>
4573 int
4574 main (void)
4575 {
4576
4577 #ifdef _POSIX_SOURCE
4578 make an error
4579 #endif
4580   ;
4581   return 0;
4582 }
4583 _ACEOF
4584 rm -f "conftest.$ac_objext"
4585 if { (eval echo "$as_me:4585: \"$ac_compile\"") >&5
4586   (eval $ac_compile) 2>&5
4587   ac_status=$?
4588   echo "$as_me:4588: \$? = $ac_status" >&5
4589   (exit "$ac_status"); } &&
4590          { ac_try='test -s "conftest.$ac_objext"'
4591   { (eval echo "$as_me:4591: \"$ac_try\"") >&5
4592   (eval $ac_try) 2>&5
4593   ac_status=$?
4594   echo "$as_me:4594: \$? = $ac_status" >&5
4595   (exit "$ac_status"); }; }; then
4596   :
4597 else
4598   echo "$as_me: failed program was:" >&5
4599 cat "conftest.$ac_ext" >&5
4600 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4601 fi
4602 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4603          fi
4604
4605 echo "${as_me:-configure}:4605: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4606
4607          CFLAGS="$cf_trim_CFLAGS"
4608          CPPFLAGS="$cf_trim_CPPFLAGS"
4609
4610         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4611         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4612
4613 echo "${as_me:-configure}:4613: testing if the second compile does not leave our definition intact error ..." 1>&5
4614
4615          cat >"conftest.$ac_ext" <<_ACEOF
4616 #line 4616 "configure"
4617 #include "confdefs.h"
4618 #include <sys/types.h>
4619 int
4620 main (void)
4621 {
4622
4623 #ifndef _POSIX_C_SOURCE
4624 make an error
4625 #endif
4626   ;
4627   return 0;
4628 }
4629 _ACEOF
4630 rm -f "conftest.$ac_objext"
4631 if { (eval echo "$as_me:4631: \"$ac_compile\"") >&5
4632   (eval $ac_compile) 2>&5
4633   ac_status=$?
4634   echo "$as_me:4634: \$? = $ac_status" >&5
4635   (exit "$ac_status"); } &&
4636          { ac_try='test -s "conftest.$ac_objext"'
4637   { (eval echo "$as_me:4637: \"$ac_try\"") >&5
4638   (eval $ac_try) 2>&5
4639   ac_status=$?
4640   echo "$as_me:4640: \$? = $ac_status" >&5
4641   (exit "$ac_status"); }; }; then
4642   :
4643 else
4644   echo "$as_me: failed program was:" >&5
4645 cat "conftest.$ac_ext" >&5
4646 cf_cv_posix_c_source=no
4647 fi
4648 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4649          CFLAGS="$cf_save_CFLAGS"
4650          CPPFLAGS="$cf_save_CPPFLAGS"
4651
4652 fi
4653 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4654
4655 fi
4656 echo "$as_me:4656: result: $cf_cv_posix_c_source" >&5
4657 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4658
4659 if test "$cf_cv_posix_c_source" != no ; then
4660         CFLAGS="$cf_trim_CFLAGS"
4661         CPPFLAGS="$cf_trim_CPPFLAGS"
4662
4663 cf_fix_cppflags=no
4664 cf_new_cflags=
4665 cf_new_cppflags=
4666 cf_new_extra_cppflags=
4667
4668 for cf_add_cflags in $cf_cv_posix_c_source
4669 do
4670 case "$cf_fix_cppflags" in
4671 (no)
4672         case "$cf_add_cflags" in
4673         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4674                 case "$cf_add_cflags" in
4675                 (-D*)
4676                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4677
4678                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4679                                 && test -z "${cf_tst_cflags}" \
4680                                 && cf_fix_cppflags=yes
4681
4682                         if test "$cf_fix_cppflags" = yes ; then
4683
4684         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4685         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4686
4687                                 continue
4688                         elif test "${cf_tst_cflags}" = "\"'" ; then
4689
4690         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4691         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4692
4693                                 continue
4694                         fi
4695                         ;;
4696                 esac
4697                 case "$CPPFLAGS" in
4698                 (*$cf_add_cflags)
4699                         ;;
4700                 (*)
4701                         case "$cf_add_cflags" in
4702                         (-D*)
4703                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4704
4705 CPPFLAGS=`echo "$CPPFLAGS" | \
4706         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4707                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4708
4709                                 ;;
4710                         esac
4711
4712         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4713         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4714
4715                         ;;
4716                 esac
4717                 ;;
4718         (*)
4719
4720         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4721         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4722
4723                 ;;
4724         esac
4725         ;;
4726 (yes)
4727
4728         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4729         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4730
4731         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4732
4733         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4734                 && test -z "${cf_tst_cflags}" \
4735                 && cf_fix_cppflags=no
4736         ;;
4737 esac
4738 done
4739
4740 if test -n "$cf_new_cflags" ; then
4741
4742         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4743         CFLAGS="${CFLAGS}$cf_new_cflags"
4744
4745 fi
4746
4747 if test -n "$cf_new_cppflags" ; then
4748
4749         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4750         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4751
4752 fi
4753
4754 if test -n "$cf_new_extra_cppflags" ; then
4755
4756         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4757         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4758
4759 fi
4760
4761 fi
4762
4763 fi # cf_cv_posix_visible
4764
4765         ;;
4766 (netbsd*)
4767         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4768         ;;
4769 (openbsd[6-9]*)
4770         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4771         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4772         # Abusing the conformance level is a workaround.
4773         { echo "$as_me:4773: WARNING: this system does not provide usable locale support" >&5
4774 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4775         cf_xopen_source="-D_BSD_SOURCE"
4776         cf_XOPEN_SOURCE=700
4777         ;;
4778 (openbsd[4-5]*)
4779         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4780         cf_xopen_source="-D_BSD_SOURCE"
4781         cf_XOPEN_SOURCE=600
4782         ;;
4783 (openbsd*)
4784         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4785         ;;
4786 (osf[45]*)
4787         cf_xopen_source="-D_OSF_SOURCE"
4788         ;;
4789 (nto-qnx*)
4790         cf_xopen_source="-D_QNX_SOURCE"
4791         ;;
4792 (sco*)
4793         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4794         ;;
4795 (solaris2.*)
4796         cf_xopen_source="-D__EXTENSIONS__"
4797         cf_cv_xopen_source=broken
4798         ;;
4799 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4800         cf_XOPEN_SOURCE=
4801         cf_POSIX_C_SOURCE=
4802         ;;
4803 (*)
4804
4805 echo "$as_me:4805: checking if we should define _XOPEN_SOURCE" >&5
4806 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4807 if test "${cf_cv_xopen_source+set}" = set; then
4808   echo $ECHO_N "(cached) $ECHO_C" >&6
4809 else
4810
4811         cat >"conftest.$ac_ext" <<_ACEOF
4812 #line 4812 "configure"
4813 #include "confdefs.h"
4814
4815 #include <stdlib.h>
4816 #include <string.h>
4817 #include <sys/types.h>
4818
4819 int
4820 main (void)
4821 {
4822
4823 #ifndef _XOPEN_SOURCE
4824 make an error
4825 #endif
4826   ;
4827   return 0;
4828 }
4829 _ACEOF
4830 rm -f "conftest.$ac_objext"
4831 if { (eval echo "$as_me:4831: \"$ac_compile\"") >&5
4832   (eval $ac_compile) 2>&5
4833   ac_status=$?
4834   echo "$as_me:4834: \$? = $ac_status" >&5
4835   (exit "$ac_status"); } &&
4836          { ac_try='test -s "conftest.$ac_objext"'
4837   { (eval echo "$as_me:4837: \"$ac_try\"") >&5
4838   (eval $ac_try) 2>&5
4839   ac_status=$?
4840   echo "$as_me:4840: \$? = $ac_status" >&5
4841   (exit "$ac_status"); }; }; then
4842   cf_cv_xopen_source=no
4843 else
4844   echo "$as_me: failed program was:" >&5
4845 cat "conftest.$ac_ext" >&5
4846 cf_save="$CPPFLAGS"
4847
4848         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4849         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4850
4851          cat >"conftest.$ac_ext" <<_ACEOF
4852 #line 4852 "configure"
4853 #include "confdefs.h"
4854
4855 #include <stdlib.h>
4856 #include <string.h>
4857 #include <sys/types.h>
4858
4859 int
4860 main (void)
4861 {
4862
4863 #ifdef _XOPEN_SOURCE
4864 make an error
4865 #endif
4866   ;
4867   return 0;
4868 }
4869 _ACEOF
4870 rm -f "conftest.$ac_objext"
4871 if { (eval echo "$as_me:4871: \"$ac_compile\"") >&5
4872   (eval $ac_compile) 2>&5
4873   ac_status=$?
4874   echo "$as_me:4874: \$? = $ac_status" >&5
4875   (exit "$ac_status"); } &&
4876          { ac_try='test -s "conftest.$ac_objext"'
4877   { (eval echo "$as_me:4877: \"$ac_try\"") >&5
4878   (eval $ac_try) 2>&5
4879   ac_status=$?
4880   echo "$as_me:4880: \$? = $ac_status" >&5
4881   (exit "$ac_status"); }; }; then
4882   cf_cv_xopen_source=no
4883 else
4884   echo "$as_me: failed program was:" >&5
4885 cat "conftest.$ac_ext" >&5
4886 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4887 fi
4888 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4889         CPPFLAGS="$cf_save"
4890
4891 fi
4892 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4893
4894 fi
4895 echo "$as_me:4895: result: $cf_cv_xopen_source" >&5
4896 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4897
4898 if test "$cf_cv_xopen_source" != no ; then
4899
4900 CFLAGS=`echo "$CFLAGS" | \
4901         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4902                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4903
4904 CPPFLAGS=`echo "$CPPFLAGS" | \
4905         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4906                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4907
4908         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4909
4910 for cf_add_cflags in $cf_temp_xopen_source
4911 do
4912         case "x$cf_add_cflags" in
4913         (x-[DU]*)
4914
4915 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4916 while true
4917 do
4918         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'`
4919         test "$CFLAGS" != "$cf_old_cflag" || break
4920
4921         CFLAGS="$cf_old_cflag"
4922 done
4923
4924 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4925 while true
4926 do
4927         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'`
4928         test "$CPPFLAGS" != "$cf_old_cflag" || break
4929
4930         CPPFLAGS="$cf_old_cflag"
4931 done
4932
4933                 ;;
4934         esac
4935
4936 cf_fix_cppflags=no
4937 cf_new_cflags=
4938 cf_new_cppflags=
4939 cf_new_extra_cppflags=
4940
4941 for cf_add_cflags in $cf_add_cflags
4942 do
4943 case "$cf_fix_cppflags" in
4944 (no)
4945         case "$cf_add_cflags" in
4946         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4947                 case "$cf_add_cflags" in
4948                 (-D*)
4949                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4950
4951                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4952                                 && test -z "${cf_tst_cflags}" \
4953                                 && cf_fix_cppflags=yes
4954
4955                         if test "$cf_fix_cppflags" = yes ; then
4956
4957         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4958         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4959
4960                                 continue
4961                         elif test "${cf_tst_cflags}" = "\"'" ; then
4962
4963         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4964         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4965
4966                                 continue
4967                         fi
4968                         ;;
4969                 esac
4970                 case "$CPPFLAGS" in
4971                 (*$cf_add_cflags)
4972                         ;;
4973                 (*)
4974                         case "$cf_add_cflags" in
4975                         (-D*)
4976                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4977
4978 CPPFLAGS=`echo "$CPPFLAGS" | \
4979         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4980                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4981
4982                                 ;;
4983                         esac
4984
4985         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4986         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4987
4988                         ;;
4989                 esac
4990                 ;;
4991         (*)
4992
4993         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4994         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4995
4996                 ;;
4997         esac
4998         ;;
4999 (yes)
5000
5001         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5002         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5003
5004         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5005
5006         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5007                 && test -z "${cf_tst_cflags}" \
5008                 && cf_fix_cppflags=no
5009         ;;
5010 esac
5011 done
5012
5013 if test -n "$cf_new_cflags" ; then
5014
5015         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5016         CFLAGS="${CFLAGS}$cf_new_cflags"
5017
5018 fi
5019
5020 if test -n "$cf_new_cppflags" ; then
5021
5022         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5023         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5024
5025 fi
5026
5027 if test -n "$cf_new_extra_cppflags" ; then
5028
5029         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5030         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5031
5032 fi
5033
5034 done
5035
5036 fi
5037
5038 if test "$cf_cv_posix_visible" = no; then
5039
5040 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5041
5042 cf_save_CFLAGS="$CFLAGS"
5043 cf_save_CPPFLAGS="$CPPFLAGS"
5044
5045 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5046         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5047                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5048
5049 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5050         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5051                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5052
5053 echo "$as_me:5053: checking if we should define _POSIX_C_SOURCE" >&5
5054 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5055 if test "${cf_cv_posix_c_source+set}" = set; then
5056   echo $ECHO_N "(cached) $ECHO_C" >&6
5057 else
5058
5059 echo "${as_me:-configure}:5059: testing if the symbol is already defined go no further ..." 1>&5
5060
5061         cat >"conftest.$ac_ext" <<_ACEOF
5062 #line 5062 "configure"
5063 #include "confdefs.h"
5064 #include <sys/types.h>
5065 int
5066 main (void)
5067 {
5068
5069 #ifndef _POSIX_C_SOURCE
5070 make an error
5071 #endif
5072   ;
5073   return 0;
5074 }
5075 _ACEOF
5076 rm -f "conftest.$ac_objext"
5077 if { (eval echo "$as_me:5077: \"$ac_compile\"") >&5
5078   (eval $ac_compile) 2>&5
5079   ac_status=$?
5080   echo "$as_me:5080: \$? = $ac_status" >&5
5081   (exit "$ac_status"); } &&
5082          { ac_try='test -s "conftest.$ac_objext"'
5083   { (eval echo "$as_me:5083: \"$ac_try\"") >&5
5084   (eval $ac_try) 2>&5
5085   ac_status=$?
5086   echo "$as_me:5086: \$? = $ac_status" >&5
5087   (exit "$ac_status"); }; }; then
5088   cf_cv_posix_c_source=no
5089 else
5090   echo "$as_me: failed program was:" >&5
5091 cat "conftest.$ac_ext" >&5
5092 cf_want_posix_source=no
5093          case .$cf_POSIX_C_SOURCE in
5094          (.[12]??*)
5095                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5096                 ;;
5097          (.2)
5098                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5099                 cf_want_posix_source=yes
5100                 ;;
5101          (.*)
5102                 cf_want_posix_source=yes
5103                 ;;
5104          esac
5105          if test "$cf_want_posix_source" = yes ; then
5106                 cat >"conftest.$ac_ext" <<_ACEOF
5107 #line 5107 "configure"
5108 #include "confdefs.h"
5109 #include <sys/types.h>
5110 int
5111 main (void)
5112 {
5113
5114 #ifdef _POSIX_SOURCE
5115 make an error
5116 #endif
5117   ;
5118   return 0;
5119 }
5120 _ACEOF
5121 rm -f "conftest.$ac_objext"
5122 if { (eval echo "$as_me:5122: \"$ac_compile\"") >&5
5123   (eval $ac_compile) 2>&5
5124   ac_status=$?
5125   echo "$as_me:5125: \$? = $ac_status" >&5
5126   (exit "$ac_status"); } &&
5127          { ac_try='test -s "conftest.$ac_objext"'
5128   { (eval echo "$as_me:5128: \"$ac_try\"") >&5
5129   (eval $ac_try) 2>&5
5130   ac_status=$?
5131   echo "$as_me:5131: \$? = $ac_status" >&5
5132   (exit "$ac_status"); }; }; then
5133   :
5134 else
5135   echo "$as_me: failed program was:" >&5
5136 cat "conftest.$ac_ext" >&5
5137 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5138 fi
5139 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5140          fi
5141
5142 echo "${as_me:-configure}:5142: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5143
5144          CFLAGS="$cf_trim_CFLAGS"
5145          CPPFLAGS="$cf_trim_CPPFLAGS"
5146
5147         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5148         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5149
5150 echo "${as_me:-configure}:5150: testing if the second compile does not leave our definition intact error ..." 1>&5
5151
5152          cat >"conftest.$ac_ext" <<_ACEOF
5153 #line 5153 "configure"
5154 #include "confdefs.h"
5155 #include <sys/types.h>
5156 int
5157 main (void)
5158 {
5159
5160 #ifndef _POSIX_C_SOURCE
5161 make an error
5162 #endif
5163   ;
5164   return 0;
5165 }
5166 _ACEOF
5167 rm -f "conftest.$ac_objext"
5168 if { (eval echo "$as_me:5168: \"$ac_compile\"") >&5
5169   (eval $ac_compile) 2>&5
5170   ac_status=$?
5171   echo "$as_me:5171: \$? = $ac_status" >&5
5172   (exit "$ac_status"); } &&
5173          { ac_try='test -s "conftest.$ac_objext"'
5174   { (eval echo "$as_me:5174: \"$ac_try\"") >&5
5175   (eval $ac_try) 2>&5
5176   ac_status=$?
5177   echo "$as_me:5177: \$? = $ac_status" >&5
5178   (exit "$ac_status"); }; }; then
5179   :
5180 else
5181   echo "$as_me: failed program was:" >&5
5182 cat "conftest.$ac_ext" >&5
5183 cf_cv_posix_c_source=no
5184 fi
5185 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5186          CFLAGS="$cf_save_CFLAGS"
5187          CPPFLAGS="$cf_save_CPPFLAGS"
5188
5189 fi
5190 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5191
5192 fi
5193 echo "$as_me:5193: result: $cf_cv_posix_c_source" >&5
5194 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5195
5196 if test "$cf_cv_posix_c_source" != no ; then
5197         CFLAGS="$cf_trim_CFLAGS"
5198         CPPFLAGS="$cf_trim_CPPFLAGS"
5199
5200 cf_fix_cppflags=no
5201 cf_new_cflags=
5202 cf_new_cppflags=
5203 cf_new_extra_cppflags=
5204
5205 for cf_add_cflags in $cf_cv_posix_c_source
5206 do
5207 case "$cf_fix_cppflags" in
5208 (no)
5209         case "$cf_add_cflags" in
5210         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5211                 case "$cf_add_cflags" in
5212                 (-D*)
5213                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5214
5215                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5216                                 && test -z "${cf_tst_cflags}" \
5217                                 && cf_fix_cppflags=yes
5218
5219                         if test "$cf_fix_cppflags" = yes ; then
5220
5221         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5222         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5223
5224                                 continue
5225                         elif test "${cf_tst_cflags}" = "\"'" ; then
5226
5227         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5228         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5229
5230                                 continue
5231                         fi
5232                         ;;
5233                 esac
5234                 case "$CPPFLAGS" in
5235                 (*$cf_add_cflags)
5236                         ;;
5237                 (*)
5238                         case "$cf_add_cflags" in
5239                         (-D*)
5240                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5241
5242 CPPFLAGS=`echo "$CPPFLAGS" | \
5243         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5244                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5245
5246                                 ;;
5247                         esac
5248
5249         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5250         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5251
5252                         ;;
5253                 esac
5254                 ;;
5255         (*)
5256
5257         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5258         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5259
5260                 ;;
5261         esac
5262         ;;
5263 (yes)
5264
5265         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5266         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5267
5268         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5269
5270         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5271                 && test -z "${cf_tst_cflags}" \
5272                 && cf_fix_cppflags=no
5273         ;;
5274 esac
5275 done
5276
5277 if test -n "$cf_new_cflags" ; then
5278
5279         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5280         CFLAGS="${CFLAGS}$cf_new_cflags"
5281
5282 fi
5283
5284 if test -n "$cf_new_cppflags" ; then
5285
5286         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5287         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5288
5289 fi
5290
5291 if test -n "$cf_new_extra_cppflags" ; then
5292
5293         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5294         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5295
5296 fi
5297
5298 fi
5299
5300 fi # cf_cv_posix_visible
5301
5302         ;;
5303 esac
5304
5305 if test -n "$cf_xopen_source" ; then
5306
5307 for cf_add_cflags in $cf_xopen_source
5308 do
5309         case "x$cf_add_cflags" in
5310         (x-[DU]*)
5311
5312 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5313 while true
5314 do
5315         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'`
5316         test "$CFLAGS" != "$cf_old_cflag" || break
5317         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
5318
5319 echo "${as_me:-configure}:5319: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
5320
5321         CFLAGS="$cf_old_cflag"
5322 done
5323
5324 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5325 while true
5326 do
5327         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'`
5328         test "$CPPFLAGS" != "$cf_old_cflag" || break
5329         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
5330
5331 echo "${as_me:-configure}:5331: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
5332
5333         CPPFLAGS="$cf_old_cflag"
5334 done
5335
5336                 ;;
5337         esac
5338
5339 cf_fix_cppflags=no
5340 cf_new_cflags=
5341 cf_new_cppflags=
5342 cf_new_extra_cppflags=
5343
5344 for cf_add_cflags in $cf_add_cflags
5345 do
5346 case "$cf_fix_cppflags" in
5347 (no)
5348         case "$cf_add_cflags" in
5349         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5350                 case "$cf_add_cflags" in
5351                 (-D*)
5352                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5353
5354                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5355                                 && test -z "${cf_tst_cflags}" \
5356                                 && cf_fix_cppflags=yes
5357
5358                         if test "$cf_fix_cppflags" = yes ; then
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                                 continue
5364                         elif test "${cf_tst_cflags}" = "\"'" ; then
5365
5366         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5367         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5368
5369                                 continue
5370                         fi
5371                         ;;
5372                 esac
5373                 case "$CPPFLAGS" in
5374                 (*$cf_add_cflags)
5375                         ;;
5376                 (*)
5377                         case "$cf_add_cflags" in
5378                         (-D*)
5379                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5380
5381 CPPFLAGS=`echo "$CPPFLAGS" | \
5382         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5383                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5384
5385                                 ;;
5386                         esac
5387
5388         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5389         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5390
5391                         ;;
5392                 esac
5393                 ;;
5394         (*)
5395
5396         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5397         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5398
5399                 ;;
5400         esac
5401         ;;
5402 (yes)
5403
5404         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5405         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5406
5407         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5408
5409         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5410                 && test -z "${cf_tst_cflags}" \
5411                 && cf_fix_cppflags=no
5412         ;;
5413 esac
5414 done
5415
5416 if test -n "$cf_new_cflags" ; then
5417         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5418
5419 echo "${as_me:-configure}:5419: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5420
5421         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5422         CFLAGS="${CFLAGS}$cf_new_cflags"
5423
5424 fi
5425
5426 if test -n "$cf_new_cppflags" ; then
5427         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5428
5429 echo "${as_me:-configure}:5429: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5430
5431         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5432         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5433
5434 fi
5435
5436 if test -n "$cf_new_extra_cppflags" ; then
5437         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5438
5439 echo "${as_me:-configure}:5439: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5440
5441         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5442         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5443
5444 fi
5445
5446 done
5447
5448 fi
5449
5450 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5451         echo "$as_me:5451: checking if _XOPEN_SOURCE really is set" >&5
5452 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5453         cat >"conftest.$ac_ext" <<_ACEOF
5454 #line 5454 "configure"
5455 #include "confdefs.h"
5456 #include <stdlib.h>
5457 int
5458 main (void)
5459 {
5460
5461 #ifndef _XOPEN_SOURCE
5462 make an error
5463 #endif
5464   ;
5465   return 0;
5466 }
5467 _ACEOF
5468 rm -f "conftest.$ac_objext"
5469 if { (eval echo "$as_me:5469: \"$ac_compile\"") >&5
5470   (eval $ac_compile) 2>&5
5471   ac_status=$?
5472   echo "$as_me:5472: \$? = $ac_status" >&5
5473   (exit "$ac_status"); } &&
5474          { ac_try='test -s "conftest.$ac_objext"'
5475   { (eval echo "$as_me:5475: \"$ac_try\"") >&5
5476   (eval $ac_try) 2>&5
5477   ac_status=$?
5478   echo "$as_me:5478: \$? = $ac_status" >&5
5479   (exit "$ac_status"); }; }; then
5480   cf_XOPEN_SOURCE_set=yes
5481 else
5482   echo "$as_me: failed program was:" >&5
5483 cat "conftest.$ac_ext" >&5
5484 cf_XOPEN_SOURCE_set=no
5485 fi
5486 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5487         echo "$as_me:5487: result: $cf_XOPEN_SOURCE_set" >&5
5488 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5489         if test "$cf_XOPEN_SOURCE_set" = yes
5490         then
5491                 cat >"conftest.$ac_ext" <<_ACEOF
5492 #line 5492 "configure"
5493 #include "confdefs.h"
5494 #include <stdlib.h>
5495 int
5496 main (void)
5497 {
5498
5499 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5500 make an error
5501 #endif
5502   ;
5503   return 0;
5504 }
5505 _ACEOF
5506 rm -f "conftest.$ac_objext"
5507 if { (eval echo "$as_me:5507: \"$ac_compile\"") >&5
5508   (eval $ac_compile) 2>&5
5509   ac_status=$?
5510   echo "$as_me:5510: \$? = $ac_status" >&5
5511   (exit "$ac_status"); } &&
5512          { ac_try='test -s "conftest.$ac_objext"'
5513   { (eval echo "$as_me:5513: \"$ac_try\"") >&5
5514   (eval $ac_try) 2>&5
5515   ac_status=$?
5516   echo "$as_me:5516: \$? = $ac_status" >&5
5517   (exit "$ac_status"); }; }; then
5518   cf_XOPEN_SOURCE_set_ok=yes
5519 else
5520   echo "$as_me: failed program was:" >&5
5521 cat "conftest.$ac_ext" >&5
5522 cf_XOPEN_SOURCE_set_ok=no
5523 fi
5524 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5525                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5526                 then
5527                         { echo "$as_me:5527: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5528 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5529                 fi
5530         else
5531
5532 echo "$as_me:5532: checking if we should define _XOPEN_SOURCE" >&5
5533 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5534 if test "${cf_cv_xopen_source+set}" = set; then
5535   echo $ECHO_N "(cached) $ECHO_C" >&6
5536 else
5537
5538         cat >"conftest.$ac_ext" <<_ACEOF
5539 #line 5539 "configure"
5540 #include "confdefs.h"
5541
5542 #include <stdlib.h>
5543 #include <string.h>
5544 #include <sys/types.h>
5545
5546 int
5547 main (void)
5548 {
5549
5550 #ifndef _XOPEN_SOURCE
5551 make an error
5552 #endif
5553   ;
5554   return 0;
5555 }
5556 _ACEOF
5557 rm -f "conftest.$ac_objext"
5558 if { (eval echo "$as_me:5558: \"$ac_compile\"") >&5
5559   (eval $ac_compile) 2>&5
5560   ac_status=$?
5561   echo "$as_me:5561: \$? = $ac_status" >&5
5562   (exit "$ac_status"); } &&
5563          { ac_try='test -s "conftest.$ac_objext"'
5564   { (eval echo "$as_me:5564: \"$ac_try\"") >&5
5565   (eval $ac_try) 2>&5
5566   ac_status=$?
5567   echo "$as_me:5567: \$? = $ac_status" >&5
5568   (exit "$ac_status"); }; }; then
5569   cf_cv_xopen_source=no
5570 else
5571   echo "$as_me: failed program was:" >&5
5572 cat "conftest.$ac_ext" >&5
5573 cf_save="$CPPFLAGS"
5574
5575         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5576         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5577
5578          cat >"conftest.$ac_ext" <<_ACEOF
5579 #line 5579 "configure"
5580 #include "confdefs.h"
5581
5582 #include <stdlib.h>
5583 #include <string.h>
5584 #include <sys/types.h>
5585
5586 int
5587 main (void)
5588 {
5589
5590 #ifdef _XOPEN_SOURCE
5591 make an error
5592 #endif
5593   ;
5594   return 0;
5595 }
5596 _ACEOF
5597 rm -f "conftest.$ac_objext"
5598 if { (eval echo "$as_me:5598: \"$ac_compile\"") >&5
5599   (eval $ac_compile) 2>&5
5600   ac_status=$?
5601   echo "$as_me:5601: \$? = $ac_status" >&5
5602   (exit "$ac_status"); } &&
5603          { ac_try='test -s "conftest.$ac_objext"'
5604   { (eval echo "$as_me:5604: \"$ac_try\"") >&5
5605   (eval $ac_try) 2>&5
5606   ac_status=$?
5607   echo "$as_me:5607: \$? = $ac_status" >&5
5608   (exit "$ac_status"); }; }; then
5609   cf_cv_xopen_source=no
5610 else
5611   echo "$as_me: failed program was:" >&5
5612 cat "conftest.$ac_ext" >&5
5613 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5614 fi
5615 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5616         CPPFLAGS="$cf_save"
5617
5618 fi
5619 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5620
5621 fi
5622 echo "$as_me:5622: result: $cf_cv_xopen_source" >&5
5623 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5624
5625 if test "$cf_cv_xopen_source" != no ; then
5626
5627 CFLAGS=`echo "$CFLAGS" | \
5628         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5629                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5630
5631 CPPFLAGS=`echo "$CPPFLAGS" | \
5632         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5633                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5634
5635         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5636
5637 for cf_add_cflags in $cf_temp_xopen_source
5638 do
5639         case "x$cf_add_cflags" in
5640         (x-[DU]*)
5641
5642 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5643 while true
5644 do
5645         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'`
5646         test "$CFLAGS" != "$cf_old_cflag" || break
5647
5648         CFLAGS="$cf_old_cflag"
5649 done
5650
5651 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5652 while true
5653 do
5654         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'`
5655         test "$CPPFLAGS" != "$cf_old_cflag" || break
5656
5657         CPPFLAGS="$cf_old_cflag"
5658 done
5659
5660                 ;;
5661         esac
5662
5663 cf_fix_cppflags=no
5664 cf_new_cflags=
5665 cf_new_cppflags=
5666 cf_new_extra_cppflags=
5667
5668 for cf_add_cflags in $cf_add_cflags
5669 do
5670 case "$cf_fix_cppflags" in
5671 (no)
5672         case "$cf_add_cflags" in
5673         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5674                 case "$cf_add_cflags" in
5675                 (-D*)
5676                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5677
5678                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5679                                 && test -z "${cf_tst_cflags}" \
5680                                 && cf_fix_cppflags=yes
5681
5682                         if test "$cf_fix_cppflags" = yes ; then
5683
5684         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5685         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5686
5687                                 continue
5688                         elif test "${cf_tst_cflags}" = "\"'" ; then
5689
5690         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5691         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5692
5693                                 continue
5694                         fi
5695                         ;;
5696                 esac
5697                 case "$CPPFLAGS" in
5698                 (*$cf_add_cflags)
5699                         ;;
5700                 (*)
5701                         case "$cf_add_cflags" in
5702                         (-D*)
5703                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5704
5705 CPPFLAGS=`echo "$CPPFLAGS" | \
5706         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5707                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5708
5709                                 ;;
5710                         esac
5711
5712         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5713         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5714
5715                         ;;
5716                 esac
5717                 ;;
5718         (*)
5719
5720         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5721         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5722
5723                 ;;
5724         esac
5725         ;;
5726 (yes)
5727
5728         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5729         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5730
5731         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5732
5733         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5734                 && test -z "${cf_tst_cflags}" \
5735                 && cf_fix_cppflags=no
5736         ;;
5737 esac
5738 done
5739
5740 if test -n "$cf_new_cflags" ; then
5741
5742         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5743         CFLAGS="${CFLAGS}$cf_new_cflags"
5744
5745 fi
5746
5747 if test -n "$cf_new_cppflags" ; then
5748
5749         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5750         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5751
5752 fi
5753
5754 if test -n "$cf_new_extra_cppflags" ; then
5755
5756         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5757         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5758
5759 fi
5760
5761 done
5762
5763 fi
5764
5765         fi
5766 fi
5767 fi # cf_cv_posix_visible
5768
5769 echo "$as_me:5769: checking for signal global datatype" >&5
5770 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5771 if test "${cf_cv_sig_atomic_t+set}" = set; then
5772   echo $ECHO_N "(cached) $ECHO_C" >&6
5773 else
5774
5775         for cf_type in \
5776                 "volatile sig_atomic_t" \
5777                 "sig_atomic_t" \
5778                 "int"
5779         do
5780         cat >"conftest.$ac_ext" <<_ACEOF
5781 #line 5781 "configure"
5782 #include "confdefs.h"
5783
5784 #include <sys/types.h>
5785 #include <signal.h>
5786 #include <stdio.h>
5787
5788 extern $cf_type x;
5789 $cf_type x;
5790 static void handler(int sig)
5791 {
5792         (void)sig;
5793         x = 5;
5794 }
5795 int
5796 main (void)
5797 {
5798 signal(SIGINT, handler);
5799                  x = 1
5800   ;
5801   return 0;
5802 }
5803 _ACEOF
5804 rm -f "conftest.$ac_objext"
5805 if { (eval echo "$as_me:5805: \"$ac_compile\"") >&5
5806   (eval $ac_compile) 2>&5
5807   ac_status=$?
5808   echo "$as_me:5808: \$? = $ac_status" >&5
5809   (exit "$ac_status"); } &&
5810          { ac_try='test -s "conftest.$ac_objext"'
5811   { (eval echo "$as_me:5811: \"$ac_try\"") >&5
5812   (eval $ac_try) 2>&5
5813   ac_status=$?
5814   echo "$as_me:5814: \$? = $ac_status" >&5
5815   (exit "$ac_status"); }; }; then
5816   cf_cv_sig_atomic_t=$cf_type
5817 else
5818   echo "$as_me: failed program was:" >&5
5819 cat "conftest.$ac_ext" >&5
5820 cf_cv_sig_atomic_t=no
5821 fi
5822 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5823                 test "$cf_cv_sig_atomic_t" != no && break
5824         done
5825
5826 fi
5827
5828 echo "$as_me:5828: result: $cf_cv_sig_atomic_t" >&5
5829 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5830 test "$cf_cv_sig_atomic_t" != no &&
5831 cat >>confdefs.h <<EOF
5832 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5833 EOF
5834
5835 # Work around breakage on OS X
5836
5837 echo "$as_me:5837: checking if SIGWINCH is defined" >&5
5838 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5839 if test "${cf_cv_define_sigwinch+set}" = set; then
5840   echo $ECHO_N "(cached) $ECHO_C" >&6
5841 else
5842
5843         cat >"conftest.$ac_ext" <<_ACEOF
5844 #line 5844 "configure"
5845 #include "confdefs.h"
5846
5847 #include <sys/types.h>
5848 #include <sys/signal.h>
5849
5850 int
5851 main (void)
5852 {
5853 int x = SIGWINCH; (void)x
5854   ;
5855   return 0;
5856 }
5857 _ACEOF
5858 rm -f "conftest.$ac_objext"
5859 if { (eval echo "$as_me:5859: \"$ac_compile\"") >&5
5860   (eval $ac_compile) 2>&5
5861   ac_status=$?
5862   echo "$as_me:5862: \$? = $ac_status" >&5
5863   (exit "$ac_status"); } &&
5864          { ac_try='test -s "conftest.$ac_objext"'
5865   { (eval echo "$as_me:5865: \"$ac_try\"") >&5
5866   (eval $ac_try) 2>&5
5867   ac_status=$?
5868   echo "$as_me:5868: \$? = $ac_status" >&5
5869   (exit "$ac_status"); }; }; then
5870   cf_cv_define_sigwinch=yes
5871 else
5872   echo "$as_me: failed program was:" >&5
5873 cat "conftest.$ac_ext" >&5
5874 cat >"conftest.$ac_ext" <<_ACEOF
5875 #line 5875 "configure"
5876 #include "confdefs.h"
5877
5878 #undef _XOPEN_SOURCE
5879 #undef _POSIX_SOURCE
5880 #undef _POSIX_C_SOURCE
5881 #include <sys/types.h>
5882 #include <sys/signal.h>
5883
5884 int
5885 main (void)
5886 {
5887 int x = SIGWINCH; (void)x
5888   ;
5889   return 0;
5890 }
5891 _ACEOF
5892 rm -f "conftest.$ac_objext"
5893 if { (eval echo "$as_me:5893: \"$ac_compile\"") >&5
5894   (eval $ac_compile) 2>&5
5895   ac_status=$?
5896   echo "$as_me:5896: \$? = $ac_status" >&5
5897   (exit "$ac_status"); } &&
5898          { ac_try='test -s "conftest.$ac_objext"'
5899   { (eval echo "$as_me:5899: \"$ac_try\"") >&5
5900   (eval $ac_try) 2>&5
5901   ac_status=$?
5902   echo "$as_me:5902: \$? = $ac_status" >&5
5903   (exit "$ac_status"); }; }; then
5904   cf_cv_define_sigwinch=maybe
5905 else
5906   echo "$as_me: failed program was:" >&5
5907 cat "conftest.$ac_ext" >&5
5908 cf_cv_define_sigwinch=no
5909 fi
5910 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5911
5912 fi
5913 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5914
5915 fi
5916 echo "$as_me:5916: result: $cf_cv_define_sigwinch" >&5
5917 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5918
5919 if test "$cf_cv_define_sigwinch" = maybe ; then
5920 echo "$as_me:5920: checking for actual SIGWINCH definition" >&5
5921 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5922 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5923   echo $ECHO_N "(cached) $ECHO_C" >&6
5924 else
5925
5926 cf_cv_fixup_sigwinch=unknown
5927 cf_sigwinch=32
5928 while test "$cf_sigwinch" != 1
5929 do
5930         cat >"conftest.$ac_ext" <<_ACEOF
5931 #line 5931 "configure"
5932 #include "confdefs.h"
5933
5934 #undef _XOPEN_SOURCE
5935 #undef _POSIX_SOURCE
5936 #undef _POSIX_C_SOURCE
5937 #include <sys/types.h>
5938 #include <sys/signal.h>
5939
5940 int
5941 main (void)
5942 {
5943
5944 #if SIGWINCH != $cf_sigwinch
5945 make an error
5946 #endif
5947 int x = SIGWINCH; (void)x
5948   ;
5949   return 0;
5950 }
5951 _ACEOF
5952 rm -f "conftest.$ac_objext"
5953 if { (eval echo "$as_me:5953: \"$ac_compile\"") >&5
5954   (eval $ac_compile) 2>&5
5955   ac_status=$?
5956   echo "$as_me:5956: \$? = $ac_status" >&5
5957   (exit "$ac_status"); } &&
5958          { ac_try='test -s "conftest.$ac_objext"'
5959   { (eval echo "$as_me:5959: \"$ac_try\"") >&5
5960   (eval $ac_try) 2>&5
5961   ac_status=$?
5962   echo "$as_me:5962: \$? = $ac_status" >&5
5963   (exit "$ac_status"); }; }; then
5964   cf_cv_fixup_sigwinch=$cf_sigwinch
5965          break
5966 else
5967   echo "$as_me: failed program was:" >&5
5968 cat "conftest.$ac_ext" >&5
5969 fi
5970 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5971
5972 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
5973 done
5974
5975 fi
5976 echo "$as_me:5976: result: $cf_cv_fixup_sigwinch" >&5
5977 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5978
5979         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5980                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5981         fi
5982 fi
5983
5984 # Checks for CODESET support.
5985
5986 echo "$as_me:5986: checking for nl_langinfo and CODESET" >&5
5987 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5988 if test "${am_cv_langinfo_codeset+set}" = set; then
5989   echo $ECHO_N "(cached) $ECHO_C" >&6
5990 else
5991   cat >"conftest.$ac_ext" <<_ACEOF
5992 #line 5992 "configure"
5993 #include "confdefs.h"
5994 #include <langinfo.h>
5995 int
5996 main (void)
5997 {
5998 char* cs = nl_langinfo(CODESET); (void)cs
5999   ;
6000   return 0;
6001 }
6002 _ACEOF
6003 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6004 if { (eval echo "$as_me:6004: \"$ac_link\"") >&5
6005   (eval $ac_link) 2>&5
6006   ac_status=$?
6007   echo "$as_me:6007: \$? = $ac_status" >&5
6008   (exit "$ac_status"); } &&
6009          { ac_try='test -s "conftest$ac_exeext"'
6010   { (eval echo "$as_me:6010: \"$ac_try\"") >&5
6011   (eval $ac_try) 2>&5
6012   ac_status=$?
6013   echo "$as_me:6013: \$? = $ac_status" >&5
6014   (exit "$ac_status"); }; }; then
6015   am_cv_langinfo_codeset=yes
6016 else
6017   echo "$as_me: failed program was:" >&5
6018 cat "conftest.$ac_ext" >&5
6019 am_cv_langinfo_codeset=no
6020 fi
6021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6022
6023 fi
6024 echo "$as_me:6024: result: $am_cv_langinfo_codeset" >&5
6025 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
6026         if test "$am_cv_langinfo_codeset" = yes; then
6027
6028 cat >>confdefs.h <<\EOF
6029 #define HAVE_LANGINFO_CODESET 1
6030 EOF
6031
6032         fi
6033
6034 echo "$as_me:6034: checking if you want to use pkg-config" >&5
6035 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
6036
6037 # Check whether --with-pkg-config or --without-pkg-config was given.
6038 if test "${with_pkg_config+set}" = set; then
6039   withval="$with_pkg_config"
6040   cf_pkg_config=$withval
6041 else
6042   cf_pkg_config=yes
6043 fi;
6044 echo "$as_me:6044: result: $cf_pkg_config" >&5
6045 echo "${ECHO_T}$cf_pkg_config" >&6
6046
6047 case "$cf_pkg_config" in
6048 (no)
6049         PKG_CONFIG=none
6050         ;;
6051 (yes)
6052
6053 if test -n "$ac_tool_prefix"; then
6054   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
6055 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
6056 echo "$as_me:6056: checking for $ac_word" >&5
6057 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6058 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
6059   echo $ECHO_N "(cached) $ECHO_C" >&6
6060 else
6061   case $PKG_CONFIG in
6062   [\\/]* | ?:[\\/]*)
6063   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6064   ;;
6065   *)
6066   ac_save_IFS=$IFS; IFS=$ac_path_separator
6067 ac_dummy="$PATH"
6068 for ac_dir in $ac_dummy; do
6069   IFS=$ac_save_IFS
6070   test -z "$ac_dir" && ac_dir=.
6071   if $as_executable_p "$ac_dir/$ac_word"; then
6072    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
6073    echo "$as_me:6073: found $ac_dir/$ac_word" >&5
6074    break
6075 fi
6076 done
6077
6078   ;;
6079 esac
6080 fi
6081 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
6082
6083 if test -n "$PKG_CONFIG"; then
6084   echo "$as_me:6084: result: $PKG_CONFIG" >&5
6085 echo "${ECHO_T}$PKG_CONFIG" >&6
6086 else
6087   echo "$as_me:6087: result: no" >&5
6088 echo "${ECHO_T}no" >&6
6089 fi
6090
6091 fi
6092 if test -z "$ac_cv_path_PKG_CONFIG"; then
6093   ac_pt_PKG_CONFIG=$PKG_CONFIG
6094   # Extract the first word of "pkg-config", so it can be a program name with args.
6095 set dummy pkg-config; ac_word=$2
6096 echo "$as_me:6096: checking for $ac_word" >&5
6097 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6098 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6099   echo $ECHO_N "(cached) $ECHO_C" >&6
6100 else
6101   case $ac_pt_PKG_CONFIG in
6102   [\\/]* | ?:[\\/]*)
6103   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6104   ;;
6105   *)
6106   ac_save_IFS=$IFS; IFS=$ac_path_separator
6107 ac_dummy="$PATH"
6108 for ac_dir in $ac_dummy; do
6109   IFS=$ac_save_IFS
6110   test -z "$ac_dir" && ac_dir=.
6111   if $as_executable_p "$ac_dir/$ac_word"; then
6112    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
6113    echo "$as_me:6113: found $ac_dir/$ac_word" >&5
6114    break
6115 fi
6116 done
6117
6118   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6119   ;;
6120 esac
6121 fi
6122 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6123
6124 if test -n "$ac_pt_PKG_CONFIG"; then
6125   echo "$as_me:6125: result: $ac_pt_PKG_CONFIG" >&5
6126 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6127 else
6128   echo "$as_me:6128: result: no" >&5
6129 echo "${ECHO_T}no" >&6
6130 fi
6131
6132   PKG_CONFIG=$ac_pt_PKG_CONFIG
6133 else
6134   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6135 fi
6136
6137         ;;
6138 (*)
6139         PKG_CONFIG=$withval
6140         ;;
6141 esac
6142
6143 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6144 if test "$PKG_CONFIG" != none ; then
6145
6146 if test "x$prefix" != xNONE; then
6147         cf_path_syntax="$prefix"
6148 else
6149         cf_path_syntax="$ac_default_prefix"
6150 fi
6151
6152 case ".$PKG_CONFIG" in
6153 (.\$\(*\)*|.\'*\'*)
6154         ;;
6155 (..|./*|.\\*)
6156         ;;
6157 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6158         ;;
6159 (.\$\{*prefix\}*|.\$\{*dir\}*)
6160         eval PKG_CONFIG="$PKG_CONFIG"
6161         case ".$PKG_CONFIG" in
6162         (.NONE/*)
6163                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6164                 ;;
6165         esac
6166         ;;
6167 (.no|.NONE/*)
6168         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6169         ;;
6170 (*)
6171         { { echo "$as_me:6171: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6172 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6173    { (exit 1); exit 1; }; }
6174         ;;
6175 esac
6176
6177 elif test "x$cf_pkg_config" != xno ; then
6178         { echo "$as_me:6178: WARNING: pkg-config is not installed" >&5
6179 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6180 fi
6181
6182 echo "$as_me:6182: checking if you want to see long compiling messages" >&5
6183 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6184
6185 # Check whether --enable-echo or --disable-echo was given.
6186 if test "${enable_echo+set}" = set; then
6187   enableval="$enable_echo"
6188   test "$enableval" != no && enableval=yes
6189         if test "$enableval" != "yes" ; then
6190
6191         ECHO_LT='--silent'
6192         ECHO_LD='@echo linking $@;'
6193         RULE_CC='@echo compiling $<'
6194         SHOW_CC='@echo compiling $@'
6195         ECHO_CC='@'
6196
6197         else
6198
6199         ECHO_LT=''
6200         ECHO_LD=''
6201         RULE_CC=''
6202         SHOW_CC=''
6203         ECHO_CC=''
6204
6205         fi
6206 else
6207   enableval=yes
6208
6209         ECHO_LT=''
6210         ECHO_LD=''
6211         RULE_CC=''
6212         SHOW_CC=''
6213         ECHO_CC=''
6214
6215 fi;
6216 echo "$as_me:6216: result: $enableval" >&5
6217 echo "${ECHO_T}$enableval" >&6
6218
6219 echo "$as_me:6219: checking for ncurses wrap-prefix" >&5
6220 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6221
6222 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6223 if test "${with_ncurses_wrap_prefix+set}" = set; then
6224   withval="$with_ncurses_wrap_prefix"
6225   NCURSES_WRAP_PREFIX=$withval
6226 else
6227   NCURSES_WRAP_PREFIX=_nc_
6228 fi;
6229 echo "$as_me:6229: result: $NCURSES_WRAP_PREFIX" >&5
6230 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6231
6232 echo "$as_me:6232: checking if you want to check for wide-character functions" >&5
6233 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6234
6235 # Check whether --enable-widec or --disable-widec was given.
6236 if test "${enable_widec+set}" = set; then
6237   enableval="$enable_widec"
6238   test "$enableval" != no && enableval=yes
6239         if test "$enableval" != "yes" ; then
6240     cf_enable_widec=no
6241         else
6242                 cf_enable_widec=yes
6243         fi
6244 else
6245   enableval=yes
6246         cf_enable_widec=yes
6247
6248 fi;
6249 echo "$as_me:6249: result: $cf_enable_widec" >&5
6250 echo "${ECHO_T}$cf_enable_widec" >&6
6251
6252 echo "$as_me:6252: checking for specific curses-directory" >&5
6253 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6254
6255 # Check whether --with-curses-dir or --without-curses-dir was given.
6256 if test "${with_curses_dir+set}" = set; then
6257   withval="$with_curses_dir"
6258   cf_cv_curses_dir=$withval
6259 else
6260   cf_cv_curses_dir=no
6261 fi;
6262 echo "$as_me:6262: result: $cf_cv_curses_dir" >&5
6263 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6264
6265 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6266 then
6267
6268 if test "x$prefix" != xNONE; then
6269         cf_path_syntax="$prefix"
6270 else
6271         cf_path_syntax="$ac_default_prefix"
6272 fi
6273
6274 case ".$withval" in
6275 (.\$\(*\)*|.\'*\'*)
6276         ;;
6277 (..|./*|.\\*)
6278         ;;
6279 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6280         ;;
6281 (.\$\{*prefix\}*|.\$\{*dir\}*)
6282         eval withval="$withval"
6283         case ".$withval" in
6284         (.NONE/*)
6285                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6286                 ;;
6287         esac
6288         ;;
6289 (.no|.NONE/*)
6290         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6291         ;;
6292 (*)
6293         { { echo "$as_me:6293: error: expected a pathname, not \"$withval\"" >&5
6294 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6295    { (exit 1); exit 1; }; }
6296         ;;
6297 esac
6298
6299         if test -d "$cf_cv_curses_dir"
6300         then
6301
6302 if test -n "$cf_cv_curses_dir/include" ; then
6303   for cf_add_incdir in $cf_cv_curses_dir/include
6304   do
6305         while test "$cf_add_incdir" != /usr/include
6306         do
6307           if test -d "$cf_add_incdir"
6308           then
6309                 cf_have_incdir=no
6310                 if test -n "$CFLAGS$CPPFLAGS" ; then
6311                   # a loop is needed to ensure we can add subdirs of existing dirs
6312                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6313                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6314                           cf_have_incdir=yes; break
6315                         fi
6316                   done
6317                 fi
6318
6319                 if test "$cf_have_incdir" = no ; then
6320                   if test "$cf_add_incdir" = /usr/local/include ; then
6321                         if test "$GCC" = yes
6322                         then
6323                           cf_save_CPPFLAGS=$CPPFLAGS
6324
6325         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6326         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6327
6328                           cat >"conftest.$ac_ext" <<_ACEOF
6329 #line 6329 "configure"
6330 #include "confdefs.h"
6331 #include <stdio.h>
6332 int
6333 main (void)
6334 {
6335 printf("Hello")
6336   ;
6337   return 0;
6338 }
6339 _ACEOF
6340 rm -f "conftest.$ac_objext"
6341 if { (eval echo "$as_me:6341: \"$ac_compile\"") >&5
6342   (eval $ac_compile) 2>&5
6343   ac_status=$?
6344   echo "$as_me:6344: \$? = $ac_status" >&5
6345   (exit "$ac_status"); } &&
6346          { ac_try='test -s "conftest.$ac_objext"'
6347   { (eval echo "$as_me:6347: \"$ac_try\"") >&5
6348   (eval $ac_try) 2>&5
6349   ac_status=$?
6350   echo "$as_me:6350: \$? = $ac_status" >&5
6351   (exit "$ac_status"); }; }; then
6352   :
6353 else
6354   echo "$as_me: failed program was:" >&5
6355 cat "conftest.$ac_ext" >&5
6356 cf_have_incdir=yes
6357 fi
6358 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6359                           CPPFLAGS=$cf_save_CPPFLAGS
6360                         fi
6361                   fi
6362                 fi
6363
6364                 if test "$cf_have_incdir" = no ; then
6365                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6366
6367 echo "${as_me:-configure}:6367: testing adding $cf_add_incdir to include-path ..." 1>&5
6368
6369                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6370
6371                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6372                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6373                   cf_add_incdir="$cf_top_incdir"
6374                 else
6375                   break
6376                 fi
6377           else
6378                 break
6379           fi
6380         done
6381   done
6382 fi
6383
6384 if test -n "$cf_cv_curses_dir/lib" ; then
6385         for cf_add_libdir in $cf_cv_curses_dir/lib
6386         do
6387                 if test "$cf_add_libdir" = /usr/lib ; then
6388                         :
6389                 elif test -d "$cf_add_libdir"
6390                 then
6391                         cf_have_libdir=no
6392                         if test -n "$LDFLAGS$LIBS" ; then
6393                                 # a loop is needed to ensure we can add subdirs of existing dirs
6394                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6395                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6396                                                 cf_have_libdir=yes; break
6397                                         fi
6398                                 done
6399                         fi
6400                         if test "$cf_have_libdir" = no ; then
6401                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6402
6403 echo "${as_me:-configure}:6403: testing adding $cf_add_libdir to library-path ..." 1>&5
6404
6405                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6406                         fi
6407                 fi
6408         done
6409 fi
6410
6411         fi
6412 fi
6413
6414 cf_cv_screen=curses
6415
6416 echo "$as_me:6416: checking for specified curses library type" >&5
6417 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6418
6419 # Check whether --with-screen or --without-screen was given.
6420 if test "${with_screen+set}" = set; then
6421   withval="$with_screen"
6422   cf_cv_screen=$withval
6423 else
6424
6425 # Check whether --with-ncursesw or --without-ncursesw was given.
6426 if test "${with_ncursesw+set}" = set; then
6427   withval="$with_ncursesw"
6428   cf_cv_screen=ncursesw
6429 else
6430
6431 # Check whether --with-ncurses or --without-ncurses was given.
6432 if test "${with_ncurses+set}" = set; then
6433   withval="$with_ncurses"
6434   cf_cv_screen=ncurses
6435 else
6436
6437 # Check whether --with-pdcurses or --without-pdcurses was given.
6438 if test "${with_pdcurses+set}" = set; then
6439   withval="$with_pdcurses"
6440   cf_cv_screen=pdcurses
6441 else
6442
6443 # Check whether --with-curses-colr or --without-curses-colr was given.
6444 if test "${with_curses_colr+set}" = set; then
6445   withval="$with_curses_colr"
6446   cf_cv_screen=curses_colr
6447 else
6448
6449 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6450 if test "${with_curses_5lib+set}" = set; then
6451   withval="$with_curses_5lib"
6452   cf_cv_screen=curses_5lib
6453 fi;
6454 fi;
6455 fi;
6456 fi;
6457 fi;
6458 fi;
6459
6460 echo "$as_me:6460: result: $cf_cv_screen" >&5
6461 echo "${ECHO_T}$cf_cv_screen" >&6
6462
6463 case $cf_cv_screen in
6464 (curses|curses_*)
6465
6466 echo "$as_me:6466: checking for extra include directories" >&5
6467 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6468 if test "${cf_cv_curses_incdir+set}" = set; then
6469   echo $ECHO_N "(cached) $ECHO_C" >&6
6470 else
6471
6472 cf_cv_curses_incdir=no
6473 case "$host_os" in
6474 (hpux10.*)
6475         if test "x$cf_cv_screen" = "xcurses_colr"
6476         then
6477                 test -d /usr/include/curses_colr && \
6478                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6479         fi
6480         ;;
6481 (sunos3*|sunos4*)
6482         if test "x$cf_cv_screen" = "xcurses_5lib"
6483         then
6484                 test -d /usr/5lib && \
6485                 test -d /usr/5include && \
6486                 cf_cv_curses_incdir="-I/usr/5include"
6487         fi
6488         ;;
6489 esac
6490
6491 fi
6492 echo "$as_me:6492: result: $cf_cv_curses_incdir" >&5
6493 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6494 if test "$cf_cv_curses_incdir" != no
6495 then
6496
6497         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6498         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6499
6500 fi
6501
6502 echo "$as_me:6502: checking if we have identified curses headers" >&5
6503 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6504 if test "${cf_cv_ncurses_header+set}" = set; then
6505   echo $ECHO_N "(cached) $ECHO_C" >&6
6506 else
6507
6508 cf_cv_ncurses_header=none
6509 for cf_header in \
6510         ncurses.h  \
6511         curses.h  ncurses/ncurses.h ncurses/curses.h
6512 do
6513 cat >"conftest.$ac_ext" <<_ACEOF
6514 #line 6514 "configure"
6515 #include "confdefs.h"
6516 #include <${cf_header}>
6517 int
6518 main (void)
6519 {
6520 initscr(); tgoto("?", 0,0)
6521   ;
6522   return 0;
6523 }
6524 _ACEOF
6525 rm -f "conftest.$ac_objext"
6526 if { (eval echo "$as_me:6526: \"$ac_compile\"") >&5
6527   (eval $ac_compile) 2>&5
6528   ac_status=$?
6529   echo "$as_me:6529: \$? = $ac_status" >&5
6530   (exit "$ac_status"); } &&
6531          { ac_try='test -s "conftest.$ac_objext"'
6532   { (eval echo "$as_me:6532: \"$ac_try\"") >&5
6533   (eval $ac_try) 2>&5
6534   ac_status=$?
6535   echo "$as_me:6535: \$? = $ac_status" >&5
6536   (exit "$ac_status"); }; }; then
6537   cf_cv_ncurses_header=$cf_header; break
6538 else
6539   echo "$as_me: failed program was:" >&5
6540 cat "conftest.$ac_ext" >&5
6541 fi
6542 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6543 done
6544
6545 fi
6546 echo "$as_me:6546: result: $cf_cv_ncurses_header" >&5
6547 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6548
6549 if test "$cf_cv_ncurses_header" = none ; then
6550         { { echo "$as_me:6550: error: No curses header-files found" >&5
6551 echo "$as_me: error: No curses header-files found" >&2;}
6552    { (exit 1); exit 1; }; }
6553 fi
6554
6555 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6556
6557 for ac_header in $cf_cv_ncurses_header
6558 do
6559 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6560 echo "$as_me:6560: checking for $ac_header" >&5
6561 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6562 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6563   echo $ECHO_N "(cached) $ECHO_C" >&6
6564 else
6565   cat >"conftest.$ac_ext" <<_ACEOF
6566 #line 6566 "configure"
6567 #include "confdefs.h"
6568 #include <$ac_header>
6569 _ACEOF
6570 if { (eval echo "$as_me:6570: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6571   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6572   ac_status=$?
6573   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6574   rm -f conftest.er1
6575   cat conftest.err >&5
6576   echo "$as_me:6576: \$? = $ac_status" >&5
6577   (exit "$ac_status"); } >/dev/null; then
6578   if test -s conftest.err; then
6579     ac_cpp_err=$ac_c_preproc_warn_flag
6580   else
6581     ac_cpp_err=
6582   fi
6583 else
6584   ac_cpp_err=yes
6585 fi
6586 if test -z "$ac_cpp_err"; then
6587   eval "$as_ac_Header=yes"
6588 else
6589   echo "$as_me: failed program was:" >&5
6590   cat "conftest.$ac_ext" >&5
6591   eval "$as_ac_Header=no"
6592 fi
6593 rm -f conftest.err "conftest.$ac_ext"
6594 fi
6595 echo "$as_me:6595: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6596 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6597 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6598   cat >>confdefs.h <<EOF
6599 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6600 EOF
6601
6602 fi
6603 done
6604
6605 echo "$as_me:6605: checking for terminfo header" >&5
6606 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6607 if test "${cf_cv_term_header+set}" = set; then
6608   echo $ECHO_N "(cached) $ECHO_C" >&6
6609 else
6610
6611 case "${cf_cv_ncurses_header}" in
6612 (*/ncurses.h|*/ncursesw.h)
6613         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6614         ;;
6615 (*)
6616         cf_term_header=term.h
6617         ;;
6618 esac
6619
6620 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6621 do
6622 cat >"conftest.$ac_ext" <<_ACEOF
6623 #line 6623 "configure"
6624 #include "confdefs.h"
6625 #include <stdio.h>
6626 #include <${cf_cv_ncurses_header:-curses.h}>
6627 #include <$cf_test>
6628
6629 int
6630 main (void)
6631 {
6632 int x = auto_left_margin; (void)x
6633   ;
6634   return 0;
6635 }
6636 _ACEOF
6637 rm -f "conftest.$ac_objext"
6638 if { (eval echo "$as_me:6638: \"$ac_compile\"") >&5
6639   (eval $ac_compile) 2>&5
6640   ac_status=$?
6641   echo "$as_me:6641: \$? = $ac_status" >&5
6642   (exit "$ac_status"); } &&
6643          { ac_try='test -s "conftest.$ac_objext"'
6644   { (eval echo "$as_me:6644: \"$ac_try\"") >&5
6645   (eval $ac_try) 2>&5
6646   ac_status=$?
6647   echo "$as_me:6647: \$? = $ac_status" >&5
6648   (exit "$ac_status"); }; }; then
6649
6650         cf_cv_term_header="$cf_test"
6651 else
6652   echo "$as_me: failed program was:" >&5
6653 cat "conftest.$ac_ext" >&5
6654
6655         cf_cv_term_header=unknown
6656
6657 fi
6658 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6659         test "$cf_cv_term_header" != unknown && break
6660 done
6661
6662 fi
6663 echo "$as_me:6663: result: $cf_cv_term_header" >&5
6664 echo "${ECHO_T}$cf_cv_term_header" >&6
6665
6666 # Set definitions to allow ifdef'ing to accommodate subdirectories
6667
6668 case "$cf_cv_term_header" in
6669 (*term.h)
6670
6671 cat >>confdefs.h <<\EOF
6672 #define HAVE_TERM_H 1
6673 EOF
6674
6675         ;;
6676 esac
6677
6678 case "$cf_cv_term_header" in
6679 (ncurses/term.h)
6680
6681 cat >>confdefs.h <<\EOF
6682 #define HAVE_NCURSES_TERM_H 1
6683 EOF
6684
6685         ;;
6686 (ncursesw/term.h)
6687
6688 cat >>confdefs.h <<\EOF
6689 #define HAVE_NCURSESW_TERM_H 1
6690 EOF
6691
6692         ;;
6693 esac
6694
6695 echo "$as_me:6695: checking for ncurses version" >&5
6696 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6697 if test "${cf_cv_ncurses_version+set}" = set; then
6698   echo $ECHO_N "(cached) $ECHO_C" >&6
6699 else
6700
6701         cf_cv_ncurses_version=no
6702         cf_tempfile=out$$
6703         rm -f "$cf_tempfile"
6704         if test "$cross_compiling" = yes; then
6705
6706         # This will not work if the preprocessor splits the line after the
6707         # Autoconf token.  The 'unproto' program does that.
6708         cat > "conftest.$ac_ext" <<EOF
6709 #include <${cf_cv_ncurses_header:-curses.h}>
6710 #undef Autoconf
6711 #ifdef NCURSES_VERSION
6712 Autoconf NCURSES_VERSION
6713 #else
6714 #ifdef __NCURSES_H
6715 Autoconf "old"
6716 #endif
6717 ;
6718 #endif
6719 EOF
6720         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6721         { (eval echo "$as_me:6721: \"$cf_try\"") >&5
6722   (eval $cf_try) 2>&5
6723   ac_status=$?
6724   echo "$as_me:6724: \$? = $ac_status" >&5
6725   (exit "$ac_status"); }
6726         if test -f conftest.out ; then
6727                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6728                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6729                 rm -f conftest.out
6730         fi
6731
6732 else
6733   cat >"conftest.$ac_ext" <<_ACEOF
6734 #line 6734 "configure"
6735 #include "confdefs.h"
6736
6737 #include <${cf_cv_ncurses_header:-curses.h}>
6738 #include <stdio.h>
6739 int main(void)
6740 {
6741         FILE *fp = fopen("$cf_tempfile", "w");
6742 #ifdef NCURSES_VERSION
6743 # ifdef NCURSES_VERSION_PATCH
6744         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6745 # else
6746         fprintf(fp, "%s\\n", NCURSES_VERSION);
6747 # endif
6748 #else
6749 # ifdef __NCURSES_H
6750         fprintf(fp, "old\\n");
6751 # else
6752         make an error
6753 # endif
6754 #endif
6755         ${cf_cv_main_return:-return}(0);
6756 }
6757 _ACEOF
6758 rm -f "conftest$ac_exeext"
6759 if { (eval echo "$as_me:6759: \"$ac_link\"") >&5
6760   (eval $ac_link) 2>&5
6761   ac_status=$?
6762   echo "$as_me:6762: \$? = $ac_status" >&5
6763   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6764   { (eval echo "$as_me:6764: \"$ac_try\"") >&5
6765   (eval $ac_try) 2>&5
6766   ac_status=$?
6767   echo "$as_me:6767: \$? = $ac_status" >&5
6768   (exit "$ac_status"); }; }; then
6769
6770         cf_cv_ncurses_version=`cat $cf_tempfile`
6771 else
6772   echo "$as_me: program exited with status $ac_status" >&5
6773 echo "$as_me: failed program was:" >&5
6774 cat "conftest.$ac_ext" >&5
6775 fi
6776 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6777 fi
6778         rm -f "$cf_tempfile"
6779
6780 fi
6781 echo "$as_me:6781: result: $cf_cv_ncurses_version" >&5
6782 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6783 test "$cf_cv_ncurses_version" = no ||
6784 cat >>confdefs.h <<\EOF
6785 #define NCURSES 1
6786 EOF
6787
6788 echo "$as_me:6788: checking if we have identified curses libraries" >&5
6789 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6790 cat >"conftest.$ac_ext" <<_ACEOF
6791 #line 6791 "configure"
6792 #include "confdefs.h"
6793 #include <${cf_cv_ncurses_header:-curses.h}>
6794 int
6795 main (void)
6796 {
6797 initscr(); tgoto("?", 0,0)
6798   ;
6799   return 0;
6800 }
6801 _ACEOF
6802 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6803 if { (eval echo "$as_me:6803: \"$ac_link\"") >&5
6804   (eval $ac_link) 2>&5
6805   ac_status=$?
6806   echo "$as_me:6806: \$? = $ac_status" >&5
6807   (exit "$ac_status"); } &&
6808          { ac_try='test -s "conftest$ac_exeext"'
6809   { (eval echo "$as_me:6809: \"$ac_try\"") >&5
6810   (eval $ac_try) 2>&5
6811   ac_status=$?
6812   echo "$as_me:6812: \$? = $ac_status" >&5
6813   (exit "$ac_status"); }; }; then
6814   cf_result=yes
6815 else
6816   echo "$as_me: failed program was:" >&5
6817 cat "conftest.$ac_ext" >&5
6818 cf_result=no
6819 fi
6820 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6821 echo "$as_me:6821: result: $cf_result" >&5
6822 echo "${ECHO_T}$cf_result" >&6
6823
6824 if test "$cf_result" = no ; then
6825 case "$host_os" in
6826 (freebsd*)
6827         echo "$as_me:6827: checking for tgoto in -lmytinfo" >&5
6828 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6829 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6830   echo $ECHO_N "(cached) $ECHO_C" >&6
6831 else
6832   ac_check_lib_save_LIBS=$LIBS
6833 LIBS="-lmytinfo  $LIBS"
6834 cat >"conftest.$ac_ext" <<_ACEOF
6835 #line 6835 "configure"
6836 #include "confdefs.h"
6837
6838 /* Override any gcc2 internal prototype to avoid an error.  */
6839 #ifdef __cplusplus
6840 extern "C"
6841 #endif
6842 /* We use char because int might match the return type of a gcc2
6843    builtin and then its argument prototype would still apply.  */
6844 char tgoto ();
6845 int
6846 main (void)
6847 {
6848 tgoto ();
6849   ;
6850   return 0;
6851 }
6852 _ACEOF
6853 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6854 if { (eval echo "$as_me:6854: \"$ac_link\"") >&5
6855   (eval $ac_link) 2>&5
6856   ac_status=$?
6857   echo "$as_me:6857: \$? = $ac_status" >&5
6858   (exit "$ac_status"); } &&
6859          { ac_try='test -s "conftest$ac_exeext"'
6860   { (eval echo "$as_me:6860: \"$ac_try\"") >&5
6861   (eval $ac_try) 2>&5
6862   ac_status=$?
6863   echo "$as_me:6863: \$? = $ac_status" >&5
6864   (exit "$ac_status"); }; }; then
6865   ac_cv_lib_mytinfo_tgoto=yes
6866 else
6867   echo "$as_me: failed program was:" >&5
6868 cat "conftest.$ac_ext" >&5
6869 ac_cv_lib_mytinfo_tgoto=no
6870 fi
6871 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6872 LIBS=$ac_check_lib_save_LIBS
6873 fi
6874 echo "$as_me:6874: result: $ac_cv_lib_mytinfo_tgoto" >&5
6875 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6876 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6877
6878 cf_add_libs="$LIBS"
6879 # reverse order
6880 cf_add_0lib=
6881 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6882 # filter duplicates
6883 for cf_add_1lib in $cf_add_0lib; do
6884         for cf_add_2lib in $cf_add_libs; do
6885                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6886                         cf_add_1lib=
6887                         break
6888                 fi
6889         done
6890         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6891 done
6892 LIBS="$cf_add_libs"
6893
6894 fi
6895
6896         ;;
6897 (hpux10.*)
6898         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6899         # next (1998), and xcurses "newer" (2000).  There is no header file for
6900         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6901         # term.h) for cur_colr
6902         if test "x$cf_cv_screen" = "xcurses_colr"
6903         then
6904                 echo "$as_me:6904: checking for initscr in -lcur_colr" >&5
6905 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6906 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6907   echo $ECHO_N "(cached) $ECHO_C" >&6
6908 else
6909   ac_check_lib_save_LIBS=$LIBS
6910 LIBS="-lcur_colr  $LIBS"
6911 cat >"conftest.$ac_ext" <<_ACEOF
6912 #line 6912 "configure"
6913 #include "confdefs.h"
6914
6915 /* Override any gcc2 internal prototype to avoid an error.  */
6916 #ifdef __cplusplus
6917 extern "C"
6918 #endif
6919 /* We use char because int might match the return type of a gcc2
6920    builtin and then its argument prototype would still apply.  */
6921 char initscr ();
6922 int
6923 main (void)
6924 {
6925 initscr ();
6926   ;
6927   return 0;
6928 }
6929 _ACEOF
6930 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6931 if { (eval echo "$as_me:6931: \"$ac_link\"") >&5
6932   (eval $ac_link) 2>&5
6933   ac_status=$?
6934   echo "$as_me:6934: \$? = $ac_status" >&5
6935   (exit "$ac_status"); } &&
6936          { ac_try='test -s "conftest$ac_exeext"'
6937   { (eval echo "$as_me:6937: \"$ac_try\"") >&5
6938   (eval $ac_try) 2>&5
6939   ac_status=$?
6940   echo "$as_me:6940: \$? = $ac_status" >&5
6941   (exit "$ac_status"); }; }; then
6942   ac_cv_lib_cur_colr_initscr=yes
6943 else
6944   echo "$as_me: failed program was:" >&5
6945 cat "conftest.$ac_ext" >&5
6946 ac_cv_lib_cur_colr_initscr=no
6947 fi
6948 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6949 LIBS=$ac_check_lib_save_LIBS
6950 fi
6951 echo "$as_me:6951: result: $ac_cv_lib_cur_colr_initscr" >&5
6952 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6953 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
6954
6955 cf_add_libs="$LIBS"
6956 # reverse order
6957 cf_add_0lib=
6958 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6959 # filter duplicates
6960 for cf_add_1lib in $cf_add_0lib; do
6961         for cf_add_2lib in $cf_add_libs; do
6962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6963                         cf_add_1lib=
6964                         break
6965                 fi
6966         done
6967         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6968 done
6969 LIBS="$cf_add_libs"
6970
6971                         ac_cv_func_initscr=yes
6972
6973 else
6974
6975                 echo "$as_me:6975: checking for initscr in -lHcurses" >&5
6976 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6977 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6978   echo $ECHO_N "(cached) $ECHO_C" >&6
6979 else
6980   ac_check_lib_save_LIBS=$LIBS
6981 LIBS="-lHcurses  $LIBS"
6982 cat >"conftest.$ac_ext" <<_ACEOF
6983 #line 6983 "configure"
6984 #include "confdefs.h"
6985
6986 /* Override any gcc2 internal prototype to avoid an error.  */
6987 #ifdef __cplusplus
6988 extern "C"
6989 #endif
6990 /* We use char because int might match the return type of a gcc2
6991    builtin and then its argument prototype would still apply.  */
6992 char initscr ();
6993 int
6994 main (void)
6995 {
6996 initscr ();
6997   ;
6998   return 0;
6999 }
7000 _ACEOF
7001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7002 if { (eval echo "$as_me:7002: \"$ac_link\"") >&5
7003   (eval $ac_link) 2>&5
7004   ac_status=$?
7005   echo "$as_me:7005: \$? = $ac_status" >&5
7006   (exit "$ac_status"); } &&
7007          { ac_try='test -s "conftest$ac_exeext"'
7008   { (eval echo "$as_me:7008: \"$ac_try\"") >&5
7009   (eval $ac_try) 2>&5
7010   ac_status=$?
7011   echo "$as_me:7011: \$? = $ac_status" >&5
7012   (exit "$ac_status"); }; }; then
7013   ac_cv_lib_Hcurses_initscr=yes
7014 else
7015   echo "$as_me: failed program was:" >&5
7016 cat "conftest.$ac_ext" >&5
7017 ac_cv_lib_Hcurses_initscr=no
7018 fi
7019 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7020 LIBS=$ac_check_lib_save_LIBS
7021 fi
7022 echo "$as_me:7022: result: $ac_cv_lib_Hcurses_initscr" >&5
7023 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
7024 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
7025
7026                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
7027
7028 cf_add_libs="$LIBS"
7029 # reverse order
7030 cf_add_0lib=
7031 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7032 # filter duplicates
7033 for cf_add_1lib in $cf_add_0lib; do
7034         for cf_add_2lib in $cf_add_libs; do
7035                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7036                         cf_add_1lib=
7037                         break
7038                 fi
7039         done
7040         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7041 done
7042 LIBS="$cf_add_libs"
7043
7044         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7045         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
7046
7047                         ac_cv_func_initscr=yes
7048
7049 fi
7050
7051 fi
7052
7053         fi
7054         ;;
7055 (linux*)
7056         case `arch 2>/dev/null` in
7057         (x86_64)
7058                 if test -d /lib64
7059                 then
7060
7061 if test -n "/lib64" ; then
7062         for cf_add_libdir in /lib64
7063         do
7064                 if test "$cf_add_libdir" = /usr/lib ; then
7065                         :
7066                 elif test -d "$cf_add_libdir"
7067                 then
7068                         cf_have_libdir=no
7069                         if test -n "$LDFLAGS$LIBS" ; then
7070                                 # a loop is needed to ensure we can add subdirs of existing dirs
7071                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7072                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7073                                                 cf_have_libdir=yes; break
7074                                         fi
7075                                 done
7076                         fi
7077                         if test "$cf_have_libdir" = no ; then
7078                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7079
7080 echo "${as_me:-configure}:7080: testing adding $cf_add_libdir to library-path ..." 1>&5
7081
7082                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7083                         fi
7084                 fi
7085         done
7086 fi
7087
7088                 else
7089
7090 if test -n "/lib" ; then
7091         for cf_add_libdir in /lib
7092         do
7093                 if test "$cf_add_libdir" = /usr/lib ; then
7094                         :
7095                 elif test -d "$cf_add_libdir"
7096                 then
7097                         cf_have_libdir=no
7098                         if test -n "$LDFLAGS$LIBS" ; then
7099                                 # a loop is needed to ensure we can add subdirs of existing dirs
7100                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7101                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7102                                                 cf_have_libdir=yes; break
7103                                         fi
7104                                 done
7105                         fi
7106                         if test "$cf_have_libdir" = no ; then
7107                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7108
7109 echo "${as_me:-configure}:7109: testing adding $cf_add_libdir to library-path ..." 1>&5
7110
7111                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7112                         fi
7113                 fi
7114         done
7115 fi
7116
7117                 fi
7118                 ;;
7119         (*)
7120
7121 if test -n "/lib" ; then
7122         for cf_add_libdir in /lib
7123         do
7124                 if test "$cf_add_libdir" = /usr/lib ; then
7125                         :
7126                 elif test -d "$cf_add_libdir"
7127                 then
7128                         cf_have_libdir=no
7129                         if test -n "$LDFLAGS$LIBS" ; then
7130                                 # a loop is needed to ensure we can add subdirs of existing dirs
7131                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7132                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7133                                                 cf_have_libdir=yes; break
7134                                         fi
7135                                 done
7136                         fi
7137                         if test "$cf_have_libdir" = no ; then
7138                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7139
7140 echo "${as_me:-configure}:7140: testing adding $cf_add_libdir to library-path ..." 1>&5
7141
7142                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7143                         fi
7144                 fi
7145         done
7146 fi
7147
7148                 ;;
7149         esac
7150         ;;
7151 (sunos3*|sunos4*)
7152         if test "x$cf_cv_screen" = "xcurses_5lib"
7153         then
7154                 if test -d /usr/5lib ; then
7155
7156 if test -n "/usr/5lib" ; then
7157         for cf_add_libdir in /usr/5lib
7158         do
7159                 if test "$cf_add_libdir" = /usr/lib ; then
7160                         :
7161                 elif test -d "$cf_add_libdir"
7162                 then
7163                         cf_have_libdir=no
7164                         if test -n "$LDFLAGS$LIBS" ; then
7165                                 # a loop is needed to ensure we can add subdirs of existing dirs
7166                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7167                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7168                                                 cf_have_libdir=yes; break
7169                                         fi
7170                                 done
7171                         fi
7172                         if test "$cf_have_libdir" = no ; then
7173                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7174
7175 echo "${as_me:-configure}:7175: testing adding $cf_add_libdir to library-path ..." 1>&5
7176
7177                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7178                         fi
7179                 fi
7180         done
7181 fi
7182
7183 cf_add_libs="$LIBS"
7184 # reverse order
7185 cf_add_0lib=
7186 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7187 # filter duplicates
7188 for cf_add_1lib in $cf_add_0lib; do
7189         for cf_add_2lib in $cf_add_libs; do
7190                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7191                         cf_add_1lib=
7192                         break
7193                 fi
7194         done
7195         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7196 done
7197 LIBS="$cf_add_libs"
7198
7199                 fi
7200         fi
7201         ac_cv_func_initscr=yes
7202         ;;
7203 esac
7204
7205 if test ".$ac_cv_func_initscr" != .yes ; then
7206         cf_save_LIBS="$LIBS"
7207
7208         if test ".${cf_cv_ncurses_version:-no}" != .no
7209         then
7210                 cf_check_list="ncurses curses cursesX"
7211         else
7212                 cf_check_list="cursesX curses ncurses"
7213         fi
7214
7215         # Check for library containing tgoto.  Do this before curses library
7216         # because it may be needed to link the test-case for initscr.
7217         if test "x$cf_term_lib" = x
7218         then
7219                 echo "$as_me:7219: checking for tgoto" >&5
7220 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7221 if test "${ac_cv_func_tgoto+set}" = set; then
7222   echo $ECHO_N "(cached) $ECHO_C" >&6
7223 else
7224   cat >"conftest.$ac_ext" <<_ACEOF
7225 #line 7225 "configure"
7226 #include "confdefs.h"
7227 #define tgoto autoconf_temporary
7228 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7229 #undef tgoto
7230
7231 #ifdef __cplusplus
7232 extern "C"
7233 #endif
7234
7235 /* We use char because int might match the return type of a gcc2
7236    builtin and then its argument prototype would still apply.  */
7237 char tgoto (void);
7238
7239 int
7240 main (void)
7241 {
7242
7243 /* The GNU C library defines stubs for functions which it implements
7244     to always fail with ENOSYS.  Some functions are actually named
7245     something starting with __ and the normal name is an alias.  */
7246 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7247 #error found stub for tgoto
7248 #endif
7249
7250         return tgoto ();
7251   ;
7252   return 0;
7253 }
7254 _ACEOF
7255 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7256 if { (eval echo "$as_me:7256: \"$ac_link\"") >&5
7257   (eval $ac_link) 2>&5
7258   ac_status=$?
7259   echo "$as_me:7259: \$? = $ac_status" >&5
7260   (exit "$ac_status"); } &&
7261          { ac_try='test -s "conftest$ac_exeext"'
7262   { (eval echo "$as_me:7262: \"$ac_try\"") >&5
7263   (eval $ac_try) 2>&5
7264   ac_status=$?
7265   echo "$as_me:7265: \$? = $ac_status" >&5
7266   (exit "$ac_status"); }; }; then
7267   ac_cv_func_tgoto=yes
7268 else
7269   echo "$as_me: failed program was:" >&5
7270 cat "conftest.$ac_ext" >&5
7271 ac_cv_func_tgoto=no
7272 fi
7273 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7274 fi
7275 echo "$as_me:7275: result: $ac_cv_func_tgoto" >&5
7276 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7277 if test "$ac_cv_func_tgoto" = yes; then
7278   cf_term_lib=predefined
7279 else
7280
7281                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7282                         do
7283                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7284 echo "$as_me:7284: checking for tgoto in -l$cf_term_lib" >&5
7285 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7286 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7287   echo $ECHO_N "(cached) $ECHO_C" >&6
7288 else
7289   ac_check_lib_save_LIBS=$LIBS
7290 LIBS="-l$cf_term_lib  $LIBS"
7291 cat >"conftest.$ac_ext" <<_ACEOF
7292 #line 7292 "configure"
7293 #include "confdefs.h"
7294
7295 /* Override any gcc2 internal prototype to avoid an error.  */
7296 #ifdef __cplusplus
7297 extern "C"
7298 #endif
7299 /* We use char because int might match the return type of a gcc2
7300    builtin and then its argument prototype would still apply.  */
7301 char tgoto ();
7302 int
7303 main (void)
7304 {
7305 tgoto ();
7306   ;
7307   return 0;
7308 }
7309 _ACEOF
7310 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7311 if { (eval echo "$as_me:7311: \"$ac_link\"") >&5
7312   (eval $ac_link) 2>&5
7313   ac_status=$?
7314   echo "$as_me:7314: \$? = $ac_status" >&5
7315   (exit "$ac_status"); } &&
7316          { ac_try='test -s "conftest$ac_exeext"'
7317   { (eval echo "$as_me:7317: \"$ac_try\"") >&5
7318   (eval $ac_try) 2>&5
7319   ac_status=$?
7320   echo "$as_me:7320: \$? = $ac_status" >&5
7321   (exit "$ac_status"); }; }; then
7322   eval "$as_ac_Lib=yes"
7323 else
7324   echo "$as_me: failed program was:" >&5
7325 cat "conftest.$ac_ext" >&5
7326 eval "$as_ac_Lib=no"
7327 fi
7328 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7329 LIBS=$ac_check_lib_save_LIBS
7330 fi
7331 echo "$as_me:7331: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7332 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7333 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7334
7335                                         : "${cf_nculib_root:=$cf_term_lib}"
7336                                         break
7337
7338 fi
7339
7340                         done
7341
7342 fi
7343
7344         fi
7345
7346         # Check for library containing initscr
7347         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7348         if test "x$cf_curs_lib" = x
7349         then
7350                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7351                 do
7352                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7353                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7354                                 echo "$as_me:7354: checking if we can link with $cf_curs_lib library" >&5
7355 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7356                                 cat >"conftest.$ac_ext" <<_ACEOF
7357 #line 7357 "configure"
7358 #include "confdefs.h"
7359 #include <${cf_cv_ncurses_header:-curses.h}>
7360 int
7361 main (void)
7362 {
7363 initscr()
7364   ;
7365   return 0;
7366 }
7367 _ACEOF
7368 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7369 if { (eval echo "$as_me:7369: \"$ac_link\"") >&5
7370   (eval $ac_link) 2>&5
7371   ac_status=$?
7372   echo "$as_me:7372: \$? = $ac_status" >&5
7373   (exit "$ac_status"); } &&
7374          { ac_try='test -s "conftest$ac_exeext"'
7375   { (eval echo "$as_me:7375: \"$ac_try\"") >&5
7376   (eval $ac_try) 2>&5
7377   ac_status=$?
7378   echo "$as_me:7378: \$? = $ac_status" >&5
7379   (exit "$ac_status"); }; }; then
7380   cf_result=yes
7381 else
7382   echo "$as_me: failed program was:" >&5
7383 cat "conftest.$ac_ext" >&5
7384 cf_result=no
7385 fi
7386 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7387                                 echo "$as_me:7387: result: $cf_result" >&5
7388 echo "${ECHO_T}$cf_result" >&6
7389                                 test "$cf_result" = yes && break
7390                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7391                                 cf_result=no
7392                         elif test "$cf_term_lib" != predefined ; then
7393                                 echo "$as_me:7393: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7394 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7395                                 cat >"conftest.$ac_ext" <<_ACEOF
7396 #line 7396 "configure"
7397 #include "confdefs.h"
7398 #include <${cf_cv_ncurses_header:-curses.h}>
7399 int
7400 main (void)
7401 {
7402 initscr(); tgoto((char *)0, 0, 0);
7403   ;
7404   return 0;
7405 }
7406 _ACEOF
7407 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7408 if { (eval echo "$as_me:7408: \"$ac_link\"") >&5
7409   (eval $ac_link) 2>&5
7410   ac_status=$?
7411   echo "$as_me:7411: \$? = $ac_status" >&5
7412   (exit "$ac_status"); } &&
7413          { ac_try='test -s "conftest$ac_exeext"'
7414   { (eval echo "$as_me:7414: \"$ac_try\"") >&5
7415   (eval $ac_try) 2>&5
7416   ac_status=$?
7417   echo "$as_me:7417: \$? = $ac_status" >&5
7418   (exit "$ac_status"); }; }; then
7419   cf_result=no
7420 else
7421   echo "$as_me: failed program was:" >&5
7422 cat "conftest.$ac_ext" >&5
7423
7424                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7425                                         cat >"conftest.$ac_ext" <<_ACEOF
7426 #line 7426 "configure"
7427 #include "confdefs.h"
7428 #include <${cf_cv_ncurses_header:-curses.h}>
7429 int
7430 main (void)
7431 {
7432 initscr()
7433   ;
7434   return 0;
7435 }
7436 _ACEOF
7437 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7438 if { (eval echo "$as_me:7438: \"$ac_link\"") >&5
7439   (eval $ac_link) 2>&5
7440   ac_status=$?
7441   echo "$as_me:7441: \$? = $ac_status" >&5
7442   (exit "$ac_status"); } &&
7443          { ac_try='test -s "conftest$ac_exeext"'
7444   { (eval echo "$as_me:7444: \"$ac_try\"") >&5
7445   (eval $ac_try) 2>&5
7446   ac_status=$?
7447   echo "$as_me:7447: \$? = $ac_status" >&5
7448   (exit "$ac_status"); }; }; then
7449   cf_result=yes
7450 else
7451   echo "$as_me: failed program was:" >&5
7452 cat "conftest.$ac_ext" >&5
7453 cf_result=error
7454 fi
7455 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7456
7457 fi
7458 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7459                                 echo "$as_me:7459: result: $cf_result" >&5
7460 echo "${ECHO_T}$cf_result" >&6
7461                                 test "$cf_result" != error && break
7462                         fi
7463                 done
7464         fi
7465         test "$cf_curs_lib" = unknown && { { echo "$as_me:7465: error: no curses library found" >&5
7466 echo "$as_me: error: no curses library found" >&2;}
7467    { (exit 1); exit 1; }; }
7468 fi
7469 fi
7470
7471         ;;
7472 (ncursesw*)
7473
7474 for ac_header in wchar.h
7475 do
7476 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7477 echo "$as_me:7477: checking for $ac_header" >&5
7478 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7479 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7480   echo $ECHO_N "(cached) $ECHO_C" >&6
7481 else
7482   cat >"conftest.$ac_ext" <<_ACEOF
7483 #line 7483 "configure"
7484 #include "confdefs.h"
7485 #include <$ac_header>
7486 _ACEOF
7487 if { (eval echo "$as_me:7487: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7488   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7489   ac_status=$?
7490   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7491   rm -f conftest.er1
7492   cat conftest.err >&5
7493   echo "$as_me:7493: \$? = $ac_status" >&5
7494   (exit "$ac_status"); } >/dev/null; then
7495   if test -s conftest.err; then
7496     ac_cpp_err=$ac_c_preproc_warn_flag
7497   else
7498     ac_cpp_err=
7499   fi
7500 else
7501   ac_cpp_err=yes
7502 fi
7503 if test -z "$ac_cpp_err"; then
7504   eval "$as_ac_Header=yes"
7505 else
7506   echo "$as_me: failed program was:" >&5
7507   cat "conftest.$ac_ext" >&5
7508   eval "$as_ac_Header=no"
7509 fi
7510 rm -f conftest.err "conftest.$ac_ext"
7511 fi
7512 echo "$as_me:7512: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7513 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7514 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7515   cat >>confdefs.h <<EOF
7516 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7517 EOF
7518
7519 fi
7520 done
7521
7522 echo "$as_me:7522: checking for multibyte character support" >&5
7523 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7524 if test "${cf_cv_utf8_lib+set}" = set; then
7525   echo $ECHO_N "(cached) $ECHO_C" >&6
7526 else
7527
7528         cf_save_LIBS="$LIBS"
7529         cat >"conftest.$ac_ext" <<_ACEOF
7530 #line 7530 "configure"
7531 #include "confdefs.h"
7532
7533 #include <stdlib.h>
7534 #include <stdio.h>
7535 #ifdef HAVE_WCHAR_H
7536 #include <wchar.h>
7537 #endif
7538
7539 int
7540 main (void)
7541 {
7542 putwc(0,0);
7543   ;
7544   return 0;
7545 }
7546 _ACEOF
7547 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7548 if { (eval echo "$as_me:7548: \"$ac_link\"") >&5
7549   (eval $ac_link) 2>&5
7550   ac_status=$?
7551   echo "$as_me:7551: \$? = $ac_status" >&5
7552   (exit "$ac_status"); } &&
7553          { ac_try='test -s "conftest$ac_exeext"'
7554   { (eval echo "$as_me:7554: \"$ac_try\"") >&5
7555   (eval $ac_try) 2>&5
7556   ac_status=$?
7557   echo "$as_me:7557: \$? = $ac_status" >&5
7558   (exit "$ac_status"); }; }; then
7559   cf_cv_utf8_lib=yes
7560 else
7561   echo "$as_me: failed program was:" >&5
7562 cat "conftest.$ac_ext" >&5
7563
7564 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7565 # will be set on completion of the AC_TRY_LINK below.
7566 cf_cv_header_path_utf8=
7567 cf_cv_library_path_utf8=
7568
7569 echo "${as_me:-configure}:7569: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7570
7571 cf_save_LIBS="$LIBS"
7572
7573 cat >"conftest.$ac_ext" <<_ACEOF
7574 #line 7574 "configure"
7575 #include "confdefs.h"
7576
7577 #include <libutf8.h>
7578 int
7579 main (void)
7580 {
7581 putwc(0,0);
7582   ;
7583   return 0;
7584 }
7585 _ACEOF
7586 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7587 if { (eval echo "$as_me:7587: \"$ac_link\"") >&5
7588   (eval $ac_link) 2>&5
7589   ac_status=$?
7590   echo "$as_me:7590: \$? = $ac_status" >&5
7591   (exit "$ac_status"); } &&
7592          { ac_try='test -s "conftest$ac_exeext"'
7593   { (eval echo "$as_me:7593: \"$ac_try\"") >&5
7594   (eval $ac_try) 2>&5
7595   ac_status=$?
7596   echo "$as_me:7596: \$? = $ac_status" >&5
7597   (exit "$ac_status"); }; }; then
7598
7599         cf_cv_find_linkage_utf8=yes
7600         cf_cv_header_path_utf8=/usr/include
7601         cf_cv_library_path_utf8=/usr/lib
7602
7603 else
7604   echo "$as_me: failed program was:" >&5
7605 cat "conftest.$ac_ext" >&5
7606
7607 LIBS="-lutf8  $cf_save_LIBS"
7608
7609 cat >"conftest.$ac_ext" <<_ACEOF
7610 #line 7610 "configure"
7611 #include "confdefs.h"
7612
7613 #include <libutf8.h>
7614 int
7615 main (void)
7616 {
7617 putwc(0,0);
7618   ;
7619   return 0;
7620 }
7621 _ACEOF
7622 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7623 if { (eval echo "$as_me:7623: \"$ac_link\"") >&5
7624   (eval $ac_link) 2>&5
7625   ac_status=$?
7626   echo "$as_me:7626: \$? = $ac_status" >&5
7627   (exit "$ac_status"); } &&
7628          { ac_try='test -s "conftest$ac_exeext"'
7629   { (eval echo "$as_me:7629: \"$ac_try\"") >&5
7630   (eval $ac_try) 2>&5
7631   ac_status=$?
7632   echo "$as_me:7632: \$? = $ac_status" >&5
7633   (exit "$ac_status"); }; }; then
7634
7635         cf_cv_find_linkage_utf8=yes
7636         cf_cv_header_path_utf8=/usr/include
7637         cf_cv_library_path_utf8=/usr/lib
7638         cf_cv_library_file_utf8="-lutf8"
7639
7640 else
7641   echo "$as_me: failed program was:" >&5
7642 cat "conftest.$ac_ext" >&5
7643
7644         cf_cv_find_linkage_utf8=no
7645         LIBS="$cf_save_LIBS"
7646
7647         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7648
7649 echo "${as_me:-configure}:7649: testing find linkage for utf8 library ..." 1>&5
7650
7651 echo "${as_me:-configure}:7651: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7652
7653         cf_save_CPPFLAGS="$CPPFLAGS"
7654         cf_test_CPPFLAGS="$CPPFLAGS"
7655
7656 cf_search=
7657
7658 # collect the current set of include-directories from compiler flags
7659 cf_header_path_list=""
7660 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7661         for cf_header_path in $CPPFLAGS $CFLAGS
7662         do
7663                 case "$cf_header_path" in
7664                 (-I*)
7665                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7666
7667 test "x$cf_header_path" != "xNONE" && \
7668 test -d "$cf_header_path" && \
7669  {
7670         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7671         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7672         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7673         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7674         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7675         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7676 }
7677
7678                         cf_header_path_list="$cf_header_path_list $cf_search"
7679                         ;;
7680                 esac
7681         done
7682 fi
7683
7684 # add the variations for the package we are looking for
7685
7686 cf_search=
7687
7688 test "x$prefix" != "xNONE" && \
7689 test -d "$prefix" && \
7690  {
7691         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7692         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7693         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7694         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7695         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7696         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7697 }
7698
7699 for cf_subdir_prefix in \
7700         /usr \
7701         /usr/local \
7702         /usr/pkg \
7703         /opt \
7704         /opt/local \
7705         $HOME
7706 do
7707
7708 test "x$cf_subdir_prefix" != "x$prefix" && \
7709 test -d "$cf_subdir_prefix" && \
7710 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7711         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7712         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7713         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7714         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7715         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7716         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7717 }
7718
7719 done
7720
7721 test "$includedir" != NONE && \
7722 test "$includedir" != "/usr/include" && \
7723 test -d "$includedir" && {
7724         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7725         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7726 }
7727
7728 test "$oldincludedir" != NONE && \
7729 test "$oldincludedir" != "/usr/include" && \
7730 test -d "$oldincludedir" && {
7731         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7732         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7733 }
7734
7735 cf_search="$cf_search $cf_header_path_list"
7736
7737         for cf_cv_header_path_utf8 in $cf_search
7738         do
7739                 if test -d "$cf_cv_header_path_utf8" ; then
7740                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7741
7742 echo "${as_me:-configure}:7742: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7743
7744                         CPPFLAGS="$cf_save_CPPFLAGS"
7745
7746         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7747         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7748
7749                         cat >"conftest.$ac_ext" <<_ACEOF
7750 #line 7750 "configure"
7751 #include "confdefs.h"
7752
7753 #include <libutf8.h>
7754 int
7755 main (void)
7756 {
7757 putwc(0,0);
7758   ;
7759   return 0;
7760 }
7761 _ACEOF
7762 rm -f "conftest.$ac_objext"
7763 if { (eval echo "$as_me:7763: \"$ac_compile\"") >&5
7764   (eval $ac_compile) 2>&5
7765   ac_status=$?
7766   echo "$as_me:7766: \$? = $ac_status" >&5
7767   (exit "$ac_status"); } &&
7768          { ac_try='test -s "conftest.$ac_objext"'
7769   { (eval echo "$as_me:7769: \"$ac_try\"") >&5
7770   (eval $ac_try) 2>&5
7771   ac_status=$?
7772   echo "$as_me:7772: \$? = $ac_status" >&5
7773   (exit "$ac_status"); }; }; then
7774
7775                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7776
7777 echo "${as_me:-configure}:7777: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7778
7779                                 cf_cv_find_linkage_utf8=maybe
7780                                 cf_test_CPPFLAGS="$CPPFLAGS"
7781                                 break
7782 else
7783   echo "$as_me: failed program was:" >&5
7784 cat "conftest.$ac_ext" >&5
7785
7786                                 CPPFLAGS="$cf_save_CPPFLAGS"
7787
7788 fi
7789 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7790                 fi
7791         done
7792
7793         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7794
7795 echo "${as_me:-configure}:7795: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7796
7797                 cf_save_LIBS="$LIBS"
7798                 cf_save_LDFLAGS="$LDFLAGS"
7799
7800                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7801
7802 cf_search=
7803 cf_library_path_list=""
7804 if test -n "${LDFLAGS}${LIBS}" ; then
7805         for cf_library_path in $LDFLAGS $LIBS
7806         do
7807                 case "$cf_library_path" in
7808                 (-L*)
7809                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7810
7811 test "x$cf_library_path" != "xNONE" && \
7812 test -d "$cf_library_path" && \
7813  {
7814         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7815         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7816         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7817         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7818         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7819         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7820 }
7821
7822                         cf_library_path_list="$cf_library_path_list $cf_search"
7823                         ;;
7824                 esac
7825         done
7826 fi
7827
7828 cf_search=
7829
7830 test "x$prefix" != "xNONE" && \
7831 test -d "$prefix" && \
7832  {
7833         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7834         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7835         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7836         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7837         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7838         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7839 }
7840
7841 for cf_subdir_prefix in \
7842         /usr \
7843         /usr/local \
7844         /usr/pkg \
7845         /opt \
7846         /opt/local \
7847         $HOME
7848 do
7849
7850 test "x$cf_subdir_prefix" != "x$prefix" && \
7851 test -d "$cf_subdir_prefix" && \
7852 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7853         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7854         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7855         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7856         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7857         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7858         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7859 }
7860
7861 done
7862
7863 cf_search="$cf_library_path_list $cf_search"
7864
7865                         for cf_cv_library_path_utf8 in $cf_search
7866                         do
7867                                 if test -d "$cf_cv_library_path_utf8" ; then
7868                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7869
7870 echo "${as_me:-configure}:7870: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7871
7872                                         CPPFLAGS="$cf_test_CPPFLAGS"
7873                                         LIBS="-lutf8  $cf_save_LIBS"
7874                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7875                                         cat >"conftest.$ac_ext" <<_ACEOF
7876 #line 7876 "configure"
7877 #include "confdefs.h"
7878
7879 #include <libutf8.h>
7880 int
7881 main (void)
7882 {
7883 putwc(0,0);
7884   ;
7885   return 0;
7886 }
7887 _ACEOF
7888 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7889 if { (eval echo "$as_me:7889: \"$ac_link\"") >&5
7890   (eval $ac_link) 2>&5
7891   ac_status=$?
7892   echo "$as_me:7892: \$? = $ac_status" >&5
7893   (exit "$ac_status"); } &&
7894          { ac_try='test -s "conftest$ac_exeext"'
7895   { (eval echo "$as_me:7895: \"$ac_try\"") >&5
7896   (eval $ac_try) 2>&5
7897   ac_status=$?
7898   echo "$as_me:7898: \$? = $ac_status" >&5
7899   (exit "$ac_status"); }; }; then
7900
7901                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7902
7903 echo "${as_me:-configure}:7903: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7904
7905                                         cf_cv_find_linkage_utf8=yes
7906                                         cf_cv_library_file_utf8="-lutf8"
7907                                         break
7908 else
7909   echo "$as_me: failed program was:" >&5
7910 cat "conftest.$ac_ext" >&5
7911
7912                                         CPPFLAGS="$cf_save_CPPFLAGS"
7913                                         LIBS="$cf_save_LIBS"
7914                                         LDFLAGS="$cf_save_LDFLAGS"
7915
7916 fi
7917 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7918                                 fi
7919                         done
7920                         CPPFLAGS="$cf_save_CPPFLAGS"
7921                         LDFLAGS="$cf_save_LDFLAGS"
7922                 fi
7923
7924         else
7925                 cf_cv_find_linkage_utf8=no
7926         fi
7927
7928 fi
7929 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7930
7931 fi
7932 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7933
7934 LIBS="$cf_save_LIBS"
7935
7936 if test "$cf_cv_find_linkage_utf8" = yes ; then
7937 cf_cv_utf8_lib=add-on
7938 else
7939 cf_cv_utf8_lib=no
7940 fi
7941
7942 fi
7943 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7944 fi
7945 echo "$as_me:7945: result: $cf_cv_utf8_lib" >&5
7946 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7947
7948 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7949 # ncurses/ncursesw:
7950 if test "$cf_cv_utf8_lib" = "add-on" ; then
7951
7952 cat >>confdefs.h <<\EOF
7953 #define HAVE_LIBUTF8_H 1
7954 EOF
7955
7956 if test -n "$cf_cv_header_path_utf8" ; then
7957   for cf_add_incdir in $cf_cv_header_path_utf8
7958   do
7959         while test "$cf_add_incdir" != /usr/include
7960         do
7961           if test -d "$cf_add_incdir"
7962           then
7963                 cf_have_incdir=no
7964                 if test -n "$CFLAGS$CPPFLAGS" ; then
7965                   # a loop is needed to ensure we can add subdirs of existing dirs
7966                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7967                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7968                           cf_have_incdir=yes; break
7969                         fi
7970                   done
7971                 fi
7972
7973                 if test "$cf_have_incdir" = no ; then
7974                   if test "$cf_add_incdir" = /usr/local/include ; then
7975                         if test "$GCC" = yes
7976                         then
7977                           cf_save_CPPFLAGS=$CPPFLAGS
7978
7979         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7980         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7981
7982                           cat >"conftest.$ac_ext" <<_ACEOF
7983 #line 7983 "configure"
7984 #include "confdefs.h"
7985 #include <stdio.h>
7986 int
7987 main (void)
7988 {
7989 printf("Hello")
7990   ;
7991   return 0;
7992 }
7993 _ACEOF
7994 rm -f "conftest.$ac_objext"
7995 if { (eval echo "$as_me:7995: \"$ac_compile\"") >&5
7996   (eval $ac_compile) 2>&5
7997   ac_status=$?
7998   echo "$as_me:7998: \$? = $ac_status" >&5
7999   (exit "$ac_status"); } &&
8000          { ac_try='test -s "conftest.$ac_objext"'
8001   { (eval echo "$as_me:8001: \"$ac_try\"") >&5
8002   (eval $ac_try) 2>&5
8003   ac_status=$?
8004   echo "$as_me:8004: \$? = $ac_status" >&5
8005   (exit "$ac_status"); }; }; then
8006   :
8007 else
8008   echo "$as_me: failed program was:" >&5
8009 cat "conftest.$ac_ext" >&5
8010 cf_have_incdir=yes
8011 fi
8012 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8013                           CPPFLAGS=$cf_save_CPPFLAGS
8014                         fi
8015                   fi
8016                 fi
8017
8018                 if test "$cf_have_incdir" = no ; then
8019                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8020
8021 echo "${as_me:-configure}:8021: testing adding $cf_add_incdir to include-path ..." 1>&5
8022
8023                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8024
8025                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8026                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8027                   cf_add_incdir="$cf_top_incdir"
8028                 else
8029                   break
8030                 fi
8031           else
8032                 break
8033           fi
8034         done
8035   done
8036 fi
8037
8038 if test -n "$cf_cv_library_path_utf8" ; then
8039         for cf_add_libdir in $cf_cv_library_path_utf8
8040         do
8041                 if test "$cf_add_libdir" = /usr/lib ; then
8042                         :
8043                 elif test -d "$cf_add_libdir"
8044                 then
8045                         cf_have_libdir=no
8046                         if test -n "$LDFLAGS$LIBS" ; then
8047                                 # a loop is needed to ensure we can add subdirs of existing dirs
8048                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
8049                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8050                                                 cf_have_libdir=yes; break
8051                                         fi
8052                                 done
8053                         fi
8054                         if test "$cf_have_libdir" = no ; then
8055                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8056
8057 echo "${as_me:-configure}:8057: testing adding $cf_add_libdir to library-path ..." 1>&5
8058
8059                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8060                         fi
8061                 fi
8062         done
8063 fi
8064
8065 cf_add_libs="$LIBS"
8066 # reverse order
8067 cf_add_0lib=
8068 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8069 # filter duplicates
8070 for cf_add_1lib in $cf_add_0lib; do
8071         for cf_add_2lib in $cf_add_libs; do
8072                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8073                         cf_add_1lib=
8074                         break
8075                 fi
8076         done
8077         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8078 done
8079 LIBS="$cf_add_libs"
8080
8081 fi
8082
8083 cf_ncuconfig_root=$cf_cv_screen
8084 cf_have_ncuconfig=no
8085
8086 if test "x${PKG_CONFIG:=none}" != xnone; then
8087         echo "$as_me:8087: checking pkg-config for $cf_ncuconfig_root" >&5
8088 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8089         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8090                 echo "$as_me:8090: result: yes" >&5
8091 echo "${ECHO_T}yes" >&6
8092
8093                 echo "$as_me:8093: checking if the $cf_ncuconfig_root package files work" >&5
8094 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8095                 cf_have_ncuconfig=unknown
8096
8097                 cf_save_CFLAGS="$CFLAGS"
8098                 cf_save_CPPFLAGS="$CPPFLAGS"
8099                 cf_save_LIBS="$LIBS"
8100
8101                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8102                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8103
8104                 # while -W for passing linker flags is prevalent, it is not "standard".
8105                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8106                 # incompatible _and_ non-standard -W option which gives an error.  Work
8107                 # around that pitfall.
8108                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8109                 (x*c[89]9@@*-W*)
8110
8111 cf_fix_cppflags=no
8112 cf_new_cflags=
8113 cf_new_cppflags=
8114 cf_new_extra_cppflags=
8115
8116 for cf_add_cflags in $cf_pkg_cflags
8117 do
8118 case "$cf_fix_cppflags" in
8119 (no)
8120         case "$cf_add_cflags" in
8121         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8122                 case "$cf_add_cflags" in
8123                 (-D*)
8124                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8125
8126                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8127                                 && test -z "${cf_tst_cflags}" \
8128                                 && cf_fix_cppflags=yes
8129
8130                         if test "$cf_fix_cppflags" = yes ; then
8131
8132         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8133         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8134
8135                                 continue
8136                         elif test "${cf_tst_cflags}" = "\"'" ; then
8137
8138         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8139         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8140
8141                                 continue
8142                         fi
8143                         ;;
8144                 esac
8145                 case "$CPPFLAGS" in
8146                 (*$cf_add_cflags)
8147                         ;;
8148                 (*)
8149                         case "$cf_add_cflags" in
8150                         (-D*)
8151                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8152
8153 CPPFLAGS=`echo "$CPPFLAGS" | \
8154         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8155                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8156
8157                                 ;;
8158                         esac
8159
8160         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8161         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8162
8163                         ;;
8164                 esac
8165                 ;;
8166         (*)
8167
8168         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8169         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8170
8171                 ;;
8172         esac
8173         ;;
8174 (yes)
8175
8176         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8177         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8178
8179         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8180
8181         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8182                 && test -z "${cf_tst_cflags}" \
8183                 && cf_fix_cppflags=no
8184         ;;
8185 esac
8186 done
8187
8188 if test -n "$cf_new_cflags" ; then
8189
8190         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8191         CFLAGS="${CFLAGS}$cf_new_cflags"
8192
8193 fi
8194
8195 if test -n "$cf_new_cppflags" ; then
8196
8197         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8198         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8199
8200 fi
8201
8202 if test -n "$cf_new_extra_cppflags" ; then
8203
8204         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8205         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8206
8207 fi
8208
8209 cf_add_libs="$LIBS"
8210 # reverse order
8211 cf_add_0lib=
8212 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8213 # filter duplicates
8214 for cf_add_1lib in $cf_add_0lib; do
8215         for cf_add_2lib in $cf_add_libs; do
8216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8217                         cf_add_1lib=
8218                         break
8219                 fi
8220         done
8221         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8222 done
8223 LIBS="$cf_add_libs"
8224
8225                         cat >"conftest.$ac_ext" <<_ACEOF
8226 #line 8226 "configure"
8227 #include "confdefs.h"
8228 #include <${cf_cv_ncurses_header:-curses.h}>
8229 int
8230 main (void)
8231 {
8232 initscr(); mousemask(0,0); tigetstr((char *)0);
8233   ;
8234   return 0;
8235 }
8236 _ACEOF
8237 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8238 if { (eval echo "$as_me:8238: \"$ac_link\"") >&5
8239   (eval $ac_link) 2>&5
8240   ac_status=$?
8241   echo "$as_me:8241: \$? = $ac_status" >&5
8242   (exit "$ac_status"); } &&
8243          { ac_try='test -s "conftest$ac_exeext"'
8244   { (eval echo "$as_me:8244: \"$ac_try\"") >&5
8245   (eval $ac_try) 2>&5
8246   ac_status=$?
8247   echo "$as_me:8247: \$? = $ac_status" >&5
8248   (exit "$ac_status"); }; }; then
8249   if test "$cross_compiling" = yes; then
8250   cf_test_ncuconfig=maybe
8251 else
8252   cat >"conftest.$ac_ext" <<_ACEOF
8253 #line 8253 "configure"
8254 #include "confdefs.h"
8255 #include <${cf_cv_ncurses_header:-curses.h}>
8256                                         int main(void)
8257                                         { const char *xx = curses_version(); return (xx == 0); }
8258 _ACEOF
8259 rm -f "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"); } && { ac_try='"./conftest$ac_exeext"'
8265   { (eval echo "$as_me:8265: \"$ac_try\"") >&5
8266   (eval $ac_try) 2>&5
8267   ac_status=$?
8268   echo "$as_me:8268: \$? = $ac_status" >&5
8269   (exit "$ac_status"); }; }; then
8270   cf_test_ncuconfig=yes
8271 else
8272   echo "$as_me: program exited with status $ac_status" >&5
8273 echo "$as_me: failed program was:" >&5
8274 cat "conftest.$ac_ext" >&5
8275 cf_test_ncuconfig=no
8276 fi
8277 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8278 fi
8279 else
8280   echo "$as_me: failed program was:" >&5
8281 cat "conftest.$ac_ext" >&5
8282 cf_test_ncuconfig=no
8283 fi
8284 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8285
8286                         CFLAGS="$cf_save_CFLAGS"
8287                         CPPFLAGS="$cf_save_CPPFLAGS"
8288                         LIBS="$cf_save_LIBS"
8289
8290                         if test "x$cf_test_ncuconfig" != xyes; then
8291                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8292                                 cf_pkg_cflags="$cf_temp"
8293                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8294                                 cf_pkg_libs="$cf_temp"
8295                         fi
8296                         ;;
8297                 esac
8298
8299 for cf_add_cflags in $cf_pkg_cflags
8300 do
8301         case "x$cf_add_cflags" in
8302         (x-[DU]*)
8303
8304 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8305 while true
8306 do
8307         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'`
8308         test "$CFLAGS" != "$cf_old_cflag" || break
8309
8310         CFLAGS="$cf_old_cflag"
8311 done
8312
8313 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8314 while true
8315 do
8316         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'`
8317         test "$CPPFLAGS" != "$cf_old_cflag" || break
8318
8319         CPPFLAGS="$cf_old_cflag"
8320 done
8321
8322                 ;;
8323         esac
8324
8325 cf_fix_cppflags=no
8326 cf_new_cflags=
8327 cf_new_cppflags=
8328 cf_new_extra_cppflags=
8329
8330 for cf_add_cflags in $cf_add_cflags
8331 do
8332 case "$cf_fix_cppflags" in
8333 (no)
8334         case "$cf_add_cflags" in
8335         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8336                 case "$cf_add_cflags" in
8337                 (-D*)
8338                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8339
8340                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8341                                 && test -z "${cf_tst_cflags}" \
8342                                 && cf_fix_cppflags=yes
8343
8344                         if test "$cf_fix_cppflags" = yes ; then
8345
8346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8348
8349                                 continue
8350                         elif test "${cf_tst_cflags}" = "\"'" ; then
8351
8352         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8353         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8354
8355                                 continue
8356                         fi
8357                         ;;
8358                 esac
8359                 case "$CPPFLAGS" in
8360                 (*$cf_add_cflags)
8361                         ;;
8362                 (*)
8363                         case "$cf_add_cflags" in
8364                         (-D*)
8365                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8366
8367 CPPFLAGS=`echo "$CPPFLAGS" | \
8368         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8369                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8370
8371                                 ;;
8372                         esac
8373
8374         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8375         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8376
8377                         ;;
8378                 esac
8379                 ;;
8380         (*)
8381
8382         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8383         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8384
8385                 ;;
8386         esac
8387         ;;
8388 (yes)
8389
8390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8392
8393         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8394
8395         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8396                 && test -z "${cf_tst_cflags}" \
8397                 && cf_fix_cppflags=no
8398         ;;
8399 esac
8400 done
8401
8402 if test -n "$cf_new_cflags" ; then
8403
8404         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8405         CFLAGS="${CFLAGS}$cf_new_cflags"
8406
8407 fi
8408
8409 if test -n "$cf_new_cppflags" ; then
8410
8411         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8412         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8413
8414 fi
8415
8416 if test -n "$cf_new_extra_cppflags" ; then
8417
8418         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8419         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8420
8421 fi
8422
8423 done
8424
8425 cf_add_libs="$LIBS"
8426 # reverse order
8427 cf_add_0lib=
8428 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8429 # filter duplicates
8430 for cf_add_1lib in $cf_add_0lib; do
8431         for cf_add_2lib in $cf_add_libs; do
8432                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8433                         cf_add_1lib=
8434                         break
8435                 fi
8436         done
8437         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8438 done
8439 LIBS="$cf_add_libs"
8440
8441                 cat >"conftest.$ac_ext" <<_ACEOF
8442 #line 8442 "configure"
8443 #include "confdefs.h"
8444 #include <${cf_cv_ncurses_header:-curses.h}>
8445 int
8446 main (void)
8447 {
8448 initscr(); mousemask(0,0); tigetstr((char *)0);
8449   ;
8450   return 0;
8451 }
8452 _ACEOF
8453 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8454 if { (eval echo "$as_me:8454: \"$ac_link\"") >&5
8455   (eval $ac_link) 2>&5
8456   ac_status=$?
8457   echo "$as_me:8457: \$? = $ac_status" >&5
8458   (exit "$ac_status"); } &&
8459          { ac_try='test -s "conftest$ac_exeext"'
8460   { (eval echo "$as_me:8460: \"$ac_try\"") >&5
8461   (eval $ac_try) 2>&5
8462   ac_status=$?
8463   echo "$as_me:8463: \$? = $ac_status" >&5
8464   (exit "$ac_status"); }; }; then
8465   if test "$cross_compiling" = yes; then
8466   cf_have_ncuconfig=maybe
8467 else
8468   cat >"conftest.$ac_ext" <<_ACEOF
8469 #line 8469 "configure"
8470 #include "confdefs.h"
8471 #include <${cf_cv_ncurses_header:-curses.h}>
8472                                 int main(void)
8473                                 { const char *xx = curses_version(); return (xx == 0); }
8474 _ACEOF
8475 rm -f "conftest$ac_exeext"
8476 if { (eval echo "$as_me:8476: \"$ac_link\"") >&5
8477   (eval $ac_link) 2>&5
8478   ac_status=$?
8479   echo "$as_me:8479: \$? = $ac_status" >&5
8480   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8481   { (eval echo "$as_me:8481: \"$ac_try\"") >&5
8482   (eval $ac_try) 2>&5
8483   ac_status=$?
8484   echo "$as_me:8484: \$? = $ac_status" >&5
8485   (exit "$ac_status"); }; }; then
8486   cf_have_ncuconfig=yes
8487 else
8488   echo "$as_me: program exited with status $ac_status" >&5
8489 echo "$as_me: failed program was:" >&5
8490 cat "conftest.$ac_ext" >&5
8491 cf_have_ncuconfig=no
8492 fi
8493 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8494 fi
8495 else
8496   echo "$as_me: failed program was:" >&5
8497 cat "conftest.$ac_ext" >&5
8498 cf_have_ncuconfig=no
8499 fi
8500 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8501                 echo "$as_me:8501: result: $cf_have_ncuconfig" >&5
8502 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8503                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8504                 if test "$cf_have_ncuconfig" != "yes"
8505                 then
8506                         CPPFLAGS="$cf_save_CPPFLAGS"
8507                         LIBS="$cf_save_LIBS"
8508                         NCURSES_CONFIG_PKG=none
8509                 else
8510
8511 cat >>confdefs.h <<\EOF
8512 #define NCURSES 1
8513 EOF
8514
8515                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8516
8517 echo "$as_me:8517: checking for terminfo header" >&5
8518 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8519 if test "${cf_cv_term_header+set}" = set; then
8520   echo $ECHO_N "(cached) $ECHO_C" >&6
8521 else
8522
8523 case "${cf_cv_ncurses_header}" in
8524 (*/ncurses.h|*/ncursesw.h)
8525         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8526         ;;
8527 (*)
8528         cf_term_header=term.h
8529         ;;
8530 esac
8531
8532 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8533 do
8534 cat >"conftest.$ac_ext" <<_ACEOF
8535 #line 8535 "configure"
8536 #include "confdefs.h"
8537 #include <stdio.h>
8538 #include <${cf_cv_ncurses_header:-curses.h}>
8539 #include <$cf_test>
8540
8541 int
8542 main (void)
8543 {
8544 int x = auto_left_margin; (void)x
8545   ;
8546   return 0;
8547 }
8548 _ACEOF
8549 rm -f "conftest.$ac_objext"
8550 if { (eval echo "$as_me:8550: \"$ac_compile\"") >&5
8551   (eval $ac_compile) 2>&5
8552   ac_status=$?
8553   echo "$as_me:8553: \$? = $ac_status" >&5
8554   (exit "$ac_status"); } &&
8555          { ac_try='test -s "conftest.$ac_objext"'
8556   { (eval echo "$as_me:8556: \"$ac_try\"") >&5
8557   (eval $ac_try) 2>&5
8558   ac_status=$?
8559   echo "$as_me:8559: \$? = $ac_status" >&5
8560   (exit "$ac_status"); }; }; then
8561
8562         cf_cv_term_header="$cf_test"
8563 else
8564   echo "$as_me: failed program was:" >&5
8565 cat "conftest.$ac_ext" >&5
8566
8567         cf_cv_term_header=unknown
8568
8569 fi
8570 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8571         test "$cf_cv_term_header" != unknown && break
8572 done
8573
8574 fi
8575 echo "$as_me:8575: result: $cf_cv_term_header" >&5
8576 echo "${ECHO_T}$cf_cv_term_header" >&6
8577
8578 # Set definitions to allow ifdef'ing to accommodate subdirectories
8579
8580 case "$cf_cv_term_header" in
8581 (*term.h)
8582
8583 cat >>confdefs.h <<\EOF
8584 #define HAVE_TERM_H 1
8585 EOF
8586
8587         ;;
8588 esac
8589
8590 case "$cf_cv_term_header" in
8591 (ncurses/term.h)
8592
8593 cat >>confdefs.h <<\EOF
8594 #define HAVE_NCURSES_TERM_H 1
8595 EOF
8596
8597         ;;
8598 (ncursesw/term.h)
8599
8600 cat >>confdefs.h <<\EOF
8601 #define HAVE_NCURSESW_TERM_H 1
8602 EOF
8603
8604         ;;
8605 esac
8606
8607                 fi
8608
8609         else
8610                 echo "$as_me:8610: result: no" >&5
8611 echo "${ECHO_T}no" >&6
8612                 NCURSES_CONFIG_PKG=none
8613         fi
8614 else
8615         NCURSES_CONFIG_PKG=none
8616 fi
8617
8618 if test "x$cf_have_ncuconfig" = "xno"; then
8619         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8620
8621 if test -n "$ac_tool_prefix"; then
8622   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8623   do
8624     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8625 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8626 echo "$as_me:8626: checking for $ac_word" >&5
8627 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8628 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8629   echo $ECHO_N "(cached) $ECHO_C" >&6
8630 else
8631   if test -n "$NCURSES_CONFIG"; then
8632   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8633 else
8634   ac_save_IFS=$IFS; IFS=$ac_path_separator
8635 ac_dummy="$PATH"
8636 for ac_dir in $ac_dummy; do
8637   IFS=$ac_save_IFS
8638   test -z "$ac_dir" && ac_dir=.
8639   $as_executable_p "$ac_dir/$ac_word" || continue
8640 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8641 echo "$as_me:8641: found $ac_dir/$ac_word" >&5
8642 break
8643 done
8644
8645 fi
8646 fi
8647 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8648 if test -n "$NCURSES_CONFIG"; then
8649   echo "$as_me:8649: result: $NCURSES_CONFIG" >&5
8650 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8651 else
8652   echo "$as_me:8652: result: no" >&5
8653 echo "${ECHO_T}no" >&6
8654 fi
8655
8656     test -n "$NCURSES_CONFIG" && break
8657   done
8658 fi
8659 if test -z "$NCURSES_CONFIG"; then
8660   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8661   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8662 do
8663   # Extract the first word of "$ac_prog", so it can be a program name with args.
8664 set dummy $ac_prog; ac_word=$2
8665 echo "$as_me:8665: checking for $ac_word" >&5
8666 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8667 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8668   echo $ECHO_N "(cached) $ECHO_C" >&6
8669 else
8670   if test -n "$ac_ct_NCURSES_CONFIG"; then
8671   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8672 else
8673   ac_save_IFS=$IFS; IFS=$ac_path_separator
8674 ac_dummy="$PATH"
8675 for ac_dir in $ac_dummy; do
8676   IFS=$ac_save_IFS
8677   test -z "$ac_dir" && ac_dir=.
8678   $as_executable_p "$ac_dir/$ac_word" || continue
8679 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8680 echo "$as_me:8680: found $ac_dir/$ac_word" >&5
8681 break
8682 done
8683
8684 fi
8685 fi
8686 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8687 if test -n "$ac_ct_NCURSES_CONFIG"; then
8688   echo "$as_me:8688: result: $ac_ct_NCURSES_CONFIG" >&5
8689 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8690 else
8691   echo "$as_me:8691: result: no" >&5
8692 echo "${ECHO_T}no" >&6
8693 fi
8694
8695   test -n "$ac_ct_NCURSES_CONFIG" && break
8696 done
8697 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8698
8699   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8700 fi
8701
8702         if test "$NCURSES_CONFIG" != none ; then
8703
8704 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8705 do
8706         case "x$cf_add_cflags" in
8707         (x-[DU]*)
8708
8709 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8710 while true
8711 do
8712         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'`
8713         test "$CFLAGS" != "$cf_old_cflag" || break
8714
8715         CFLAGS="$cf_old_cflag"
8716 done
8717
8718 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8719 while true
8720 do
8721         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'`
8722         test "$CPPFLAGS" != "$cf_old_cflag" || break
8723
8724         CPPFLAGS="$cf_old_cflag"
8725 done
8726
8727                 ;;
8728         esac
8729
8730 cf_fix_cppflags=no
8731 cf_new_cflags=
8732 cf_new_cppflags=
8733 cf_new_extra_cppflags=
8734
8735 for cf_add_cflags in $cf_add_cflags
8736 do
8737 case "$cf_fix_cppflags" in
8738 (no)
8739         case "$cf_add_cflags" in
8740         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8741                 case "$cf_add_cflags" in
8742                 (-D*)
8743                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8744
8745                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8746                                 && test -z "${cf_tst_cflags}" \
8747                                 && cf_fix_cppflags=yes
8748
8749                         if test "$cf_fix_cppflags" = yes ; then
8750
8751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8753
8754                                 continue
8755                         elif test "${cf_tst_cflags}" = "\"'" ; then
8756
8757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8759
8760                                 continue
8761                         fi
8762                         ;;
8763                 esac
8764                 case "$CPPFLAGS" in
8765                 (*$cf_add_cflags)
8766                         ;;
8767                 (*)
8768                         case "$cf_add_cflags" in
8769                         (-D*)
8770                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8771
8772 CPPFLAGS=`echo "$CPPFLAGS" | \
8773         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8774                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8775
8776                                 ;;
8777                         esac
8778
8779         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8780         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8781
8782                         ;;
8783                 esac
8784                 ;;
8785         (*)
8786
8787         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8788         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8789
8790                 ;;
8791         esac
8792         ;;
8793 (yes)
8794
8795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8797
8798         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8799
8800         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8801                 && test -z "${cf_tst_cflags}" \
8802                 && cf_fix_cppflags=no
8803         ;;
8804 esac
8805 done
8806
8807 if test -n "$cf_new_cflags" ; then
8808
8809         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8810         CFLAGS="${CFLAGS}$cf_new_cflags"
8811
8812 fi
8813
8814 if test -n "$cf_new_cppflags" ; then
8815
8816         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8817         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8818
8819 fi
8820
8821 if test -n "$cf_new_extra_cppflags" ; then
8822
8823         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8824         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8825
8826 fi
8827
8828 done
8829
8830 cf_add_libs="$LIBS"
8831 # reverse order
8832 cf_add_0lib=
8833 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8834 # filter duplicates
8835 for cf_add_1lib in $cf_add_0lib; do
8836         for cf_add_2lib in $cf_add_libs; do
8837                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8838                         cf_add_1lib=
8839                         break
8840                 fi
8841         done
8842         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8843 done
8844 LIBS="$cf_add_libs"
8845
8846                 # even with config script, some packages use no-override for curses.h
8847
8848 echo "$as_me:8848: checking if we have identified curses headers" >&5
8849 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8850 if test "${cf_cv_ncurses_header+set}" = set; then
8851   echo $ECHO_N "(cached) $ECHO_C" >&6
8852 else
8853
8854 cf_cv_ncurses_header=none
8855 for cf_header in \
8856         ncurses.h $cf_cv_screen/ncurses.h \
8857         curses.h $cf_cv_screen/curses.h
8858 do
8859 cat >"conftest.$ac_ext" <<_ACEOF
8860 #line 8860 "configure"
8861 #include "confdefs.h"
8862 #include <${cf_header}>
8863 int
8864 main (void)
8865 {
8866 initscr(); tgoto("?", 0,0)
8867   ;
8868   return 0;
8869 }
8870 _ACEOF
8871 rm -f "conftest.$ac_objext"
8872 if { (eval echo "$as_me:8872: \"$ac_compile\"") >&5
8873   (eval $ac_compile) 2>&5
8874   ac_status=$?
8875   echo "$as_me:8875: \$? = $ac_status" >&5
8876   (exit "$ac_status"); } &&
8877          { ac_try='test -s "conftest.$ac_objext"'
8878   { (eval echo "$as_me:8878: \"$ac_try\"") >&5
8879   (eval $ac_try) 2>&5
8880   ac_status=$?
8881   echo "$as_me:8881: \$? = $ac_status" >&5
8882   (exit "$ac_status"); }; }; then
8883   cf_cv_ncurses_header=$cf_header; break
8884 else
8885   echo "$as_me: failed program was:" >&5
8886 cat "conftest.$ac_ext" >&5
8887 fi
8888 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8889 done
8890
8891 fi
8892 echo "$as_me:8892: result: $cf_cv_ncurses_header" >&5
8893 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8894
8895 if test "$cf_cv_ncurses_header" = none ; then
8896         { { echo "$as_me:8896: error: No curses header-files found" >&5
8897 echo "$as_me: error: No curses header-files found" >&2;}
8898    { (exit 1); exit 1; }; }
8899 fi
8900
8901 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8902
8903 for ac_header in $cf_cv_ncurses_header
8904 do
8905 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8906 echo "$as_me:8906: checking for $ac_header" >&5
8907 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8908 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8909   echo $ECHO_N "(cached) $ECHO_C" >&6
8910 else
8911   cat >"conftest.$ac_ext" <<_ACEOF
8912 #line 8912 "configure"
8913 #include "confdefs.h"
8914 #include <$ac_header>
8915 _ACEOF
8916 if { (eval echo "$as_me:8916: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8917   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8918   ac_status=$?
8919   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8920   rm -f conftest.er1
8921   cat conftest.err >&5
8922   echo "$as_me:8922: \$? = $ac_status" >&5
8923   (exit "$ac_status"); } >/dev/null; then
8924   if test -s conftest.err; then
8925     ac_cpp_err=$ac_c_preproc_warn_flag
8926   else
8927     ac_cpp_err=
8928   fi
8929 else
8930   ac_cpp_err=yes
8931 fi
8932 if test -z "$ac_cpp_err"; then
8933   eval "$as_ac_Header=yes"
8934 else
8935   echo "$as_me: failed program was:" >&5
8936   cat "conftest.$ac_ext" >&5
8937   eval "$as_ac_Header=no"
8938 fi
8939 rm -f conftest.err "conftest.$ac_ext"
8940 fi
8941 echo "$as_me:8941: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8942 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8943 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8944   cat >>confdefs.h <<EOF
8945 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8946 EOF
8947
8948 fi
8949 done
8950
8951 cat >>confdefs.h <<\EOF
8952 #define NCURSES 1
8953 EOF
8954
8955 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8956
8957                 cat >>confdefs.h <<EOF
8958 #define $cf_nculib_ROOT 1
8959 EOF
8960
8961                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8962
8963         else
8964
8965 cf_ncuhdr_root=$cf_cv_screen
8966
8967 test -n "$cf_cv_curses_dir" && \
8968 test "$cf_cv_curses_dir" != "no" && { \
8969
8970 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8971   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8972   do
8973         while test "$cf_add_incdir" != /usr/include
8974         do
8975           if test -d "$cf_add_incdir"
8976           then
8977                 cf_have_incdir=no
8978                 if test -n "$CFLAGS$CPPFLAGS" ; then
8979                   # a loop is needed to ensure we can add subdirs of existing dirs
8980                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8981                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8982                           cf_have_incdir=yes; break
8983                         fi
8984                   done
8985                 fi
8986
8987                 if test "$cf_have_incdir" = no ; then
8988                   if test "$cf_add_incdir" = /usr/local/include ; then
8989                         if test "$GCC" = yes
8990                         then
8991                           cf_save_CPPFLAGS=$CPPFLAGS
8992
8993         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8994         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8995
8996                           cat >"conftest.$ac_ext" <<_ACEOF
8997 #line 8997 "configure"
8998 #include "confdefs.h"
8999 #include <stdio.h>
9000 int
9001 main (void)
9002 {
9003 printf("Hello")
9004   ;
9005   return 0;
9006 }
9007 _ACEOF
9008 rm -f "conftest.$ac_objext"
9009 if { (eval echo "$as_me:9009: \"$ac_compile\"") >&5
9010   (eval $ac_compile) 2>&5
9011   ac_status=$?
9012   echo "$as_me:9012: \$? = $ac_status" >&5
9013   (exit "$ac_status"); } &&
9014          { ac_try='test -s "conftest.$ac_objext"'
9015   { (eval echo "$as_me:9015: \"$ac_try\"") >&5
9016   (eval $ac_try) 2>&5
9017   ac_status=$?
9018   echo "$as_me:9018: \$? = $ac_status" >&5
9019   (exit "$ac_status"); }; }; then
9020   :
9021 else
9022   echo "$as_me: failed program was:" >&5
9023 cat "conftest.$ac_ext" >&5
9024 cf_have_incdir=yes
9025 fi
9026 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9027                           CPPFLAGS=$cf_save_CPPFLAGS
9028                         fi
9029                   fi
9030                 fi
9031
9032                 if test "$cf_have_incdir" = no ; then
9033                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9034
9035 echo "${as_me:-configure}:9035: testing adding $cf_add_incdir to include-path ..." 1>&5
9036
9037                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9038
9039                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9040                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9041                   cf_add_incdir="$cf_top_incdir"
9042                 else
9043                   break
9044                 fi
9045           else
9046                 break
9047           fi
9048         done
9049   done
9050 fi
9051
9052 }
9053
9054 echo "$as_me:9054: checking for $cf_ncuhdr_root header in include-path" >&5
9055 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9056 if test "${cf_cv_ncurses_h+set}" = set; then
9057   echo $ECHO_N "(cached) $ECHO_C" >&6
9058 else
9059
9060         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9061         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9062         for cf_header in $cf_header_list
9063         do
9064
9065         cat >"conftest.$ac_ext" <<_ACEOF
9066 #line 9066 "configure"
9067 #include "confdefs.h"
9068
9069 #include <$cf_header>
9070 int
9071 main (void)
9072 {
9073
9074 #ifdef NCURSES_VERSION
9075
9076 printf("%s\\n", NCURSES_VERSION);
9077 #else
9078 #ifdef __NCURSES_H
9079 printf("old\\n");
9080 #else
9081         make an error
9082 #endif
9083 #endif
9084
9085   ;
9086   return 0;
9087 }
9088 _ACEOF
9089 rm -f "conftest.$ac_objext"
9090 if { (eval echo "$as_me:9090: \"$ac_compile\"") >&5
9091   (eval $ac_compile) 2>&5
9092   ac_status=$?
9093   echo "$as_me:9093: \$? = $ac_status" >&5
9094   (exit "$ac_status"); } &&
9095          { ac_try='test -s "conftest.$ac_objext"'
9096   { (eval echo "$as_me:9096: \"$ac_try\"") >&5
9097   (eval $ac_try) 2>&5
9098   ac_status=$?
9099   echo "$as_me:9099: \$? = $ac_status" >&5
9100   (exit "$ac_status"); }; }; then
9101   cf_cv_ncurses_h=$cf_header
9102
9103 else
9104   echo "$as_me: failed program was:" >&5
9105 cat "conftest.$ac_ext" >&5
9106 cf_cv_ncurses_h=no
9107 fi
9108 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9109
9110                 test "$cf_cv_ncurses_h" != no && break
9111         done
9112
9113 fi
9114 echo "$as_me:9114: result: $cf_cv_ncurses_h" >&5
9115 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9116
9117 if test "$cf_cv_ncurses_h" != no ; then
9118         cf_cv_ncurses_header=$cf_cv_ncurses_h
9119 else
9120
9121 echo "$as_me:9121: checking for $cf_ncuhdr_root include-path" >&5
9122 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9123 if test "${cf_cv_ncurses_h2+set}" = set; then
9124   echo $ECHO_N "(cached) $ECHO_C" >&6
9125 else
9126
9127         test -n "$verbose" && echo
9128
9129 cf_search=
9130
9131 # collect the current set of include-directories from compiler flags
9132 cf_header_path_list=""
9133 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9134         for cf_header_path in $CPPFLAGS $CFLAGS
9135         do
9136                 case "$cf_header_path" in
9137                 (-I*)
9138                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9139
9140 test "x$cf_header_path" != "xNONE" && \
9141 test -d "$cf_header_path" && \
9142  {
9143         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9144         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
9145         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9146         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9147         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9148         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"
9149 }
9150
9151                         cf_header_path_list="$cf_header_path_list $cf_search"
9152                         ;;
9153                 esac
9154         done
9155 fi
9156
9157 # add the variations for the package we are looking for
9158
9159 cf_search=
9160
9161 test "x$prefix" != "xNONE" && \
9162 test -d "$prefix" && \
9163  {
9164         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9165         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
9166         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9167         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9168         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9169         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9170 }
9171
9172 for cf_subdir_prefix in \
9173         /usr \
9174         /usr/local \
9175         /usr/pkg \
9176         /opt \
9177         /opt/local \
9178         $HOME
9179 do
9180
9181 test "x$cf_subdir_prefix" != "x$prefix" && \
9182 test -d "$cf_subdir_prefix" && \
9183 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9184         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9185         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
9186         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9187         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9188         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9189         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"
9190 }
9191
9192 done
9193
9194 test "$includedir" != NONE && \
9195 test "$includedir" != "/usr/include" && \
9196 test -d "$includedir" && {
9197         test -d "$includedir" &&    cf_search="$cf_search $includedir"
9198         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9199 }
9200
9201 test "$oldincludedir" != NONE && \
9202 test "$oldincludedir" != "/usr/include" && \
9203 test -d "$oldincludedir" && {
9204         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
9205         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9206 }
9207
9208 cf_search="$cf_search $cf_header_path_list"
9209
9210         test -n "$verbose" && echo "search path $cf_search"
9211         cf_save2_CPPFLAGS="$CPPFLAGS"
9212         for cf_incdir in $cf_search
9213         do
9214
9215 if test -n "$cf_incdir" ; then
9216   for cf_add_incdir in $cf_incdir
9217   do
9218         while test "$cf_add_incdir" != /usr/include
9219         do
9220           if test -d "$cf_add_incdir"
9221           then
9222                 cf_have_incdir=no
9223                 if test -n "$CFLAGS$CPPFLAGS" ; then
9224                   # a loop is needed to ensure we can add subdirs of existing dirs
9225                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9226                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9227                           cf_have_incdir=yes; break
9228                         fi
9229                   done
9230                 fi
9231
9232                 if test "$cf_have_incdir" = no ; then
9233                   if test "$cf_add_incdir" = /usr/local/include ; then
9234                         if test "$GCC" = yes
9235                         then
9236                           cf_save_CPPFLAGS=$CPPFLAGS
9237
9238         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9239         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9240
9241                           cat >"conftest.$ac_ext" <<_ACEOF
9242 #line 9242 "configure"
9243 #include "confdefs.h"
9244 #include <stdio.h>
9245 int
9246 main (void)
9247 {
9248 printf("Hello")
9249   ;
9250   return 0;
9251 }
9252 _ACEOF
9253 rm -f "conftest.$ac_objext"
9254 if { (eval echo "$as_me:9254: \"$ac_compile\"") >&5
9255   (eval $ac_compile) 2>&5
9256   ac_status=$?
9257   echo "$as_me:9257: \$? = $ac_status" >&5
9258   (exit "$ac_status"); } &&
9259          { ac_try='test -s "conftest.$ac_objext"'
9260   { (eval echo "$as_me:9260: \"$ac_try\"") >&5
9261   (eval $ac_try) 2>&5
9262   ac_status=$?
9263   echo "$as_me:9263: \$? = $ac_status" >&5
9264   (exit "$ac_status"); }; }; then
9265   :
9266 else
9267   echo "$as_me: failed program was:" >&5
9268 cat "conftest.$ac_ext" >&5
9269 cf_have_incdir=yes
9270 fi
9271 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9272                           CPPFLAGS=$cf_save_CPPFLAGS
9273                         fi
9274                   fi
9275                 fi
9276
9277                 if test "$cf_have_incdir" = no ; then
9278                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9279
9280 echo "${as_me:-configure}:9280: testing adding $cf_add_incdir to include-path ..." 1>&5
9281
9282                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9283
9284                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9285                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9286                   cf_add_incdir="$cf_top_incdir"
9287                 else
9288                   break
9289                 fi
9290           else
9291                 break
9292           fi
9293         done
9294   done
9295 fi
9296
9297                 for cf_header in \
9298                         ncurses.h \
9299                         curses.h
9300                 do
9301
9302         cat >"conftest.$ac_ext" <<_ACEOF
9303 #line 9303 "configure"
9304 #include "confdefs.h"
9305
9306 #include <$cf_header>
9307 int
9308 main (void)
9309 {
9310
9311 #ifdef NCURSES_VERSION
9312
9313 printf("%s\\n", NCURSES_VERSION);
9314 #else
9315 #ifdef __NCURSES_H
9316 printf("old\\n");
9317 #else
9318         make an error
9319 #endif
9320 #endif
9321
9322   ;
9323   return 0;
9324 }
9325 _ACEOF
9326 rm -f "conftest.$ac_objext"
9327 if { (eval echo "$as_me:9327: \"$ac_compile\"") >&5
9328   (eval $ac_compile) 2>&5
9329   ac_status=$?
9330   echo "$as_me:9330: \$? = $ac_status" >&5
9331   (exit "$ac_status"); } &&
9332          { ac_try='test -s "conftest.$ac_objext"'
9333   { (eval echo "$as_me:9333: \"$ac_try\"") >&5
9334   (eval $ac_try) 2>&5
9335   ac_status=$?
9336   echo "$as_me:9336: \$? = $ac_status" >&5
9337   (exit "$ac_status"); }; }; then
9338   cf_cv_ncurses_h2=$cf_header
9339
9340 else
9341   echo "$as_me: failed program was:" >&5
9342 cat "conftest.$ac_ext" >&5
9343 cf_cv_ncurses_h2=no
9344 fi
9345 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9346
9347                         if test "$cf_cv_ncurses_h2" != no ; then
9348                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9349                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9350                                 break
9351                         fi
9352                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9353                 done
9354                 CPPFLAGS="$cf_save2_CPPFLAGS"
9355                 test "$cf_cv_ncurses_h2" != no && break
9356         done
9357         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9357: error: not found" >&5
9358 echo "$as_me: error: not found" >&2;}
9359    { (exit 1); exit 1; }; }
9360
9361 fi
9362 echo "$as_me:9362: result: $cf_cv_ncurses_h2" >&5
9363 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9364
9365         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9366         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9367         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9368                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9369         fi
9370
9371 if test -n "$cf_1st_incdir" ; then
9372   for cf_add_incdir in $cf_1st_incdir
9373   do
9374         while test "$cf_add_incdir" != /usr/include
9375         do
9376           if test -d "$cf_add_incdir"
9377           then
9378                 cf_have_incdir=no
9379                 if test -n "$CFLAGS$CPPFLAGS" ; then
9380                   # a loop is needed to ensure we can add subdirs of existing dirs
9381                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9382                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9383                           cf_have_incdir=yes; break
9384                         fi
9385                   done
9386                 fi
9387
9388                 if test "$cf_have_incdir" = no ; then
9389                   if test "$cf_add_incdir" = /usr/local/include ; then
9390                         if test "$GCC" = yes
9391                         then
9392                           cf_save_CPPFLAGS=$CPPFLAGS
9393
9394         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9395         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9396
9397                           cat >"conftest.$ac_ext" <<_ACEOF
9398 #line 9398 "configure"
9399 #include "confdefs.h"
9400 #include <stdio.h>
9401 int
9402 main (void)
9403 {
9404 printf("Hello")
9405   ;
9406   return 0;
9407 }
9408 _ACEOF
9409 rm -f "conftest.$ac_objext"
9410 if { (eval echo "$as_me:9410: \"$ac_compile\"") >&5
9411   (eval $ac_compile) 2>&5
9412   ac_status=$?
9413   echo "$as_me:9413: \$? = $ac_status" >&5
9414   (exit "$ac_status"); } &&
9415          { ac_try='test -s "conftest.$ac_objext"'
9416   { (eval echo "$as_me:9416: \"$ac_try\"") >&5
9417   (eval $ac_try) 2>&5
9418   ac_status=$?
9419   echo "$as_me:9419: \$? = $ac_status" >&5
9420   (exit "$ac_status"); }; }; then
9421   :
9422 else
9423   echo "$as_me: failed program was:" >&5
9424 cat "conftest.$ac_ext" >&5
9425 cf_have_incdir=yes
9426 fi
9427 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9428                           CPPFLAGS=$cf_save_CPPFLAGS
9429                         fi
9430                   fi
9431                 fi
9432
9433                 if test "$cf_have_incdir" = no ; then
9434                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9435
9436 echo "${as_me:-configure}:9436: testing adding $cf_add_incdir to include-path ..." 1>&5
9437
9438                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9439
9440                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9441                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9442                   cf_add_incdir="$cf_top_incdir"
9443                 else
9444                   break
9445                 fi
9446           else
9447                 break
9448           fi
9449         done
9450   done
9451 fi
9452
9453 fi
9454
9455 # Set definitions to allow ifdef'ing for ncurses.h
9456
9457 case "$cf_cv_ncurses_header" in
9458 (*ncurses.h)
9459
9460 cat >>confdefs.h <<\EOF
9461 #define HAVE_NCURSES_H 1
9462 EOF
9463
9464         ;;
9465 esac
9466
9467 case "$cf_cv_ncurses_header" in
9468 (ncurses/curses.h|ncurses/ncurses.h)
9469
9470 cat >>confdefs.h <<\EOF
9471 #define HAVE_NCURSES_NCURSES_H 1
9472 EOF
9473
9474         ;;
9475 (ncursesw/curses.h|ncursesw/ncurses.h)
9476
9477 cat >>confdefs.h <<\EOF
9478 #define HAVE_NCURSESW_NCURSES_H 1
9479 EOF
9480
9481         ;;
9482 esac
9483
9484 echo "$as_me:9484: checking for terminfo header" >&5
9485 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9486 if test "${cf_cv_term_header+set}" = set; then
9487   echo $ECHO_N "(cached) $ECHO_C" >&6
9488 else
9489
9490 case "${cf_cv_ncurses_header}" in
9491 (*/ncurses.h|*/ncursesw.h)
9492         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9493         ;;
9494 (*)
9495         cf_term_header=term.h
9496         ;;
9497 esac
9498
9499 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9500 do
9501 cat >"conftest.$ac_ext" <<_ACEOF
9502 #line 9502 "configure"
9503 #include "confdefs.h"
9504 #include <stdio.h>
9505 #include <${cf_cv_ncurses_header:-curses.h}>
9506 #include <$cf_test>
9507
9508 int
9509 main (void)
9510 {
9511 int x = auto_left_margin; (void)x
9512   ;
9513   return 0;
9514 }
9515 _ACEOF
9516 rm -f "conftest.$ac_objext"
9517 if { (eval echo "$as_me:9517: \"$ac_compile\"") >&5
9518   (eval $ac_compile) 2>&5
9519   ac_status=$?
9520   echo "$as_me:9520: \$? = $ac_status" >&5
9521   (exit "$ac_status"); } &&
9522          { ac_try='test -s "conftest.$ac_objext"'
9523   { (eval echo "$as_me:9523: \"$ac_try\"") >&5
9524   (eval $ac_try) 2>&5
9525   ac_status=$?
9526   echo "$as_me:9526: \$? = $ac_status" >&5
9527   (exit "$ac_status"); }; }; then
9528
9529         cf_cv_term_header="$cf_test"
9530 else
9531   echo "$as_me: failed program was:" >&5
9532 cat "conftest.$ac_ext" >&5
9533
9534         cf_cv_term_header=unknown
9535
9536 fi
9537 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9538         test "$cf_cv_term_header" != unknown && break
9539 done
9540
9541 fi
9542 echo "$as_me:9542: result: $cf_cv_term_header" >&5
9543 echo "${ECHO_T}$cf_cv_term_header" >&6
9544
9545 # Set definitions to allow ifdef'ing to accommodate subdirectories
9546
9547 case "$cf_cv_term_header" in
9548 (*term.h)
9549
9550 cat >>confdefs.h <<\EOF
9551 #define HAVE_TERM_H 1
9552 EOF
9553
9554         ;;
9555 esac
9556
9557 case "$cf_cv_term_header" in
9558 (ncurses/term.h)
9559
9560 cat >>confdefs.h <<\EOF
9561 #define HAVE_NCURSES_TERM_H 1
9562 EOF
9563
9564         ;;
9565 (ncursesw/term.h)
9566
9567 cat >>confdefs.h <<\EOF
9568 #define HAVE_NCURSESW_TERM_H 1
9569 EOF
9570
9571         ;;
9572 esac
9573
9574 # some applications need this, but should check for NCURSES_VERSION
9575
9576 cat >>confdefs.h <<\EOF
9577 #define NCURSES 1
9578 EOF
9579
9580 echo "$as_me:9580: checking for ncurses version" >&5
9581 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9582 if test "${cf_cv_ncurses_version+set}" = set; then
9583   echo $ECHO_N "(cached) $ECHO_C" >&6
9584 else
9585
9586         cf_cv_ncurses_version=no
9587         cf_tempfile=out$$
9588         rm -f "$cf_tempfile"
9589         if test "$cross_compiling" = yes; then
9590
9591         # This will not work if the preprocessor splits the line after the
9592         # Autoconf token.  The 'unproto' program does that.
9593         cat > "conftest.$ac_ext" <<EOF
9594 #include <${cf_cv_ncurses_header:-curses.h}>
9595 #undef Autoconf
9596 #ifdef NCURSES_VERSION
9597 Autoconf NCURSES_VERSION
9598 #else
9599 #ifdef __NCURSES_H
9600 Autoconf "old"
9601 #endif
9602 ;
9603 #endif
9604 EOF
9605         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9606         { (eval echo "$as_me:9606: \"$cf_try\"") >&5
9607   (eval $cf_try) 2>&5
9608   ac_status=$?
9609   echo "$as_me:9609: \$? = $ac_status" >&5
9610   (exit "$ac_status"); }
9611         if test -f conftest.out ; then
9612                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9613                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9614                 rm -f conftest.out
9615         fi
9616
9617 else
9618   cat >"conftest.$ac_ext" <<_ACEOF
9619 #line 9619 "configure"
9620 #include "confdefs.h"
9621
9622 #include <${cf_cv_ncurses_header:-curses.h}>
9623 #include <stdio.h>
9624 int main(void)
9625 {
9626         FILE *fp = fopen("$cf_tempfile", "w");
9627 #ifdef NCURSES_VERSION
9628 # ifdef NCURSES_VERSION_PATCH
9629         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9630 # else
9631         fprintf(fp, "%s\\n", NCURSES_VERSION);
9632 # endif
9633 #else
9634 # ifdef __NCURSES_H
9635         fprintf(fp, "old\\n");
9636 # else
9637         make an error
9638 # endif
9639 #endif
9640         ${cf_cv_main_return:-return}(0);
9641 }
9642 _ACEOF
9643 rm -f "conftest$ac_exeext"
9644 if { (eval echo "$as_me:9644: \"$ac_link\"") >&5
9645   (eval $ac_link) 2>&5
9646   ac_status=$?
9647   echo "$as_me:9647: \$? = $ac_status" >&5
9648   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9649   { (eval echo "$as_me:9649: \"$ac_try\"") >&5
9650   (eval $ac_try) 2>&5
9651   ac_status=$?
9652   echo "$as_me:9652: \$? = $ac_status" >&5
9653   (exit "$ac_status"); }; }; then
9654
9655         cf_cv_ncurses_version=`cat $cf_tempfile`
9656 else
9657   echo "$as_me: program exited with status $ac_status" >&5
9658 echo "$as_me: failed program was:" >&5
9659 cat "conftest.$ac_ext" >&5
9660 fi
9661 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9662 fi
9663         rm -f "$cf_tempfile"
9664
9665 fi
9666 echo "$as_me:9666: result: $cf_cv_ncurses_version" >&5
9667 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9668 test "$cf_cv_ncurses_version" = no ||
9669 cat >>confdefs.h <<\EOF
9670 #define NCURSES 1
9671 EOF
9672
9673 cf_nculib_root=$cf_cv_screen
9674         # This works, except for the special case where we find gpm, but
9675         # ncurses is in a nonstandard location via $LIBS, and we really want
9676         # to link gpm.
9677 cf_ncurses_LIBS=""
9678 cf_ncurses_SAVE="$LIBS"
9679 echo "$as_me:9679: checking for Gpm_Open in -lgpm" >&5
9680 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9681 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9682   echo $ECHO_N "(cached) $ECHO_C" >&6
9683 else
9684   ac_check_lib_save_LIBS=$LIBS
9685 LIBS="-lgpm  $LIBS"
9686 cat >"conftest.$ac_ext" <<_ACEOF
9687 #line 9687 "configure"
9688 #include "confdefs.h"
9689
9690 /* Override any gcc2 internal prototype to avoid an error.  */
9691 #ifdef __cplusplus
9692 extern "C"
9693 #endif
9694 /* We use char because int might match the return type of a gcc2
9695    builtin and then its argument prototype would still apply.  */
9696 char Gpm_Open ();
9697 int
9698 main (void)
9699 {
9700 Gpm_Open ();
9701   ;
9702   return 0;
9703 }
9704 _ACEOF
9705 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9706 if { (eval echo "$as_me:9706: \"$ac_link\"") >&5
9707   (eval $ac_link) 2>&5
9708   ac_status=$?
9709   echo "$as_me:9709: \$? = $ac_status" >&5
9710   (exit "$ac_status"); } &&
9711          { ac_try='test -s "conftest$ac_exeext"'
9712   { (eval echo "$as_me:9712: \"$ac_try\"") >&5
9713   (eval $ac_try) 2>&5
9714   ac_status=$?
9715   echo "$as_me:9715: \$? = $ac_status" >&5
9716   (exit "$ac_status"); }; }; then
9717   ac_cv_lib_gpm_Gpm_Open=yes
9718 else
9719   echo "$as_me: failed program was:" >&5
9720 cat "conftest.$ac_ext" >&5
9721 ac_cv_lib_gpm_Gpm_Open=no
9722 fi
9723 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9724 LIBS=$ac_check_lib_save_LIBS
9725 fi
9726 echo "$as_me:9726: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9727 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9728 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9729   echo "$as_me:9729: checking for initscr in -lgpm" >&5
9730 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9731 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9732   echo $ECHO_N "(cached) $ECHO_C" >&6
9733 else
9734   ac_check_lib_save_LIBS=$LIBS
9735 LIBS="-lgpm  $LIBS"
9736 cat >"conftest.$ac_ext" <<_ACEOF
9737 #line 9737 "configure"
9738 #include "confdefs.h"
9739
9740 /* Override any gcc2 internal prototype to avoid an error.  */
9741 #ifdef __cplusplus
9742 extern "C"
9743 #endif
9744 /* We use char because int might match the return type of a gcc2
9745    builtin and then its argument prototype would still apply.  */
9746 char initscr ();
9747 int
9748 main (void)
9749 {
9750 initscr ();
9751   ;
9752   return 0;
9753 }
9754 _ACEOF
9755 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9756 if { (eval echo "$as_me:9756: \"$ac_link\"") >&5
9757   (eval $ac_link) 2>&5
9758   ac_status=$?
9759   echo "$as_me:9759: \$? = $ac_status" >&5
9760   (exit "$ac_status"); } &&
9761          { ac_try='test -s "conftest$ac_exeext"'
9762   { (eval echo "$as_me:9762: \"$ac_try\"") >&5
9763   (eval $ac_try) 2>&5
9764   ac_status=$?
9765   echo "$as_me:9765: \$? = $ac_status" >&5
9766   (exit "$ac_status"); }; }; then
9767   ac_cv_lib_gpm_initscr=yes
9768 else
9769   echo "$as_me: failed program was:" >&5
9770 cat "conftest.$ac_ext" >&5
9771 ac_cv_lib_gpm_initscr=no
9772 fi
9773 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9774 LIBS=$ac_check_lib_save_LIBS
9775 fi
9776 echo "$as_me:9776: result: $ac_cv_lib_gpm_initscr" >&5
9777 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9778 if test "$ac_cv_lib_gpm_initscr" = yes; then
9779   LIBS="$cf_ncurses_SAVE"
9780 else
9781   cf_ncurses_LIBS="-lgpm"
9782 fi
9783
9784 fi
9785
9786 case "$host_os" in
9787 (freebsd*)
9788         # This is only necessary if you are linking against an obsolete
9789         # version of ncurses (but it should do no harm, since it is static).
9790         if test "$cf_nculib_root" = ncurses ; then
9791                 echo "$as_me:9791: checking for tgoto in -lmytinfo" >&5
9792 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9793 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9794   echo $ECHO_N "(cached) $ECHO_C" >&6
9795 else
9796   ac_check_lib_save_LIBS=$LIBS
9797 LIBS="-lmytinfo  $LIBS"
9798 cat >"conftest.$ac_ext" <<_ACEOF
9799 #line 9799 "configure"
9800 #include "confdefs.h"
9801
9802 /* Override any gcc2 internal prototype to avoid an error.  */
9803 #ifdef __cplusplus
9804 extern "C"
9805 #endif
9806 /* We use char because int might match the return type of a gcc2
9807    builtin and then its argument prototype would still apply.  */
9808 char tgoto ();
9809 int
9810 main (void)
9811 {
9812 tgoto ();
9813   ;
9814   return 0;
9815 }
9816 _ACEOF
9817 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9818 if { (eval echo "$as_me:9818: \"$ac_link\"") >&5
9819   (eval $ac_link) 2>&5
9820   ac_status=$?
9821   echo "$as_me:9821: \$? = $ac_status" >&5
9822   (exit "$ac_status"); } &&
9823          { ac_try='test -s "conftest$ac_exeext"'
9824   { (eval echo "$as_me:9824: \"$ac_try\"") >&5
9825   (eval $ac_try) 2>&5
9826   ac_status=$?
9827   echo "$as_me:9827: \$? = $ac_status" >&5
9828   (exit "$ac_status"); }; }; then
9829   ac_cv_lib_mytinfo_tgoto=yes
9830 else
9831   echo "$as_me: failed program was:" >&5
9832 cat "conftest.$ac_ext" >&5
9833 ac_cv_lib_mytinfo_tgoto=no
9834 fi
9835 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9836 LIBS=$ac_check_lib_save_LIBS
9837 fi
9838 echo "$as_me:9838: result: $ac_cv_lib_mytinfo_tgoto" >&5
9839 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9840 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9841   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9842 fi
9843
9844         fi
9845         ;;
9846 esac
9847
9848 cf_add_libs="$LIBS"
9849 # reverse order
9850 cf_add_0lib=
9851 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9852 # filter duplicates
9853 for cf_add_1lib in $cf_add_0lib; do
9854         for cf_add_2lib in $cf_add_libs; do
9855                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9856                         cf_add_1lib=
9857                         break
9858                 fi
9859         done
9860         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9861 done
9862 LIBS="$cf_add_libs"
9863
9864 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9865 then
9866
9867 cf_add_libs="$LIBS"
9868 # reverse order
9869 cf_add_0lib=
9870 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9871 # filter duplicates
9872 for cf_add_1lib in $cf_add_0lib; do
9873         for cf_add_2lib in $cf_add_libs; do
9874                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9875                         cf_add_1lib=
9876                         break
9877                 fi
9878         done
9879         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9880 done
9881 LIBS="$cf_add_libs"
9882
9883 else
9884
9885         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9886         cf_libdir=""
9887         echo "$as_me:9887: checking for initscr" >&5
9888 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9889 if test "${ac_cv_func_initscr+set}" = set; then
9890   echo $ECHO_N "(cached) $ECHO_C" >&6
9891 else
9892   cat >"conftest.$ac_ext" <<_ACEOF
9893 #line 9893 "configure"
9894 #include "confdefs.h"
9895 #define initscr autoconf_temporary
9896 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9897 #undef initscr
9898
9899 #ifdef __cplusplus
9900 extern "C"
9901 #endif
9902
9903 /* We use char because int might match the return type of a gcc2
9904    builtin and then its argument prototype would still apply.  */
9905 char initscr (void);
9906
9907 int
9908 main (void)
9909 {
9910
9911 /* The GNU C library defines stubs for functions which it implements
9912     to always fail with ENOSYS.  Some functions are actually named
9913     something starting with __ and the normal name is an alias.  */
9914 #if defined (__stub_initscr) || defined (__stub___initscr)
9915 #error found stub for initscr
9916 #endif
9917
9918         return initscr ();
9919   ;
9920   return 0;
9921 }
9922 _ACEOF
9923 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9924 if { (eval echo "$as_me:9924: \"$ac_link\"") >&5
9925   (eval $ac_link) 2>&5
9926   ac_status=$?
9927   echo "$as_me:9927: \$? = $ac_status" >&5
9928   (exit "$ac_status"); } &&
9929          { ac_try='test -s "conftest$ac_exeext"'
9930   { (eval echo "$as_me:9930: \"$ac_try\"") >&5
9931   (eval $ac_try) 2>&5
9932   ac_status=$?
9933   echo "$as_me:9933: \$? = $ac_status" >&5
9934   (exit "$ac_status"); }; }; then
9935   ac_cv_func_initscr=yes
9936 else
9937   echo "$as_me: failed program was:" >&5
9938 cat "conftest.$ac_ext" >&5
9939 ac_cv_func_initscr=no
9940 fi
9941 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9942 fi
9943 echo "$as_me:9943: result: $ac_cv_func_initscr" >&5
9944 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9945 if test "$ac_cv_func_initscr" = yes; then
9946   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9947 else
9948
9949                 cf_save_LIBS="$LIBS"
9950                 echo "$as_me:9950: checking for initscr in -l$cf_nculib_root" >&5
9951 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9952                 LIBS="-l$cf_nculib_root $LIBS"
9953                 cat >"conftest.$ac_ext" <<_ACEOF
9954 #line 9954 "configure"
9955 #include "confdefs.h"
9956 #include <${cf_cv_ncurses_header:-curses.h}>
9957 int
9958 main (void)
9959 {
9960 initscr()
9961   ;
9962   return 0;
9963 }
9964 _ACEOF
9965 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9966 if { (eval echo "$as_me:9966: \"$ac_link\"") >&5
9967   (eval $ac_link) 2>&5
9968   ac_status=$?
9969   echo "$as_me:9969: \$? = $ac_status" >&5
9970   (exit "$ac_status"); } &&
9971          { ac_try='test -s "conftest$ac_exeext"'
9972   { (eval echo "$as_me:9972: \"$ac_try\"") >&5
9973   (eval $ac_try) 2>&5
9974   ac_status=$?
9975   echo "$as_me:9975: \$? = $ac_status" >&5
9976   (exit "$ac_status"); }; }; then
9977   echo "$as_me:9977: result: yes" >&5
9978 echo "${ECHO_T}yes" >&6
9979                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9980
9981 else
9982   echo "$as_me: failed program was:" >&5
9983 cat "conftest.$ac_ext" >&5
9984 echo "$as_me:9984: result: no" >&5
9985 echo "${ECHO_T}no" >&6
9986
9987 cf_search=
9988 cf_library_path_list=""
9989 if test -n "${LDFLAGS}${LIBS}" ; then
9990         for cf_library_path in $LDFLAGS $LIBS
9991         do
9992                 case "$cf_library_path" in
9993                 (-L*)
9994                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9995
9996 test "x$cf_library_path" != "xNONE" && \
9997 test -d "$cf_library_path" && \
9998  {
9999         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10000         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10001         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10002         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10003         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10004         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"
10005 }
10006
10007                         cf_library_path_list="$cf_library_path_list $cf_search"
10008                         ;;
10009                 esac
10010         done
10011 fi
10012
10013 cf_search=
10014
10015 test "x$prefix" != "xNONE" && \
10016 test -d "$prefix" && \
10017  {
10018         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10019         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10020         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10021         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10022         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10023         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10024 }
10025
10026 for cf_subdir_prefix in \
10027         /usr \
10028         /usr/local \
10029         /usr/pkg \
10030         /opt \
10031         /opt/local \
10032         $HOME
10033 do
10034
10035 test "x$cf_subdir_prefix" != "x$prefix" && \
10036 test -d "$cf_subdir_prefix" && \
10037 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10038         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10039         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10040         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10041         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10042         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10043         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"
10044 }
10045
10046 done
10047
10048 cf_search="$cf_library_path_list $cf_search"
10049
10050                         for cf_libdir in $cf_search
10051                         do
10052                                 echo "$as_me:10052: checking for -l$cf_nculib_root in $cf_libdir" >&5
10053 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10054                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10055                                 cat >"conftest.$ac_ext" <<_ACEOF
10056 #line 10056 "configure"
10057 #include "confdefs.h"
10058 #include <${cf_cv_ncurses_header:-curses.h}>
10059 int
10060 main (void)
10061 {
10062 initscr()
10063   ;
10064   return 0;
10065 }
10066 _ACEOF
10067 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10068 if { (eval echo "$as_me:10068: \"$ac_link\"") >&5
10069   (eval $ac_link) 2>&5
10070   ac_status=$?
10071   echo "$as_me:10071: \$? = $ac_status" >&5
10072   (exit "$ac_status"); } &&
10073          { ac_try='test -s "conftest$ac_exeext"'
10074   { (eval echo "$as_me:10074: \"$ac_try\"") >&5
10075   (eval $ac_try) 2>&5
10076   ac_status=$?
10077   echo "$as_me:10077: \$? = $ac_status" >&5
10078   (exit "$ac_status"); }; }; then
10079   echo "$as_me:10079: result: yes" >&5
10080 echo "${ECHO_T}yes" >&6
10081                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10082                                          break
10083 else
10084   echo "$as_me: failed program was:" >&5
10085 cat "conftest.$ac_ext" >&5
10086 echo "$as_me:10086: result: no" >&5
10087 echo "${ECHO_T}no" >&6
10088                                          LIBS="$cf_save_LIBS"
10089 fi
10090 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10091                         done
10092
10093 fi
10094 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10095
10096 fi
10097
10098 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10099
10100 if test "$cf_found_library" = no ; then
10101         { { echo "$as_me:10101: error: Cannot link $cf_nculib_root library" >&5
10102 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10103    { (exit 1); exit 1; }; }
10104 fi
10105
10106 fi
10107
10108 if test -n "$cf_ncurses_LIBS" ; then
10109         echo "$as_me:10109: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10110 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10111         cf_ncurses_SAVE="$LIBS"
10112         for p in $cf_ncurses_LIBS ; do
10113                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
10114                 if test "$q" != "$LIBS" ; then
10115                         LIBS="$q"
10116                 fi
10117         done
10118         cat >"conftest.$ac_ext" <<_ACEOF
10119 #line 10119 "configure"
10120 #include "confdefs.h"
10121 #include <${cf_cv_ncurses_header:-curses.h}>
10122 int
10123 main (void)
10124 {
10125 initscr(); mousemask(0,0); tigetstr((char *)0);
10126   ;
10127   return 0;
10128 }
10129 _ACEOF
10130 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10131 if { (eval echo "$as_me:10131: \"$ac_link\"") >&5
10132   (eval $ac_link) 2>&5
10133   ac_status=$?
10134   echo "$as_me:10134: \$? = $ac_status" >&5
10135   (exit "$ac_status"); } &&
10136          { ac_try='test -s "conftest$ac_exeext"'
10137   { (eval echo "$as_me:10137: \"$ac_try\"") >&5
10138   (eval $ac_try) 2>&5
10139   ac_status=$?
10140   echo "$as_me:10140: \$? = $ac_status" >&5
10141   (exit "$ac_status"); }; }; then
10142   echo "$as_me:10142: result: yes" >&5
10143 echo "${ECHO_T}yes" >&6
10144 else
10145   echo "$as_me: failed program was:" >&5
10146 cat "conftest.$ac_ext" >&5
10147 echo "$as_me:10147: result: no" >&5
10148 echo "${ECHO_T}no" >&6
10149                  LIBS="$cf_ncurses_SAVE"
10150 fi
10151 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10152 fi
10153
10154 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10155
10156 cat >>confdefs.h <<EOF
10157 #define $cf_nculib_ROOT 1
10158 EOF
10159
10160         fi
10161 else
10162         NCURSES_CONFIG=none
10163 fi
10164
10165         ;;
10166 (ncurses*)
10167
10168 cf_ncuconfig_root=$cf_cv_screen
10169 cf_have_ncuconfig=no
10170
10171 if test "x${PKG_CONFIG:=none}" != xnone; then
10172         echo "$as_me:10172: checking pkg-config for $cf_ncuconfig_root" >&5
10173 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10174         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
10175                 echo "$as_me:10175: result: yes" >&5
10176 echo "${ECHO_T}yes" >&6
10177
10178                 echo "$as_me:10178: checking if the $cf_ncuconfig_root package files work" >&5
10179 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10180                 cf_have_ncuconfig=unknown
10181
10182                 cf_save_CFLAGS="$CFLAGS"
10183                 cf_save_CPPFLAGS="$CPPFLAGS"
10184                 cf_save_LIBS="$LIBS"
10185
10186                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10187                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
10188
10189                 # while -W for passing linker flags is prevalent, it is not "standard".
10190                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10191                 # incompatible _and_ non-standard -W option which gives an error.  Work
10192                 # around that pitfall.
10193                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10194                 (x*c[89]9@@*-W*)
10195
10196 cf_fix_cppflags=no
10197 cf_new_cflags=
10198 cf_new_cppflags=
10199 cf_new_extra_cppflags=
10200
10201 for cf_add_cflags in $cf_pkg_cflags
10202 do
10203 case "$cf_fix_cppflags" in
10204 (no)
10205         case "$cf_add_cflags" in
10206         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10207                 case "$cf_add_cflags" in
10208                 (-D*)
10209                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10210
10211                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10212                                 && test -z "${cf_tst_cflags}" \
10213                                 && cf_fix_cppflags=yes
10214
10215                         if test "$cf_fix_cppflags" = yes ; then
10216
10217         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10218         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10219
10220                                 continue
10221                         elif test "${cf_tst_cflags}" = "\"'" ; then
10222
10223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10225
10226                                 continue
10227                         fi
10228                         ;;
10229                 esac
10230                 case "$CPPFLAGS" in
10231                 (*$cf_add_cflags)
10232                         ;;
10233                 (*)
10234                         case "$cf_add_cflags" in
10235                         (-D*)
10236                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10237
10238 CPPFLAGS=`echo "$CPPFLAGS" | \
10239         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10240                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10241
10242                                 ;;
10243                         esac
10244
10245         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10246         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10247
10248                         ;;
10249                 esac
10250                 ;;
10251         (*)
10252
10253         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10254         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10255
10256                 ;;
10257         esac
10258         ;;
10259 (yes)
10260
10261         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10262         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10263
10264         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10265
10266         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10267                 && test -z "${cf_tst_cflags}" \
10268                 && cf_fix_cppflags=no
10269         ;;
10270 esac
10271 done
10272
10273 if test -n "$cf_new_cflags" ; then
10274
10275         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10276         CFLAGS="${CFLAGS}$cf_new_cflags"
10277
10278 fi
10279
10280 if test -n "$cf_new_cppflags" ; then
10281
10282         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10283         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10284
10285 fi
10286
10287 if test -n "$cf_new_extra_cppflags" ; then
10288
10289         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10290         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10291
10292 fi
10293
10294 cf_add_libs="$LIBS"
10295 # reverse order
10296 cf_add_0lib=
10297 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10298 # filter duplicates
10299 for cf_add_1lib in $cf_add_0lib; do
10300         for cf_add_2lib in $cf_add_libs; do
10301                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10302                         cf_add_1lib=
10303                         break
10304                 fi
10305         done
10306         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10307 done
10308 LIBS="$cf_add_libs"
10309
10310                         cat >"conftest.$ac_ext" <<_ACEOF
10311 #line 10311 "configure"
10312 #include "confdefs.h"
10313 #include <${cf_cv_ncurses_header:-curses.h}>
10314 int
10315 main (void)
10316 {
10317 initscr(); mousemask(0,0); tigetstr((char *)0);
10318   ;
10319   return 0;
10320 }
10321 _ACEOF
10322 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10323 if { (eval echo "$as_me:10323: \"$ac_link\"") >&5
10324   (eval $ac_link) 2>&5
10325   ac_status=$?
10326   echo "$as_me:10326: \$? = $ac_status" >&5
10327   (exit "$ac_status"); } &&
10328          { ac_try='test -s "conftest$ac_exeext"'
10329   { (eval echo "$as_me:10329: \"$ac_try\"") >&5
10330   (eval $ac_try) 2>&5
10331   ac_status=$?
10332   echo "$as_me:10332: \$? = $ac_status" >&5
10333   (exit "$ac_status"); }; }; then
10334   if test "$cross_compiling" = yes; then
10335   cf_test_ncuconfig=maybe
10336 else
10337   cat >"conftest.$ac_ext" <<_ACEOF
10338 #line 10338 "configure"
10339 #include "confdefs.h"
10340 #include <${cf_cv_ncurses_header:-curses.h}>
10341                                         int main(void)
10342                                         { const char *xx = curses_version(); return (xx == 0); }
10343 _ACEOF
10344 rm -f "conftest$ac_exeext"
10345 if { (eval echo "$as_me:10345: \"$ac_link\"") >&5
10346   (eval $ac_link) 2>&5
10347   ac_status=$?
10348   echo "$as_me:10348: \$? = $ac_status" >&5
10349   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10350   { (eval echo "$as_me:10350: \"$ac_try\"") >&5
10351   (eval $ac_try) 2>&5
10352   ac_status=$?
10353   echo "$as_me:10353: \$? = $ac_status" >&5
10354   (exit "$ac_status"); }; }; then
10355   cf_test_ncuconfig=yes
10356 else
10357   echo "$as_me: program exited with status $ac_status" >&5
10358 echo "$as_me: failed program was:" >&5
10359 cat "conftest.$ac_ext" >&5
10360 cf_test_ncuconfig=no
10361 fi
10362 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10363 fi
10364 else
10365   echo "$as_me: failed program was:" >&5
10366 cat "conftest.$ac_ext" >&5
10367 cf_test_ncuconfig=no
10368 fi
10369 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10370
10371                         CFLAGS="$cf_save_CFLAGS"
10372                         CPPFLAGS="$cf_save_CPPFLAGS"
10373                         LIBS="$cf_save_LIBS"
10374
10375                         if test "x$cf_test_ncuconfig" != xyes; then
10376                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10377                                 cf_pkg_cflags="$cf_temp"
10378                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10379                                 cf_pkg_libs="$cf_temp"
10380                         fi
10381                         ;;
10382                 esac
10383
10384 for cf_add_cflags in $cf_pkg_cflags
10385 do
10386         case "x$cf_add_cflags" in
10387         (x-[DU]*)
10388
10389 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10390 while true
10391 do
10392         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'`
10393         test "$CFLAGS" != "$cf_old_cflag" || break
10394
10395         CFLAGS="$cf_old_cflag"
10396 done
10397
10398 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10399 while true
10400 do
10401         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'`
10402         test "$CPPFLAGS" != "$cf_old_cflag" || break
10403
10404         CPPFLAGS="$cf_old_cflag"
10405 done
10406
10407                 ;;
10408         esac
10409
10410 cf_fix_cppflags=no
10411 cf_new_cflags=
10412 cf_new_cppflags=
10413 cf_new_extra_cppflags=
10414
10415 for cf_add_cflags in $cf_add_cflags
10416 do
10417 case "$cf_fix_cppflags" in
10418 (no)
10419         case "$cf_add_cflags" in
10420         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10421                 case "$cf_add_cflags" in
10422                 (-D*)
10423                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10424
10425                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10426                                 && test -z "${cf_tst_cflags}" \
10427                                 && cf_fix_cppflags=yes
10428
10429                         if test "$cf_fix_cppflags" = yes ; then
10430
10431         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10432         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10433
10434                                 continue
10435                         elif test "${cf_tst_cflags}" = "\"'" ; then
10436
10437         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10438         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10439
10440                                 continue
10441                         fi
10442                         ;;
10443                 esac
10444                 case "$CPPFLAGS" in
10445                 (*$cf_add_cflags)
10446                         ;;
10447                 (*)
10448                         case "$cf_add_cflags" in
10449                         (-D*)
10450                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10451
10452 CPPFLAGS=`echo "$CPPFLAGS" | \
10453         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10454                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10455
10456                                 ;;
10457                         esac
10458
10459         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10460         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10461
10462                         ;;
10463                 esac
10464                 ;;
10465         (*)
10466
10467         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10468         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10469
10470                 ;;
10471         esac
10472         ;;
10473 (yes)
10474
10475         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10476         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10477
10478         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10479
10480         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10481                 && test -z "${cf_tst_cflags}" \
10482                 && cf_fix_cppflags=no
10483         ;;
10484 esac
10485 done
10486
10487 if test -n "$cf_new_cflags" ; then
10488
10489         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10490         CFLAGS="${CFLAGS}$cf_new_cflags"
10491
10492 fi
10493
10494 if test -n "$cf_new_cppflags" ; then
10495
10496         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10497         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10498
10499 fi
10500
10501 if test -n "$cf_new_extra_cppflags" ; then
10502
10503         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10504         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10505
10506 fi
10507
10508 done
10509
10510 cf_add_libs="$LIBS"
10511 # reverse order
10512 cf_add_0lib=
10513 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10514 # filter duplicates
10515 for cf_add_1lib in $cf_add_0lib; do
10516         for cf_add_2lib in $cf_add_libs; do
10517                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10518                         cf_add_1lib=
10519                         break
10520                 fi
10521         done
10522         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10523 done
10524 LIBS="$cf_add_libs"
10525
10526                 cat >"conftest.$ac_ext" <<_ACEOF
10527 #line 10527 "configure"
10528 #include "confdefs.h"
10529 #include <${cf_cv_ncurses_header:-curses.h}>
10530 int
10531 main (void)
10532 {
10533 initscr(); mousemask(0,0); tigetstr((char *)0);
10534   ;
10535   return 0;
10536 }
10537 _ACEOF
10538 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10539 if { (eval echo "$as_me:10539: \"$ac_link\"") >&5
10540   (eval $ac_link) 2>&5
10541   ac_status=$?
10542   echo "$as_me:10542: \$? = $ac_status" >&5
10543   (exit "$ac_status"); } &&
10544          { ac_try='test -s "conftest$ac_exeext"'
10545   { (eval echo "$as_me:10545: \"$ac_try\"") >&5
10546   (eval $ac_try) 2>&5
10547   ac_status=$?
10548   echo "$as_me:10548: \$? = $ac_status" >&5
10549   (exit "$ac_status"); }; }; then
10550   if test "$cross_compiling" = yes; then
10551   cf_have_ncuconfig=maybe
10552 else
10553   cat >"conftest.$ac_ext" <<_ACEOF
10554 #line 10554 "configure"
10555 #include "confdefs.h"
10556 #include <${cf_cv_ncurses_header:-curses.h}>
10557                                 int main(void)
10558                                 { const char *xx = curses_version(); return (xx == 0); }
10559 _ACEOF
10560 rm -f "conftest$ac_exeext"
10561 if { (eval echo "$as_me:10561: \"$ac_link\"") >&5
10562   (eval $ac_link) 2>&5
10563   ac_status=$?
10564   echo "$as_me:10564: \$? = $ac_status" >&5
10565   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10566   { (eval echo "$as_me:10566: \"$ac_try\"") >&5
10567   (eval $ac_try) 2>&5
10568   ac_status=$?
10569   echo "$as_me:10569: \$? = $ac_status" >&5
10570   (exit "$ac_status"); }; }; then
10571   cf_have_ncuconfig=yes
10572 else
10573   echo "$as_me: program exited with status $ac_status" >&5
10574 echo "$as_me: failed program was:" >&5
10575 cat "conftest.$ac_ext" >&5
10576 cf_have_ncuconfig=no
10577 fi
10578 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10579 fi
10580 else
10581   echo "$as_me: failed program was:" >&5
10582 cat "conftest.$ac_ext" >&5
10583 cf_have_ncuconfig=no
10584 fi
10585 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10586                 echo "$as_me:10586: result: $cf_have_ncuconfig" >&5
10587 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10588                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10589                 if test "$cf_have_ncuconfig" != "yes"
10590                 then
10591                         CPPFLAGS="$cf_save_CPPFLAGS"
10592                         LIBS="$cf_save_LIBS"
10593                         NCURSES_CONFIG_PKG=none
10594                 else
10595
10596 cat >>confdefs.h <<\EOF
10597 #define NCURSES 1
10598 EOF
10599
10600                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10601
10602 echo "$as_me:10602: checking for terminfo header" >&5
10603 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10604 if test "${cf_cv_term_header+set}" = set; then
10605   echo $ECHO_N "(cached) $ECHO_C" >&6
10606 else
10607
10608 case "${cf_cv_ncurses_header}" in
10609 (*/ncurses.h|*/ncursesw.h)
10610         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10611         ;;
10612 (*)
10613         cf_term_header=term.h
10614         ;;
10615 esac
10616
10617 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10618 do
10619 cat >"conftest.$ac_ext" <<_ACEOF
10620 #line 10620 "configure"
10621 #include "confdefs.h"
10622 #include <stdio.h>
10623 #include <${cf_cv_ncurses_header:-curses.h}>
10624 #include <$cf_test>
10625
10626 int
10627 main (void)
10628 {
10629 int x = auto_left_margin; (void)x
10630   ;
10631   return 0;
10632 }
10633 _ACEOF
10634 rm -f "conftest.$ac_objext"
10635 if { (eval echo "$as_me:10635: \"$ac_compile\"") >&5
10636   (eval $ac_compile) 2>&5
10637   ac_status=$?
10638   echo "$as_me:10638: \$? = $ac_status" >&5
10639   (exit "$ac_status"); } &&
10640          { ac_try='test -s "conftest.$ac_objext"'
10641   { (eval echo "$as_me:10641: \"$ac_try\"") >&5
10642   (eval $ac_try) 2>&5
10643   ac_status=$?
10644   echo "$as_me:10644: \$? = $ac_status" >&5
10645   (exit "$ac_status"); }; }; then
10646
10647         cf_cv_term_header="$cf_test"
10648 else
10649   echo "$as_me: failed program was:" >&5
10650 cat "conftest.$ac_ext" >&5
10651
10652         cf_cv_term_header=unknown
10653
10654 fi
10655 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10656         test "$cf_cv_term_header" != unknown && break
10657 done
10658
10659 fi
10660 echo "$as_me:10660: result: $cf_cv_term_header" >&5
10661 echo "${ECHO_T}$cf_cv_term_header" >&6
10662
10663 # Set definitions to allow ifdef'ing to accommodate subdirectories
10664
10665 case "$cf_cv_term_header" in
10666 (*term.h)
10667
10668 cat >>confdefs.h <<\EOF
10669 #define HAVE_TERM_H 1
10670 EOF
10671
10672         ;;
10673 esac
10674
10675 case "$cf_cv_term_header" in
10676 (ncurses/term.h)
10677
10678 cat >>confdefs.h <<\EOF
10679 #define HAVE_NCURSES_TERM_H 1
10680 EOF
10681
10682         ;;
10683 (ncursesw/term.h)
10684
10685 cat >>confdefs.h <<\EOF
10686 #define HAVE_NCURSESW_TERM_H 1
10687 EOF
10688
10689         ;;
10690 esac
10691
10692                 fi
10693
10694         else
10695                 echo "$as_me:10695: result: no" >&5
10696 echo "${ECHO_T}no" >&6
10697                 NCURSES_CONFIG_PKG=none
10698         fi
10699 else
10700         NCURSES_CONFIG_PKG=none
10701 fi
10702
10703 if test "x$cf_have_ncuconfig" = "xno"; then
10704         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10705
10706 if test -n "$ac_tool_prefix"; then
10707   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10708   do
10709     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10710 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10711 echo "$as_me:10711: checking for $ac_word" >&5
10712 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10713 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10714   echo $ECHO_N "(cached) $ECHO_C" >&6
10715 else
10716   if test -n "$NCURSES_CONFIG"; then
10717   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10718 else
10719   ac_save_IFS=$IFS; IFS=$ac_path_separator
10720 ac_dummy="$PATH"
10721 for ac_dir in $ac_dummy; do
10722   IFS=$ac_save_IFS
10723   test -z "$ac_dir" && ac_dir=.
10724   $as_executable_p "$ac_dir/$ac_word" || continue
10725 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10726 echo "$as_me:10726: found $ac_dir/$ac_word" >&5
10727 break
10728 done
10729
10730 fi
10731 fi
10732 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10733 if test -n "$NCURSES_CONFIG"; then
10734   echo "$as_me:10734: result: $NCURSES_CONFIG" >&5
10735 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10736 else
10737   echo "$as_me:10737: result: no" >&5
10738 echo "${ECHO_T}no" >&6
10739 fi
10740
10741     test -n "$NCURSES_CONFIG" && break
10742   done
10743 fi
10744 if test -z "$NCURSES_CONFIG"; then
10745   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10746   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10747 do
10748   # Extract the first word of "$ac_prog", so it can be a program name with args.
10749 set dummy $ac_prog; ac_word=$2
10750 echo "$as_me:10750: checking for $ac_word" >&5
10751 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10752 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10753   echo $ECHO_N "(cached) $ECHO_C" >&6
10754 else
10755   if test -n "$ac_ct_NCURSES_CONFIG"; then
10756   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10757 else
10758   ac_save_IFS=$IFS; IFS=$ac_path_separator
10759 ac_dummy="$PATH"
10760 for ac_dir in $ac_dummy; do
10761   IFS=$ac_save_IFS
10762   test -z "$ac_dir" && ac_dir=.
10763   $as_executable_p "$ac_dir/$ac_word" || continue
10764 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10765 echo "$as_me:10765: found $ac_dir/$ac_word" >&5
10766 break
10767 done
10768
10769 fi
10770 fi
10771 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10772 if test -n "$ac_ct_NCURSES_CONFIG"; then
10773   echo "$as_me:10773: result: $ac_ct_NCURSES_CONFIG" >&5
10774 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10775 else
10776   echo "$as_me:10776: result: no" >&5
10777 echo "${ECHO_T}no" >&6
10778 fi
10779
10780   test -n "$ac_ct_NCURSES_CONFIG" && break
10781 done
10782 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10783
10784   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10785 fi
10786
10787         if test "$NCURSES_CONFIG" != none ; then
10788
10789 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10790 do
10791         case "x$cf_add_cflags" in
10792         (x-[DU]*)
10793
10794 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10795 while true
10796 do
10797         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'`
10798         test "$CFLAGS" != "$cf_old_cflag" || break
10799
10800         CFLAGS="$cf_old_cflag"
10801 done
10802
10803 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10804 while true
10805 do
10806         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'`
10807         test "$CPPFLAGS" != "$cf_old_cflag" || break
10808
10809         CPPFLAGS="$cf_old_cflag"
10810 done
10811
10812                 ;;
10813         esac
10814
10815 cf_fix_cppflags=no
10816 cf_new_cflags=
10817 cf_new_cppflags=
10818 cf_new_extra_cppflags=
10819
10820 for cf_add_cflags in $cf_add_cflags
10821 do
10822 case "$cf_fix_cppflags" in
10823 (no)
10824         case "$cf_add_cflags" in
10825         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10826                 case "$cf_add_cflags" in
10827                 (-D*)
10828                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10829
10830                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10831                                 && test -z "${cf_tst_cflags}" \
10832                                 && cf_fix_cppflags=yes
10833
10834                         if test "$cf_fix_cppflags" = yes ; then
10835
10836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10838
10839                                 continue
10840                         elif test "${cf_tst_cflags}" = "\"'" ; then
10841
10842         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10843         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10844
10845                                 continue
10846                         fi
10847                         ;;
10848                 esac
10849                 case "$CPPFLAGS" in
10850                 (*$cf_add_cflags)
10851                         ;;
10852                 (*)
10853                         case "$cf_add_cflags" in
10854                         (-D*)
10855                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10856
10857 CPPFLAGS=`echo "$CPPFLAGS" | \
10858         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10859                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10860
10861                                 ;;
10862                         esac
10863
10864         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10865         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10866
10867                         ;;
10868                 esac
10869                 ;;
10870         (*)
10871
10872         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10873         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10874
10875                 ;;
10876         esac
10877         ;;
10878 (yes)
10879
10880         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10881         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10882
10883         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10884
10885         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10886                 && test -z "${cf_tst_cflags}" \
10887                 && cf_fix_cppflags=no
10888         ;;
10889 esac
10890 done
10891
10892 if test -n "$cf_new_cflags" ; then
10893
10894         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10895         CFLAGS="${CFLAGS}$cf_new_cflags"
10896
10897 fi
10898
10899 if test -n "$cf_new_cppflags" ; then
10900
10901         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10902         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10903
10904 fi
10905
10906 if test -n "$cf_new_extra_cppflags" ; then
10907
10908         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10909         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10910
10911 fi
10912
10913 done
10914
10915 cf_add_libs="$LIBS"
10916 # reverse order
10917 cf_add_0lib=
10918 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10919 # filter duplicates
10920 for cf_add_1lib in $cf_add_0lib; do
10921         for cf_add_2lib in $cf_add_libs; do
10922                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10923                         cf_add_1lib=
10924                         break
10925                 fi
10926         done
10927         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10928 done
10929 LIBS="$cf_add_libs"
10930
10931                 # even with config script, some packages use no-override for curses.h
10932
10933 echo "$as_me:10933: checking if we have identified curses headers" >&5
10934 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10935 if test "${cf_cv_ncurses_header+set}" = set; then
10936   echo $ECHO_N "(cached) $ECHO_C" >&6
10937 else
10938
10939 cf_cv_ncurses_header=none
10940 for cf_header in \
10941         ncurses.h $cf_cv_screen/ncurses.h \
10942         curses.h $cf_cv_screen/curses.h
10943 do
10944 cat >"conftest.$ac_ext" <<_ACEOF
10945 #line 10945 "configure"
10946 #include "confdefs.h"
10947 #include <${cf_header}>
10948 int
10949 main (void)
10950 {
10951 initscr(); tgoto("?", 0,0)
10952   ;
10953   return 0;
10954 }
10955 _ACEOF
10956 rm -f "conftest.$ac_objext"
10957 if { (eval echo "$as_me:10957: \"$ac_compile\"") >&5
10958   (eval $ac_compile) 2>&5
10959   ac_status=$?
10960   echo "$as_me:10960: \$? = $ac_status" >&5
10961   (exit "$ac_status"); } &&
10962          { ac_try='test -s "conftest.$ac_objext"'
10963   { (eval echo "$as_me:10963: \"$ac_try\"") >&5
10964   (eval $ac_try) 2>&5
10965   ac_status=$?
10966   echo "$as_me:10966: \$? = $ac_status" >&5
10967   (exit "$ac_status"); }; }; then
10968   cf_cv_ncurses_header=$cf_header; break
10969 else
10970   echo "$as_me: failed program was:" >&5
10971 cat "conftest.$ac_ext" >&5
10972 fi
10973 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10974 done
10975
10976 fi
10977 echo "$as_me:10977: result: $cf_cv_ncurses_header" >&5
10978 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10979
10980 if test "$cf_cv_ncurses_header" = none ; then
10981         { { echo "$as_me:10981: error: No curses header-files found" >&5
10982 echo "$as_me: error: No curses header-files found" >&2;}
10983    { (exit 1); exit 1; }; }
10984 fi
10985
10986 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10987
10988 for ac_header in $cf_cv_ncurses_header
10989 do
10990 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10991 echo "$as_me:10991: checking for $ac_header" >&5
10992 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10993 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10994   echo $ECHO_N "(cached) $ECHO_C" >&6
10995 else
10996   cat >"conftest.$ac_ext" <<_ACEOF
10997 #line 10997 "configure"
10998 #include "confdefs.h"
10999 #include <$ac_header>
11000 _ACEOF
11001 if { (eval echo "$as_me:11001: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11002   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
11003   ac_status=$?
11004   $EGREP -v '^ *\+' conftest.er1 >conftest.err
11005   rm -f conftest.er1
11006   cat conftest.err >&5
11007   echo "$as_me:11007: \$? = $ac_status" >&5
11008   (exit "$ac_status"); } >/dev/null; then
11009   if test -s conftest.err; then
11010     ac_cpp_err=$ac_c_preproc_warn_flag
11011   else
11012     ac_cpp_err=
11013   fi
11014 else
11015   ac_cpp_err=yes
11016 fi
11017 if test -z "$ac_cpp_err"; then
11018   eval "$as_ac_Header=yes"
11019 else
11020   echo "$as_me: failed program was:" >&5
11021   cat "conftest.$ac_ext" >&5
11022   eval "$as_ac_Header=no"
11023 fi
11024 rm -f conftest.err "conftest.$ac_ext"
11025 fi
11026 echo "$as_me:11026: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
11027 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
11028 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
11029   cat >>confdefs.h <<EOF
11030 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11031 EOF
11032
11033 fi
11034 done
11035
11036 cat >>confdefs.h <<\EOF
11037 #define NCURSES 1
11038 EOF
11039
11040 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11041
11042                 cat >>confdefs.h <<EOF
11043 #define $cf_nculib_ROOT 1
11044 EOF
11045
11046                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
11047
11048         else
11049
11050 cf_ncuhdr_root=$cf_cv_screen
11051
11052 test -n "$cf_cv_curses_dir" && \
11053 test "$cf_cv_curses_dir" != "no" && { \
11054
11055 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
11056   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
11057   do
11058         while test "$cf_add_incdir" != /usr/include
11059         do
11060           if test -d "$cf_add_incdir"
11061           then
11062                 cf_have_incdir=no
11063                 if test -n "$CFLAGS$CPPFLAGS" ; then
11064                   # a loop is needed to ensure we can add subdirs of existing dirs
11065                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11066                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11067                           cf_have_incdir=yes; break
11068                         fi
11069                   done
11070                 fi
11071
11072                 if test "$cf_have_incdir" = no ; then
11073                   if test "$cf_add_incdir" = /usr/local/include ; then
11074                         if test "$GCC" = yes
11075                         then
11076                           cf_save_CPPFLAGS=$CPPFLAGS
11077
11078         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11079         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11080
11081                           cat >"conftest.$ac_ext" <<_ACEOF
11082 #line 11082 "configure"
11083 #include "confdefs.h"
11084 #include <stdio.h>
11085 int
11086 main (void)
11087 {
11088 printf("Hello")
11089   ;
11090   return 0;
11091 }
11092 _ACEOF
11093 rm -f "conftest.$ac_objext"
11094 if { (eval echo "$as_me:11094: \"$ac_compile\"") >&5
11095   (eval $ac_compile) 2>&5
11096   ac_status=$?
11097   echo "$as_me:11097: \$? = $ac_status" >&5
11098   (exit "$ac_status"); } &&
11099          { ac_try='test -s "conftest.$ac_objext"'
11100   { (eval echo "$as_me:11100: \"$ac_try\"") >&5
11101   (eval $ac_try) 2>&5
11102   ac_status=$?
11103   echo "$as_me:11103: \$? = $ac_status" >&5
11104   (exit "$ac_status"); }; }; then
11105   :
11106 else
11107   echo "$as_me: failed program was:" >&5
11108 cat "conftest.$ac_ext" >&5
11109 cf_have_incdir=yes
11110 fi
11111 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11112                           CPPFLAGS=$cf_save_CPPFLAGS
11113                         fi
11114                   fi
11115                 fi
11116
11117                 if test "$cf_have_incdir" = no ; then
11118                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11119
11120 echo "${as_me:-configure}:11120: testing adding $cf_add_incdir to include-path ..." 1>&5
11121
11122                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11123
11124                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11125                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11126                   cf_add_incdir="$cf_top_incdir"
11127                 else
11128                   break
11129                 fi
11130           else
11131                 break
11132           fi
11133         done
11134   done
11135 fi
11136
11137 }
11138
11139 echo "$as_me:11139: checking for $cf_ncuhdr_root header in include-path" >&5
11140 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
11141 if test "${cf_cv_ncurses_h+set}" = set; then
11142   echo $ECHO_N "(cached) $ECHO_C" >&6
11143 else
11144
11145         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
11146         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
11147         for cf_header in $cf_header_list
11148         do
11149
11150         cat >"conftest.$ac_ext" <<_ACEOF
11151 #line 11151 "configure"
11152 #include "confdefs.h"
11153
11154 #include <$cf_header>
11155 int
11156 main (void)
11157 {
11158
11159 #ifdef NCURSES_VERSION
11160
11161 printf("%s\\n", NCURSES_VERSION);
11162 #else
11163 #ifdef __NCURSES_H
11164 printf("old\\n");
11165 #else
11166         make an error
11167 #endif
11168 #endif
11169
11170   ;
11171   return 0;
11172 }
11173 _ACEOF
11174 rm -f "conftest.$ac_objext"
11175 if { (eval echo "$as_me:11175: \"$ac_compile\"") >&5
11176   (eval $ac_compile) 2>&5
11177   ac_status=$?
11178   echo "$as_me:11178: \$? = $ac_status" >&5
11179   (exit "$ac_status"); } &&
11180          { ac_try='test -s "conftest.$ac_objext"'
11181   { (eval echo "$as_me:11181: \"$ac_try\"") >&5
11182   (eval $ac_try) 2>&5
11183   ac_status=$?
11184   echo "$as_me:11184: \$? = $ac_status" >&5
11185   (exit "$ac_status"); }; }; then
11186   cf_cv_ncurses_h=$cf_header
11187
11188 else
11189   echo "$as_me: failed program was:" >&5
11190 cat "conftest.$ac_ext" >&5
11191 cf_cv_ncurses_h=no
11192 fi
11193 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11194
11195                 test "$cf_cv_ncurses_h" != no && break
11196         done
11197
11198 fi
11199 echo "$as_me:11199: result: $cf_cv_ncurses_h" >&5
11200 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
11201
11202 if test "$cf_cv_ncurses_h" != no ; then
11203         cf_cv_ncurses_header=$cf_cv_ncurses_h
11204 else
11205
11206 echo "$as_me:11206: checking for $cf_ncuhdr_root include-path" >&5
11207 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11208 if test "${cf_cv_ncurses_h2+set}" = set; then
11209   echo $ECHO_N "(cached) $ECHO_C" >&6
11210 else
11211
11212         test -n "$verbose" && echo
11213
11214 cf_search=
11215
11216 # collect the current set of include-directories from compiler flags
11217 cf_header_path_list=""
11218 if test -n "${CFLAGS}${CPPFLAGS}" ; then
11219         for cf_header_path in $CPPFLAGS $CFLAGS
11220         do
11221                 case "$cf_header_path" in
11222                 (-I*)
11223                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11224
11225 test "x$cf_header_path" != "xNONE" && \
11226 test -d "$cf_header_path" && \
11227  {
11228         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
11229         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
11230         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11231         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11232         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11233         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"
11234 }
11235
11236                         cf_header_path_list="$cf_header_path_list $cf_search"
11237                         ;;
11238                 esac
11239         done
11240 fi
11241
11242 # add the variations for the package we are looking for
11243
11244 cf_search=
11245
11246 test "x$prefix" != "xNONE" && \
11247 test -d "$prefix" && \
11248  {
11249         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
11250         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
11251         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11252         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11253         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11254         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
11255 }
11256
11257 for cf_subdir_prefix in \
11258         /usr \
11259         /usr/local \
11260         /usr/pkg \
11261         /opt \
11262         /opt/local \
11263         $HOME
11264 do
11265
11266 test "x$cf_subdir_prefix" != "x$prefix" && \
11267 test -d "$cf_subdir_prefix" && \
11268 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11269         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11270         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11271         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11272         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11273         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11274         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"
11275 }
11276
11277 done
11278
11279 test "$includedir" != NONE && \
11280 test "$includedir" != "/usr/include" && \
11281 test -d "$includedir" && {
11282         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11283         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11284 }
11285
11286 test "$oldincludedir" != NONE && \
11287 test "$oldincludedir" != "/usr/include" && \
11288 test -d "$oldincludedir" && {
11289         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11290         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11291 }
11292
11293 cf_search="$cf_search $cf_header_path_list"
11294
11295         test -n "$verbose" && echo "search path $cf_search"
11296         cf_save2_CPPFLAGS="$CPPFLAGS"
11297         for cf_incdir in $cf_search
11298         do
11299
11300 if test -n "$cf_incdir" ; then
11301   for cf_add_incdir in $cf_incdir
11302   do
11303         while test "$cf_add_incdir" != /usr/include
11304         do
11305           if test -d "$cf_add_incdir"
11306           then
11307                 cf_have_incdir=no
11308                 if test -n "$CFLAGS$CPPFLAGS" ; then
11309                   # a loop is needed to ensure we can add subdirs of existing dirs
11310                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11311                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11312                           cf_have_incdir=yes; break
11313                         fi
11314                   done
11315                 fi
11316
11317                 if test "$cf_have_incdir" = no ; then
11318                   if test "$cf_add_incdir" = /usr/local/include ; then
11319                         if test "$GCC" = yes
11320                         then
11321                           cf_save_CPPFLAGS=$CPPFLAGS
11322
11323         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11324         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11325
11326                           cat >"conftest.$ac_ext" <<_ACEOF
11327 #line 11327 "configure"
11328 #include "confdefs.h"
11329 #include <stdio.h>
11330 int
11331 main (void)
11332 {
11333 printf("Hello")
11334   ;
11335   return 0;
11336 }
11337 _ACEOF
11338 rm -f "conftest.$ac_objext"
11339 if { (eval echo "$as_me:11339: \"$ac_compile\"") >&5
11340   (eval $ac_compile) 2>&5
11341   ac_status=$?
11342   echo "$as_me:11342: \$? = $ac_status" >&5
11343   (exit "$ac_status"); } &&
11344          { ac_try='test -s "conftest.$ac_objext"'
11345   { (eval echo "$as_me:11345: \"$ac_try\"") >&5
11346   (eval $ac_try) 2>&5
11347   ac_status=$?
11348   echo "$as_me:11348: \$? = $ac_status" >&5
11349   (exit "$ac_status"); }; }; then
11350   :
11351 else
11352   echo "$as_me: failed program was:" >&5
11353 cat "conftest.$ac_ext" >&5
11354 cf_have_incdir=yes
11355 fi
11356 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11357                           CPPFLAGS=$cf_save_CPPFLAGS
11358                         fi
11359                   fi
11360                 fi
11361
11362                 if test "$cf_have_incdir" = no ; then
11363                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11364
11365 echo "${as_me:-configure}:11365: testing adding $cf_add_incdir to include-path ..." 1>&5
11366
11367                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11368
11369                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11370                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11371                   cf_add_incdir="$cf_top_incdir"
11372                 else
11373                   break
11374                 fi
11375           else
11376                 break
11377           fi
11378         done
11379   done
11380 fi
11381
11382                 for cf_header in \
11383                         ncurses.h \
11384                         curses.h
11385                 do
11386
11387         cat >"conftest.$ac_ext" <<_ACEOF
11388 #line 11388 "configure"
11389 #include "confdefs.h"
11390
11391 #include <$cf_header>
11392 int
11393 main (void)
11394 {
11395
11396 #ifdef NCURSES_VERSION
11397
11398 printf("%s\\n", NCURSES_VERSION);
11399 #else
11400 #ifdef __NCURSES_H
11401 printf("old\\n");
11402 #else
11403         make an error
11404 #endif
11405 #endif
11406
11407   ;
11408   return 0;
11409 }
11410 _ACEOF
11411 rm -f "conftest.$ac_objext"
11412 if { (eval echo "$as_me:11412: \"$ac_compile\"") >&5
11413   (eval $ac_compile) 2>&5
11414   ac_status=$?
11415   echo "$as_me:11415: \$? = $ac_status" >&5
11416   (exit "$ac_status"); } &&
11417          { ac_try='test -s "conftest.$ac_objext"'
11418   { (eval echo "$as_me:11418: \"$ac_try\"") >&5
11419   (eval $ac_try) 2>&5
11420   ac_status=$?
11421   echo "$as_me:11421: \$? = $ac_status" >&5
11422   (exit "$ac_status"); }; }; then
11423   cf_cv_ncurses_h2=$cf_header
11424
11425 else
11426   echo "$as_me: failed program was:" >&5
11427 cat "conftest.$ac_ext" >&5
11428 cf_cv_ncurses_h2=no
11429 fi
11430 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11431
11432                         if test "$cf_cv_ncurses_h2" != no ; then
11433                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11434                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11435                                 break
11436                         fi
11437                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11438                 done
11439                 CPPFLAGS="$cf_save2_CPPFLAGS"
11440                 test "$cf_cv_ncurses_h2" != no && break
11441         done
11442         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11442: error: not found" >&5
11443 echo "$as_me: error: not found" >&2;}
11444    { (exit 1); exit 1; }; }
11445
11446 fi
11447 echo "$as_me:11447: result: $cf_cv_ncurses_h2" >&5
11448 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11449
11450         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11451         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11452         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11453                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11454         fi
11455
11456 if test -n "$cf_1st_incdir" ; then
11457   for cf_add_incdir in $cf_1st_incdir
11458   do
11459         while test "$cf_add_incdir" != /usr/include
11460         do
11461           if test -d "$cf_add_incdir"
11462           then
11463                 cf_have_incdir=no
11464                 if test -n "$CFLAGS$CPPFLAGS" ; then
11465                   # a loop is needed to ensure we can add subdirs of existing dirs
11466                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11467                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11468                           cf_have_incdir=yes; break
11469                         fi
11470                   done
11471                 fi
11472
11473                 if test "$cf_have_incdir" = no ; then
11474                   if test "$cf_add_incdir" = /usr/local/include ; then
11475                         if test "$GCC" = yes
11476                         then
11477                           cf_save_CPPFLAGS=$CPPFLAGS
11478
11479         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11480         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11481
11482                           cat >"conftest.$ac_ext" <<_ACEOF
11483 #line 11483 "configure"
11484 #include "confdefs.h"
11485 #include <stdio.h>
11486 int
11487 main (void)
11488 {
11489 printf("Hello")
11490   ;
11491   return 0;
11492 }
11493 _ACEOF
11494 rm -f "conftest.$ac_objext"
11495 if { (eval echo "$as_me:11495: \"$ac_compile\"") >&5
11496   (eval $ac_compile) 2>&5
11497   ac_status=$?
11498   echo "$as_me:11498: \$? = $ac_status" >&5
11499   (exit "$ac_status"); } &&
11500          { ac_try='test -s "conftest.$ac_objext"'
11501   { (eval echo "$as_me:11501: \"$ac_try\"") >&5
11502   (eval $ac_try) 2>&5
11503   ac_status=$?
11504   echo "$as_me:11504: \$? = $ac_status" >&5
11505   (exit "$ac_status"); }; }; then
11506   :
11507 else
11508   echo "$as_me: failed program was:" >&5
11509 cat "conftest.$ac_ext" >&5
11510 cf_have_incdir=yes
11511 fi
11512 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11513                           CPPFLAGS=$cf_save_CPPFLAGS
11514                         fi
11515                   fi
11516                 fi
11517
11518                 if test "$cf_have_incdir" = no ; then
11519                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11520
11521 echo "${as_me:-configure}:11521: testing adding $cf_add_incdir to include-path ..." 1>&5
11522
11523                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11524
11525                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11526                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11527                   cf_add_incdir="$cf_top_incdir"
11528                 else
11529                   break
11530                 fi
11531           else
11532                 break
11533           fi
11534         done
11535   done
11536 fi
11537
11538 fi
11539
11540 # Set definitions to allow ifdef'ing for ncurses.h
11541
11542 case "$cf_cv_ncurses_header" in
11543 (*ncurses.h)
11544
11545 cat >>confdefs.h <<\EOF
11546 #define HAVE_NCURSES_H 1
11547 EOF
11548
11549         ;;
11550 esac
11551
11552 case "$cf_cv_ncurses_header" in
11553 (ncurses/curses.h|ncurses/ncurses.h)
11554
11555 cat >>confdefs.h <<\EOF
11556 #define HAVE_NCURSES_NCURSES_H 1
11557 EOF
11558
11559         ;;
11560 (ncursesw/curses.h|ncursesw/ncurses.h)
11561
11562 cat >>confdefs.h <<\EOF
11563 #define HAVE_NCURSESW_NCURSES_H 1
11564 EOF
11565
11566         ;;
11567 esac
11568
11569 echo "$as_me:11569: checking for terminfo header" >&5
11570 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11571 if test "${cf_cv_term_header+set}" = set; then
11572   echo $ECHO_N "(cached) $ECHO_C" >&6
11573 else
11574
11575 case "${cf_cv_ncurses_header}" in
11576 (*/ncurses.h|*/ncursesw.h)
11577         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11578         ;;
11579 (*)
11580         cf_term_header=term.h
11581         ;;
11582 esac
11583
11584 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11585 do
11586 cat >"conftest.$ac_ext" <<_ACEOF
11587 #line 11587 "configure"
11588 #include "confdefs.h"
11589 #include <stdio.h>
11590 #include <${cf_cv_ncurses_header:-curses.h}>
11591 #include <$cf_test>
11592
11593 int
11594 main (void)
11595 {
11596 int x = auto_left_margin; (void)x
11597   ;
11598   return 0;
11599 }
11600 _ACEOF
11601 rm -f "conftest.$ac_objext"
11602 if { (eval echo "$as_me:11602: \"$ac_compile\"") >&5
11603   (eval $ac_compile) 2>&5
11604   ac_status=$?
11605   echo "$as_me:11605: \$? = $ac_status" >&5
11606   (exit "$ac_status"); } &&
11607          { ac_try='test -s "conftest.$ac_objext"'
11608   { (eval echo "$as_me:11608: \"$ac_try\"") >&5
11609   (eval $ac_try) 2>&5
11610   ac_status=$?
11611   echo "$as_me:11611: \$? = $ac_status" >&5
11612   (exit "$ac_status"); }; }; then
11613
11614         cf_cv_term_header="$cf_test"
11615 else
11616   echo "$as_me: failed program was:" >&5
11617 cat "conftest.$ac_ext" >&5
11618
11619         cf_cv_term_header=unknown
11620
11621 fi
11622 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11623         test "$cf_cv_term_header" != unknown && break
11624 done
11625
11626 fi
11627 echo "$as_me:11627: result: $cf_cv_term_header" >&5
11628 echo "${ECHO_T}$cf_cv_term_header" >&6
11629
11630 # Set definitions to allow ifdef'ing to accommodate subdirectories
11631
11632 case "$cf_cv_term_header" in
11633 (*term.h)
11634
11635 cat >>confdefs.h <<\EOF
11636 #define HAVE_TERM_H 1
11637 EOF
11638
11639         ;;
11640 esac
11641
11642 case "$cf_cv_term_header" in
11643 (ncurses/term.h)
11644
11645 cat >>confdefs.h <<\EOF
11646 #define HAVE_NCURSES_TERM_H 1
11647 EOF
11648
11649         ;;
11650 (ncursesw/term.h)
11651
11652 cat >>confdefs.h <<\EOF
11653 #define HAVE_NCURSESW_TERM_H 1
11654 EOF
11655
11656         ;;
11657 esac
11658
11659 # some applications need this, but should check for NCURSES_VERSION
11660
11661 cat >>confdefs.h <<\EOF
11662 #define NCURSES 1
11663 EOF
11664
11665 echo "$as_me:11665: checking for ncurses version" >&5
11666 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11667 if test "${cf_cv_ncurses_version+set}" = set; then
11668   echo $ECHO_N "(cached) $ECHO_C" >&6
11669 else
11670
11671         cf_cv_ncurses_version=no
11672         cf_tempfile=out$$
11673         rm -f "$cf_tempfile"
11674         if test "$cross_compiling" = yes; then
11675
11676         # This will not work if the preprocessor splits the line after the
11677         # Autoconf token.  The 'unproto' program does that.
11678         cat > "conftest.$ac_ext" <<EOF
11679 #include <${cf_cv_ncurses_header:-curses.h}>
11680 #undef Autoconf
11681 #ifdef NCURSES_VERSION
11682 Autoconf NCURSES_VERSION
11683 #else
11684 #ifdef __NCURSES_H
11685 Autoconf "old"
11686 #endif
11687 ;
11688 #endif
11689 EOF
11690         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11691         { (eval echo "$as_me:11691: \"$cf_try\"") >&5
11692   (eval $cf_try) 2>&5
11693   ac_status=$?
11694   echo "$as_me:11694: \$? = $ac_status" >&5
11695   (exit "$ac_status"); }
11696         if test -f conftest.out ; then
11697                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11698                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11699                 rm -f conftest.out
11700         fi
11701
11702 else
11703   cat >"conftest.$ac_ext" <<_ACEOF
11704 #line 11704 "configure"
11705 #include "confdefs.h"
11706
11707 #include <${cf_cv_ncurses_header:-curses.h}>
11708 #include <stdio.h>
11709 int main(void)
11710 {
11711         FILE *fp = fopen("$cf_tempfile", "w");
11712 #ifdef NCURSES_VERSION
11713 # ifdef NCURSES_VERSION_PATCH
11714         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11715 # else
11716         fprintf(fp, "%s\\n", NCURSES_VERSION);
11717 # endif
11718 #else
11719 # ifdef __NCURSES_H
11720         fprintf(fp, "old\\n");
11721 # else
11722         make an error
11723 # endif
11724 #endif
11725         ${cf_cv_main_return:-return}(0);
11726 }
11727 _ACEOF
11728 rm -f "conftest$ac_exeext"
11729 if { (eval echo "$as_me:11729: \"$ac_link\"") >&5
11730   (eval $ac_link) 2>&5
11731   ac_status=$?
11732   echo "$as_me:11732: \$? = $ac_status" >&5
11733   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11734   { (eval echo "$as_me:11734: \"$ac_try\"") >&5
11735   (eval $ac_try) 2>&5
11736   ac_status=$?
11737   echo "$as_me:11737: \$? = $ac_status" >&5
11738   (exit "$ac_status"); }; }; then
11739
11740         cf_cv_ncurses_version=`cat $cf_tempfile`
11741 else
11742   echo "$as_me: program exited with status $ac_status" >&5
11743 echo "$as_me: failed program was:" >&5
11744 cat "conftest.$ac_ext" >&5
11745 fi
11746 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11747 fi
11748         rm -f "$cf_tempfile"
11749
11750 fi
11751 echo "$as_me:11751: result: $cf_cv_ncurses_version" >&5
11752 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11753 test "$cf_cv_ncurses_version" = no ||
11754 cat >>confdefs.h <<\EOF
11755 #define NCURSES 1
11756 EOF
11757
11758 cf_nculib_root=$cf_cv_screen
11759         # This works, except for the special case where we find gpm, but
11760         # ncurses is in a nonstandard location via $LIBS, and we really want
11761         # to link gpm.
11762 cf_ncurses_LIBS=""
11763 cf_ncurses_SAVE="$LIBS"
11764 echo "$as_me:11764: checking for Gpm_Open in -lgpm" >&5
11765 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11766 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11767   echo $ECHO_N "(cached) $ECHO_C" >&6
11768 else
11769   ac_check_lib_save_LIBS=$LIBS
11770 LIBS="-lgpm  $LIBS"
11771 cat >"conftest.$ac_ext" <<_ACEOF
11772 #line 11772 "configure"
11773 #include "confdefs.h"
11774
11775 /* Override any gcc2 internal prototype to avoid an error.  */
11776 #ifdef __cplusplus
11777 extern "C"
11778 #endif
11779 /* We use char because int might match the return type of a gcc2
11780    builtin and then its argument prototype would still apply.  */
11781 char Gpm_Open ();
11782 int
11783 main (void)
11784 {
11785 Gpm_Open ();
11786   ;
11787   return 0;
11788 }
11789 _ACEOF
11790 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11791 if { (eval echo "$as_me:11791: \"$ac_link\"") >&5
11792   (eval $ac_link) 2>&5
11793   ac_status=$?
11794   echo "$as_me:11794: \$? = $ac_status" >&5
11795   (exit "$ac_status"); } &&
11796          { ac_try='test -s "conftest$ac_exeext"'
11797   { (eval echo "$as_me:11797: \"$ac_try\"") >&5
11798   (eval $ac_try) 2>&5
11799   ac_status=$?
11800   echo "$as_me:11800: \$? = $ac_status" >&5
11801   (exit "$ac_status"); }; }; then
11802   ac_cv_lib_gpm_Gpm_Open=yes
11803 else
11804   echo "$as_me: failed program was:" >&5
11805 cat "conftest.$ac_ext" >&5
11806 ac_cv_lib_gpm_Gpm_Open=no
11807 fi
11808 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11809 LIBS=$ac_check_lib_save_LIBS
11810 fi
11811 echo "$as_me:11811: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11812 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11813 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11814   echo "$as_me:11814: checking for initscr in -lgpm" >&5
11815 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11816 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11817   echo $ECHO_N "(cached) $ECHO_C" >&6
11818 else
11819   ac_check_lib_save_LIBS=$LIBS
11820 LIBS="-lgpm  $LIBS"
11821 cat >"conftest.$ac_ext" <<_ACEOF
11822 #line 11822 "configure"
11823 #include "confdefs.h"
11824
11825 /* Override any gcc2 internal prototype to avoid an error.  */
11826 #ifdef __cplusplus
11827 extern "C"
11828 #endif
11829 /* We use char because int might match the return type of a gcc2
11830    builtin and then its argument prototype would still apply.  */
11831 char initscr ();
11832 int
11833 main (void)
11834 {
11835 initscr ();
11836   ;
11837   return 0;
11838 }
11839 _ACEOF
11840 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11841 if { (eval echo "$as_me:11841: \"$ac_link\"") >&5
11842   (eval $ac_link) 2>&5
11843   ac_status=$?
11844   echo "$as_me:11844: \$? = $ac_status" >&5
11845   (exit "$ac_status"); } &&
11846          { ac_try='test -s "conftest$ac_exeext"'
11847   { (eval echo "$as_me:11847: \"$ac_try\"") >&5
11848   (eval $ac_try) 2>&5
11849   ac_status=$?
11850   echo "$as_me:11850: \$? = $ac_status" >&5
11851   (exit "$ac_status"); }; }; then
11852   ac_cv_lib_gpm_initscr=yes
11853 else
11854   echo "$as_me: failed program was:" >&5
11855 cat "conftest.$ac_ext" >&5
11856 ac_cv_lib_gpm_initscr=no
11857 fi
11858 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11859 LIBS=$ac_check_lib_save_LIBS
11860 fi
11861 echo "$as_me:11861: result: $ac_cv_lib_gpm_initscr" >&5
11862 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11863 if test "$ac_cv_lib_gpm_initscr" = yes; then
11864   LIBS="$cf_ncurses_SAVE"
11865 else
11866   cf_ncurses_LIBS="-lgpm"
11867 fi
11868
11869 fi
11870
11871 case "$host_os" in
11872 (freebsd*)
11873         # This is only necessary if you are linking against an obsolete
11874         # version of ncurses (but it should do no harm, since it is static).
11875         if test "$cf_nculib_root" = ncurses ; then
11876                 echo "$as_me:11876: checking for tgoto in -lmytinfo" >&5
11877 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11878 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11879   echo $ECHO_N "(cached) $ECHO_C" >&6
11880 else
11881   ac_check_lib_save_LIBS=$LIBS
11882 LIBS="-lmytinfo  $LIBS"
11883 cat >"conftest.$ac_ext" <<_ACEOF
11884 #line 11884 "configure"
11885 #include "confdefs.h"
11886
11887 /* Override any gcc2 internal prototype to avoid an error.  */
11888 #ifdef __cplusplus
11889 extern "C"
11890 #endif
11891 /* We use char because int might match the return type of a gcc2
11892    builtin and then its argument prototype would still apply.  */
11893 char tgoto ();
11894 int
11895 main (void)
11896 {
11897 tgoto ();
11898   ;
11899   return 0;
11900 }
11901 _ACEOF
11902 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11903 if { (eval echo "$as_me:11903: \"$ac_link\"") >&5
11904   (eval $ac_link) 2>&5
11905   ac_status=$?
11906   echo "$as_me:11906: \$? = $ac_status" >&5
11907   (exit "$ac_status"); } &&
11908          { ac_try='test -s "conftest$ac_exeext"'
11909   { (eval echo "$as_me:11909: \"$ac_try\"") >&5
11910   (eval $ac_try) 2>&5
11911   ac_status=$?
11912   echo "$as_me:11912: \$? = $ac_status" >&5
11913   (exit "$ac_status"); }; }; then
11914   ac_cv_lib_mytinfo_tgoto=yes
11915 else
11916   echo "$as_me: failed program was:" >&5
11917 cat "conftest.$ac_ext" >&5
11918 ac_cv_lib_mytinfo_tgoto=no
11919 fi
11920 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11921 LIBS=$ac_check_lib_save_LIBS
11922 fi
11923 echo "$as_me:11923: result: $ac_cv_lib_mytinfo_tgoto" >&5
11924 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11925 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11926   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11927 fi
11928
11929         fi
11930         ;;
11931 esac
11932
11933 cf_add_libs="$LIBS"
11934 # reverse order
11935 cf_add_0lib=
11936 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11937 # filter duplicates
11938 for cf_add_1lib in $cf_add_0lib; do
11939         for cf_add_2lib in $cf_add_libs; do
11940                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11941                         cf_add_1lib=
11942                         break
11943                 fi
11944         done
11945         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11946 done
11947 LIBS="$cf_add_libs"
11948
11949 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11950 then
11951
11952 cf_add_libs="$LIBS"
11953 # reverse order
11954 cf_add_0lib=
11955 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11956 # filter duplicates
11957 for cf_add_1lib in $cf_add_0lib; do
11958         for cf_add_2lib in $cf_add_libs; do
11959                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11960                         cf_add_1lib=
11961                         break
11962                 fi
11963         done
11964         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11965 done
11966 LIBS="$cf_add_libs"
11967
11968 else
11969
11970         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11971         cf_libdir=""
11972         echo "$as_me:11972: checking for initscr" >&5
11973 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11974 if test "${ac_cv_func_initscr+set}" = set; then
11975   echo $ECHO_N "(cached) $ECHO_C" >&6
11976 else
11977   cat >"conftest.$ac_ext" <<_ACEOF
11978 #line 11978 "configure"
11979 #include "confdefs.h"
11980 #define initscr autoconf_temporary
11981 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11982 #undef initscr
11983
11984 #ifdef __cplusplus
11985 extern "C"
11986 #endif
11987
11988 /* We use char because int might match the return type of a gcc2
11989    builtin and then its argument prototype would still apply.  */
11990 char initscr (void);
11991
11992 int
11993 main (void)
11994 {
11995
11996 /* The GNU C library defines stubs for functions which it implements
11997     to always fail with ENOSYS.  Some functions are actually named
11998     something starting with __ and the normal name is an alias.  */
11999 #if defined (__stub_initscr) || defined (__stub___initscr)
12000 #error found stub for initscr
12001 #endif
12002
12003         return initscr ();
12004   ;
12005   return 0;
12006 }
12007 _ACEOF
12008 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12009 if { (eval echo "$as_me:12009: \"$ac_link\"") >&5
12010   (eval $ac_link) 2>&5
12011   ac_status=$?
12012   echo "$as_me:12012: \$? = $ac_status" >&5
12013   (exit "$ac_status"); } &&
12014          { ac_try='test -s "conftest$ac_exeext"'
12015   { (eval echo "$as_me:12015: \"$ac_try\"") >&5
12016   (eval $ac_try) 2>&5
12017   ac_status=$?
12018   echo "$as_me:12018: \$? = $ac_status" >&5
12019   (exit "$ac_status"); }; }; then
12020   ac_cv_func_initscr=yes
12021 else
12022   echo "$as_me: failed program was:" >&5
12023 cat "conftest.$ac_ext" >&5
12024 ac_cv_func_initscr=no
12025 fi
12026 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12027 fi
12028 echo "$as_me:12028: result: $ac_cv_func_initscr" >&5
12029 echo "${ECHO_T}$ac_cv_func_initscr" >&6
12030 if test "$ac_cv_func_initscr" = yes; then
12031   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12032 else
12033
12034                 cf_save_LIBS="$LIBS"
12035                 echo "$as_me:12035: checking for initscr in -l$cf_nculib_root" >&5
12036 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
12037                 LIBS="-l$cf_nculib_root $LIBS"
12038                 cat >"conftest.$ac_ext" <<_ACEOF
12039 #line 12039 "configure"
12040 #include "confdefs.h"
12041 #include <${cf_cv_ncurses_header:-curses.h}>
12042 int
12043 main (void)
12044 {
12045 initscr()
12046   ;
12047   return 0;
12048 }
12049 _ACEOF
12050 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12051 if { (eval echo "$as_me:12051: \"$ac_link\"") >&5
12052   (eval $ac_link) 2>&5
12053   ac_status=$?
12054   echo "$as_me:12054: \$? = $ac_status" >&5
12055   (exit "$ac_status"); } &&
12056          { ac_try='test -s "conftest$ac_exeext"'
12057   { (eval echo "$as_me:12057: \"$ac_try\"") >&5
12058   (eval $ac_try) 2>&5
12059   ac_status=$?
12060   echo "$as_me:12060: \$? = $ac_status" >&5
12061   (exit "$ac_status"); }; }; then
12062   echo "$as_me:12062: result: yes" >&5
12063 echo "${ECHO_T}yes" >&6
12064                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12065
12066 else
12067   echo "$as_me: failed program was:" >&5
12068 cat "conftest.$ac_ext" >&5
12069 echo "$as_me:12069: result: no" >&5
12070 echo "${ECHO_T}no" >&6
12071
12072 cf_search=
12073 cf_library_path_list=""
12074 if test -n "${LDFLAGS}${LIBS}" ; then
12075         for cf_library_path in $LDFLAGS $LIBS
12076         do
12077                 case "$cf_library_path" in
12078                 (-L*)
12079                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
12080
12081 test "x$cf_library_path" != "xNONE" && \
12082 test -d "$cf_library_path" && \
12083  {
12084         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
12085         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
12086         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
12087         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
12088         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
12089         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"
12090 }
12091
12092                         cf_library_path_list="$cf_library_path_list $cf_search"
12093                         ;;
12094                 esac
12095         done
12096 fi
12097
12098 cf_search=
12099
12100 test "x$prefix" != "xNONE" && \
12101 test -d "$prefix" && \
12102  {
12103         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
12104         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
12105         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
12106         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
12107         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
12108         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
12109 }
12110
12111 for cf_subdir_prefix in \
12112         /usr \
12113         /usr/local \
12114         /usr/pkg \
12115         /opt \
12116         /opt/local \
12117         $HOME
12118 do
12119
12120 test "x$cf_subdir_prefix" != "x$prefix" && \
12121 test -d "$cf_subdir_prefix" && \
12122 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
12123         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
12124         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
12125         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
12126         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
12127         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
12128         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"
12129 }
12130
12131 done
12132
12133 cf_search="$cf_library_path_list $cf_search"
12134
12135                         for cf_libdir in $cf_search
12136                         do
12137                                 echo "$as_me:12137: checking for -l$cf_nculib_root in $cf_libdir" >&5
12138 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
12139                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
12140                                 cat >"conftest.$ac_ext" <<_ACEOF
12141 #line 12141 "configure"
12142 #include "confdefs.h"
12143 #include <${cf_cv_ncurses_header:-curses.h}>
12144 int
12145 main (void)
12146 {
12147 initscr()
12148   ;
12149   return 0;
12150 }
12151 _ACEOF
12152 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12153 if { (eval echo "$as_me:12153: \"$ac_link\"") >&5
12154   (eval $ac_link) 2>&5
12155   ac_status=$?
12156   echo "$as_me:12156: \$? = $ac_status" >&5
12157   (exit "$ac_status"); } &&
12158          { ac_try='test -s "conftest$ac_exeext"'
12159   { (eval echo "$as_me:12159: \"$ac_try\"") >&5
12160   (eval $ac_try) 2>&5
12161   ac_status=$?
12162   echo "$as_me:12162: \$? = $ac_status" >&5
12163   (exit "$ac_status"); }; }; then
12164   echo "$as_me:12164: result: yes" >&5
12165 echo "${ECHO_T}yes" >&6
12166                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12167                                          break
12168 else
12169   echo "$as_me: failed program was:" >&5
12170 cat "conftest.$ac_ext" >&5
12171 echo "$as_me:12171: result: no" >&5
12172 echo "${ECHO_T}no" >&6
12173                                          LIBS="$cf_save_LIBS"
12174 fi
12175 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12176                         done
12177
12178 fi
12179 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12180
12181 fi
12182
12183 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
12184
12185 if test "$cf_found_library" = no ; then
12186         { { echo "$as_me:12186: error: Cannot link $cf_nculib_root library" >&5
12187 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
12188    { (exit 1); exit 1; }; }
12189 fi
12190
12191 fi
12192
12193 if test -n "$cf_ncurses_LIBS" ; then
12194         echo "$as_me:12194: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
12195 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
12196         cf_ncurses_SAVE="$LIBS"
12197         for p in $cf_ncurses_LIBS ; do
12198                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
12199                 if test "$q" != "$LIBS" ; then
12200                         LIBS="$q"
12201                 fi
12202         done
12203         cat >"conftest.$ac_ext" <<_ACEOF
12204 #line 12204 "configure"
12205 #include "confdefs.h"
12206 #include <${cf_cv_ncurses_header:-curses.h}>
12207 int
12208 main (void)
12209 {
12210 initscr(); mousemask(0,0); tigetstr((char *)0);
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   echo "$as_me:12227: result: yes" >&5
12228 echo "${ECHO_T}yes" >&6
12229 else
12230   echo "$as_me: failed program was:" >&5
12231 cat "conftest.$ac_ext" >&5
12232 echo "$as_me:12232: result: no" >&5
12233 echo "${ECHO_T}no" >&6
12234                  LIBS="$cf_ncurses_SAVE"
12235 fi
12236 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12237 fi
12238
12239 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12240
12241 cat >>confdefs.h <<EOF
12242 #define $cf_nculib_ROOT 1
12243 EOF
12244
12245         fi
12246 else
12247         NCURSES_CONFIG=none
12248 fi
12249
12250         ;;
12251 (pdcurses)
12252         echo "$as_me:12252: checking for X" >&5
12253 echo $ECHO_N "checking for X... $ECHO_C" >&6
12254
12255 # Check whether --with-x or --without-x was given.
12256 if test "${with_x+set}" = set; then
12257   withval="$with_x"
12258
12259 fi;
12260 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12261 if test "x$with_x" = xno; then
12262   # The user explicitly disabled X.
12263   have_x=disabled
12264 else
12265   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12266     # Both variables are already set.
12267     have_x=yes
12268   else
12269     if test "${ac_cv_have_x+set}" = set; then
12270   echo $ECHO_N "(cached) $ECHO_C" >&6
12271 else
12272   # One or both of the vars are not set, and there is no cached value.
12273 ac_x_includes=no ac_x_libraries=no
12274 rm -fr conftest.dir
12275 if mkdir conftest.dir; then
12276   cd conftest.dir
12277   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12278   cat >Imakefile <<'EOF'
12279 acfindx:
12280         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12281 EOF
12282   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12283     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12284     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12285     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12286     for ac_extension in a so sl dylib dll; do
12287       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12288          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12289         ac_im_usrlibdir=$ac_im_libdir; break
12290       fi
12291     done
12292     # Screen out bogus values from the imake configuration.  They are
12293     # bogus both because they are the default anyway, and because
12294     # using them would break gcc on systems where it needs fixed includes.
12295     case $ac_im_incroot in
12296         /usr/include) ;;
12297         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12298     esac
12299     case $ac_im_usrlibdir in
12300         /usr/lib | /lib) ;;
12301         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12302     esac
12303   fi
12304   cd ..
12305   rm -fr conftest.dir
12306 fi
12307
12308 # Standard set of common directories for X headers.
12309 # Check X11 before X11Rn because it is often a symlink to the current release.
12310 ac_x_header_dirs='
12311 /usr/X11/include
12312 /usr/X11R7/include
12313 /usr/X11R6/include
12314 /usr/X11R5/include
12315 /usr/X11R4/include
12316
12317 /opt/local/include
12318 /opt/X11/include
12319
12320 /usr/include/X11
12321 /usr/include/X11R7
12322 /usr/include/X11R6
12323 /usr/include/X11R5
12324 /usr/include/X11R4
12325
12326 /usr/local/X11/include
12327 /usr/local/X11R7/include
12328 /usr/local/X11R6/include
12329 /usr/local/X11R5/include
12330 /usr/local/X11R4/include
12331
12332 /usr/local/include/X11
12333 /usr/local/include/X11R7
12334 /usr/local/include/X11R6
12335 /usr/local/include/X11R5
12336 /usr/local/include/X11R4
12337
12338 /usr/X386/include
12339 /usr/x386/include
12340 /usr/XFree86/include/X11
12341
12342 /usr/include
12343 /usr/local/include
12344 /usr/unsupported/include
12345 /usr/athena/include
12346 /usr/local/x11r5/include
12347 /usr/lpp/Xamples/include
12348
12349 /usr/openwin/include
12350 /usr/openwin/share/include'
12351
12352 if test "$ac_x_includes" = no; then
12353   # Guess where to find include files, by looking for Intrinsic.h.
12354   # First, try using that file with no special directory specified.
12355   cat >"conftest.$ac_ext" <<_ACEOF
12356 #line 12356 "configure"
12357 #include "confdefs.h"
12358 #include <X11/Intrinsic.h>
12359 _ACEOF
12360 if { (eval echo "$as_me:12360: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12361   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12362   ac_status=$?
12363   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12364   rm -f conftest.er1
12365   cat conftest.err >&5
12366   echo "$as_me:12366: \$? = $ac_status" >&5
12367   (exit "$ac_status"); } >/dev/null; then
12368   if test -s conftest.err; then
12369     ac_cpp_err=$ac_c_preproc_warn_flag
12370   else
12371     ac_cpp_err=
12372   fi
12373 else
12374   ac_cpp_err=yes
12375 fi
12376 if test -z "$ac_cpp_err"; then
12377   # We can compile using X headers with no special include directory.
12378 ac_x_includes=
12379 else
12380   echo "$as_me: failed program was:" >&5
12381   cat "conftest.$ac_ext" >&5
12382   for ac_dir in $ac_x_header_dirs; do
12383   if test -r "$ac_dir/X11/Intrinsic.h"; then
12384     ac_x_includes=$ac_dir
12385     break
12386   fi
12387 done
12388 fi
12389 rm -f conftest.err "conftest.$ac_ext"
12390 fi # $ac_x_includes = no
12391
12392 if test "$ac_x_libraries" = no; then
12393   # Check for the libraries.
12394   # See if we find them without any special options.
12395   # Don't add to $LIBS permanently.
12396   ac_save_LIBS=$LIBS
12397   LIBS="-lXt $LIBS"
12398   cat >"conftest.$ac_ext" <<_ACEOF
12399 #line 12399 "configure"
12400 #include "confdefs.h"
12401 #include <X11/Intrinsic.h>
12402 int
12403 main (void)
12404 {
12405 XtMalloc (0)
12406   ;
12407   return 0;
12408 }
12409 _ACEOF
12410 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12411 if { (eval echo "$as_me:12411: \"$ac_link\"") >&5
12412   (eval $ac_link) 2>&5
12413   ac_status=$?
12414   echo "$as_me:12414: \$? = $ac_status" >&5
12415   (exit "$ac_status"); } &&
12416          { ac_try='test -s "conftest$ac_exeext"'
12417   { (eval echo "$as_me:12417: \"$ac_try\"") >&5
12418   (eval $ac_try) 2>&5
12419   ac_status=$?
12420   echo "$as_me:12420: \$? = $ac_status" >&5
12421   (exit "$ac_status"); }; }; then
12422   LIBS=$ac_save_LIBS
12423 # We can link X programs with no special library path.
12424 ac_x_libraries=
12425 else
12426   echo "$as_me: failed program was:" >&5
12427 cat "conftest.$ac_ext" >&5
12428 LIBS=$ac_save_LIBS
12429 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12430 do
12431   # Don't even attempt the hair of trying to link an X program!
12432   for ac_extension in a so sl dylib dll; do
12433     if test -r "$ac_dir/libXt.$ac_extension"; then
12434       ac_x_libraries=$ac_dir
12435       break 2
12436     fi
12437   done
12438 done
12439 fi
12440 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12441 fi # $ac_x_libraries = no
12442
12443 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12444   # Didn't find X anywhere.  Cache the known absence of X.
12445   ac_cv_have_x="have_x=no"
12446 else
12447   # Record where we found X for the cache.
12448   ac_cv_have_x="have_x=yes \
12449                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12450 fi
12451 fi
12452
12453   fi
12454   eval "$ac_cv_have_x"
12455 fi # $with_x != no
12456
12457 if test "$have_x" != yes; then
12458   echo "$as_me:12458: result: $have_x" >&5
12459 echo "${ECHO_T}$have_x" >&6
12460   no_x=yes
12461 else
12462   # If each of the values was on the command line, it overrides each guess.
12463   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12464   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12465   # Update the cache value to reflect the command line values.
12466   ac_cv_have_x="have_x=yes \
12467                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12468   echo "$as_me:12468: result: libraries $x_libraries, headers $x_includes" >&5
12469 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12470 fi
12471
12472 if test "$no_x" = yes; then
12473   # Not all programs may use this symbol, but it does not hurt to define it.
12474
12475 cat >>confdefs.h <<\EOF
12476 #define X_DISPLAY_MISSING 1
12477 EOF
12478
12479   X_CFLAGS=
12480   X_PRE_LIBS=
12481   X_LIBS=
12482   X_EXTRA_LIBS=
12483 else
12484   if test -n "$x_includes"; then
12485     X_CFLAGS="$X_CFLAGS -I$x_includes"
12486   fi
12487
12488   # It would also be nice to do this for all -L options, not just this one.
12489   if test -n "$x_libraries"; then
12490     X_LIBS="$X_LIBS -L$x_libraries"
12491     # For Solaris; some versions of Sun CC require a space after -R and
12492     # others require no space.  Words are not sufficient . . . .
12493     case `(uname -sr) 2>/dev/null` in
12494     "SunOS 5"*)
12495       echo "$as_me:12495: checking whether -R must be followed by a space" >&5
12496 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12497       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12498       cat >"conftest.$ac_ext" <<_ACEOF
12499 #line 12499 "configure"
12500 #include "confdefs.h"
12501
12502 int
12503 main (void)
12504 {
12505
12506   ;
12507   return 0;
12508 }
12509 _ACEOF
12510 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12511 if { (eval echo "$as_me:12511: \"$ac_link\"") >&5
12512   (eval $ac_link) 2>&5
12513   ac_status=$?
12514   echo "$as_me:12514: \$? = $ac_status" >&5
12515   (exit "$ac_status"); } &&
12516          { ac_try='test -s "conftest$ac_exeext"'
12517   { (eval echo "$as_me:12517: \"$ac_try\"") >&5
12518   (eval $ac_try) 2>&5
12519   ac_status=$?
12520   echo "$as_me:12520: \$? = $ac_status" >&5
12521   (exit "$ac_status"); }; }; then
12522   ac_R_nospace=yes
12523 else
12524   echo "$as_me: failed program was:" >&5
12525 cat "conftest.$ac_ext" >&5
12526 ac_R_nospace=no
12527 fi
12528 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12529       if test $ac_R_nospace = yes; then
12530         echo "$as_me:12530: result: no" >&5
12531 echo "${ECHO_T}no" >&6
12532         X_LIBS="$X_LIBS -R$x_libraries"
12533       else
12534         LIBS="$ac_xsave_LIBS -R $x_libraries"
12535         cat >"conftest.$ac_ext" <<_ACEOF
12536 #line 12536 "configure"
12537 #include "confdefs.h"
12538
12539 int
12540 main (void)
12541 {
12542
12543   ;
12544   return 0;
12545 }
12546 _ACEOF
12547 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12548 if { (eval echo "$as_me:12548: \"$ac_link\"") >&5
12549   (eval $ac_link) 2>&5
12550   ac_status=$?
12551   echo "$as_me:12551: \$? = $ac_status" >&5
12552   (exit "$ac_status"); } &&
12553          { ac_try='test -s "conftest$ac_exeext"'
12554   { (eval echo "$as_me:12554: \"$ac_try\"") >&5
12555   (eval $ac_try) 2>&5
12556   ac_status=$?
12557   echo "$as_me:12557: \$? = $ac_status" >&5
12558   (exit "$ac_status"); }; }; then
12559   ac_R_space=yes
12560 else
12561   echo "$as_me: failed program was:" >&5
12562 cat "conftest.$ac_ext" >&5
12563 ac_R_space=no
12564 fi
12565 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12566         if test $ac_R_space = yes; then
12567           echo "$as_me:12567: result: yes" >&5
12568 echo "${ECHO_T}yes" >&6
12569           X_LIBS="$X_LIBS -R $x_libraries"
12570         else
12571           echo "$as_me:12571: result: neither works" >&5
12572 echo "${ECHO_T}neither works" >&6
12573         fi
12574       fi
12575       LIBS=$ac_xsave_LIBS
12576     esac
12577   fi
12578
12579   # Check for system-dependent libraries X programs must link with.
12580   # Do this before checking for the system-independent R6 libraries
12581   # (-lICE), since we may need -lsocket or whatever for X linking.
12582
12583   if test "$ISC" = yes; then
12584     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12585   else
12586     # Martyn Johnson says this is needed for Ultrix, if the X
12587     # libraries were built with DECnet support.  And Karl Berry says
12588     # the Alpha needs dnet_stub (dnet does not exist).
12589     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12590     cat >"conftest.$ac_ext" <<_ACEOF
12591 #line 12591 "configure"
12592 #include "confdefs.h"
12593
12594 /* Override any gcc2 internal prototype to avoid an error.  */
12595 #ifdef __cplusplus
12596 extern "C"
12597 #endif
12598 /* We use char because int might match the return type of a gcc2
12599    builtin and then its argument prototype would still apply.  */
12600 char XOpenDisplay ();
12601 int
12602 main (void)
12603 {
12604 XOpenDisplay ();
12605   ;
12606   return 0;
12607 }
12608 _ACEOF
12609 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12610 if { (eval echo "$as_me:12610: \"$ac_link\"") >&5
12611   (eval $ac_link) 2>&5
12612   ac_status=$?
12613   echo "$as_me:12613: \$? = $ac_status" >&5
12614   (exit "$ac_status"); } &&
12615          { ac_try='test -s "conftest$ac_exeext"'
12616   { (eval echo "$as_me:12616: \"$ac_try\"") >&5
12617   (eval $ac_try) 2>&5
12618   ac_status=$?
12619   echo "$as_me:12619: \$? = $ac_status" >&5
12620   (exit "$ac_status"); }; }; then
12621   :
12622 else
12623   echo "$as_me: failed program was:" >&5
12624 cat "conftest.$ac_ext" >&5
12625 echo "$as_me:12625: checking for dnet_ntoa in -ldnet" >&5
12626 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12627 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12628   echo $ECHO_N "(cached) $ECHO_C" >&6
12629 else
12630   ac_check_lib_save_LIBS=$LIBS
12631 LIBS="-ldnet  $LIBS"
12632 cat >"conftest.$ac_ext" <<_ACEOF
12633 #line 12633 "configure"
12634 #include "confdefs.h"
12635
12636 /* Override any gcc2 internal prototype to avoid an error.  */
12637 #ifdef __cplusplus
12638 extern "C"
12639 #endif
12640 /* We use char because int might match the return type of a gcc2
12641    builtin and then its argument prototype would still apply.  */
12642 char dnet_ntoa ();
12643 int
12644 main (void)
12645 {
12646 dnet_ntoa ();
12647   ;
12648   return 0;
12649 }
12650 _ACEOF
12651 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12652 if { (eval echo "$as_me:12652: \"$ac_link\"") >&5
12653   (eval $ac_link) 2>&5
12654   ac_status=$?
12655   echo "$as_me:12655: \$? = $ac_status" >&5
12656   (exit "$ac_status"); } &&
12657          { ac_try='test -s "conftest$ac_exeext"'
12658   { (eval echo "$as_me:12658: \"$ac_try\"") >&5
12659   (eval $ac_try) 2>&5
12660   ac_status=$?
12661   echo "$as_me:12661: \$? = $ac_status" >&5
12662   (exit "$ac_status"); }; }; then
12663   ac_cv_lib_dnet_dnet_ntoa=yes
12664 else
12665   echo "$as_me: failed program was:" >&5
12666 cat "conftest.$ac_ext" >&5
12667 ac_cv_lib_dnet_dnet_ntoa=no
12668 fi
12669 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12670 LIBS=$ac_check_lib_save_LIBS
12671 fi
12672 echo "$as_me:12672: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12673 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12674 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12675   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12676 fi
12677
12678     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12679       echo "$as_me:12679: checking for dnet_ntoa in -ldnet_stub" >&5
12680 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12681 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12682   echo $ECHO_N "(cached) $ECHO_C" >&6
12683 else
12684   ac_check_lib_save_LIBS=$LIBS
12685 LIBS="-ldnet_stub  $LIBS"
12686 cat >"conftest.$ac_ext" <<_ACEOF
12687 #line 12687 "configure"
12688 #include "confdefs.h"
12689
12690 /* Override any gcc2 internal prototype to avoid an error.  */
12691 #ifdef __cplusplus
12692 extern "C"
12693 #endif
12694 /* We use char because int might match the return type of a gcc2
12695    builtin and then its argument prototype would still apply.  */
12696 char dnet_ntoa ();
12697 int
12698 main (void)
12699 {
12700 dnet_ntoa ();
12701   ;
12702   return 0;
12703 }
12704 _ACEOF
12705 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12706 if { (eval echo "$as_me:12706: \"$ac_link\"") >&5
12707   (eval $ac_link) 2>&5
12708   ac_status=$?
12709   echo "$as_me:12709: \$? = $ac_status" >&5
12710   (exit "$ac_status"); } &&
12711          { ac_try='test -s "conftest$ac_exeext"'
12712   { (eval echo "$as_me:12712: \"$ac_try\"") >&5
12713   (eval $ac_try) 2>&5
12714   ac_status=$?
12715   echo "$as_me:12715: \$? = $ac_status" >&5
12716   (exit "$ac_status"); }; }; then
12717   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12718 else
12719   echo "$as_me: failed program was:" >&5
12720 cat "conftest.$ac_ext" >&5
12721 ac_cv_lib_dnet_stub_dnet_ntoa=no
12722 fi
12723 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12724 LIBS=$ac_check_lib_save_LIBS
12725 fi
12726 echo "$as_me:12726: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12727 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12728 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12729   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12730 fi
12731
12732     fi
12733 fi
12734 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12735     LIBS="$ac_xsave_LIBS"
12736
12737     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12738     # to get the SysV transport functions.
12739     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12740     # needs -lnsl.
12741     # The nsl library prevents programs from opening the X display
12742     # on Irix 5.2, according to T.E. Dickey.
12743     # The functions gethostbyname, getservbyname, and inet_addr are
12744     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12745     echo "$as_me:12745: checking for gethostbyname" >&5
12746 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12747 if test "${ac_cv_func_gethostbyname+set}" = set; then
12748   echo $ECHO_N "(cached) $ECHO_C" >&6
12749 else
12750   cat >"conftest.$ac_ext" <<_ACEOF
12751 #line 12751 "configure"
12752 #include "confdefs.h"
12753 #define gethostbyname autoconf_temporary
12754 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12755 #undef gethostbyname
12756
12757 #ifdef __cplusplus
12758 extern "C"
12759 #endif
12760
12761 /* We use char because int might match the return type of a gcc2
12762    builtin and then its argument prototype would still apply.  */
12763 char gethostbyname (void);
12764
12765 int
12766 main (void)
12767 {
12768
12769 /* The GNU C library defines stubs for functions which it implements
12770     to always fail with ENOSYS.  Some functions are actually named
12771     something starting with __ and the normal name is an alias.  */
12772 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12773 #error found stub for gethostbyname
12774 #endif
12775
12776         return gethostbyname ();
12777   ;
12778   return 0;
12779 }
12780 _ACEOF
12781 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12782 if { (eval echo "$as_me:12782: \"$ac_link\"") >&5
12783   (eval $ac_link) 2>&5
12784   ac_status=$?
12785   echo "$as_me:12785: \$? = $ac_status" >&5
12786   (exit "$ac_status"); } &&
12787          { ac_try='test -s "conftest$ac_exeext"'
12788   { (eval echo "$as_me:12788: \"$ac_try\"") >&5
12789   (eval $ac_try) 2>&5
12790   ac_status=$?
12791   echo "$as_me:12791: \$? = $ac_status" >&5
12792   (exit "$ac_status"); }; }; then
12793   ac_cv_func_gethostbyname=yes
12794 else
12795   echo "$as_me: failed program was:" >&5
12796 cat "conftest.$ac_ext" >&5
12797 ac_cv_func_gethostbyname=no
12798 fi
12799 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12800 fi
12801 echo "$as_me:12801: result: $ac_cv_func_gethostbyname" >&5
12802 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12803
12804     if test $ac_cv_func_gethostbyname = no; then
12805       echo "$as_me:12805: checking for gethostbyname in -lnsl" >&5
12806 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12807 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12808   echo $ECHO_N "(cached) $ECHO_C" >&6
12809 else
12810   ac_check_lib_save_LIBS=$LIBS
12811 LIBS="-lnsl  $LIBS"
12812 cat >"conftest.$ac_ext" <<_ACEOF
12813 #line 12813 "configure"
12814 #include "confdefs.h"
12815
12816 /* Override any gcc2 internal prototype to avoid an error.  */
12817 #ifdef __cplusplus
12818 extern "C"
12819 #endif
12820 /* We use char because int might match the return type of a gcc2
12821    builtin and then its argument prototype would still apply.  */
12822 char gethostbyname ();
12823 int
12824 main (void)
12825 {
12826 gethostbyname ();
12827   ;
12828   return 0;
12829 }
12830 _ACEOF
12831 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12832 if { (eval echo "$as_me:12832: \"$ac_link\"") >&5
12833   (eval $ac_link) 2>&5
12834   ac_status=$?
12835   echo "$as_me:12835: \$? = $ac_status" >&5
12836   (exit "$ac_status"); } &&
12837          { ac_try='test -s "conftest$ac_exeext"'
12838   { (eval echo "$as_me:12838: \"$ac_try\"") >&5
12839   (eval $ac_try) 2>&5
12840   ac_status=$?
12841   echo "$as_me:12841: \$? = $ac_status" >&5
12842   (exit "$ac_status"); }; }; then
12843   ac_cv_lib_nsl_gethostbyname=yes
12844 else
12845   echo "$as_me: failed program was:" >&5
12846 cat "conftest.$ac_ext" >&5
12847 ac_cv_lib_nsl_gethostbyname=no
12848 fi
12849 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12850 LIBS=$ac_check_lib_save_LIBS
12851 fi
12852 echo "$as_me:12852: result: $ac_cv_lib_nsl_gethostbyname" >&5
12853 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12854 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12855   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12856 fi
12857
12858       if test $ac_cv_lib_nsl_gethostbyname = no; then
12859         echo "$as_me:12859: checking for gethostbyname in -lbsd" >&5
12860 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12861 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12862   echo $ECHO_N "(cached) $ECHO_C" >&6
12863 else
12864   ac_check_lib_save_LIBS=$LIBS
12865 LIBS="-lbsd  $LIBS"
12866 cat >"conftest.$ac_ext" <<_ACEOF
12867 #line 12867 "configure"
12868 #include "confdefs.h"
12869
12870 /* Override any gcc2 internal prototype to avoid an error.  */
12871 #ifdef __cplusplus
12872 extern "C"
12873 #endif
12874 /* We use char because int might match the return type of a gcc2
12875    builtin and then its argument prototype would still apply.  */
12876 char gethostbyname ();
12877 int
12878 main (void)
12879 {
12880 gethostbyname ();
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_cv_lib_bsd_gethostbyname=yes
12898 else
12899   echo "$as_me: failed program was:" >&5
12900 cat "conftest.$ac_ext" >&5
12901 ac_cv_lib_bsd_gethostbyname=no
12902 fi
12903 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12904 LIBS=$ac_check_lib_save_LIBS
12905 fi
12906 echo "$as_me:12906: result: $ac_cv_lib_bsd_gethostbyname" >&5
12907 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12908 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
12909   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12910 fi
12911
12912       fi
12913     fi
12914
12915     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12916     # socket/setsockopt and other routines are undefined under SCO ODT
12917     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12918     # on later versions), says Simon Leinen: it contains gethostby*
12919     # variants that don't use the nameserver (or something).  -lsocket
12920     # must be given before -lnsl if both are needed.  We assume that
12921     # if connect needs -lnsl, so does gethostbyname.
12922     echo "$as_me:12922: checking for connect" >&5
12923 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12924 if test "${ac_cv_func_connect+set}" = set; then
12925   echo $ECHO_N "(cached) $ECHO_C" >&6
12926 else
12927   cat >"conftest.$ac_ext" <<_ACEOF
12928 #line 12928 "configure"
12929 #include "confdefs.h"
12930 #define connect autoconf_temporary
12931 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12932 #undef connect
12933
12934 #ifdef __cplusplus
12935 extern "C"
12936 #endif
12937
12938 /* We use char because int might match the return type of a gcc2
12939    builtin and then its argument prototype would still apply.  */
12940 char connect (void);
12941
12942 int
12943 main (void)
12944 {
12945
12946 /* The GNU C library defines stubs for functions which it implements
12947     to always fail with ENOSYS.  Some functions are actually named
12948     something starting with __ and the normal name is an alias.  */
12949 #if defined (__stub_connect) || defined (__stub___connect)
12950 #error found stub for connect
12951 #endif
12952
12953         return connect ();
12954   ;
12955   return 0;
12956 }
12957 _ACEOF
12958 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12959 if { (eval echo "$as_me:12959: \"$ac_link\"") >&5
12960   (eval $ac_link) 2>&5
12961   ac_status=$?
12962   echo "$as_me:12962: \$? = $ac_status" >&5
12963   (exit "$ac_status"); } &&
12964          { ac_try='test -s "conftest$ac_exeext"'
12965   { (eval echo "$as_me:12965: \"$ac_try\"") >&5
12966   (eval $ac_try) 2>&5
12967   ac_status=$?
12968   echo "$as_me:12968: \$? = $ac_status" >&5
12969   (exit "$ac_status"); }; }; then
12970   ac_cv_func_connect=yes
12971 else
12972   echo "$as_me: failed program was:" >&5
12973 cat "conftest.$ac_ext" >&5
12974 ac_cv_func_connect=no
12975 fi
12976 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12977 fi
12978 echo "$as_me:12978: result: $ac_cv_func_connect" >&5
12979 echo "${ECHO_T}$ac_cv_func_connect" >&6
12980
12981     if test $ac_cv_func_connect = no; then
12982       echo "$as_me:12982: checking for connect in -lsocket" >&5
12983 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12984 if test "${ac_cv_lib_socket_connect+set}" = set; then
12985   echo $ECHO_N "(cached) $ECHO_C" >&6
12986 else
12987   ac_check_lib_save_LIBS=$LIBS
12988 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12989 cat >"conftest.$ac_ext" <<_ACEOF
12990 #line 12990 "configure"
12991 #include "confdefs.h"
12992
12993 /* Override any gcc2 internal prototype to avoid an error.  */
12994 #ifdef __cplusplus
12995 extern "C"
12996 #endif
12997 /* We use char because int might match the return type of a gcc2
12998    builtin and then its argument prototype would still apply.  */
12999 char connect ();
13000 int
13001 main (void)
13002 {
13003 connect ();
13004   ;
13005   return 0;
13006 }
13007 _ACEOF
13008 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13009 if { (eval echo "$as_me:13009: \"$ac_link\"") >&5
13010   (eval $ac_link) 2>&5
13011   ac_status=$?
13012   echo "$as_me:13012: \$? = $ac_status" >&5
13013   (exit "$ac_status"); } &&
13014          { ac_try='test -s "conftest$ac_exeext"'
13015   { (eval echo "$as_me:13015: \"$ac_try\"") >&5
13016   (eval $ac_try) 2>&5
13017   ac_status=$?
13018   echo "$as_me:13018: \$? = $ac_status" >&5
13019   (exit "$ac_status"); }; }; then
13020   ac_cv_lib_socket_connect=yes
13021 else
13022   echo "$as_me: failed program was:" >&5
13023 cat "conftest.$ac_ext" >&5
13024 ac_cv_lib_socket_connect=no
13025 fi
13026 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13027 LIBS=$ac_check_lib_save_LIBS
13028 fi
13029 echo "$as_me:13029: result: $ac_cv_lib_socket_connect" >&5
13030 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
13031 if test "$ac_cv_lib_socket_connect" = yes; then
13032   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
13033 fi
13034
13035     fi
13036
13037     # Guillermo Gomez says -lposix is necessary on A/UX.
13038     echo "$as_me:13038: checking for remove" >&5
13039 echo $ECHO_N "checking for remove... $ECHO_C" >&6
13040 if test "${ac_cv_func_remove+set}" = set; then
13041   echo $ECHO_N "(cached) $ECHO_C" >&6
13042 else
13043   cat >"conftest.$ac_ext" <<_ACEOF
13044 #line 13044 "configure"
13045 #include "confdefs.h"
13046 #define remove autoconf_temporary
13047 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13048 #undef remove
13049
13050 #ifdef __cplusplus
13051 extern "C"
13052 #endif
13053
13054 /* We use char because int might match the return type of a gcc2
13055    builtin and then its argument prototype would still apply.  */
13056 char remove (void);
13057
13058 int
13059 main (void)
13060 {
13061
13062 /* The GNU C library defines stubs for functions which it implements
13063     to always fail with ENOSYS.  Some functions are actually named
13064     something starting with __ and the normal name is an alias.  */
13065 #if defined (__stub_remove) || defined (__stub___remove)
13066 #error found stub for remove
13067 #endif
13068
13069         return remove ();
13070   ;
13071   return 0;
13072 }
13073 _ACEOF
13074 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13075 if { (eval echo "$as_me:13075: \"$ac_link\"") >&5
13076   (eval $ac_link) 2>&5
13077   ac_status=$?
13078   echo "$as_me:13078: \$? = $ac_status" >&5
13079   (exit "$ac_status"); } &&
13080          { ac_try='test -s "conftest$ac_exeext"'
13081   { (eval echo "$as_me:13081: \"$ac_try\"") >&5
13082   (eval $ac_try) 2>&5
13083   ac_status=$?
13084   echo "$as_me:13084: \$? = $ac_status" >&5
13085   (exit "$ac_status"); }; }; then
13086   ac_cv_func_remove=yes
13087 else
13088   echo "$as_me: failed program was:" >&5
13089 cat "conftest.$ac_ext" >&5
13090 ac_cv_func_remove=no
13091 fi
13092 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13093 fi
13094 echo "$as_me:13094: result: $ac_cv_func_remove" >&5
13095 echo "${ECHO_T}$ac_cv_func_remove" >&6
13096
13097     if test $ac_cv_func_remove = no; then
13098       echo "$as_me:13098: checking for remove in -lposix" >&5
13099 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
13100 if test "${ac_cv_lib_posix_remove+set}" = set; then
13101   echo $ECHO_N "(cached) $ECHO_C" >&6
13102 else
13103   ac_check_lib_save_LIBS=$LIBS
13104 LIBS="-lposix  $LIBS"
13105 cat >"conftest.$ac_ext" <<_ACEOF
13106 #line 13106 "configure"
13107 #include "confdefs.h"
13108
13109 /* Override any gcc2 internal prototype to avoid an error.  */
13110 #ifdef __cplusplus
13111 extern "C"
13112 #endif
13113 /* We use char because int might match the return type of a gcc2
13114    builtin and then its argument prototype would still apply.  */
13115 char remove ();
13116 int
13117 main (void)
13118 {
13119 remove ();
13120   ;
13121   return 0;
13122 }
13123 _ACEOF
13124 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13125 if { (eval echo "$as_me:13125: \"$ac_link\"") >&5
13126   (eval $ac_link) 2>&5
13127   ac_status=$?
13128   echo "$as_me:13128: \$? = $ac_status" >&5
13129   (exit "$ac_status"); } &&
13130          { ac_try='test -s "conftest$ac_exeext"'
13131   { (eval echo "$as_me:13131: \"$ac_try\"") >&5
13132   (eval $ac_try) 2>&5
13133   ac_status=$?
13134   echo "$as_me:13134: \$? = $ac_status" >&5
13135   (exit "$ac_status"); }; }; then
13136   ac_cv_lib_posix_remove=yes
13137 else
13138   echo "$as_me: failed program was:" >&5
13139 cat "conftest.$ac_ext" >&5
13140 ac_cv_lib_posix_remove=no
13141 fi
13142 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13143 LIBS=$ac_check_lib_save_LIBS
13144 fi
13145 echo "$as_me:13145: result: $ac_cv_lib_posix_remove" >&5
13146 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
13147 if test "$ac_cv_lib_posix_remove" = yes; then
13148   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
13149 fi
13150
13151     fi
13152
13153     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
13154     echo "$as_me:13154: checking for shmat" >&5
13155 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
13156 if test "${ac_cv_func_shmat+set}" = set; then
13157   echo $ECHO_N "(cached) $ECHO_C" >&6
13158 else
13159   cat >"conftest.$ac_ext" <<_ACEOF
13160 #line 13160 "configure"
13161 #include "confdefs.h"
13162 #define shmat autoconf_temporary
13163 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13164 #undef shmat
13165
13166 #ifdef __cplusplus
13167 extern "C"
13168 #endif
13169
13170 /* We use char because int might match the return type of a gcc2
13171    builtin and then its argument prototype would still apply.  */
13172 char shmat (void);
13173
13174 int
13175 main (void)
13176 {
13177
13178 /* The GNU C library defines stubs for functions which it implements
13179     to always fail with ENOSYS.  Some functions are actually named
13180     something starting with __ and the normal name is an alias.  */
13181 #if defined (__stub_shmat) || defined (__stub___shmat)
13182 #error found stub for shmat
13183 #endif
13184
13185         return shmat ();
13186   ;
13187   return 0;
13188 }
13189 _ACEOF
13190 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13191 if { (eval echo "$as_me:13191: \"$ac_link\"") >&5
13192   (eval $ac_link) 2>&5
13193   ac_status=$?
13194   echo "$as_me:13194: \$? = $ac_status" >&5
13195   (exit "$ac_status"); } &&
13196          { ac_try='test -s "conftest$ac_exeext"'
13197   { (eval echo "$as_me:13197: \"$ac_try\"") >&5
13198   (eval $ac_try) 2>&5
13199   ac_status=$?
13200   echo "$as_me:13200: \$? = $ac_status" >&5
13201   (exit "$ac_status"); }; }; then
13202   ac_cv_func_shmat=yes
13203 else
13204   echo "$as_me: failed program was:" >&5
13205 cat "conftest.$ac_ext" >&5
13206 ac_cv_func_shmat=no
13207 fi
13208 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13209 fi
13210 echo "$as_me:13210: result: $ac_cv_func_shmat" >&5
13211 echo "${ECHO_T}$ac_cv_func_shmat" >&6
13212
13213     if test $ac_cv_func_shmat = no; then
13214       echo "$as_me:13214: checking for shmat in -lipc" >&5
13215 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13216 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13217   echo $ECHO_N "(cached) $ECHO_C" >&6
13218 else
13219   ac_check_lib_save_LIBS=$LIBS
13220 LIBS="-lipc  $LIBS"
13221 cat >"conftest.$ac_ext" <<_ACEOF
13222 #line 13222 "configure"
13223 #include "confdefs.h"
13224
13225 /* Override any gcc2 internal prototype to avoid an error.  */
13226 #ifdef __cplusplus
13227 extern "C"
13228 #endif
13229 /* We use char because int might match the return type of a gcc2
13230    builtin and then its argument prototype would still apply.  */
13231 char shmat ();
13232 int
13233 main (void)
13234 {
13235 shmat ();
13236   ;
13237   return 0;
13238 }
13239 _ACEOF
13240 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13241 if { (eval echo "$as_me:13241: \"$ac_link\"") >&5
13242   (eval $ac_link) 2>&5
13243   ac_status=$?
13244   echo "$as_me:13244: \$? = $ac_status" >&5
13245   (exit "$ac_status"); } &&
13246          { ac_try='test -s "conftest$ac_exeext"'
13247   { (eval echo "$as_me:13247: \"$ac_try\"") >&5
13248   (eval $ac_try) 2>&5
13249   ac_status=$?
13250   echo "$as_me:13250: \$? = $ac_status" >&5
13251   (exit "$ac_status"); }; }; then
13252   ac_cv_lib_ipc_shmat=yes
13253 else
13254   echo "$as_me: failed program was:" >&5
13255 cat "conftest.$ac_ext" >&5
13256 ac_cv_lib_ipc_shmat=no
13257 fi
13258 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13259 LIBS=$ac_check_lib_save_LIBS
13260 fi
13261 echo "$as_me:13261: result: $ac_cv_lib_ipc_shmat" >&5
13262 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
13263 if test "$ac_cv_lib_ipc_shmat" = yes; then
13264   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13265 fi
13266
13267     fi
13268   fi
13269
13270   # Check for libraries that X11R6 Xt/Xaw programs need.
13271   ac_save_LDFLAGS=$LDFLAGS
13272   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13273   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13274   # check for ICE first), but we must link in the order -lSM -lICE or
13275   # we get undefined symbols.  So assume we have SM if we have ICE.
13276   # These have to be linked with before -lX11, unlike the other
13277   # libraries we check for below, so use a different variable.
13278   # John Interrante, Karl Berry
13279   echo "$as_me:13279: checking for IceConnectionNumber in -lICE" >&5
13280 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13281 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13282   echo $ECHO_N "(cached) $ECHO_C" >&6
13283 else
13284   ac_check_lib_save_LIBS=$LIBS
13285 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13286 cat >"conftest.$ac_ext" <<_ACEOF
13287 #line 13287 "configure"
13288 #include "confdefs.h"
13289
13290 /* Override any gcc2 internal prototype to avoid an error.  */
13291 #ifdef __cplusplus
13292 extern "C"
13293 #endif
13294 /* We use char because int might match the return type of a gcc2
13295    builtin and then its argument prototype would still apply.  */
13296 char IceConnectionNumber ();
13297 int
13298 main (void)
13299 {
13300 IceConnectionNumber ();
13301   ;
13302   return 0;
13303 }
13304 _ACEOF
13305 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13306 if { (eval echo "$as_me:13306: \"$ac_link\"") >&5
13307   (eval $ac_link) 2>&5
13308   ac_status=$?
13309   echo "$as_me:13309: \$? = $ac_status" >&5
13310   (exit "$ac_status"); } &&
13311          { ac_try='test -s "conftest$ac_exeext"'
13312   { (eval echo "$as_me:13312: \"$ac_try\"") >&5
13313   (eval $ac_try) 2>&5
13314   ac_status=$?
13315   echo "$as_me:13315: \$? = $ac_status" >&5
13316   (exit "$ac_status"); }; }; then
13317   ac_cv_lib_ICE_IceConnectionNumber=yes
13318 else
13319   echo "$as_me: failed program was:" >&5
13320 cat "conftest.$ac_ext" >&5
13321 ac_cv_lib_ICE_IceConnectionNumber=no
13322 fi
13323 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13324 LIBS=$ac_check_lib_save_LIBS
13325 fi
13326 echo "$as_me:13326: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13327 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13328 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13329   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13330 fi
13331
13332   LDFLAGS=$ac_save_LDFLAGS
13333
13334 fi
13335
13336 cf_x_athena=${cf_x_athena:-Xaw}
13337
13338 echo "$as_me:13338: checking if you want to link with Xaw 3d library" >&5
13339 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13340 withval=
13341
13342 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13343 if test "${with_Xaw3d+set}" = set; then
13344   withval="$with_Xaw3d"
13345
13346 fi;
13347 if test "$withval" = yes ; then
13348         cf_x_athena=Xaw3d
13349         echo "$as_me:13349: result: yes" >&5
13350 echo "${ECHO_T}yes" >&6
13351 else
13352         echo "$as_me:13352: result: no" >&5
13353 echo "${ECHO_T}no" >&6
13354 fi
13355
13356 echo "$as_me:13356: checking if you want to link with Xaw 3d xft library" >&5
13357 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13358 withval=
13359
13360 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13361 if test "${with_Xaw3dxft+set}" = set; then
13362   withval="$with_Xaw3dxft"
13363
13364 fi;
13365 if test "$withval" = yes ; then
13366         cf_x_athena=Xaw3dxft
13367         echo "$as_me:13367: result: yes" >&5
13368 echo "${ECHO_T}yes" >&6
13369 else
13370         echo "$as_me:13370: result: no" >&5
13371 echo "${ECHO_T}no" >&6
13372 fi
13373
13374 echo "$as_me:13374: checking if you want to link with neXT Athena library" >&5
13375 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13376 withval=
13377
13378 # Check whether --with-neXtaw or --without-neXtaw was given.
13379 if test "${with_neXtaw+set}" = set; then
13380   withval="$with_neXtaw"
13381
13382 fi;
13383 if test "$withval" = yes ; then
13384         cf_x_athena=neXtaw
13385         echo "$as_me:13385: result: yes" >&5
13386 echo "${ECHO_T}yes" >&6
13387 else
13388         echo "$as_me:13388: result: no" >&5
13389 echo "${ECHO_T}no" >&6
13390 fi
13391
13392 echo "$as_me:13392: checking if you want to link with Athena-Plus library" >&5
13393 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13394 withval=
13395
13396 # Check whether --with-XawPlus or --without-XawPlus was given.
13397 if test "${with_XawPlus+set}" = set; then
13398   withval="$with_XawPlus"
13399
13400 fi;
13401 if test "$withval" = yes ; then
13402         cf_x_athena=XawPlus
13403         echo "$as_me:13403: result: yes" >&5
13404 echo "${ECHO_T}yes" >&6
13405 else
13406         echo "$as_me:13406: result: no" >&5
13407 echo "${ECHO_T}no" >&6
13408 fi
13409
13410 cf_x_athena_lib=""
13411
13412 if test "$PKG_CONFIG" != none ; then
13413         cf_athena_list=
13414         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13415         for cf_athena_pkg in \
13416                 $cf_athena_list \
13417                 ${cf_x_athena} \
13418                 ${cf_x_athena}-devel \
13419                 lib${cf_x_athena} \
13420                 lib${cf_x_athena}-devel
13421         do
13422
13423 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13424         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13425
13426 echo "${as_me:-configure}:13426: testing found package $cf_athena_pkg ..." 1>&5
13427
13428         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13429         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13430         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13431
13432 echo "${as_me:-configure}:13432: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13433
13434         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13435
13436 echo "${as_me:-configure}:13436: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13437
13438 cf_fix_cppflags=no
13439 cf_new_cflags=
13440 cf_new_cppflags=
13441 cf_new_extra_cppflags=
13442
13443 for cf_add_cflags in $cf_pkgconfig_incs
13444 do
13445 case "$cf_fix_cppflags" in
13446 (no)
13447         case "$cf_add_cflags" in
13448         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13449                 case "$cf_add_cflags" in
13450                 (-D*)
13451                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13452
13453                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13454                                 && test -z "${cf_tst_cflags}" \
13455                                 && cf_fix_cppflags=yes
13456
13457                         if test "$cf_fix_cppflags" = yes ; then
13458
13459         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13460         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13461
13462                                 continue
13463                         elif test "${cf_tst_cflags}" = "\"'" ; then
13464
13465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13467
13468                                 continue
13469                         fi
13470                         ;;
13471                 esac
13472                 case "$CPPFLAGS" in
13473                 (*$cf_add_cflags)
13474                         ;;
13475                 (*)
13476                         case "$cf_add_cflags" in
13477                         (-D*)
13478                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13479
13480 CPPFLAGS=`echo "$CPPFLAGS" | \
13481         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13482                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13483
13484                                 ;;
13485                         esac
13486
13487         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13488         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13489
13490                         ;;
13491                 esac
13492                 ;;
13493         (*)
13494
13495         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13496         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13497
13498                 ;;
13499         esac
13500         ;;
13501 (yes)
13502
13503         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13504         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13505
13506         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13507
13508         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13509                 && test -z "${cf_tst_cflags}" \
13510                 && cf_fix_cppflags=no
13511         ;;
13512 esac
13513 done
13514
13515 if test -n "$cf_new_cflags" ; then
13516
13517         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13518         CFLAGS="${CFLAGS}$cf_new_cflags"
13519
13520 fi
13521
13522 if test -n "$cf_new_cppflags" ; then
13523
13524         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13525         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13526
13527 fi
13528
13529 if test -n "$cf_new_extra_cppflags" ; then
13530
13531         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13532         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13533
13534 fi
13535
13536 cf_add_libs="$LIBS"
13537 # reverse order
13538 cf_add_0lib=
13539 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13540 # filter duplicates
13541 for cf_add_1lib in $cf_add_0lib; do
13542         for cf_add_2lib in $cf_add_libs; do
13543                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13544                         cf_add_1lib=
13545                         break
13546                 fi
13547         done
13548         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13549 done
13550 LIBS="$cf_add_libs"
13551
13552                         cf_x_athena_lib="$cf_pkgconfig_libs"
13553
13554 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13555
13556                         cat >>confdefs.h <<EOF
13557 #define $cf_x_athena_LIBS 1
13558 EOF
13559
13560         for cf_trim_lib in Xmu Xt X11
13561         do
13562                 case "$LIBS" in
13563                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13564                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13565                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13566
13567 echo "${as_me:-configure}:13567: testing ..trimmed $LIBS ..." 1>&5
13568
13569                         ;;
13570                 esac
13571         done
13572
13573 echo "$as_me:13573: checking for usable $cf_x_athena/Xmu package" >&5
13574 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13575 if test "${cf_cv_xaw_compat+set}" = set; then
13576   echo $ECHO_N "(cached) $ECHO_C" >&6
13577 else
13578
13579 cat >"conftest.$ac_ext" <<_ACEOF
13580 #line 13580 "configure"
13581 #include "confdefs.h"
13582
13583 #include <X11/Xmu/CharSet.h>
13584
13585 int
13586 main (void)
13587 {
13588
13589 int check = XmuCompareISOLatin1("big", "small");
13590 (void)check;
13591
13592   ;
13593   return 0;
13594 }
13595 _ACEOF
13596 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13597 if { (eval echo "$as_me:13597: \"$ac_link\"") >&5
13598   (eval $ac_link) 2>&5
13599   ac_status=$?
13600   echo "$as_me:13600: \$? = $ac_status" >&5
13601   (exit "$ac_status"); } &&
13602          { ac_try='test -s "conftest$ac_exeext"'
13603   { (eval echo "$as_me:13603: \"$ac_try\"") >&5
13604   (eval $ac_try) 2>&5
13605   ac_status=$?
13606   echo "$as_me:13606: \$? = $ac_status" >&5
13607   (exit "$ac_status"); }; }; then
13608   cf_cv_xaw_compat=yes
13609 else
13610   echo "$as_me: failed program was:" >&5
13611 cat "conftest.$ac_ext" >&5
13612 cf_cv_xaw_compat=no
13613 fi
13614 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13615 fi
13616 echo "$as_me:13616: result: $cf_cv_xaw_compat" >&5
13617 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13618
13619                         if test "$cf_cv_xaw_compat" = no
13620                         then
13621                                 # workaround for broken ".pc" files...
13622                                 case "$cf_x_athena_lib" in
13623                                 (*-lXmu*)
13624                                         ;;
13625                                 (*)
13626                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13627
13628 echo "${as_me:-configure}:13628: testing work around broken package ..." 1>&5
13629
13630                                         cf_save_xmu="$LIBS"
13631                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13632
13633 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13634         test -n "$verbose" && echo "    found package xmu" 1>&6
13635
13636 echo "${as_me:-configure}:13636: testing found package xmu ..." 1>&5
13637
13638         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13639         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13640         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13641
13642 echo "${as_me:-configure}:13642: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13643
13644         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13645
13646 echo "${as_me:-configure}:13646: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13647
13648 cf_fix_cppflags=no
13649 cf_new_cflags=
13650 cf_new_cppflags=
13651 cf_new_extra_cppflags=
13652
13653 for cf_add_cflags in $cf_pkgconfig_incs
13654 do
13655 case "$cf_fix_cppflags" in
13656 (no)
13657         case "$cf_add_cflags" in
13658         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13659                 case "$cf_add_cflags" in
13660                 (-D*)
13661                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13662
13663                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13664                                 && test -z "${cf_tst_cflags}" \
13665                                 && cf_fix_cppflags=yes
13666
13667                         if test "$cf_fix_cppflags" = yes ; then
13668
13669         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13670         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13671
13672                                 continue
13673                         elif test "${cf_tst_cflags}" = "\"'" ; then
13674
13675         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13676         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13677
13678                                 continue
13679                         fi
13680                         ;;
13681                 esac
13682                 case "$CPPFLAGS" in
13683                 (*$cf_add_cflags)
13684                         ;;
13685                 (*)
13686                         case "$cf_add_cflags" in
13687                         (-D*)
13688                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13689
13690 CPPFLAGS=`echo "$CPPFLAGS" | \
13691         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13692                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13693
13694                                 ;;
13695                         esac
13696
13697         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13698         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13699
13700                         ;;
13701                 esac
13702                 ;;
13703         (*)
13704
13705         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13706         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13707
13708                 ;;
13709         esac
13710         ;;
13711 (yes)
13712
13713         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13714         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13715
13716         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13717
13718         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13719                 && test -z "${cf_tst_cflags}" \
13720                 && cf_fix_cppflags=no
13721         ;;
13722 esac
13723 done
13724
13725 if test -n "$cf_new_cflags" ; then
13726
13727         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13728         CFLAGS="${CFLAGS}$cf_new_cflags"
13729
13730 fi
13731
13732 if test -n "$cf_new_cppflags" ; then
13733
13734         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13735         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13736
13737 fi
13738
13739 if test -n "$cf_new_extra_cppflags" ; then
13740
13741         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13742         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13743
13744 fi
13745
13746 cf_add_libs="$LIBS"
13747 # reverse order
13748 cf_add_0lib=
13749 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13750 # filter duplicates
13751 for cf_add_1lib in $cf_add_0lib; do
13752         for cf_add_2lib in $cf_add_libs; do
13753                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13754                         cf_add_1lib=
13755                         break
13756                 fi
13757         done
13758         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13759 done
13760 LIBS="$cf_add_libs"
13761
13762                                                         LIBS="$cf_save_xmu"
13763
13764 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13765
13766 echo "${as_me:-configure}:13766: testing ...before $LIBS ..." 1>&5
13767
13768 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13769 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13770
13771 echo "${as_me:-configure}:13771: testing ...after  $LIBS ..." 1>&5
13772
13773 else
13774         cf_pkgconfig_incs=
13775         cf_pkgconfig_libs=
13776
13777 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13778
13779 echo "${as_me:-configure}:13779: testing ...before $LIBS ..." 1>&5
13780
13781 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13782 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13783
13784 echo "${as_me:-configure}:13784: testing ...after  $LIBS ..." 1>&5
13785
13786 fi
13787
13788         for cf_trim_lib in Xmu Xt X11
13789         do
13790                 case "$LIBS" in
13791                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13792                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13793                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13794
13795 echo "${as_me:-configure}:13795: testing ..trimmed $LIBS ..." 1>&5
13796
13797                         ;;
13798                 esac
13799         done
13800
13801                                         ;;
13802                                 esac
13803                         fi
13804
13805                         break
13806 else
13807         cf_pkgconfig_incs=
13808         cf_pkgconfig_libs=
13809         :
13810 fi
13811
13812         done
13813 fi
13814
13815 if test -z "$cf_x_athena_lib" ; then
13816
13817 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13818         test -n "$verbose" && echo "    found package Xext" 1>&6
13819
13820 echo "${as_me:-configure}:13820: testing found package Xext ..." 1>&5
13821
13822         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13823         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13824         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13825
13826 echo "${as_me:-configure}:13826: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13827
13828         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13829
13830 echo "${as_me:-configure}:13830: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13831
13832 cf_fix_cppflags=no
13833 cf_new_cflags=
13834 cf_new_cppflags=
13835 cf_new_extra_cppflags=
13836
13837 for cf_add_cflags in $cf_pkgconfig_incs
13838 do
13839 case "$cf_fix_cppflags" in
13840 (no)
13841         case "$cf_add_cflags" in
13842         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13843                 case "$cf_add_cflags" in
13844                 (-D*)
13845                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13846
13847                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13848                                 && test -z "${cf_tst_cflags}" \
13849                                 && cf_fix_cppflags=yes
13850
13851                         if test "$cf_fix_cppflags" = yes ; then
13852
13853         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13854         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13855
13856                                 continue
13857                         elif test "${cf_tst_cflags}" = "\"'" ; then
13858
13859         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13860         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13861
13862                                 continue
13863                         fi
13864                         ;;
13865                 esac
13866                 case "$CPPFLAGS" in
13867                 (*$cf_add_cflags)
13868                         ;;
13869                 (*)
13870                         case "$cf_add_cflags" in
13871                         (-D*)
13872                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13873
13874 CPPFLAGS=`echo "$CPPFLAGS" | \
13875         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13876                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13877
13878                                 ;;
13879                         esac
13880
13881         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13882         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13883
13884                         ;;
13885                 esac
13886                 ;;
13887         (*)
13888
13889         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13890         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13891
13892                 ;;
13893         esac
13894         ;;
13895 (yes)
13896
13897         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13898         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13899
13900         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13901
13902         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13903                 && test -z "${cf_tst_cflags}" \
13904                 && cf_fix_cppflags=no
13905         ;;
13906 esac
13907 done
13908
13909 if test -n "$cf_new_cflags" ; then
13910
13911         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13912         CFLAGS="${CFLAGS}$cf_new_cflags"
13913
13914 fi
13915
13916 if test -n "$cf_new_cppflags" ; then
13917
13918         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13919         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13920
13921 fi
13922
13923 if test -n "$cf_new_extra_cppflags" ; then
13924
13925         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13926         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13927
13928 fi
13929
13930 cf_add_libs="$LIBS"
13931 # reverse order
13932 cf_add_0lib=
13933 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13934 # filter duplicates
13935 for cf_add_1lib in $cf_add_0lib; do
13936         for cf_add_2lib in $cf_add_libs; do
13937                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13938                         cf_add_1lib=
13939                         break
13940                 fi
13941         done
13942         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13943 done
13944 LIBS="$cf_add_libs"
13945
13946         :
13947 else
13948         cf_pkgconfig_incs=
13949         cf_pkgconfig_libs=
13950
13951         echo "$as_me:13951: checking for XextCreateExtension in -lXext" >&5
13952 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13953 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13954   echo $ECHO_N "(cached) $ECHO_C" >&6
13955 else
13956   ac_check_lib_save_LIBS=$LIBS
13957 LIBS="-lXext  $LIBS"
13958 cat >"conftest.$ac_ext" <<_ACEOF
13959 #line 13959 "configure"
13960 #include "confdefs.h"
13961
13962 /* Override any gcc2 internal prototype to avoid an error.  */
13963 #ifdef __cplusplus
13964 extern "C"
13965 #endif
13966 /* We use char because int might match the return type of a gcc2
13967    builtin and then its argument prototype would still apply.  */
13968 char XextCreateExtension ();
13969 int
13970 main (void)
13971 {
13972 XextCreateExtension ();
13973   ;
13974   return 0;
13975 }
13976 _ACEOF
13977 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13978 if { (eval echo "$as_me:13978: \"$ac_link\"") >&5
13979   (eval $ac_link) 2>&5
13980   ac_status=$?
13981   echo "$as_me:13981: \$? = $ac_status" >&5
13982   (exit "$ac_status"); } &&
13983          { ac_try='test -s "conftest$ac_exeext"'
13984   { (eval echo "$as_me:13984: \"$ac_try\"") >&5
13985   (eval $ac_try) 2>&5
13986   ac_status=$?
13987   echo "$as_me:13987: \$? = $ac_status" >&5
13988   (exit "$ac_status"); }; }; then
13989   ac_cv_lib_Xext_XextCreateExtension=yes
13990 else
13991   echo "$as_me: failed program was:" >&5
13992 cat "conftest.$ac_ext" >&5
13993 ac_cv_lib_Xext_XextCreateExtension=no
13994 fi
13995 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13996 LIBS=$ac_check_lib_save_LIBS
13997 fi
13998 echo "$as_me:13998: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13999 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
14000 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
14001
14002 cf_add_libs="$LIBS"
14003 # reverse order
14004 cf_add_0lib=
14005 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14006 # filter duplicates
14007 for cf_add_1lib in $cf_add_0lib; do
14008         for cf_add_2lib in $cf_add_libs; do
14009                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14010                         cf_add_1lib=
14011                         break
14012                 fi
14013         done
14014         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14015 done
14016 LIBS="$cf_add_libs"
14017
14018 fi
14019
14020 fi
14021
14022 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
14023 # in some cases has installed dummy files in the former, other cases replaced
14024 # it with a link to the new location).  This complicates the configure script.
14025 # Check for that pitfall, and recover using pkg-config
14026 #
14027 # If none of these are set, the configuration is almost certainly broken.
14028 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
14029 then
14030
14031 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14032         test -n "$verbose" && echo "    found package x11" 1>&6
14033
14034 echo "${as_me:-configure}:14034: testing found package x11 ..." 1>&5
14035
14036         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14037         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14038         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14039
14040 echo "${as_me:-configure}:14040: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14041
14042         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14043
14044 echo "${as_me:-configure}:14044: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14045
14046 cf_fix_cppflags=no
14047 cf_new_cflags=
14048 cf_new_cppflags=
14049 cf_new_extra_cppflags=
14050
14051 for cf_add_cflags in $cf_pkgconfig_incs
14052 do
14053 case "$cf_fix_cppflags" in
14054 (no)
14055         case "$cf_add_cflags" in
14056         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14057                 case "$cf_add_cflags" in
14058                 (-D*)
14059                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14060
14061                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14062                                 && test -z "${cf_tst_cflags}" \
14063                                 && cf_fix_cppflags=yes
14064
14065                         if test "$cf_fix_cppflags" = yes ; then
14066
14067         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14068         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14069
14070                                 continue
14071                         elif test "${cf_tst_cflags}" = "\"'" ; then
14072
14073         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14074         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14075
14076                                 continue
14077                         fi
14078                         ;;
14079                 esac
14080                 case "$CPPFLAGS" in
14081                 (*$cf_add_cflags)
14082                         ;;
14083                 (*)
14084                         case "$cf_add_cflags" in
14085                         (-D*)
14086                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14087
14088 CPPFLAGS=`echo "$CPPFLAGS" | \
14089         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14090                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14091
14092                                 ;;
14093                         esac
14094
14095         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14096         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14097
14098                         ;;
14099                 esac
14100                 ;;
14101         (*)
14102
14103         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14104         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14105
14106                 ;;
14107         esac
14108         ;;
14109 (yes)
14110
14111         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14112         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14113
14114         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14115
14116         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14117                 && test -z "${cf_tst_cflags}" \
14118                 && cf_fix_cppflags=no
14119         ;;
14120 esac
14121 done
14122
14123 if test -n "$cf_new_cflags" ; then
14124
14125         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14126         CFLAGS="${CFLAGS}$cf_new_cflags"
14127
14128 fi
14129
14130 if test -n "$cf_new_cppflags" ; then
14131
14132         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14133         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14134
14135 fi
14136
14137 if test -n "$cf_new_extra_cppflags" ; then
14138
14139         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14140         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14141
14142 fi
14143
14144 cf_add_libs="$LIBS"
14145 # reverse order
14146 cf_add_0lib=
14147 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14148 # filter duplicates
14149 for cf_add_1lib in $cf_add_0lib; do
14150         for cf_add_2lib in $cf_add_libs; do
14151                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14152                         cf_add_1lib=
14153                         break
14154                 fi
14155         done
14156         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14157 done
14158 LIBS="$cf_add_libs"
14159
14160         :
14161 else
14162         cf_pkgconfig_incs=
14163         cf_pkgconfig_libs=
14164         { echo "$as_me:14164: WARNING: unable to find X11 library" >&5
14165 echo "$as_me: WARNING: unable to find X11 library" >&2;}
14166 fi
14167
14168 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14169         test -n "$verbose" && echo "    found package ice" 1>&6
14170
14171 echo "${as_me:-configure}:14171: testing found package ice ..." 1>&5
14172
14173         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14174         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14175         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14176
14177 echo "${as_me:-configure}:14177: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14178
14179         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14180
14181 echo "${as_me:-configure}:14181: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14182
14183 cf_fix_cppflags=no
14184 cf_new_cflags=
14185 cf_new_cppflags=
14186 cf_new_extra_cppflags=
14187
14188 for cf_add_cflags in $cf_pkgconfig_incs
14189 do
14190 case "$cf_fix_cppflags" in
14191 (no)
14192         case "$cf_add_cflags" in
14193         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14194                 case "$cf_add_cflags" in
14195                 (-D*)
14196                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14197
14198                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14199                                 && test -z "${cf_tst_cflags}" \
14200                                 && cf_fix_cppflags=yes
14201
14202                         if test "$cf_fix_cppflags" = yes ; then
14203
14204         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14205         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14206
14207                                 continue
14208                         elif test "${cf_tst_cflags}" = "\"'" ; then
14209
14210         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14211         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14212
14213                                 continue
14214                         fi
14215                         ;;
14216                 esac
14217                 case "$CPPFLAGS" in
14218                 (*$cf_add_cflags)
14219                         ;;
14220                 (*)
14221                         case "$cf_add_cflags" in
14222                         (-D*)
14223                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14224
14225 CPPFLAGS=`echo "$CPPFLAGS" | \
14226         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14227                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14228
14229                                 ;;
14230                         esac
14231
14232         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14233         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14234
14235                         ;;
14236                 esac
14237                 ;;
14238         (*)
14239
14240         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14241         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14242
14243                 ;;
14244         esac
14245         ;;
14246 (yes)
14247
14248         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14249         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14250
14251         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14252
14253         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14254                 && test -z "${cf_tst_cflags}" \
14255                 && cf_fix_cppflags=no
14256         ;;
14257 esac
14258 done
14259
14260 if test -n "$cf_new_cflags" ; then
14261
14262         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14263         CFLAGS="${CFLAGS}$cf_new_cflags"
14264
14265 fi
14266
14267 if test -n "$cf_new_cppflags" ; then
14268
14269         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14270         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14271
14272 fi
14273
14274 if test -n "$cf_new_extra_cppflags" ; then
14275
14276         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14277         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14278
14279 fi
14280
14281 cf_add_libs="$LIBS"
14282 # reverse order
14283 cf_add_0lib=
14284 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14285 # filter duplicates
14286 for cf_add_1lib in $cf_add_0lib; do
14287         for cf_add_2lib in $cf_add_libs; do
14288                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14289                         cf_add_1lib=
14290                         break
14291                 fi
14292         done
14293         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14294 done
14295 LIBS="$cf_add_libs"
14296
14297         :
14298 else
14299         cf_pkgconfig_incs=
14300         cf_pkgconfig_libs=
14301         { echo "$as_me:14301: WARNING: unable to find ICE library" >&5
14302 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14303 fi
14304
14305 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14306         test -n "$verbose" && echo "    found package sm" 1>&6
14307
14308 echo "${as_me:-configure}:14308: testing found package sm ..." 1>&5
14309
14310         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14311         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14312         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14313
14314 echo "${as_me:-configure}:14314: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14315
14316         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14317
14318 echo "${as_me:-configure}:14318: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14319
14320 cf_fix_cppflags=no
14321 cf_new_cflags=
14322 cf_new_cppflags=
14323 cf_new_extra_cppflags=
14324
14325 for cf_add_cflags in $cf_pkgconfig_incs
14326 do
14327 case "$cf_fix_cppflags" in
14328 (no)
14329         case "$cf_add_cflags" in
14330         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14331                 case "$cf_add_cflags" in
14332                 (-D*)
14333                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14334
14335                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14336                                 && test -z "${cf_tst_cflags}" \
14337                                 && cf_fix_cppflags=yes
14338
14339                         if test "$cf_fix_cppflags" = yes ; then
14340
14341         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14342         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14343
14344                                 continue
14345                         elif test "${cf_tst_cflags}" = "\"'" ; then
14346
14347         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14348         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14349
14350                                 continue
14351                         fi
14352                         ;;
14353                 esac
14354                 case "$CPPFLAGS" in
14355                 (*$cf_add_cflags)
14356                         ;;
14357                 (*)
14358                         case "$cf_add_cflags" in
14359                         (-D*)
14360                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14361
14362 CPPFLAGS=`echo "$CPPFLAGS" | \
14363         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14364                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14365
14366                                 ;;
14367                         esac
14368
14369         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14370         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14371
14372                         ;;
14373                 esac
14374                 ;;
14375         (*)
14376
14377         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14378         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14379
14380                 ;;
14381         esac
14382         ;;
14383 (yes)
14384
14385         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14386         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14387
14388         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14389
14390         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14391                 && test -z "${cf_tst_cflags}" \
14392                 && cf_fix_cppflags=no
14393         ;;
14394 esac
14395 done
14396
14397 if test -n "$cf_new_cflags" ; then
14398
14399         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14400         CFLAGS="${CFLAGS}$cf_new_cflags"
14401
14402 fi
14403
14404 if test -n "$cf_new_cppflags" ; then
14405
14406         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14407         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14408
14409 fi
14410
14411 if test -n "$cf_new_extra_cppflags" ; then
14412
14413         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14414         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14415
14416 fi
14417
14418 cf_add_libs="$LIBS"
14419 # reverse order
14420 cf_add_0lib=
14421 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14422 # filter duplicates
14423 for cf_add_1lib in $cf_add_0lib; do
14424         for cf_add_2lib in $cf_add_libs; do
14425                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14426                         cf_add_1lib=
14427                         break
14428                 fi
14429         done
14430         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14431 done
14432 LIBS="$cf_add_libs"
14433
14434         :
14435 else
14436         cf_pkgconfig_incs=
14437         cf_pkgconfig_libs=
14438         { echo "$as_me:14438: WARNING: unable to find SM library" >&5
14439 echo "$as_me: WARNING: unable to find SM library" >&2;}
14440 fi
14441
14442 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14443         test -n "$verbose" && echo "    found package xt" 1>&6
14444
14445 echo "${as_me:-configure}:14445: testing found package xt ..." 1>&5
14446
14447         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14448         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14449         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14450
14451 echo "${as_me:-configure}:14451: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14452
14453         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14454
14455 echo "${as_me:-configure}:14455: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14456
14457 cf_fix_cppflags=no
14458 cf_new_cflags=
14459 cf_new_cppflags=
14460 cf_new_extra_cppflags=
14461
14462 for cf_add_cflags in $cf_pkgconfig_incs
14463 do
14464 case "$cf_fix_cppflags" in
14465 (no)
14466         case "$cf_add_cflags" in
14467         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14468                 case "$cf_add_cflags" in
14469                 (-D*)
14470                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14471
14472                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14473                                 && test -z "${cf_tst_cflags}" \
14474                                 && cf_fix_cppflags=yes
14475
14476                         if test "$cf_fix_cppflags" = yes ; then
14477
14478         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14479         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14480
14481                                 continue
14482                         elif test "${cf_tst_cflags}" = "\"'" ; then
14483
14484         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14485         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14486
14487                                 continue
14488                         fi
14489                         ;;
14490                 esac
14491                 case "$CPPFLAGS" in
14492                 (*$cf_add_cflags)
14493                         ;;
14494                 (*)
14495                         case "$cf_add_cflags" in
14496                         (-D*)
14497                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14498
14499 CPPFLAGS=`echo "$CPPFLAGS" | \
14500         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14501                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14502
14503                                 ;;
14504                         esac
14505
14506         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14507         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14508
14509                         ;;
14510                 esac
14511                 ;;
14512         (*)
14513
14514         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14515         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14516
14517                 ;;
14518         esac
14519         ;;
14520 (yes)
14521
14522         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14523         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14524
14525         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14526
14527         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14528                 && test -z "${cf_tst_cflags}" \
14529                 && cf_fix_cppflags=no
14530         ;;
14531 esac
14532 done
14533
14534 if test -n "$cf_new_cflags" ; then
14535
14536         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14537         CFLAGS="${CFLAGS}$cf_new_cflags"
14538
14539 fi
14540
14541 if test -n "$cf_new_cppflags" ; then
14542
14543         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14544         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14545
14546 fi
14547
14548 if test -n "$cf_new_extra_cppflags" ; then
14549
14550         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14551         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14552
14553 fi
14554
14555 cf_add_libs="$LIBS"
14556 # reverse order
14557 cf_add_0lib=
14558 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14559 # filter duplicates
14560 for cf_add_1lib in $cf_add_0lib; do
14561         for cf_add_2lib in $cf_add_libs; do
14562                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14563                         cf_add_1lib=
14564                         break
14565                 fi
14566         done
14567         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14568 done
14569 LIBS="$cf_add_libs"
14570
14571         :
14572 else
14573         cf_pkgconfig_incs=
14574         cf_pkgconfig_libs=
14575         { echo "$as_me:14575: WARNING: unable to find Xt library" >&5
14576 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14577 fi
14578
14579 else
14580         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14581 fi
14582
14583 cf_have_X_LIBS=no
14584
14585 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14586         test -n "$verbose" && echo "    found package xt" 1>&6
14587
14588 echo "${as_me:-configure}:14588: testing found package xt ..." 1>&5
14589
14590         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14591         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14592         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14593
14594 echo "${as_me:-configure}:14594: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14595
14596         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14597
14598 echo "${as_me:-configure}:14598: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14599
14600 cf_fix_cppflags=no
14601 cf_new_cflags=
14602 cf_new_cppflags=
14603 cf_new_extra_cppflags=
14604
14605 for cf_add_cflags in $cf_pkgconfig_incs
14606 do
14607 case "$cf_fix_cppflags" in
14608 (no)
14609         case "$cf_add_cflags" in
14610         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14611                 case "$cf_add_cflags" in
14612                 (-D*)
14613                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14614
14615                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14616                                 && test -z "${cf_tst_cflags}" \
14617                                 && cf_fix_cppflags=yes
14618
14619                         if test "$cf_fix_cppflags" = yes ; then
14620
14621         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14622         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14623
14624                                 continue
14625                         elif test "${cf_tst_cflags}" = "\"'" ; then
14626
14627         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14628         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14629
14630                                 continue
14631                         fi
14632                         ;;
14633                 esac
14634                 case "$CPPFLAGS" in
14635                 (*$cf_add_cflags)
14636                         ;;
14637                 (*)
14638                         case "$cf_add_cflags" in
14639                         (-D*)
14640                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14641
14642 CPPFLAGS=`echo "$CPPFLAGS" | \
14643         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14644                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14645
14646                                 ;;
14647                         esac
14648
14649         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14650         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14651
14652                         ;;
14653                 esac
14654                 ;;
14655         (*)
14656
14657         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14658         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14659
14660                 ;;
14661         esac
14662         ;;
14663 (yes)
14664
14665         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14666         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14667
14668         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14669
14670         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14671                 && test -z "${cf_tst_cflags}" \
14672                 && cf_fix_cppflags=no
14673         ;;
14674 esac
14675 done
14676
14677 if test -n "$cf_new_cflags" ; then
14678
14679         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14680         CFLAGS="${CFLAGS}$cf_new_cflags"
14681
14682 fi
14683
14684 if test -n "$cf_new_cppflags" ; then
14685
14686         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14687         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14688
14689 fi
14690
14691 if test -n "$cf_new_extra_cppflags" ; then
14692
14693         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14694         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14695
14696 fi
14697
14698 cf_add_libs="$LIBS"
14699 # reverse order
14700 cf_add_0lib=
14701 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14702 # filter duplicates
14703 for cf_add_1lib in $cf_add_0lib; do
14704         for cf_add_2lib in $cf_add_libs; do
14705                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14706                         cf_add_1lib=
14707                         break
14708                 fi
14709         done
14710         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14711 done
14712 LIBS="$cf_add_libs"
14713
14714         case "x$LIBS" in
14715         (*-lX11*)
14716                 ;;
14717         (*)
14718 # we have an "xt" package, but it may omit Xt's dependency on X11
14719 echo "$as_me:14719: checking for usable X dependency" >&5
14720 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14721 if test "${cf_cv_xt_x11_compat+set}" = set; then
14722   echo $ECHO_N "(cached) $ECHO_C" >&6
14723 else
14724
14725 cat >"conftest.$ac_ext" <<_ACEOF
14726 #line 14726 "configure"
14727 #include "confdefs.h"
14728
14729 #include <X11/Xlib.h>
14730
14731 int
14732 main (void)
14733 {
14734
14735         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14736         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14737         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14738         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14739
14740   ;
14741   return 0;
14742 }
14743 _ACEOF
14744 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14745 if { (eval echo "$as_me:14745: \"$ac_link\"") >&5
14746   (eval $ac_link) 2>&5
14747   ac_status=$?
14748   echo "$as_me:14748: \$? = $ac_status" >&5
14749   (exit "$ac_status"); } &&
14750          { ac_try='test -s "conftest$ac_exeext"'
14751   { (eval echo "$as_me:14751: \"$ac_try\"") >&5
14752   (eval $ac_try) 2>&5
14753   ac_status=$?
14754   echo "$as_me:14754: \$? = $ac_status" >&5
14755   (exit "$ac_status"); }; }; then
14756   cf_cv_xt_x11_compat=yes
14757 else
14758   echo "$as_me: failed program was:" >&5
14759 cat "conftest.$ac_ext" >&5
14760 cf_cv_xt_x11_compat=no
14761 fi
14762 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14763 fi
14764 echo "$as_me:14764: result: $cf_cv_xt_x11_compat" >&5
14765 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14766                 if test "$cf_cv_xt_x11_compat" = no
14767                 then
14768                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14769
14770 echo "${as_me:-configure}:14770: testing work around broken X11 dependency ..." 1>&5
14771
14772                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14773
14774 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14775         test -n "$verbose" && echo "    found package x11" 1>&6
14776
14777 echo "${as_me:-configure}:14777: testing found package x11 ..." 1>&5
14778
14779         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14780         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14781         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14782
14783 echo "${as_me:-configure}:14783: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14784
14785         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14786
14787 echo "${as_me:-configure}:14787: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14788
14789 cf_fix_cppflags=no
14790 cf_new_cflags=
14791 cf_new_cppflags=
14792 cf_new_extra_cppflags=
14793
14794 for cf_add_cflags in $cf_pkgconfig_incs
14795 do
14796 case "$cf_fix_cppflags" in
14797 (no)
14798         case "$cf_add_cflags" in
14799         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14800                 case "$cf_add_cflags" in
14801                 (-D*)
14802                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14803
14804                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14805                                 && test -z "${cf_tst_cflags}" \
14806                                 && cf_fix_cppflags=yes
14807
14808                         if test "$cf_fix_cppflags" = yes ; then
14809
14810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14812
14813                                 continue
14814                         elif test "${cf_tst_cflags}" = "\"'" ; then
14815
14816         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14817         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14818
14819                                 continue
14820                         fi
14821                         ;;
14822                 esac
14823                 case "$CPPFLAGS" in
14824                 (*$cf_add_cflags)
14825                         ;;
14826                 (*)
14827                         case "$cf_add_cflags" in
14828                         (-D*)
14829                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14830
14831 CPPFLAGS=`echo "$CPPFLAGS" | \
14832         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14833                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14834
14835                                 ;;
14836                         esac
14837
14838         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14839         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14840
14841                         ;;
14842                 esac
14843                 ;;
14844         (*)
14845
14846         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14847         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14848
14849                 ;;
14850         esac
14851         ;;
14852 (yes)
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         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14858
14859         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14860                 && test -z "${cf_tst_cflags}" \
14861                 && cf_fix_cppflags=no
14862         ;;
14863 esac
14864 done
14865
14866 if test -n "$cf_new_cflags" ; then
14867
14868         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14869         CFLAGS="${CFLAGS}$cf_new_cflags"
14870
14871 fi
14872
14873 if test -n "$cf_new_cppflags" ; then
14874
14875         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14876         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14877
14878 fi
14879
14880 if test -n "$cf_new_extra_cppflags" ; then
14881
14882         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14883         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14884
14885 fi
14886
14887 cf_add_libs="$LIBS"
14888 # reverse order
14889 cf_add_0lib=
14890 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14891 # filter duplicates
14892 for cf_add_1lib in $cf_add_0lib; do
14893         for cf_add_2lib in $cf_add_libs; do
14894                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14895                         cf_add_1lib=
14896                         break
14897                 fi
14898         done
14899         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14900 done
14901 LIBS="$cf_add_libs"
14902
14903         :
14904 else
14905         cf_pkgconfig_incs=
14906         cf_pkgconfig_libs=
14907
14908 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14909
14910 echo "${as_me:-configure}:14910: testing ...before $LIBS ..." 1>&5
14911
14912 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14913 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14914
14915 echo "${as_me:-configure}:14915: testing ...after  $LIBS ..." 1>&5
14916
14917 fi
14918
14919                 fi
14920                 ;;
14921         esac
14922
14923 echo "$as_me:14923: checking for usable X Toolkit package" >&5
14924 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14925 if test "${cf_cv_xt_ice_compat+set}" = set; then
14926   echo $ECHO_N "(cached) $ECHO_C" >&6
14927 else
14928
14929 cat >"conftest.$ac_ext" <<_ACEOF
14930 #line 14930 "configure"
14931 #include "confdefs.h"
14932
14933 #include <X11/Shell.h>
14934
14935 int
14936 main (void)
14937 {
14938 int num = IceConnectionNumber(0); (void) num
14939
14940   ;
14941   return 0;
14942 }
14943 _ACEOF
14944 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14945 if { (eval echo "$as_me:14945: \"$ac_link\"") >&5
14946   (eval $ac_link) 2>&5
14947   ac_status=$?
14948   echo "$as_me:14948: \$? = $ac_status" >&5
14949   (exit "$ac_status"); } &&
14950          { ac_try='test -s "conftest$ac_exeext"'
14951   { (eval echo "$as_me:14951: \"$ac_try\"") >&5
14952   (eval $ac_try) 2>&5
14953   ac_status=$?
14954   echo "$as_me:14954: \$? = $ac_status" >&5
14955   (exit "$ac_status"); }; }; then
14956   cf_cv_xt_ice_compat=yes
14957 else
14958   echo "$as_me: failed program was:" >&5
14959 cat "conftest.$ac_ext" >&5
14960 cf_cv_xt_ice_compat=no
14961 fi
14962 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14963 fi
14964 echo "$as_me:14964: result: $cf_cv_xt_ice_compat" >&5
14965 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14966
14967         if test "$cf_cv_xt_ice_compat" = no
14968         then
14969                 # workaround for broken ".pc" files used for X Toolkit.
14970                 case "x$X_PRE_LIBS" in
14971                 (*-lICE*)
14972                         case "x$LIBS" in
14973                         (*-lICE*)
14974                                 ;;
14975                         (*)
14976                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14977
14978 echo "${as_me:-configure}:14978: testing work around broken ICE dependency ..." 1>&5
14979
14980 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14981         test -n "$verbose" && echo "    found package ice" 1>&6
14982
14983 echo "${as_me:-configure}:14983: testing found package ice ..." 1>&5
14984
14985         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14986         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14987         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14988
14989 echo "${as_me:-configure}:14989: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14990
14991         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14992
14993 echo "${as_me:-configure}:14993: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14994
14995 cf_fix_cppflags=no
14996 cf_new_cflags=
14997 cf_new_cppflags=
14998 cf_new_extra_cppflags=
14999
15000 for cf_add_cflags in $cf_pkgconfig_incs
15001 do
15002 case "$cf_fix_cppflags" in
15003 (no)
15004         case "$cf_add_cflags" in
15005         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15006                 case "$cf_add_cflags" in
15007                 (-D*)
15008                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15009
15010                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15011                                 && test -z "${cf_tst_cflags}" \
15012                                 && cf_fix_cppflags=yes
15013
15014                         if test "$cf_fix_cppflags" = yes ; then
15015
15016         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15017         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15018
15019                                 continue
15020                         elif test "${cf_tst_cflags}" = "\"'" ; then
15021
15022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15024
15025                                 continue
15026                         fi
15027                         ;;
15028                 esac
15029                 case "$CPPFLAGS" in
15030                 (*$cf_add_cflags)
15031                         ;;
15032                 (*)
15033                         case "$cf_add_cflags" in
15034                         (-D*)
15035                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15036
15037 CPPFLAGS=`echo "$CPPFLAGS" | \
15038         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15039                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15040
15041                                 ;;
15042                         esac
15043
15044         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15045         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15046
15047                         ;;
15048                 esac
15049                 ;;
15050         (*)
15051
15052         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15053         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15054
15055                 ;;
15056         esac
15057         ;;
15058 (yes)
15059
15060         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15061         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15062
15063         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15064
15065         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15066                 && test -z "${cf_tst_cflags}" \
15067                 && cf_fix_cppflags=no
15068         ;;
15069 esac
15070 done
15071
15072 if test -n "$cf_new_cflags" ; then
15073
15074         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15075         CFLAGS="${CFLAGS}$cf_new_cflags"
15076
15077 fi
15078
15079 if test -n "$cf_new_cppflags" ; then
15080
15081         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15082         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15083
15084 fi
15085
15086 if test -n "$cf_new_extra_cppflags" ; then
15087
15088         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15089         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15090
15091 fi
15092
15093 cf_add_libs="$LIBS"
15094 # reverse order
15095 cf_add_0lib=
15096 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15097 # filter duplicates
15098 for cf_add_1lib in $cf_add_0lib; do
15099         for cf_add_2lib in $cf_add_libs; do
15100                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15101                         cf_add_1lib=
15102                         break
15103                 fi
15104         done
15105         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15106 done
15107 LIBS="$cf_add_libs"
15108
15109 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
15110         test -n "$verbose" && echo "    found package sm" 1>&6
15111
15112 echo "${as_me:-configure}:15112: testing found package sm ..." 1>&5
15113
15114         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
15115         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
15116         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
15117
15118 echo "${as_me:-configure}:15118: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15119
15120         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
15121
15122 echo "${as_me:-configure}:15122: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
15123
15124 cf_fix_cppflags=no
15125 cf_new_cflags=
15126 cf_new_cppflags=
15127 cf_new_extra_cppflags=
15128
15129 for cf_add_cflags in $cf_pkgconfig_incs
15130 do
15131 case "$cf_fix_cppflags" in
15132 (no)
15133         case "$cf_add_cflags" in
15134         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15135                 case "$cf_add_cflags" in
15136                 (-D*)
15137                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15138
15139                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15140                                 && test -z "${cf_tst_cflags}" \
15141                                 && cf_fix_cppflags=yes
15142
15143                         if test "$cf_fix_cppflags" = yes ; then
15144
15145         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15146         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15147
15148                                 continue
15149                         elif test "${cf_tst_cflags}" = "\"'" ; then
15150
15151         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15152         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15153
15154                                 continue
15155                         fi
15156                         ;;
15157                 esac
15158                 case "$CPPFLAGS" in
15159                 (*$cf_add_cflags)
15160                         ;;
15161                 (*)
15162                         case "$cf_add_cflags" in
15163                         (-D*)
15164                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15165
15166 CPPFLAGS=`echo "$CPPFLAGS" | \
15167         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15168                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15169
15170                                 ;;
15171                         esac
15172
15173         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15174         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15175
15176                         ;;
15177                 esac
15178                 ;;
15179         (*)
15180
15181         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15182         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15183
15184                 ;;
15185         esac
15186         ;;
15187 (yes)
15188
15189         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15190         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15191
15192         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15193
15194         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15195                 && test -z "${cf_tst_cflags}" \
15196                 && cf_fix_cppflags=no
15197         ;;
15198 esac
15199 done
15200
15201 if test -n "$cf_new_cflags" ; then
15202
15203         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15204         CFLAGS="${CFLAGS}$cf_new_cflags"
15205
15206 fi
15207
15208 if test -n "$cf_new_cppflags" ; then
15209
15210         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15211         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15212
15213 fi
15214
15215 if test -n "$cf_new_extra_cppflags" ; then
15216
15217         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15218         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15219
15220 fi
15221
15222 cf_add_libs="$LIBS"
15223 # reverse order
15224 cf_add_0lib=
15225 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15226 # filter duplicates
15227 for cf_add_1lib in $cf_add_0lib; do
15228         for cf_add_2lib in $cf_add_libs; do
15229                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15230                         cf_add_1lib=
15231                         break
15232                 fi
15233         done
15234         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15235 done
15236 LIBS="$cf_add_libs"
15237
15238         :
15239 else
15240         cf_pkgconfig_incs=
15241         cf_pkgconfig_libs=
15242         :
15243 fi
15244
15245 else
15246         cf_pkgconfig_incs=
15247         cf_pkgconfig_libs=
15248
15249 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15250
15251 echo "${as_me:-configure}:15251: testing ...before $LIBS ..." 1>&5
15252
15253 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
15254 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15255
15256 echo "${as_me:-configure}:15256: testing ...after  $LIBS ..." 1>&5
15257
15258 fi
15259
15260                                 ;;
15261                         esac
15262                         ;;
15263                 esac
15264         fi
15265
15266         cf_have_X_LIBS=yes
15267
15268 else
15269         cf_pkgconfig_incs=
15270         cf_pkgconfig_libs=
15271
15272         LDFLAGS="$X_LIBS $LDFLAGS"
15273
15274 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15275
15276 echo "${as_me:-configure}:15276: testing checking additions to CFLAGS ..." 1>&5
15277
15278 cf_check_cflags="$CFLAGS"
15279 cf_check_cppflags="$CPPFLAGS"
15280
15281 cf_fix_cppflags=no
15282 cf_new_cflags=
15283 cf_new_cppflags=
15284 cf_new_extra_cppflags=
15285
15286 for cf_add_cflags in $X_CFLAGS
15287 do
15288 case "$cf_fix_cppflags" in
15289 (no)
15290         case "$cf_add_cflags" in
15291         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15292                 case "$cf_add_cflags" in
15293                 (-D*)
15294                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15295
15296                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15297                                 && test -z "${cf_tst_cflags}" \
15298                                 && cf_fix_cppflags=yes
15299
15300                         if test "$cf_fix_cppflags" = yes ; then
15301
15302         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15303         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15304
15305                                 continue
15306                         elif test "${cf_tst_cflags}" = "\"'" ; then
15307
15308         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15309         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15310
15311                                 continue
15312                         fi
15313                         ;;
15314                 esac
15315                 case "$CPPFLAGS" in
15316                 (*$cf_add_cflags)
15317                         ;;
15318                 (*)
15319                         case "$cf_add_cflags" in
15320                         (-D*)
15321                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15322
15323 CPPFLAGS=`echo "$CPPFLAGS" | \
15324         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15325                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15326
15327                                 ;;
15328                         esac
15329
15330         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15331         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15332
15333                         ;;
15334                 esac
15335                 ;;
15336         (*)
15337
15338         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15339         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15340
15341                 ;;
15342         esac
15343         ;;
15344 (yes)
15345
15346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15348
15349         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15350
15351         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15352                 && test -z "${cf_tst_cflags}" \
15353                 && cf_fix_cppflags=no
15354         ;;
15355 esac
15356 done
15357
15358 if test -n "$cf_new_cflags" ; then
15359         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15360
15361 echo "${as_me:-configure}:15361: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15362
15363         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15364         CFLAGS="${CFLAGS}$cf_new_cflags"
15365
15366 fi
15367
15368 if test -n "$cf_new_cppflags" ; then
15369         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15370
15371 echo "${as_me:-configure}:15371: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15372
15373         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15374         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15375
15376 fi
15377
15378 if test -n "$cf_new_extra_cppflags" ; then
15379         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15380
15381 echo "${as_me:-configure}:15381: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15382
15383         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15384         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15385
15386 fi
15387
15388 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15389 cat >"conftest.$ac_ext" <<_ACEOF
15390 #line 15390 "configure"
15391 #include "confdefs.h"
15392 #include <stdio.h>
15393 int
15394 main (void)
15395 {
15396 printf("Hello world");
15397   ;
15398   return 0;
15399 }
15400 _ACEOF
15401 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15402 if { (eval echo "$as_me:15402: \"$ac_link\"") >&5
15403   (eval $ac_link) 2>&5
15404   ac_status=$?
15405   echo "$as_me:15405: \$? = $ac_status" >&5
15406   (exit "$ac_status"); } &&
15407          { ac_try='test -s "conftest$ac_exeext"'
15408   { (eval echo "$as_me:15408: \"$ac_try\"") >&5
15409   (eval $ac_try) 2>&5
15410   ac_status=$?
15411   echo "$as_me:15411: \$? = $ac_status" >&5
15412   (exit "$ac_status"); }; }; then
15413   :
15414 else
15415   echo "$as_me: failed program was:" >&5
15416 cat "conftest.$ac_ext" >&5
15417 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15418
15419 echo "${as_me:-configure}:15419: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15420
15421          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15422                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15423
15424 echo "${as_me:-configure}:15424: testing but keeping change to \$CPPFLAGS ..." 1>&5
15425
15426          fi
15427          CFLAGS="$cf_check_cflags"
15428 fi
15429 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15430 fi
15431
15432         echo "$as_me:15432: checking for XOpenDisplay" >&5
15433 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15434 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15435   echo $ECHO_N "(cached) $ECHO_C" >&6
15436 else
15437   cat >"conftest.$ac_ext" <<_ACEOF
15438 #line 15438 "configure"
15439 #include "confdefs.h"
15440 #define XOpenDisplay autoconf_temporary
15441 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15442 #undef XOpenDisplay
15443
15444 #ifdef __cplusplus
15445 extern "C"
15446 #endif
15447
15448 /* We use char because int might match the return type of a gcc2
15449    builtin and then its argument prototype would still apply.  */
15450 char XOpenDisplay (void);
15451
15452 int
15453 main (void)
15454 {
15455
15456 /* The GNU C library defines stubs for functions which it implements
15457     to always fail with ENOSYS.  Some functions are actually named
15458     something starting with __ and the normal name is an alias.  */
15459 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15460 #error found stub for XOpenDisplay
15461 #endif
15462
15463         return XOpenDisplay ();
15464   ;
15465   return 0;
15466 }
15467 _ACEOF
15468 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15469 if { (eval echo "$as_me:15469: \"$ac_link\"") >&5
15470   (eval $ac_link) 2>&5
15471   ac_status=$?
15472   echo "$as_me:15472: \$? = $ac_status" >&5
15473   (exit "$ac_status"); } &&
15474          { ac_try='test -s "conftest$ac_exeext"'
15475   { (eval echo "$as_me:15475: \"$ac_try\"") >&5
15476   (eval $ac_try) 2>&5
15477   ac_status=$?
15478   echo "$as_me:15478: \$? = $ac_status" >&5
15479   (exit "$ac_status"); }; }; then
15480   ac_cv_func_XOpenDisplay=yes
15481 else
15482   echo "$as_me: failed program was:" >&5
15483 cat "conftest.$ac_ext" >&5
15484 ac_cv_func_XOpenDisplay=no
15485 fi
15486 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15487 fi
15488 echo "$as_me:15488: result: $ac_cv_func_XOpenDisplay" >&5
15489 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15490 if test "$ac_cv_func_XOpenDisplay" = yes; then
15491   :
15492 else
15493
15494         echo "$as_me:15494: checking for XOpenDisplay in -lX11" >&5
15495 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15496 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15497   echo $ECHO_N "(cached) $ECHO_C" >&6
15498 else
15499   ac_check_lib_save_LIBS=$LIBS
15500 LIBS="-lX11  $LIBS"
15501 cat >"conftest.$ac_ext" <<_ACEOF
15502 #line 15502 "configure"
15503 #include "confdefs.h"
15504
15505 /* Override any gcc2 internal prototype to avoid an error.  */
15506 #ifdef __cplusplus
15507 extern "C"
15508 #endif
15509 /* We use char because int might match the return type of a gcc2
15510    builtin and then its argument prototype would still apply.  */
15511 char XOpenDisplay ();
15512 int
15513 main (void)
15514 {
15515 XOpenDisplay ();
15516   ;
15517   return 0;
15518 }
15519 _ACEOF
15520 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15521 if { (eval echo "$as_me:15521: \"$ac_link\"") >&5
15522   (eval $ac_link) 2>&5
15523   ac_status=$?
15524   echo "$as_me:15524: \$? = $ac_status" >&5
15525   (exit "$ac_status"); } &&
15526          { ac_try='test -s "conftest$ac_exeext"'
15527   { (eval echo "$as_me:15527: \"$ac_try\"") >&5
15528   (eval $ac_try) 2>&5
15529   ac_status=$?
15530   echo "$as_me:15530: \$? = $ac_status" >&5
15531   (exit "$ac_status"); }; }; then
15532   ac_cv_lib_X11_XOpenDisplay=yes
15533 else
15534   echo "$as_me: failed program was:" >&5
15535 cat "conftest.$ac_ext" >&5
15536 ac_cv_lib_X11_XOpenDisplay=no
15537 fi
15538 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15539 LIBS=$ac_check_lib_save_LIBS
15540 fi
15541 echo "$as_me:15541: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15542 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15543 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15544
15545 cf_add_libs="$LIBS"
15546 # reverse order
15547 cf_add_0lib=
15548 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15549 # filter duplicates
15550 for cf_add_1lib in $cf_add_0lib; do
15551         for cf_add_2lib in $cf_add_libs; do
15552                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15553                         cf_add_1lib=
15554                         break
15555                 fi
15556         done
15557         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15558 done
15559 LIBS="$cf_add_libs"
15560
15561 fi
15562
15563 fi
15564
15565         echo "$as_me:15565: checking for XtAppInitialize" >&5
15566 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15567 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15568   echo $ECHO_N "(cached) $ECHO_C" >&6
15569 else
15570   cat >"conftest.$ac_ext" <<_ACEOF
15571 #line 15571 "configure"
15572 #include "confdefs.h"
15573 #define XtAppInitialize autoconf_temporary
15574 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15575 #undef XtAppInitialize
15576
15577 #ifdef __cplusplus
15578 extern "C"
15579 #endif
15580
15581 /* We use char because int might match the return type of a gcc2
15582    builtin and then its argument prototype would still apply.  */
15583 char XtAppInitialize (void);
15584
15585 int
15586 main (void)
15587 {
15588
15589 /* The GNU C library defines stubs for functions which it implements
15590     to always fail with ENOSYS.  Some functions are actually named
15591     something starting with __ and the normal name is an alias.  */
15592 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15593 #error found stub for XtAppInitialize
15594 #endif
15595
15596         return XtAppInitialize ();
15597   ;
15598   return 0;
15599 }
15600 _ACEOF
15601 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15602 if { (eval echo "$as_me:15602: \"$ac_link\"") >&5
15603   (eval $ac_link) 2>&5
15604   ac_status=$?
15605   echo "$as_me:15605: \$? = $ac_status" >&5
15606   (exit "$ac_status"); } &&
15607          { ac_try='test -s "conftest$ac_exeext"'
15608   { (eval echo "$as_me:15608: \"$ac_try\"") >&5
15609   (eval $ac_try) 2>&5
15610   ac_status=$?
15611   echo "$as_me:15611: \$? = $ac_status" >&5
15612   (exit "$ac_status"); }; }; then
15613   ac_cv_func_XtAppInitialize=yes
15614 else
15615   echo "$as_me: failed program was:" >&5
15616 cat "conftest.$ac_ext" >&5
15617 ac_cv_func_XtAppInitialize=no
15618 fi
15619 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15620 fi
15621 echo "$as_me:15621: result: $ac_cv_func_XtAppInitialize" >&5
15622 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15623 if test "$ac_cv_func_XtAppInitialize" = yes; then
15624   :
15625 else
15626
15627         echo "$as_me:15627: checking for XtAppInitialize in -lXt" >&5
15628 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15629 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15630   echo $ECHO_N "(cached) $ECHO_C" >&6
15631 else
15632   ac_check_lib_save_LIBS=$LIBS
15633 LIBS="-lXt  $LIBS"
15634 cat >"conftest.$ac_ext" <<_ACEOF
15635 #line 15635 "configure"
15636 #include "confdefs.h"
15637
15638 /* Override any gcc2 internal prototype to avoid an error.  */
15639 #ifdef __cplusplus
15640 extern "C"
15641 #endif
15642 /* We use char because int might match the return type of a gcc2
15643    builtin and then its argument prototype would still apply.  */
15644 char XtAppInitialize ();
15645 int
15646 main (void)
15647 {
15648 XtAppInitialize ();
15649   ;
15650   return 0;
15651 }
15652 _ACEOF
15653 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15654 if { (eval echo "$as_me:15654: \"$ac_link\"") >&5
15655   (eval $ac_link) 2>&5
15656   ac_status=$?
15657   echo "$as_me:15657: \$? = $ac_status" >&5
15658   (exit "$ac_status"); } &&
15659          { ac_try='test -s "conftest$ac_exeext"'
15660   { (eval echo "$as_me:15660: \"$ac_try\"") >&5
15661   (eval $ac_try) 2>&5
15662   ac_status=$?
15663   echo "$as_me:15663: \$? = $ac_status" >&5
15664   (exit "$ac_status"); }; }; then
15665   ac_cv_lib_Xt_XtAppInitialize=yes
15666 else
15667   echo "$as_me: failed program was:" >&5
15668 cat "conftest.$ac_ext" >&5
15669 ac_cv_lib_Xt_XtAppInitialize=no
15670 fi
15671 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15672 LIBS=$ac_check_lib_save_LIBS
15673 fi
15674 echo "$as_me:15674: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15675 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15676 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15677
15678 cat >>confdefs.h <<\EOF
15679 #define HAVE_LIBXT 1
15680 EOF
15681
15682                  cf_have_X_LIBS=Xt
15683                  LIBS="-lXt $LIBS"
15684 fi
15685
15686 fi
15687
15688 fi
15689
15690 if test "$cf_have_X_LIBS" = no ; then
15691         { echo "$as_me:15691: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15692 test program.  You will have to check and add the proper libraries by hand
15693 to makefile." >&5
15694 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15695 test program.  You will have to check and add the proper libraries by hand
15696 to makefile." >&2;}
15697 fi
15698
15699 cf_x_athena_root=$cf_x_athena
15700 cf_x_athena_inc=""
15701
15702 for cf_path in default \
15703         /usr/contrib/X11R6 \
15704         /usr/contrib/X11R5 \
15705         /usr/lib/X11R5 \
15706         /usr/local
15707 do
15708         if test -z "$cf_x_athena_inc" ; then
15709
15710 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15711 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15712 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15713 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15714 for cf_X_CFLAGS in $X_CFLAGS
15715 do
15716         case "x$cf_X_CFLAGS" in
15717         x-[IUD]*)
15718                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15719                 ;;
15720         *)
15721                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15722                 ;;
15723         esac
15724 done
15725
15726                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15727                 if test "$cf_path" != default ; then
15728
15729         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15730         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15731
15732                         echo "$as_me:15732: checking for $cf_test in $cf_path" >&5
15733 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15734                 else
15735                         echo "$as_me:15735: checking for $cf_test" >&5
15736 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15737                 fi
15738                 cat >"conftest.$ac_ext" <<_ACEOF
15739 #line 15739 "configure"
15740 #include "confdefs.h"
15741
15742 #include <X11/Intrinsic.h>
15743 #include <$cf_test>
15744 int
15745 main (void)
15746 {
15747
15748   ;
15749   return 0;
15750 }
15751 _ACEOF
15752 rm -f "conftest.$ac_objext"
15753 if { (eval echo "$as_me:15753: \"$ac_compile\"") >&5
15754   (eval $ac_compile) 2>&5
15755   ac_status=$?
15756   echo "$as_me:15756: \$? = $ac_status" >&5
15757   (exit "$ac_status"); } &&
15758          { ac_try='test -s "conftest.$ac_objext"'
15759   { (eval echo "$as_me:15759: \"$ac_try\"") >&5
15760   (eval $ac_try) 2>&5
15761   ac_status=$?
15762   echo "$as_me:15762: \$? = $ac_status" >&5
15763   (exit "$ac_status"); }; }; then
15764   cf_result=yes
15765 else
15766   echo "$as_me: failed program was:" >&5
15767 cat "conftest.$ac_ext" >&5
15768 cf_result=no
15769 fi
15770 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15771                 echo "$as_me:15771: result: $cf_result" >&5
15772 echo "${ECHO_T}$cf_result" >&6
15773
15774 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15775 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15776 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15777
15778                 if test "$cf_result" = yes ; then
15779                         test "$cf_path"  = default && cf_x_athena_inc=default
15780                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15781                         break
15782                 fi
15783         fi
15784 done
15785
15786 if test -z "$cf_x_athena_inc" ; then
15787         { echo "$as_me:15787: WARNING: Unable to find Athena header files" >&5
15788 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15789 elif test "$cf_x_athena_inc" != default ; then
15790
15791         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15792         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15793
15794 fi
15795
15796 cf_x_athena_root=$cf_x_athena
15797 cf_x_athena_lib=""
15798
15799 for cf_path in default \
15800         /usr/contrib/X11R6 \
15801         /usr/contrib/X11R5 \
15802         /usr/lib/X11R5 \
15803         /usr/local
15804 do
15805         for cf_lib in \
15806                 ${cf_x_athena_root} \
15807                 ${cf_x_athena_root}7 \
15808                 ${cf_x_athena_root}6
15809         do
15810         for cf_libs in \
15811                 "-l$cf_lib -lXmu" \
15812                 "-l$cf_lib -lXpm -lXmu" \
15813                 "-l${cf_lib}_s -lXmu_s"
15814         do
15815                 test -n "$cf_x_athena_lib" && break
15816
15817 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15818 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15819 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15820 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15821 for cf_X_CFLAGS in $X_CFLAGS
15822 do
15823         case "x$cf_X_CFLAGS" in
15824         x-[IUD]*)
15825                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15826                 ;;
15827         *)
15828                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15829                 ;;
15830         esac
15831 done
15832
15833                 cf_test=XawSimpleMenuAddGlobalActions
15834                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15835
15836 cf_add_libs="$LIBS"
15837 # reverse order
15838 cf_add_0lib=
15839 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15840 # filter duplicates
15841 for cf_add_1lib in $cf_add_0lib; do
15842         for cf_add_2lib in $cf_add_libs; do
15843                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15844                         cf_add_1lib=
15845                         break
15846                 fi
15847         done
15848         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15849 done
15850 LIBS="$cf_add_libs"
15851
15852                 echo "$as_me:15852: checking for $cf_test in $cf_libs" >&5
15853 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15854                 cat >"conftest.$ac_ext" <<_ACEOF
15855 #line 15855 "configure"
15856 #include "confdefs.h"
15857
15858 #include <X11/Intrinsic.h>
15859 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15860
15861 int
15862 main (void)
15863 {
15864
15865 $cf_test((XtAppContext) 0)
15866   ;
15867   return 0;
15868 }
15869 _ACEOF
15870 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15871 if { (eval echo "$as_me:15871: \"$ac_link\"") >&5
15872   (eval $ac_link) 2>&5
15873   ac_status=$?
15874   echo "$as_me:15874: \$? = $ac_status" >&5
15875   (exit "$ac_status"); } &&
15876          { ac_try='test -s "conftest$ac_exeext"'
15877   { (eval echo "$as_me:15877: \"$ac_try\"") >&5
15878   (eval $ac_try) 2>&5
15879   ac_status=$?
15880   echo "$as_me:15880: \$? = $ac_status" >&5
15881   (exit "$ac_status"); }; }; then
15882   cf_result=yes
15883 else
15884   echo "$as_me: failed program was:" >&5
15885 cat "conftest.$ac_ext" >&5
15886 cf_result=no
15887 fi
15888 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15889                 echo "$as_me:15889: result: $cf_result" >&5
15890 echo "${ECHO_T}$cf_result" >&6
15891
15892 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15893 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15894 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15895
15896                 if test "$cf_result" = yes ; then
15897                         cf_x_athena_lib="$cf_libs"
15898                         break
15899                 fi
15900         done # cf_libs
15901                 test -n "$cf_x_athena_lib" && break
15902         done # cf_lib
15903 done
15904
15905 if test -z "$cf_x_athena_lib" ; then
15906         { { echo "$as_me:15906: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15907 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15908    { (exit 1); exit 1; }; }
15909 fi
15910
15911 cf_add_libs="$LIBS"
15912 # reverse order
15913 cf_add_0lib=
15914 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15915 # filter duplicates
15916 for cf_add_1lib in $cf_add_0lib; do
15917         for cf_add_2lib in $cf_add_libs; do
15918                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15919                         cf_add_1lib=
15920                         break
15921                 fi
15922         done
15923         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15924 done
15925 LIBS="$cf_add_libs"
15926
15927 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15928
15929 cat >>confdefs.h <<EOF
15930 #define $cf_x_athena_LIBS 1
15931 EOF
15932
15933 fi
15934
15935 if test -n "$ac_tool_prefix"; then
15936   for ac_prog in xcurses-config
15937   do
15938     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15939 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15940 echo "$as_me:15940: checking for $ac_word" >&5
15941 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15942 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15943   echo $ECHO_N "(cached) $ECHO_C" >&6
15944 else
15945   if test -n "$XCURSES_CONFIG"; then
15946   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15947 else
15948   ac_save_IFS=$IFS; IFS=$ac_path_separator
15949 ac_dummy="$PATH"
15950 for ac_dir in $ac_dummy; do
15951   IFS=$ac_save_IFS
15952   test -z "$ac_dir" && ac_dir=.
15953   $as_executable_p "$ac_dir/$ac_word" || continue
15954 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15955 echo "$as_me:15955: found $ac_dir/$ac_word" >&5
15956 break
15957 done
15958
15959 fi
15960 fi
15961 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15962 if test -n "$XCURSES_CONFIG"; then
15963   echo "$as_me:15963: result: $XCURSES_CONFIG" >&5
15964 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15965 else
15966   echo "$as_me:15966: result: no" >&5
15967 echo "${ECHO_T}no" >&6
15968 fi
15969
15970     test -n "$XCURSES_CONFIG" && break
15971   done
15972 fi
15973 if test -z "$XCURSES_CONFIG"; then
15974   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15975   for ac_prog in xcurses-config
15976 do
15977   # Extract the first word of "$ac_prog", so it can be a program name with args.
15978 set dummy $ac_prog; ac_word=$2
15979 echo "$as_me:15979: checking for $ac_word" >&5
15980 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15981 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15982   echo $ECHO_N "(cached) $ECHO_C" >&6
15983 else
15984   if test -n "$ac_ct_XCURSES_CONFIG"; then
15985   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15986 else
15987   ac_save_IFS=$IFS; IFS=$ac_path_separator
15988 ac_dummy="$PATH"
15989 for ac_dir in $ac_dummy; do
15990   IFS=$ac_save_IFS
15991   test -z "$ac_dir" && ac_dir=.
15992   $as_executable_p "$ac_dir/$ac_word" || continue
15993 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15994 echo "$as_me:15994: found $ac_dir/$ac_word" >&5
15995 break
15996 done
15997
15998 fi
15999 fi
16000 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
16001 if test -n "$ac_ct_XCURSES_CONFIG"; then
16002   echo "$as_me:16002: result: $ac_ct_XCURSES_CONFIG" >&5
16003 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
16004 else
16005   echo "$as_me:16005: result: no" >&5
16006 echo "${ECHO_T}no" >&6
16007 fi
16008
16009   test -n "$ac_ct_XCURSES_CONFIG" && break
16010 done
16011 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
16012
16013   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
16014 fi
16015
16016 if test "$XCURSES_CONFIG" != none ; then
16017
16018 cf_fix_cppflags=no
16019 cf_new_cflags=
16020 cf_new_cppflags=
16021 cf_new_extra_cppflags=
16022
16023 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
16024 do
16025 case "$cf_fix_cppflags" in
16026 (no)
16027         case "$cf_add_cflags" in
16028         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16029                 case "$cf_add_cflags" in
16030                 (-D*)
16031                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16032
16033                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16034                                 && test -z "${cf_tst_cflags}" \
16035                                 && cf_fix_cppflags=yes
16036
16037                         if test "$cf_fix_cppflags" = yes ; then
16038
16039         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16040         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16041
16042                                 continue
16043                         elif test "${cf_tst_cflags}" = "\"'" ; then
16044
16045         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16046         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16047
16048                                 continue
16049                         fi
16050                         ;;
16051                 esac
16052                 case "$CPPFLAGS" in
16053                 (*$cf_add_cflags)
16054                         ;;
16055                 (*)
16056                         case "$cf_add_cflags" in
16057                         (-D*)
16058                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16059
16060 CPPFLAGS=`echo "$CPPFLAGS" | \
16061         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16062                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16063
16064                                 ;;
16065                         esac
16066
16067         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16068         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16069
16070                         ;;
16071                 esac
16072                 ;;
16073         (*)
16074
16075         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16076         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16077
16078                 ;;
16079         esac
16080         ;;
16081 (yes)
16082
16083         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16084         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16085
16086         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16087
16088         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16089                 && test -z "${cf_tst_cflags}" \
16090                 && cf_fix_cppflags=no
16091         ;;
16092 esac
16093 done
16094
16095 if test -n "$cf_new_cflags" ; then
16096
16097         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16098         CFLAGS="${CFLAGS}$cf_new_cflags"
16099
16100 fi
16101
16102 if test -n "$cf_new_cppflags" ; then
16103
16104         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16105         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16106
16107 fi
16108
16109 if test -n "$cf_new_extra_cppflags" ; then
16110
16111         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16112         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16113
16114 fi
16115
16116 cf_add_libs="$LIBS"
16117 # reverse order
16118 cf_add_0lib=
16119 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16120 # filter duplicates
16121 for cf_add_1lib in $cf_add_0lib; do
16122         for cf_add_2lib in $cf_add_libs; do
16123                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16124                         cf_add_1lib=
16125                         break
16126                 fi
16127         done
16128         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16129 done
16130 LIBS="$cf_add_libs"
16131
16132 cf_cv_lib_XCurses=yes
16133
16134 else
16135
16136 LDFLAGS="$LDFLAGS $X_LIBS"
16137
16138 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
16139
16140 echo "${as_me:-configure}:16140: testing checking additions to CFLAGS ..." 1>&5
16141
16142 cf_check_cflags="$CFLAGS"
16143 cf_check_cppflags="$CPPFLAGS"
16144
16145 cf_fix_cppflags=no
16146 cf_new_cflags=
16147 cf_new_cppflags=
16148 cf_new_extra_cppflags=
16149
16150 for cf_add_cflags in $X_CFLAGS
16151 do
16152 case "$cf_fix_cppflags" in
16153 (no)
16154         case "$cf_add_cflags" in
16155         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16156                 case "$cf_add_cflags" in
16157                 (-D*)
16158                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16159
16160                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16161                                 && test -z "${cf_tst_cflags}" \
16162                                 && cf_fix_cppflags=yes
16163
16164                         if test "$cf_fix_cppflags" = yes ; then
16165
16166         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16167         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16168
16169                                 continue
16170                         elif test "${cf_tst_cflags}" = "\"'" ; then
16171
16172         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16173         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16174
16175                                 continue
16176                         fi
16177                         ;;
16178                 esac
16179                 case "$CPPFLAGS" in
16180                 (*$cf_add_cflags)
16181                         ;;
16182                 (*)
16183                         case "$cf_add_cflags" in
16184                         (-D*)
16185                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16186
16187 CPPFLAGS=`echo "$CPPFLAGS" | \
16188         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16189                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16190
16191                                 ;;
16192                         esac
16193
16194         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16195         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16196
16197                         ;;
16198                 esac
16199                 ;;
16200         (*)
16201
16202         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16203         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16204
16205                 ;;
16206         esac
16207         ;;
16208 (yes)
16209
16210         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16211         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16212
16213         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16214
16215         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16216                 && test -z "${cf_tst_cflags}" \
16217                 && cf_fix_cppflags=no
16218         ;;
16219 esac
16220 done
16221
16222 if test -n "$cf_new_cflags" ; then
16223         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
16224
16225 echo "${as_me:-configure}:16225: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
16226
16227         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16228         CFLAGS="${CFLAGS}$cf_new_cflags"
16229
16230 fi
16231
16232 if test -n "$cf_new_cppflags" ; then
16233         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16234
16235 echo "${as_me:-configure}:16235: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
16236
16237         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16238         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16239
16240 fi
16241
16242 if test -n "$cf_new_extra_cppflags" ; then
16243         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16244
16245 echo "${as_me:-configure}:16245: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
16246
16247         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16248         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16249
16250 fi
16251
16252 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
16253 cat >"conftest.$ac_ext" <<_ACEOF
16254 #line 16254 "configure"
16255 #include "confdefs.h"
16256 #include <stdio.h>
16257 int
16258 main (void)
16259 {
16260 printf("Hello world");
16261   ;
16262   return 0;
16263 }
16264 _ACEOF
16265 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16266 if { (eval echo "$as_me:16266: \"$ac_link\"") >&5
16267   (eval $ac_link) 2>&5
16268   ac_status=$?
16269   echo "$as_me:16269: \$? = $ac_status" >&5
16270   (exit "$ac_status"); } &&
16271          { ac_try='test -s "conftest$ac_exeext"'
16272   { (eval echo "$as_me:16272: \"$ac_try\"") >&5
16273   (eval $ac_try) 2>&5
16274   ac_status=$?
16275   echo "$as_me:16275: \$? = $ac_status" >&5
16276   (exit "$ac_status"); }; }; then
16277   :
16278 else
16279   echo "$as_me: failed program was:" >&5
16280 cat "conftest.$ac_ext" >&5
16281 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16282
16283 echo "${as_me:-configure}:16283: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16284
16285          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16286                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16287
16288 echo "${as_me:-configure}:16288: testing but keeping change to \$CPPFLAGS ..." 1>&5
16289
16290          fi
16291          CFLAGS="$cf_check_cflags"
16292 fi
16293 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16294 fi
16295
16296 echo "$as_me:16296: checking for XOpenDisplay in -lX11" >&5
16297 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16298 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16299   echo $ECHO_N "(cached) $ECHO_C" >&6
16300 else
16301   ac_check_lib_save_LIBS=$LIBS
16302 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16303 cat >"conftest.$ac_ext" <<_ACEOF
16304 #line 16304 "configure"
16305 #include "confdefs.h"
16306
16307 /* Override any gcc2 internal prototype to avoid an error.  */
16308 #ifdef __cplusplus
16309 extern "C"
16310 #endif
16311 /* We use char because int might match the return type of a gcc2
16312    builtin and then its argument prototype would still apply.  */
16313 char XOpenDisplay ();
16314 int
16315 main (void)
16316 {
16317 XOpenDisplay ();
16318   ;
16319   return 0;
16320 }
16321 _ACEOF
16322 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16323 if { (eval echo "$as_me:16323: \"$ac_link\"") >&5
16324   (eval $ac_link) 2>&5
16325   ac_status=$?
16326   echo "$as_me:16326: \$? = $ac_status" >&5
16327   (exit "$ac_status"); } &&
16328          { ac_try='test -s "conftest$ac_exeext"'
16329   { (eval echo "$as_me:16329: \"$ac_try\"") >&5
16330   (eval $ac_try) 2>&5
16331   ac_status=$?
16332   echo "$as_me:16332: \$? = $ac_status" >&5
16333   (exit "$ac_status"); }; }; then
16334   ac_cv_lib_X11_XOpenDisplay=yes
16335 else
16336   echo "$as_me: failed program was:" >&5
16337 cat "conftest.$ac_ext" >&5
16338 ac_cv_lib_X11_XOpenDisplay=no
16339 fi
16340 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16341 LIBS=$ac_check_lib_save_LIBS
16342 fi
16343 echo "$as_me:16343: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16344 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16345 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16346
16347 cf_add_libs="$LIBS"
16348 # reverse order
16349 cf_add_0lib=
16350 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16351 # filter duplicates
16352 for cf_add_1lib in $cf_add_0lib; do
16353         for cf_add_2lib in $cf_add_libs; do
16354                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16355                         cf_add_1lib=
16356                         break
16357                 fi
16358         done
16359         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16360 done
16361 LIBS="$cf_add_libs"
16362
16363 fi
16364
16365 echo "$as_me:16365: checking for XCurses library" >&5
16366 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16367 if test "${cf_cv_lib_XCurses+set}" = set; then
16368   echo $ECHO_N "(cached) $ECHO_C" >&6
16369 else
16370
16371 cf_add_libs="$LIBS"
16372 # reverse order
16373 cf_add_0lib=
16374 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16375 # filter duplicates
16376 for cf_add_1lib in $cf_add_0lib; do
16377         for cf_add_2lib in $cf_add_libs; do
16378                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16379                         cf_add_1lib=
16380                         break
16381                 fi
16382         done
16383         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16384 done
16385 LIBS="$cf_add_libs"
16386
16387 cat >"conftest.$ac_ext" <<_ACEOF
16388 #line 16388 "configure"
16389 #include "confdefs.h"
16390
16391 #include <xcurses.h>
16392 char *XCursesProgramName = "test";
16393
16394 int
16395 main (void)
16396 {
16397 XCursesExit();
16398   ;
16399   return 0;
16400 }
16401 _ACEOF
16402 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16403 if { (eval echo "$as_me:16403: \"$ac_link\"") >&5
16404   (eval $ac_link) 2>&5
16405   ac_status=$?
16406   echo "$as_me:16406: \$? = $ac_status" >&5
16407   (exit "$ac_status"); } &&
16408          { ac_try='test -s "conftest$ac_exeext"'
16409   { (eval echo "$as_me:16409: \"$ac_try\"") >&5
16410   (eval $ac_try) 2>&5
16411   ac_status=$?
16412   echo "$as_me:16412: \$? = $ac_status" >&5
16413   (exit "$ac_status"); }; }; then
16414   cf_cv_lib_XCurses=yes
16415 else
16416   echo "$as_me: failed program was:" >&5
16417 cat "conftest.$ac_ext" >&5
16418 cf_cv_lib_XCurses=no
16419 fi
16420 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16421
16422 fi
16423 echo "$as_me:16423: result: $cf_cv_lib_XCurses" >&5
16424 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16425
16426 fi
16427
16428 if test "$cf_cv_lib_XCurses" = yes ; then
16429
16430 cat >>confdefs.h <<\EOF
16431 #define UNIX 1
16432 EOF
16433
16434 cat >>confdefs.h <<\EOF
16435 #define XCURSES 1
16436 EOF
16437
16438         echo "$as_me:16438: checking for xcurses.h" >&5
16439 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16440 if test "${ac_cv_header_xcurses_h+set}" = set; then
16441   echo $ECHO_N "(cached) $ECHO_C" >&6
16442 else
16443   cat >"conftest.$ac_ext" <<_ACEOF
16444 #line 16444 "configure"
16445 #include "confdefs.h"
16446 #include <xcurses.h>
16447 _ACEOF
16448 if { (eval echo "$as_me:16448: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16449   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16450   ac_status=$?
16451   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16452   rm -f conftest.er1
16453   cat conftest.err >&5
16454   echo "$as_me:16454: \$? = $ac_status" >&5
16455   (exit "$ac_status"); } >/dev/null; then
16456   if test -s conftest.err; then
16457     ac_cpp_err=$ac_c_preproc_warn_flag
16458   else
16459     ac_cpp_err=
16460   fi
16461 else
16462   ac_cpp_err=yes
16463 fi
16464 if test -z "$ac_cpp_err"; then
16465   ac_cv_header_xcurses_h=yes
16466 else
16467   echo "$as_me: failed program was:" >&5
16468   cat "conftest.$ac_ext" >&5
16469   ac_cv_header_xcurses_h=no
16470 fi
16471 rm -f conftest.err "conftest.$ac_ext"
16472 fi
16473 echo "$as_me:16473: result: $ac_cv_header_xcurses_h" >&5
16474 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16475 if test "$ac_cv_header_xcurses_h" = yes; then
16476
16477 cat >>confdefs.h <<\EOF
16478 #define HAVE_XCURSES 1
16479 EOF
16480
16481 fi
16482
16483 else
16484         { { echo "$as_me:16484: error: Cannot link with XCurses" >&5
16485 echo "$as_me: error: Cannot link with XCurses" >&2;}
16486    { (exit 1); exit 1; }; }
16487 fi
16488
16489         ;;
16490 (*)
16491         { { echo "$as_me:16491: error: unexpected screen-value: $cf_cv_screen" >&5
16492 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16493    { (exit 1); exit 1; }; }
16494         ;;
16495 esac
16496
16497 : ${cf_nculib_root:=$cf_cv_screen}
16498 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16499 echo "$as_me:16499: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16500 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16501 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16502   echo $ECHO_N "(cached) $ECHO_C" >&6
16503 else
16504   ac_check_lib_save_LIBS=$LIBS
16505 LIBS="-l$cf_nculib_root  $LIBS"
16506 cat >"conftest.$ac_ext" <<_ACEOF
16507 #line 16507 "configure"
16508 #include "confdefs.h"
16509
16510 /* Override any gcc2 internal prototype to avoid an error.  */
16511 #ifdef __cplusplus
16512 extern "C"
16513 #endif
16514 /* We use char because int might match the return type of a gcc2
16515    builtin and then its argument prototype would still apply.  */
16516 char _nc_init_pthreads ();
16517 int
16518 main (void)
16519 {
16520 _nc_init_pthreads ();
16521   ;
16522   return 0;
16523 }
16524 _ACEOF
16525 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16526 if { (eval echo "$as_me:16526: \"$ac_link\"") >&5
16527   (eval $ac_link) 2>&5
16528   ac_status=$?
16529   echo "$as_me:16529: \$? = $ac_status" >&5
16530   (exit "$ac_status"); } &&
16531          { ac_try='test -s "conftest$ac_exeext"'
16532   { (eval echo "$as_me:16532: \"$ac_try\"") >&5
16533   (eval $ac_try) 2>&5
16534   ac_status=$?
16535   echo "$as_me:16535: \$? = $ac_status" >&5
16536   (exit "$ac_status"); }; }; then
16537   eval "$as_ac_Lib=yes"
16538 else
16539   echo "$as_me: failed program was:" >&5
16540 cat "conftest.$ac_ext" >&5
16541 eval "$as_ac_Lib=no"
16542 fi
16543 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16544 LIBS=$ac_check_lib_save_LIBS
16545 fi
16546 echo "$as_me:16546: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16547 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16548 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16549   cf_cv_ncurses_pthreads=yes
16550 else
16551   cf_cv_ncurses_pthreads=no
16552 fi
16553
16554 if test "$cf_cv_ncurses_pthreads" = yes
16555 then
16556
16557 cf_add_libs="$LIBS"
16558 # reverse order
16559 cf_add_0lib=
16560 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16561 # filter duplicates
16562 for cf_add_1lib in $cf_add_0lib; do
16563         for cf_add_2lib in $cf_add_libs; do
16564                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16565                         cf_add_1lib=
16566                         break
16567                 fi
16568         done
16569         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16570 done
16571 LIBS="$cf_add_libs"
16572
16573 fi
16574
16575 case $cf_cv_screen in
16576 (ncurses*)
16577         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16578         ;;
16579 esac
16580
16581 echo "$as_me:16581: checking for X11 rgb file" >&5
16582 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16583
16584 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16585 if test "${with_x11_rgb+set}" = set; then
16586   withval="$with_x11_rgb"
16587   RGB_PATH=$withval
16588 else
16589   RGB_PATH=auto
16590 fi;
16591
16592 if test "x$RGB_PATH" = xauto
16593 then
16594         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16595         for cf_path in \
16596                 /opt/local/share/X11/rgb.txt \
16597                 /opt/X11/share/X11/rgb.txt \
16598                 /usr/share/X11/rgb.txt \
16599                 /usr/X11/share/X11/rgb.txt \
16600                 /usr/X11/lib/X11/rgb.txt \
16601                 /usr/lib/X11/rgb.txt \
16602                 /etc/X11/rgb.txt \
16603                 /usr/pkg/lib/X11/rgb.txt \
16604                 /usr/X11R7/lib/X11/rgb.txt \
16605                 /usr/X11R6/lib/X11/rgb.txt \
16606                 /usr/X11R5/lib/X11/rgb.txt \
16607                 /usr/X11R4/lib/X11/rgb.txt \
16608                 /usr/local/lib/X11/rgb.txt \
16609                 /usr/local/share/X11/rgb.txt \
16610                 /usr/lib64/X11/rgb.txt
16611         do
16612                 if test -f "$cf_path" ; then
16613                         RGB_PATH="$cf_path"
16614                         break
16615                 fi
16616         done
16617 else
16618         cf_path=$RGB_PATH
16619
16620 if test "x$prefix" != xNONE; then
16621         cf_path_syntax="$prefix"
16622 else
16623         cf_path_syntax="$ac_default_prefix"
16624 fi
16625
16626 case ".$cf_path" in
16627 (.\$\(*\)*|.\'*\'*)
16628         ;;
16629 (..|./*|.\\*)
16630         ;;
16631 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16632         ;;
16633 (.\$\{*prefix\}*|.\$\{*dir\}*)
16634         eval cf_path="$cf_path"
16635         case ".$cf_path" in
16636         (.NONE/*)
16637                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16638                 ;;
16639         esac
16640         ;;
16641 (.no|.NONE/*)
16642         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16643         ;;
16644 (*)
16645         { { echo "$as_me:16645: error: expected a pathname, not \"$cf_path\"" >&5
16646 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16647    { (exit 1); exit 1; }; }
16648         ;;
16649 esac
16650
16651 fi
16652
16653 echo "$as_me:16653: result: $RGB_PATH" >&5
16654 echo "${ECHO_T}$RGB_PATH" >&6
16655
16656 cat >>confdefs.h <<EOF
16657 #define RGB_PATH "$cf_path"
16658 EOF
16659
16660 no_x11_rgb=
16661 if test "$RGB_PATH" = no
16662 then
16663         no_x11_rgb="#"
16664 fi
16665
16666 cf_curses_headers=
16667
16668 case $cf_cv_screen in
16669 (pdcurses)
16670         cf_default_panel=no
16671         cf_default_form=no
16672         cf_default_menu=no
16673         cf_default_tinfo=no
16674         ;;
16675 (xcurses|bsdcurses)
16676         cf_default_panel=no
16677         cf_default_form=no
16678         cf_default_menu=no
16679         cf_default_tinfo=yes
16680         ;;
16681 (*)
16682         cf_default_panel=yes
16683         cf_default_form=yes
16684         cf_default_menu=yes
16685         cf_default_tinfo=yes
16686         case $cf_cv_screen in
16687         (ncurses*)
16688                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16689                 ;;
16690         esac
16691         ;;
16692 esac
16693
16694 echo "$as_me:16694: checking for desired basename for form library" >&5
16695 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16696
16697 # Check whether --with-form-libname or --without-form-libname was given.
16698 if test "${with_form_libname+set}" = set; then
16699   withval="$with_form_libname"
16700   with_lib_basename=$withval
16701 else
16702   with_lib_basename=form
16703 fi;
16704 FORM_NAME="$with_lib_basename"
16705
16706 case "x$FORM_NAME" in
16707 (x|xno|xnone|xyes)
16708         FORM_NAME=form
16709         ;;
16710 (*)
16711         ;;
16712 esac
16713
16714 echo "$as_me:16714: result: $FORM_NAME" >&5
16715 echo "${ECHO_T}$FORM_NAME" >&6
16716
16717 echo "$as_me:16717: checking for desired basename for menu library" >&5
16718 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16719
16720 # Check whether --with-menu-libname or --without-menu-libname was given.
16721 if test "${with_menu_libname+set}" = set; then
16722   withval="$with_menu_libname"
16723   with_lib_basename=$withval
16724 else
16725   with_lib_basename=menu
16726 fi;
16727 MENU_NAME="$with_lib_basename"
16728
16729 case "x$MENU_NAME" in
16730 (x|xno|xnone|xyes)
16731         MENU_NAME=menu
16732         ;;
16733 (*)
16734         ;;
16735 esac
16736
16737 echo "$as_me:16737: result: $MENU_NAME" >&5
16738 echo "${ECHO_T}$MENU_NAME" >&6
16739
16740 echo "$as_me:16740: checking for desired basename for panel library" >&5
16741 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16742
16743 # Check whether --with-panel-libname or --without-panel-libname was given.
16744 if test "${with_panel_libname+set}" = set; then
16745   withval="$with_panel_libname"
16746   with_lib_basename=$withval
16747 else
16748   with_lib_basename=panel
16749 fi;
16750 PANEL_NAME="$with_lib_basename"
16751
16752 case "x$PANEL_NAME" in
16753 (x|xno|xnone|xyes)
16754         PANEL_NAME=panel
16755         ;;
16756 (*)
16757         ;;
16758 esac
16759
16760 echo "$as_me:16760: result: $PANEL_NAME" >&5
16761 echo "${ECHO_T}$PANEL_NAME" >&6
16762
16763 echo "$as_me:16763: checking if you want to check for panel functions" >&5
16764 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16765
16766 # Check whether --enable-panel or --disable-panel was given.
16767 if test "${enable_panel+set}" = set; then
16768   enableval="$enable_panel"
16769   test "$enableval" != no && enableval=yes
16770         if test "$enableval" != "yes" ; then
16771     cf_enable_panel=no
16772         else
16773                 cf_enable_panel=$cf_default_panel
16774         fi
16775 else
16776   enableval=yes
16777         cf_enable_panel=$cf_default_panel
16778
16779 fi;
16780 echo "$as_me:16780: result: $cf_enable_panel" >&5
16781 echo "${ECHO_T}$cf_enable_panel" >&6
16782 if test $cf_enable_panel = yes
16783 then
16784
16785 cf_have_curses_lib=no
16786
16787 : ${NCURSES_CONFIG_PKG:=none}
16788 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16789         :
16790 elif test "x${PKG_CONFIG:=none}" != xnone; then
16791         echo "$as_me:16791: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16792 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16793         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16794                 echo "$as_me:16794: result: yes" >&5
16795 echo "${ECHO_T}yes" >&6
16796
16797                 echo "$as_me:16797: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16798 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16799
16800                 cf_save_CFLAGS="$CFLAGS"
16801                 cf_save_CPPFLAGS="$CPPFLAGS"
16802                 cf_save_LIBS="$LIBS"
16803
16804 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16805 do
16806         case "x$cf_add_cflags" in
16807         (x-[DU]*)
16808
16809 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16810 while true
16811 do
16812         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'`
16813         test "$CFLAGS" != "$cf_old_cflag" || break
16814
16815         CFLAGS="$cf_old_cflag"
16816 done
16817
16818 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16819 while true
16820 do
16821         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'`
16822         test "$CPPFLAGS" != "$cf_old_cflag" || break
16823
16824         CPPFLAGS="$cf_old_cflag"
16825 done
16826
16827                 ;;
16828         esac
16829
16830 cf_fix_cppflags=no
16831 cf_new_cflags=
16832 cf_new_cppflags=
16833 cf_new_extra_cppflags=
16834
16835 for cf_add_cflags in $cf_add_cflags
16836 do
16837 case "$cf_fix_cppflags" in
16838 (no)
16839         case "$cf_add_cflags" in
16840         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16841                 case "$cf_add_cflags" in
16842                 (-D*)
16843                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16844
16845                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16846                                 && test -z "${cf_tst_cflags}" \
16847                                 && cf_fix_cppflags=yes
16848
16849                         if test "$cf_fix_cppflags" = yes ; then
16850
16851         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16852         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16853
16854                                 continue
16855                         elif test "${cf_tst_cflags}" = "\"'" ; then
16856
16857         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16858         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16859
16860                                 continue
16861                         fi
16862                         ;;
16863                 esac
16864                 case "$CPPFLAGS" in
16865                 (*$cf_add_cflags)
16866                         ;;
16867                 (*)
16868                         case "$cf_add_cflags" in
16869                         (-D*)
16870                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16871
16872 CPPFLAGS=`echo "$CPPFLAGS" | \
16873         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16874                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16875
16876                                 ;;
16877                         esac
16878
16879         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16880         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16881
16882                         ;;
16883                 esac
16884                 ;;
16885         (*)
16886
16887         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16888         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16889
16890                 ;;
16891         esac
16892         ;;
16893 (yes)
16894
16895         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16896         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16897
16898         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16899
16900         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16901                 && test -z "${cf_tst_cflags}" \
16902                 && cf_fix_cppflags=no
16903         ;;
16904 esac
16905 done
16906
16907 if test -n "$cf_new_cflags" ; then
16908
16909         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16910         CFLAGS="${CFLAGS}$cf_new_cflags"
16911
16912 fi
16913
16914 if test -n "$cf_new_cppflags" ; then
16915
16916         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16917         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16918
16919 fi
16920
16921 if test -n "$cf_new_extra_cppflags" ; then
16922
16923         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16924         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16925
16926 fi
16927
16928 done
16929
16930 cf_add_libs="$LIBS"
16931 # reverse order
16932 cf_add_0lib=
16933 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16934 # filter duplicates
16935 for cf_add_1lib in $cf_add_0lib; do
16936         for cf_add_2lib in $cf_add_libs; do
16937                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16938                         cf_add_1lib=
16939                         break
16940                 fi
16941         done
16942         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16943 done
16944 LIBS="$cf_add_libs"
16945
16946                 cat >"conftest.$ac_ext" <<_ACEOF
16947 #line 16947 "configure"
16948 #include "confdefs.h"
16949 #include <$PANEL_NAME.h>
16950 int
16951 main (void)
16952 {
16953 (void) new_panel ( 0 );
16954   ;
16955   return 0;
16956 }
16957 _ACEOF
16958 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16959 if { (eval echo "$as_me:16959: \"$ac_link\"") >&5
16960   (eval $ac_link) 2>&5
16961   ac_status=$?
16962   echo "$as_me:16962: \$? = $ac_status" >&5
16963   (exit "$ac_status"); } &&
16964          { ac_try='test -s "conftest$ac_exeext"'
16965   { (eval echo "$as_me:16965: \"$ac_try\"") >&5
16966   (eval $ac_try) 2>&5
16967   ac_status=$?
16968   echo "$as_me:16968: \$? = $ac_status" >&5
16969   (exit "$ac_status"); }; }; then
16970   if test "$cross_compiling" = yes; then
16971   cf_have_curses_lib=maybe
16972 else
16973   cat >"conftest.$ac_ext" <<_ACEOF
16974 #line 16974 "configure"
16975 #include "confdefs.h"
16976 #include <$PANEL_NAME.h>
16977                                 int main(void)
16978                                 { (void) new_panel ( 0 ); return 0; }
16979 _ACEOF
16980 rm -f "conftest$ac_exeext"
16981 if { (eval echo "$as_me:16981: \"$ac_link\"") >&5
16982   (eval $ac_link) 2>&5
16983   ac_status=$?
16984   echo "$as_me:16984: \$? = $ac_status" >&5
16985   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16986   { (eval echo "$as_me:16986: \"$ac_try\"") >&5
16987   (eval $ac_try) 2>&5
16988   ac_status=$?
16989   echo "$as_me:16989: \$? = $ac_status" >&5
16990   (exit "$ac_status"); }; }; then
16991   cf_have_curses_lib=yes
16992 else
16993   echo "$as_me: program exited with status $ac_status" >&5
16994 echo "$as_me: failed program was:" >&5
16995 cat "conftest.$ac_ext" >&5
16996 cf_have_curses_lib=no
16997 fi
16998 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16999 fi
17000 else
17001   echo "$as_me: failed program was:" >&5
17002 cat "conftest.$ac_ext" >&5
17003 cf_have_curses_lib=no
17004 fi
17005 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17006                 echo "$as_me:17006: result: $cf_have_curses_lib" >&5
17007 echo "${ECHO_T}$cf_have_curses_lib" >&6
17008                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17009                 if test "$cf_have_curses_lib" = "yes"
17010                 then
17011
17012 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17013
17014                         cat >>confdefs.h <<EOF
17015 #define $cf_upper 1
17016 EOF
17017
17018                 else
17019                         CFLAGS="$cf_save_CFLAGS"
17020                         CPPFLAGS="$cf_save_CPPFLAGS"
17021                         LIBS="$cf_save_LIBS"
17022                 fi
17023         fi
17024 fi
17025 if test "$cf_have_curses_lib" = no; then
17026         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
17027 echo "$as_me:17027: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
17028 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17029 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17030   echo $ECHO_N "(cached) $ECHO_C" >&6
17031 else
17032   ac_check_lib_save_LIBS=$LIBS
17033 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
17034 cat >"conftest.$ac_ext" <<_ACEOF
17035 #line 17035 "configure"
17036 #include "confdefs.h"
17037
17038 /* Override any gcc2 internal prototype to avoid an error.  */
17039 #ifdef __cplusplus
17040 extern "C"
17041 #endif
17042 /* We use char because int might match the return type of a gcc2
17043    builtin and then its argument prototype would still apply.  */
17044 char new_panel ();
17045 int
17046 main (void)
17047 {
17048 new_panel ();
17049   ;
17050   return 0;
17051 }
17052 _ACEOF
17053 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17054 if { (eval echo "$as_me:17054: \"$ac_link\"") >&5
17055   (eval $ac_link) 2>&5
17056   ac_status=$?
17057   echo "$as_me:17057: \$? = $ac_status" >&5
17058   (exit "$ac_status"); } &&
17059          { ac_try='test -s "conftest$ac_exeext"'
17060   { (eval echo "$as_me:17060: \"$ac_try\"") >&5
17061   (eval $ac_try) 2>&5
17062   ac_status=$?
17063   echo "$as_me:17063: \$? = $ac_status" >&5
17064   (exit "$ac_status"); }; }; then
17065   eval "$as_ac_Lib=yes"
17066 else
17067   echo "$as_me: failed program was:" >&5
17068 cat "conftest.$ac_ext" >&5
17069 eval "$as_ac_Lib=no"
17070 fi
17071 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17072 LIBS=$ac_check_lib_save_LIBS
17073 fi
17074 echo "$as_me:17074: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17075 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17076 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17077
17078 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17079
17080 cf_add_libs="$LIBS"
17081 # reverse order
17082 cf_add_0lib=
17083 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17084 # filter duplicates
17085 for cf_add_1lib in $cf_add_0lib; do
17086         for cf_add_2lib in $cf_add_libs; do
17087                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17088                         cf_add_1lib=
17089                         break
17090                 fi
17091         done
17092         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17093 done
17094 LIBS="$cf_add_libs"
17095
17096                 cat >>confdefs.h <<EOF
17097 #define $cf_upper 1
17098 EOF
17099
17100 fi
17101
17102 fi
17103
17104         cf_curses_headers="$cf_curses_headers panel.h"
17105 fi
17106
17107 echo "$as_me:17107: checking if you want to check for menu functions" >&5
17108 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
17109
17110 # Check whether --enable-menu or --disable-menu was given.
17111 if test "${enable_menu+set}" = set; then
17112   enableval="$enable_menu"
17113   test "$enableval" != no && enableval=yes
17114         if test "$enableval" != "yes" ; then
17115     cf_enable_menu=no
17116         else
17117                 cf_enable_menu=$cf_default_menu
17118         fi
17119 else
17120   enableval=yes
17121         cf_enable_menu=$cf_default_menu
17122
17123 fi;
17124 echo "$as_me:17124: result: $cf_enable_menu" >&5
17125 echo "${ECHO_T}$cf_enable_menu" >&6
17126 if test $cf_enable_menu = yes
17127 then
17128         case $cf_cv_screen in
17129         (ncurses*)
17130                 ;;
17131         (curses*)
17132
17133 echo "$as_me:17133: checking for NetBSD menu.h" >&5
17134 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
17135 if test "${cf_cv_netbsd_menu_h+set}" = set; then
17136   echo $ECHO_N "(cached) $ECHO_C" >&6
17137 else
17138
17139 cat >"conftest.$ac_ext" <<_ACEOF
17140 #line 17140 "configure"
17141 #include "confdefs.h"
17142
17143 #include <${cf_cv_ncurses_header:-curses.h}>
17144 #include <menu.h>
17145
17146 int
17147 main (void)
17148 {
17149
17150         MENU *menu;
17151         int y = menu->max_item_width;
17152
17153   ;
17154   return 0;
17155 }
17156 _ACEOF
17157 rm -f "conftest.$ac_objext"
17158 if { (eval echo "$as_me:17158: \"$ac_compile\"") >&5
17159   (eval $ac_compile) 2>&5
17160   ac_status=$?
17161   echo "$as_me:17161: \$? = $ac_status" >&5
17162   (exit "$ac_status"); } &&
17163          { ac_try='test -s "conftest.$ac_objext"'
17164   { (eval echo "$as_me:17164: \"$ac_try\"") >&5
17165   (eval $ac_try) 2>&5
17166   ac_status=$?
17167   echo "$as_me:17167: \$? = $ac_status" >&5
17168   (exit "$ac_status"); }; }; then
17169   cf_cv_netbsd_menu_h=yes
17170
17171 else
17172   echo "$as_me: failed program was:" >&5
17173 cat "conftest.$ac_ext" >&5
17174 cf_cv_netbsd_menu_h=no
17175 fi
17176 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17177
17178 fi
17179 echo "$as_me:17179: result: $cf_cv_netbsd_menu_h" >&5
17180 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
17181
17182 test "$cf_cv_netbsd_menu_h" = yes &&
17183 cat >>confdefs.h <<\EOF
17184 #define HAVE_NETBSD_MENU_H 1
17185 EOF
17186
17187                 ;;
17188         esac
17189
17190 cf_have_curses_lib=no
17191
17192 : ${NCURSES_CONFIG_PKG:=none}
17193 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17194         :
17195 elif test "x${PKG_CONFIG:=none}" != xnone; then
17196         echo "$as_me:17196: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
17197 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17198         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
17199                 echo "$as_me:17199: result: yes" >&5
17200 echo "${ECHO_T}yes" >&6
17201
17202                 echo "$as_me:17202: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
17203 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17204
17205                 cf_save_CFLAGS="$CFLAGS"
17206                 cf_save_CPPFLAGS="$CPPFLAGS"
17207                 cf_save_LIBS="$LIBS"
17208
17209 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
17210 do
17211         case "x$cf_add_cflags" in
17212         (x-[DU]*)
17213
17214 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17215 while true
17216 do
17217         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'`
17218         test "$CFLAGS" != "$cf_old_cflag" || break
17219
17220         CFLAGS="$cf_old_cflag"
17221 done
17222
17223 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17224 while true
17225 do
17226         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'`
17227         test "$CPPFLAGS" != "$cf_old_cflag" || break
17228
17229         CPPFLAGS="$cf_old_cflag"
17230 done
17231
17232                 ;;
17233         esac
17234
17235 cf_fix_cppflags=no
17236 cf_new_cflags=
17237 cf_new_cppflags=
17238 cf_new_extra_cppflags=
17239
17240 for cf_add_cflags in $cf_add_cflags
17241 do
17242 case "$cf_fix_cppflags" in
17243 (no)
17244         case "$cf_add_cflags" in
17245         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17246                 case "$cf_add_cflags" in
17247                 (-D*)
17248                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17249
17250                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17251                                 && test -z "${cf_tst_cflags}" \
17252                                 && cf_fix_cppflags=yes
17253
17254                         if test "$cf_fix_cppflags" = yes ; then
17255
17256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17258
17259                                 continue
17260                         elif test "${cf_tst_cflags}" = "\"'" ; then
17261
17262         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17263         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17264
17265                                 continue
17266                         fi
17267                         ;;
17268                 esac
17269                 case "$CPPFLAGS" in
17270                 (*$cf_add_cflags)
17271                         ;;
17272                 (*)
17273                         case "$cf_add_cflags" in
17274                         (-D*)
17275                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17276
17277 CPPFLAGS=`echo "$CPPFLAGS" | \
17278         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17279                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17280
17281                                 ;;
17282                         esac
17283
17284         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17285         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17286
17287                         ;;
17288                 esac
17289                 ;;
17290         (*)
17291
17292         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17293         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17294
17295                 ;;
17296         esac
17297         ;;
17298 (yes)
17299
17300         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17301         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17302
17303         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17304
17305         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17306                 && test -z "${cf_tst_cflags}" \
17307                 && cf_fix_cppflags=no
17308         ;;
17309 esac
17310 done
17311
17312 if test -n "$cf_new_cflags" ; then
17313
17314         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17315         CFLAGS="${CFLAGS}$cf_new_cflags"
17316
17317 fi
17318
17319 if test -n "$cf_new_cppflags" ; then
17320
17321         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17322         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17323
17324 fi
17325
17326 if test -n "$cf_new_extra_cppflags" ; then
17327
17328         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17329         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17330
17331 fi
17332
17333 done
17334
17335 cf_add_libs="$LIBS"
17336 # reverse order
17337 cf_add_0lib=
17338 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17339 # filter duplicates
17340 for cf_add_1lib in $cf_add_0lib; do
17341         for cf_add_2lib in $cf_add_libs; do
17342                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17343                         cf_add_1lib=
17344                         break
17345                 fi
17346         done
17347         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17348 done
17349 LIBS="$cf_add_libs"
17350
17351                 cat >"conftest.$ac_ext" <<_ACEOF
17352 #line 17352 "configure"
17353 #include "confdefs.h"
17354 #include <$MENU_NAME.h>
17355 int
17356 main (void)
17357 {
17358 (void) menu_driver ( 0,0 );
17359   ;
17360   return 0;
17361 }
17362 _ACEOF
17363 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17364 if { (eval echo "$as_me:17364: \"$ac_link\"") >&5
17365   (eval $ac_link) 2>&5
17366   ac_status=$?
17367   echo "$as_me:17367: \$? = $ac_status" >&5
17368   (exit "$ac_status"); } &&
17369          { ac_try='test -s "conftest$ac_exeext"'
17370   { (eval echo "$as_me:17370: \"$ac_try\"") >&5
17371   (eval $ac_try) 2>&5
17372   ac_status=$?
17373   echo "$as_me:17373: \$? = $ac_status" >&5
17374   (exit "$ac_status"); }; }; then
17375   if test "$cross_compiling" = yes; then
17376   cf_have_curses_lib=maybe
17377 else
17378   cat >"conftest.$ac_ext" <<_ACEOF
17379 #line 17379 "configure"
17380 #include "confdefs.h"
17381 #include <$MENU_NAME.h>
17382                                 int main(void)
17383                                 { (void) menu_driver ( 0,0 ); return 0; }
17384 _ACEOF
17385 rm -f "conftest$ac_exeext"
17386 if { (eval echo "$as_me:17386: \"$ac_link\"") >&5
17387   (eval $ac_link) 2>&5
17388   ac_status=$?
17389   echo "$as_me:17389: \$? = $ac_status" >&5
17390   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17391   { (eval echo "$as_me:17391: \"$ac_try\"") >&5
17392   (eval $ac_try) 2>&5
17393   ac_status=$?
17394   echo "$as_me:17394: \$? = $ac_status" >&5
17395   (exit "$ac_status"); }; }; then
17396   cf_have_curses_lib=yes
17397 else
17398   echo "$as_me: program exited with status $ac_status" >&5
17399 echo "$as_me: failed program was:" >&5
17400 cat "conftest.$ac_ext" >&5
17401 cf_have_curses_lib=no
17402 fi
17403 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17404 fi
17405 else
17406   echo "$as_me: failed program was:" >&5
17407 cat "conftest.$ac_ext" >&5
17408 cf_have_curses_lib=no
17409 fi
17410 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17411                 echo "$as_me:17411: result: $cf_have_curses_lib" >&5
17412 echo "${ECHO_T}$cf_have_curses_lib" >&6
17413                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17414                 if test "$cf_have_curses_lib" = "yes"
17415                 then
17416
17417 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17418
17419                         cat >>confdefs.h <<EOF
17420 #define $cf_upper 1
17421 EOF
17422
17423                 else
17424                         CFLAGS="$cf_save_CFLAGS"
17425                         CPPFLAGS="$cf_save_CPPFLAGS"
17426                         LIBS="$cf_save_LIBS"
17427                 fi
17428         fi
17429 fi
17430 if test "$cf_have_curses_lib" = no; then
17431         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17432 echo "$as_me:17432: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17433 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17434 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17435   echo $ECHO_N "(cached) $ECHO_C" >&6
17436 else
17437   ac_check_lib_save_LIBS=$LIBS
17438 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17439 cat >"conftest.$ac_ext" <<_ACEOF
17440 #line 17440 "configure"
17441 #include "confdefs.h"
17442
17443 /* Override any gcc2 internal prototype to avoid an error.  */
17444 #ifdef __cplusplus
17445 extern "C"
17446 #endif
17447 /* We use char because int might match the return type of a gcc2
17448    builtin and then its argument prototype would still apply.  */
17449 char menu_driver ();
17450 int
17451 main (void)
17452 {
17453 menu_driver ();
17454   ;
17455   return 0;
17456 }
17457 _ACEOF
17458 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17459 if { (eval echo "$as_me:17459: \"$ac_link\"") >&5
17460   (eval $ac_link) 2>&5
17461   ac_status=$?
17462   echo "$as_me:17462: \$? = $ac_status" >&5
17463   (exit "$ac_status"); } &&
17464          { ac_try='test -s "conftest$ac_exeext"'
17465   { (eval echo "$as_me:17465: \"$ac_try\"") >&5
17466   (eval $ac_try) 2>&5
17467   ac_status=$?
17468   echo "$as_me:17468: \$? = $ac_status" >&5
17469   (exit "$ac_status"); }; }; then
17470   eval "$as_ac_Lib=yes"
17471 else
17472   echo "$as_me: failed program was:" >&5
17473 cat "conftest.$ac_ext" >&5
17474 eval "$as_ac_Lib=no"
17475 fi
17476 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17477 LIBS=$ac_check_lib_save_LIBS
17478 fi
17479 echo "$as_me:17479: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17480 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17481 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17482
17483 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17484
17485 cf_add_libs="$LIBS"
17486 # reverse order
17487 cf_add_0lib=
17488 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17489 # filter duplicates
17490 for cf_add_1lib in $cf_add_0lib; do
17491         for cf_add_2lib in $cf_add_libs; do
17492                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17493                         cf_add_1lib=
17494                         break
17495                 fi
17496         done
17497         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17498 done
17499 LIBS="$cf_add_libs"
17500
17501                 cat >>confdefs.h <<EOF
17502 #define $cf_upper 1
17503 EOF
17504
17505 fi
17506
17507 fi
17508
17509         cf_curses_headers="$cf_curses_headers menu.h"
17510 fi
17511
17512 echo "$as_me:17512: checking if you want to check for form functions" >&5
17513 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17514
17515 # Check whether --enable-form or --disable-form was given.
17516 if test "${enable_form+set}" = set; then
17517   enableval="$enable_form"
17518   test "$enableval" != no && enableval=yes
17519         if test "$enableval" != "yes" ; then
17520     cf_enable_form=no
17521         else
17522                 cf_enable_form=$cf_default_form
17523         fi
17524 else
17525   enableval=yes
17526         cf_enable_form=$cf_default_form
17527
17528 fi;
17529 echo "$as_me:17529: result: $cf_enable_form" >&5
17530 echo "${ECHO_T}$cf_enable_form" >&6
17531 if test $cf_enable_form = yes
17532 then
17533         case $cf_cv_screen in
17534         (ncurses*)
17535                 ;;
17536         (curses*)
17537
17538 echo "$as_me:17538: checking for NetBSD form.h" >&5
17539 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17540 if test "${cf_cv_netbsd_form_h+set}" = set; then
17541   echo $ECHO_N "(cached) $ECHO_C" >&6
17542 else
17543
17544 cat >"conftest.$ac_ext" <<_ACEOF
17545 #line 17545 "configure"
17546 #include "confdefs.h"
17547
17548 #include <${cf_cv_ncurses_header:-curses.h}>
17549 #include <form.h>
17550
17551 int
17552 main (void)
17553 {
17554
17555         FORM *form;
17556         int y = current_field(form)->cursor_ypos;
17557         int x = current_field(form)->cursor_xpos;
17558
17559   ;
17560   return 0;
17561 }
17562 _ACEOF
17563 rm -f "conftest.$ac_objext"
17564 if { (eval echo "$as_me:17564: \"$ac_compile\"") >&5
17565   (eval $ac_compile) 2>&5
17566   ac_status=$?
17567   echo "$as_me:17567: \$? = $ac_status" >&5
17568   (exit "$ac_status"); } &&
17569          { ac_try='test -s "conftest.$ac_objext"'
17570   { (eval echo "$as_me:17570: \"$ac_try\"") >&5
17571   (eval $ac_try) 2>&5
17572   ac_status=$?
17573   echo "$as_me:17573: \$? = $ac_status" >&5
17574   (exit "$ac_status"); }; }; then
17575   cf_cv_netbsd_form_h=yes
17576
17577 else
17578   echo "$as_me: failed program was:" >&5
17579 cat "conftest.$ac_ext" >&5
17580 cf_cv_netbsd_form_h=no
17581 fi
17582 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17583
17584 fi
17585 echo "$as_me:17585: result: $cf_cv_netbsd_form_h" >&5
17586 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17587
17588 test "$cf_cv_netbsd_form_h" = yes &&
17589 cat >>confdefs.h <<\EOF
17590 #define HAVE_NETBSD_FORM_H 1
17591 EOF
17592
17593                 ;;
17594         esac
17595
17596 cf_have_curses_lib=no
17597
17598 : ${NCURSES_CONFIG_PKG:=none}
17599 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17600         :
17601 elif test "x${PKG_CONFIG:=none}" != xnone; then
17602         echo "$as_me:17602: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17603 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17604         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17605                 echo "$as_me:17605: result: yes" >&5
17606 echo "${ECHO_T}yes" >&6
17607
17608                 echo "$as_me:17608: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17609 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17610
17611                 cf_save_CFLAGS="$CFLAGS"
17612                 cf_save_CPPFLAGS="$CPPFLAGS"
17613                 cf_save_LIBS="$LIBS"
17614
17615 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17616 do
17617         case "x$cf_add_cflags" in
17618         (x-[DU]*)
17619
17620 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17621 while true
17622 do
17623         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'`
17624         test "$CFLAGS" != "$cf_old_cflag" || break
17625
17626         CFLAGS="$cf_old_cflag"
17627 done
17628
17629 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17630 while true
17631 do
17632         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'`
17633         test "$CPPFLAGS" != "$cf_old_cflag" || break
17634
17635         CPPFLAGS="$cf_old_cflag"
17636 done
17637
17638                 ;;
17639         esac
17640
17641 cf_fix_cppflags=no
17642 cf_new_cflags=
17643 cf_new_cppflags=
17644 cf_new_extra_cppflags=
17645
17646 for cf_add_cflags in $cf_add_cflags
17647 do
17648 case "$cf_fix_cppflags" in
17649 (no)
17650         case "$cf_add_cflags" in
17651         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17652                 case "$cf_add_cflags" in
17653                 (-D*)
17654                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17655
17656                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17657                                 && test -z "${cf_tst_cflags}" \
17658                                 && cf_fix_cppflags=yes
17659
17660                         if test "$cf_fix_cppflags" = yes ; then
17661
17662         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17663         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17664
17665                                 continue
17666                         elif test "${cf_tst_cflags}" = "\"'" ; then
17667
17668         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17669         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17670
17671                                 continue
17672                         fi
17673                         ;;
17674                 esac
17675                 case "$CPPFLAGS" in
17676                 (*$cf_add_cflags)
17677                         ;;
17678                 (*)
17679                         case "$cf_add_cflags" in
17680                         (-D*)
17681                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17682
17683 CPPFLAGS=`echo "$CPPFLAGS" | \
17684         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17685                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17686
17687                                 ;;
17688                         esac
17689
17690         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17691         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17692
17693                         ;;
17694                 esac
17695                 ;;
17696         (*)
17697
17698         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17699         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17700
17701                 ;;
17702         esac
17703         ;;
17704 (yes)
17705
17706         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17707         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17708
17709         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17710
17711         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17712                 && test -z "${cf_tst_cflags}" \
17713                 && cf_fix_cppflags=no
17714         ;;
17715 esac
17716 done
17717
17718 if test -n "$cf_new_cflags" ; then
17719
17720         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17721         CFLAGS="${CFLAGS}$cf_new_cflags"
17722
17723 fi
17724
17725 if test -n "$cf_new_cppflags" ; then
17726
17727         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17728         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17729
17730 fi
17731
17732 if test -n "$cf_new_extra_cppflags" ; then
17733
17734         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17735         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17736
17737 fi
17738
17739 done
17740
17741 cf_add_libs="$LIBS"
17742 # reverse order
17743 cf_add_0lib=
17744 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17745 # filter duplicates
17746 for cf_add_1lib in $cf_add_0lib; do
17747         for cf_add_2lib in $cf_add_libs; do
17748                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17749                         cf_add_1lib=
17750                         break
17751                 fi
17752         done
17753         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17754 done
17755 LIBS="$cf_add_libs"
17756
17757                 cat >"conftest.$ac_ext" <<_ACEOF
17758 #line 17758 "configure"
17759 #include "confdefs.h"
17760 #include <$FORM_NAME.h>
17761 int
17762 main (void)
17763 {
17764 (void) form_driver ( 0,0 );
17765   ;
17766   return 0;
17767 }
17768 _ACEOF
17769 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17770 if { (eval echo "$as_me:17770: \"$ac_link\"") >&5
17771   (eval $ac_link) 2>&5
17772   ac_status=$?
17773   echo "$as_me:17773: \$? = $ac_status" >&5
17774   (exit "$ac_status"); } &&
17775          { ac_try='test -s "conftest$ac_exeext"'
17776   { (eval echo "$as_me:17776: \"$ac_try\"") >&5
17777   (eval $ac_try) 2>&5
17778   ac_status=$?
17779   echo "$as_me:17779: \$? = $ac_status" >&5
17780   (exit "$ac_status"); }; }; then
17781   if test "$cross_compiling" = yes; then
17782   cf_have_curses_lib=maybe
17783 else
17784   cat >"conftest.$ac_ext" <<_ACEOF
17785 #line 17785 "configure"
17786 #include "confdefs.h"
17787 #include <$FORM_NAME.h>
17788                                 int main(void)
17789                                 { (void) form_driver ( 0,0 ); return 0; }
17790 _ACEOF
17791 rm -f "conftest$ac_exeext"
17792 if { (eval echo "$as_me:17792: \"$ac_link\"") >&5
17793   (eval $ac_link) 2>&5
17794   ac_status=$?
17795   echo "$as_me:17795: \$? = $ac_status" >&5
17796   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17797   { (eval echo "$as_me:17797: \"$ac_try\"") >&5
17798   (eval $ac_try) 2>&5
17799   ac_status=$?
17800   echo "$as_me:17800: \$? = $ac_status" >&5
17801   (exit "$ac_status"); }; }; then
17802   cf_have_curses_lib=yes
17803 else
17804   echo "$as_me: program exited with status $ac_status" >&5
17805 echo "$as_me: failed program was:" >&5
17806 cat "conftest.$ac_ext" >&5
17807 cf_have_curses_lib=no
17808 fi
17809 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17810 fi
17811 else
17812   echo "$as_me: failed program was:" >&5
17813 cat "conftest.$ac_ext" >&5
17814 cf_have_curses_lib=no
17815 fi
17816 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17817                 echo "$as_me:17817: result: $cf_have_curses_lib" >&5
17818 echo "${ECHO_T}$cf_have_curses_lib" >&6
17819                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17820                 if test "$cf_have_curses_lib" = "yes"
17821                 then
17822
17823 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17824
17825                         cat >>confdefs.h <<EOF
17826 #define $cf_upper 1
17827 EOF
17828
17829                 else
17830                         CFLAGS="$cf_save_CFLAGS"
17831                         CPPFLAGS="$cf_save_CPPFLAGS"
17832                         LIBS="$cf_save_LIBS"
17833                 fi
17834         fi
17835 fi
17836 if test "$cf_have_curses_lib" = no; then
17837         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17838 echo "$as_me:17838: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17839 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17840 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17841   echo $ECHO_N "(cached) $ECHO_C" >&6
17842 else
17843   ac_check_lib_save_LIBS=$LIBS
17844 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17845 cat >"conftest.$ac_ext" <<_ACEOF
17846 #line 17846 "configure"
17847 #include "confdefs.h"
17848
17849 /* Override any gcc2 internal prototype to avoid an error.  */
17850 #ifdef __cplusplus
17851 extern "C"
17852 #endif
17853 /* We use char because int might match the return type of a gcc2
17854    builtin and then its argument prototype would still apply.  */
17855 char form_driver ();
17856 int
17857 main (void)
17858 {
17859 form_driver ();
17860   ;
17861   return 0;
17862 }
17863 _ACEOF
17864 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17865 if { (eval echo "$as_me:17865: \"$ac_link\"") >&5
17866   (eval $ac_link) 2>&5
17867   ac_status=$?
17868   echo "$as_me:17868: \$? = $ac_status" >&5
17869   (exit "$ac_status"); } &&
17870          { ac_try='test -s "conftest$ac_exeext"'
17871   { (eval echo "$as_me:17871: \"$ac_try\"") >&5
17872   (eval $ac_try) 2>&5
17873   ac_status=$?
17874   echo "$as_me:17874: \$? = $ac_status" >&5
17875   (exit "$ac_status"); }; }; then
17876   eval "$as_ac_Lib=yes"
17877 else
17878   echo "$as_me: failed program was:" >&5
17879 cat "conftest.$ac_ext" >&5
17880 eval "$as_ac_Lib=no"
17881 fi
17882 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17883 LIBS=$ac_check_lib_save_LIBS
17884 fi
17885 echo "$as_me:17885: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17886 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17887 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17888
17889 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17890
17891 cf_add_libs="$LIBS"
17892 # reverse order
17893 cf_add_0lib=
17894 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17895 # filter duplicates
17896 for cf_add_1lib in $cf_add_0lib; do
17897         for cf_add_2lib in $cf_add_libs; do
17898                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17899                         cf_add_1lib=
17900                         break
17901                 fi
17902         done
17903         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17904 done
17905 LIBS="$cf_add_libs"
17906
17907                 cat >>confdefs.h <<EOF
17908 #define $cf_upper 1
17909 EOF
17910
17911 fi
17912
17913 fi
17914
17915         cf_curses_headers="$cf_curses_headers form.h"
17916 fi
17917
17918 # look for curses-related headers
17919
17920 for ac_header in $cf_curses_headers
17921 do
17922 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17923 echo "$as_me:17923: checking for $ac_header" >&5
17924 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17925 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17926   echo $ECHO_N "(cached) $ECHO_C" >&6
17927 else
17928   cat >"conftest.$ac_ext" <<_ACEOF
17929 #line 17929 "configure"
17930 #include "confdefs.h"
17931 #include <$ac_header>
17932 _ACEOF
17933 if { (eval echo "$as_me:17933: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17934   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17935   ac_status=$?
17936   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17937   rm -f conftest.er1
17938   cat conftest.err >&5
17939   echo "$as_me:17939: \$? = $ac_status" >&5
17940   (exit "$ac_status"); } >/dev/null; then
17941   if test -s conftest.err; then
17942     ac_cpp_err=$ac_c_preproc_warn_flag
17943   else
17944     ac_cpp_err=
17945   fi
17946 else
17947   ac_cpp_err=yes
17948 fi
17949 if test -z "$ac_cpp_err"; then
17950   eval "$as_ac_Header=yes"
17951 else
17952   echo "$as_me: failed program was:" >&5
17953   cat "conftest.$ac_ext" >&5
17954   eval "$as_ac_Header=no"
17955 fi
17956 rm -f conftest.err "conftest.$ac_ext"
17957 fi
17958 echo "$as_me:17958: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17959 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17960 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17961   cat >>confdefs.h <<EOF
17962 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17963 EOF
17964
17965 fi
17966 done
17967
17968 echo "$as_me:17968: checking for ANSI C header files" >&5
17969 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17970 if test "${ac_cv_header_stdc+set}" = set; then
17971   echo $ECHO_N "(cached) $ECHO_C" >&6
17972 else
17973   cat >"conftest.$ac_ext" <<_ACEOF
17974 #line 17974 "configure"
17975 #include "confdefs.h"
17976 #include <stdlib.h>
17977 #include <stdarg.h>
17978 #include <string.h>
17979 #include <float.h>
17980
17981 _ACEOF
17982 if { (eval echo "$as_me:17982: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17983   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17984   ac_status=$?
17985   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17986   rm -f conftest.er1
17987   cat conftest.err >&5
17988   echo "$as_me:17988: \$? = $ac_status" >&5
17989   (exit "$ac_status"); } >/dev/null; then
17990   if test -s conftest.err; then
17991     ac_cpp_err=$ac_c_preproc_warn_flag
17992   else
17993     ac_cpp_err=
17994   fi
17995 else
17996   ac_cpp_err=yes
17997 fi
17998 if test -z "$ac_cpp_err"; then
17999   ac_cv_header_stdc=yes
18000 else
18001   echo "$as_me: failed program was:" >&5
18002   cat "conftest.$ac_ext" >&5
18003   ac_cv_header_stdc=no
18004 fi
18005 rm -f conftest.err "conftest.$ac_ext"
18006
18007 if test $ac_cv_header_stdc = yes; then
18008   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
18009   cat >"conftest.$ac_ext" <<_ACEOF
18010 #line 18010 "configure"
18011 #include "confdefs.h"
18012 #include <string.h>
18013
18014 _ACEOF
18015 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18016   $EGREP "memchr" >/dev/null 2>&1; then
18017   :
18018 else
18019   ac_cv_header_stdc=no
18020 fi
18021 rm -rf conftest*
18022
18023 fi
18024
18025 if test $ac_cv_header_stdc = yes; then
18026   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
18027   cat >"conftest.$ac_ext" <<_ACEOF
18028 #line 18028 "configure"
18029 #include "confdefs.h"
18030 #include <stdlib.h>
18031
18032 _ACEOF
18033 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18034   $EGREP "free" >/dev/null 2>&1; then
18035   :
18036 else
18037   ac_cv_header_stdc=no
18038 fi
18039 rm -rf conftest*
18040
18041 fi
18042
18043 if test $ac_cv_header_stdc = yes; then
18044   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
18045   if test "$cross_compiling" = yes; then
18046   :
18047 else
18048   cat >"conftest.$ac_ext" <<_ACEOF
18049 #line 18049 "configure"
18050 #include "confdefs.h"
18051 #include <ctype.h>
18052 #if ((' ' & 0x0FF) == 0x020)
18053 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
18054 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
18055 #else
18056 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
18057                      || ('j' <= (c) && (c) <= 'r') \
18058                      || ('s' <= (c) && (c) <= 'z'))
18059 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
18060 #endif
18061
18062 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
18063 int
18064 main (void)
18065 {
18066   int i;
18067   for (i = 0; i < 256; i++)
18068     if (XOR (islower (i), ISLOWER (i))
18069         || toupper (i) != TOUPPER (i))
18070       $ac_main_return(2);
18071   $ac_main_return (0);
18072 }
18073 _ACEOF
18074 rm -f "conftest$ac_exeext"
18075 if { (eval echo "$as_me:18075: \"$ac_link\"") >&5
18076   (eval $ac_link) 2>&5
18077   ac_status=$?
18078   echo "$as_me:18078: \$? = $ac_status" >&5
18079   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
18080   { (eval echo "$as_me:18080: \"$ac_try\"") >&5
18081   (eval $ac_try) 2>&5
18082   ac_status=$?
18083   echo "$as_me:18083: \$? = $ac_status" >&5
18084   (exit "$ac_status"); }; }; then
18085   :
18086 else
18087   echo "$as_me: program exited with status $ac_status" >&5
18088 echo "$as_me: failed program was:" >&5
18089 cat "conftest.$ac_ext" >&5
18090 ac_cv_header_stdc=no
18091 fi
18092 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
18093 fi
18094 fi
18095 fi
18096 echo "$as_me:18096: result: $ac_cv_header_stdc" >&5
18097 echo "${ECHO_T}$ac_cv_header_stdc" >&6
18098 if test $ac_cv_header_stdc = yes; then
18099
18100 cat >>confdefs.h <<\EOF
18101 #define STDC_HEADERS 1
18102 EOF
18103
18104 fi
18105
18106 echo "$as_me:18106: checking whether time.h and sys/time.h may both be included" >&5
18107 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
18108 if test "${ac_cv_header_time+set}" = set; then
18109   echo $ECHO_N "(cached) $ECHO_C" >&6
18110 else
18111   cat >"conftest.$ac_ext" <<_ACEOF
18112 #line 18112 "configure"
18113 #include "confdefs.h"
18114 #include <sys/types.h>
18115 #include <sys/time.h>
18116 #include <time.h>
18117
18118 int
18119 main (void)
18120 {
18121 if ((struct tm *) 0)
18122 return 0;
18123   ;
18124   return 0;
18125 }
18126 _ACEOF
18127 rm -f "conftest.$ac_objext"
18128 if { (eval echo "$as_me:18128: \"$ac_compile\"") >&5
18129   (eval $ac_compile) 2>&5
18130   ac_status=$?
18131   echo "$as_me:18131: \$? = $ac_status" >&5
18132   (exit "$ac_status"); } &&
18133          { ac_try='test -s "conftest.$ac_objext"'
18134   { (eval echo "$as_me:18134: \"$ac_try\"") >&5
18135   (eval $ac_try) 2>&5
18136   ac_status=$?
18137   echo "$as_me:18137: \$? = $ac_status" >&5
18138   (exit "$ac_status"); }; }; then
18139   ac_cv_header_time=yes
18140 else
18141   echo "$as_me: failed program was:" >&5
18142 cat "conftest.$ac_ext" >&5
18143 ac_cv_header_time=no
18144 fi
18145 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18146 fi
18147 echo "$as_me:18147: result: $ac_cv_header_time" >&5
18148 echo "${ECHO_T}$ac_cv_header_time" >&6
18149 if test $ac_cv_header_time = yes; then
18150
18151 cat >>confdefs.h <<\EOF
18152 #define TIME_WITH_SYS_TIME 1
18153 EOF
18154
18155 fi
18156
18157 for ac_header in \
18158 getopt.h \
18159 locale.h \
18160 math.h \
18161 stdarg.h \
18162 stdint.h \
18163 sys/ioctl.h \
18164 sys/select.h \
18165 sys/time.h \
18166 termios.h \
18167 unistd.h \
18168
18169 do
18170 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18171 echo "$as_me:18171: checking for $ac_header" >&5
18172 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18173 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18174   echo $ECHO_N "(cached) $ECHO_C" >&6
18175 else
18176   cat >"conftest.$ac_ext" <<_ACEOF
18177 #line 18177 "configure"
18178 #include "confdefs.h"
18179 #include <$ac_header>
18180 _ACEOF
18181 if { (eval echo "$as_me:18181: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18182   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18183   ac_status=$?
18184   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18185   rm -f conftest.er1
18186   cat conftest.err >&5
18187   echo "$as_me:18187: \$? = $ac_status" >&5
18188   (exit "$ac_status"); } >/dev/null; then
18189   if test -s conftest.err; then
18190     ac_cpp_err=$ac_c_preproc_warn_flag
18191   else
18192     ac_cpp_err=
18193   fi
18194 else
18195   ac_cpp_err=yes
18196 fi
18197 if test -z "$ac_cpp_err"; then
18198   eval "$as_ac_Header=yes"
18199 else
18200   echo "$as_me: failed program was:" >&5
18201   cat "conftest.$ac_ext" >&5
18202   eval "$as_ac_Header=no"
18203 fi
18204 rm -f conftest.err "conftest.$ac_ext"
18205 fi
18206 echo "$as_me:18206: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18207 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18208 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18209   cat >>confdefs.h <<EOF
18210 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18211 EOF
18212
18213 fi
18214 done
18215
18216 for ac_header in unistd.h getopt.h
18217 do
18218 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18219 echo "$as_me:18219: checking for $ac_header" >&5
18220 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18221 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18222   echo $ECHO_N "(cached) $ECHO_C" >&6
18223 else
18224   cat >"conftest.$ac_ext" <<_ACEOF
18225 #line 18225 "configure"
18226 #include "confdefs.h"
18227 #include <$ac_header>
18228 _ACEOF
18229 if { (eval echo "$as_me:18229: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18230   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18231   ac_status=$?
18232   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18233   rm -f conftest.er1
18234   cat conftest.err >&5
18235   echo "$as_me:18235: \$? = $ac_status" >&5
18236   (exit "$ac_status"); } >/dev/null; then
18237   if test -s conftest.err; then
18238     ac_cpp_err=$ac_c_preproc_warn_flag
18239   else
18240     ac_cpp_err=
18241   fi
18242 else
18243   ac_cpp_err=yes
18244 fi
18245 if test -z "$ac_cpp_err"; then
18246   eval "$as_ac_Header=yes"
18247 else
18248   echo "$as_me: failed program was:" >&5
18249   cat "conftest.$ac_ext" >&5
18250   eval "$as_ac_Header=no"
18251 fi
18252 rm -f conftest.err "conftest.$ac_ext"
18253 fi
18254 echo "$as_me:18254: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18255 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18256 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18257   cat >>confdefs.h <<EOF
18258 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18259 EOF
18260
18261 fi
18262 done
18263
18264 echo "$as_me:18264: checking for header declaring getopt variables" >&5
18265 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
18266 if test "${cf_cv_getopt_header+set}" = set; then
18267   echo $ECHO_N "(cached) $ECHO_C" >&6
18268 else
18269
18270 cf_cv_getopt_header=none
18271 for cf_header in stdio.h stdlib.h unistd.h getopt.h
18272 do
18273 cat >"conftest.$ac_ext" <<_ACEOF
18274 #line 18274 "configure"
18275 #include "confdefs.h"
18276
18277 #include <$cf_header>
18278 int
18279 main (void)
18280 {
18281 int x = optind; char *y = optarg; (void)x; (void)y
18282   ;
18283   return 0;
18284 }
18285 _ACEOF
18286 rm -f "conftest.$ac_objext"
18287 if { (eval echo "$as_me:18287: \"$ac_compile\"") >&5
18288   (eval $ac_compile) 2>&5
18289   ac_status=$?
18290   echo "$as_me:18290: \$? = $ac_status" >&5
18291   (exit "$ac_status"); } &&
18292          { ac_try='test -s "conftest.$ac_objext"'
18293   { (eval echo "$as_me:18293: \"$ac_try\"") >&5
18294   (eval $ac_try) 2>&5
18295   ac_status=$?
18296   echo "$as_me:18296: \$? = $ac_status" >&5
18297   (exit "$ac_status"); }; }; then
18298   cf_cv_getopt_header=$cf_header
18299  break
18300 else
18301   echo "$as_me: failed program was:" >&5
18302 cat "conftest.$ac_ext" >&5
18303 fi
18304 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18305 done
18306
18307 fi
18308 echo "$as_me:18308: result: $cf_cv_getopt_header" >&5
18309 echo "${ECHO_T}$cf_cv_getopt_header" >&6
18310 if test "$cf_cv_getopt_header" != none ; then
18311
18312 cat >>confdefs.h <<\EOF
18313 #define HAVE_GETOPT_HEADER 1
18314 EOF
18315
18316 fi
18317 if test "$cf_cv_getopt_header" = getopt.h ; then
18318
18319 cat >>confdefs.h <<\EOF
18320 #define NEED_GETOPT_H 1
18321 EOF
18322
18323 fi
18324
18325 for ac_func in \
18326 getopt \
18327 gettimeofday \
18328 snprintf \
18329 strdup \
18330 strstr \
18331 tsearch \
18332
18333 do
18334 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18335 echo "$as_me:18335: checking for $ac_func" >&5
18336 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18337 if eval "test \"\${$as_ac_var+set}\" = set"; then
18338   echo $ECHO_N "(cached) $ECHO_C" >&6
18339 else
18340   cat >"conftest.$ac_ext" <<_ACEOF
18341 #line 18341 "configure"
18342 #include "confdefs.h"
18343 #define $ac_func autoconf_temporary
18344 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18345 #undef $ac_func
18346
18347 #ifdef __cplusplus
18348 extern "C"
18349 #endif
18350
18351 /* We use char because int might match the return type of a gcc2
18352    builtin and then its argument prototype would still apply.  */
18353 char $ac_func (void);
18354
18355 int
18356 main (void)
18357 {
18358
18359 /* The GNU C library defines stubs for functions which it implements
18360     to always fail with ENOSYS.  Some functions are actually named
18361     something starting with __ and the normal name is an alias.  */
18362 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18363 #error found stub for $ac_func
18364 #endif
18365
18366         return $ac_func ();
18367   ;
18368   return 0;
18369 }
18370 _ACEOF
18371 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18372 if { (eval echo "$as_me:18372: \"$ac_link\"") >&5
18373   (eval $ac_link) 2>&5
18374   ac_status=$?
18375   echo "$as_me:18375: \$? = $ac_status" >&5
18376   (exit "$ac_status"); } &&
18377          { ac_try='test -s "conftest$ac_exeext"'
18378   { (eval echo "$as_me:18378: \"$ac_try\"") >&5
18379   (eval $ac_try) 2>&5
18380   ac_status=$?
18381   echo "$as_me:18381: \$? = $ac_status" >&5
18382   (exit "$ac_status"); }; }; then
18383   eval "$as_ac_var=yes"
18384 else
18385   echo "$as_me: failed program was:" >&5
18386 cat "conftest.$ac_ext" >&5
18387 eval "$as_ac_var=no"
18388 fi
18389 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18390 fi
18391 echo "$as_me:18391: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18392 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18393 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18394   cat >>confdefs.h <<EOF
18395 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18396 EOF
18397
18398 fi
18399 done
18400
18401 # use a compile-check to work with ncurses*-config and subdirectory includes
18402 echo "$as_me:18402: checking if we can use termcap.h" >&5
18403 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18404 if test "${cf_cv_have_termcap_h+set}" = set; then
18405   echo $ECHO_N "(cached) $ECHO_C" >&6
18406 else
18407
18408         cat >"conftest.$ac_ext" <<_ACEOF
18409 #line 18409 "configure"
18410 #include "confdefs.h"
18411
18412 #include <curses.h>
18413 #ifdef NCURSES_VERSION
18414 #undef NCURSES_VERSION
18415 #endif
18416 #include <termcap.h>
18417 #ifndef NCURSES_VERSION
18418 #error wrong header
18419 #endif
18420
18421 int
18422 main (void)
18423 {
18424 return 0;
18425   ;
18426   return 0;
18427 }
18428 _ACEOF
18429 rm -f "conftest.$ac_objext"
18430 if { (eval echo "$as_me:18430: \"$ac_compile\"") >&5
18431   (eval $ac_compile) 2>&5
18432   ac_status=$?
18433   echo "$as_me:18433: \$? = $ac_status" >&5
18434   (exit "$ac_status"); } &&
18435          { ac_try='test -s "conftest.$ac_objext"'
18436   { (eval echo "$as_me:18436: \"$ac_try\"") >&5
18437   (eval $ac_try) 2>&5
18438   ac_status=$?
18439   echo "$as_me:18439: \$? = $ac_status" >&5
18440   (exit "$ac_status"); }; }; then
18441   cf_cv_have_termcap_h=yes
18442 else
18443   echo "$as_me: failed program was:" >&5
18444 cat "conftest.$ac_ext" >&5
18445 cf_cv_have_termcap_h=no
18446 fi
18447 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18448 fi
18449 echo "$as_me:18449: result: $cf_cv_have_termcap_h" >&5
18450 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18451 if test "x$cf_cv_have_termcap_h" = xyes
18452 then
18453
18454 cat >>confdefs.h <<\EOF
18455 #define HAVE_TERMCAP_H 1
18456 EOF
18457
18458 else
18459 echo "$as_me:18459: checking if we can use ncurses/termcap.h" >&5
18460 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18461 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18462   echo $ECHO_N "(cached) $ECHO_C" >&6
18463 else
18464
18465         cat >"conftest.$ac_ext" <<_ACEOF
18466 #line 18466 "configure"
18467 #include "confdefs.h"
18468
18469 #include <ncurses/curses.h>
18470 #ifdef NCURSES_VERSION
18471 #undef NCURSES_VERSION
18472 #endif
18473 #include <ncurses/termcap.h>
18474 #ifndef NCURSES_VERSION
18475 #error wrong header
18476 #endif
18477
18478 int
18479 main (void)
18480 {
18481 return 0;
18482   ;
18483   return 0;
18484 }
18485 _ACEOF
18486 rm -f "conftest.$ac_objext"
18487 if { (eval echo "$as_me:18487: \"$ac_compile\"") >&5
18488   (eval $ac_compile) 2>&5
18489   ac_status=$?
18490   echo "$as_me:18490: \$? = $ac_status" >&5
18491   (exit "$ac_status"); } &&
18492          { ac_try='test -s "conftest.$ac_objext"'
18493   { (eval echo "$as_me:18493: \"$ac_try\"") >&5
18494   (eval $ac_try) 2>&5
18495   ac_status=$?
18496   echo "$as_me:18496: \$? = $ac_status" >&5
18497   (exit "$ac_status"); }; }; then
18498   cf_cv_have_ncurses_termcap_h=yes
18499 else
18500   echo "$as_me: failed program was:" >&5
18501 cat "conftest.$ac_ext" >&5
18502 cf_cv_have_ncurses_termcap_h=no
18503 fi
18504 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18505 fi
18506 echo "$as_me:18506: result: $cf_cv_have_ncurses_termcap_h" >&5
18507 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18508 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18509 cat >>confdefs.h <<\EOF
18510 #define HAVE_NCURSES_TERMCAP_H 1
18511 EOF
18512
18513 fi
18514
18515 if test "x$ac_cv_func_getopt" = xno; then
18516         { { echo "$as_me:18516: error: getopt is required for building programs" >&5
18517 echo "$as_me: error: getopt is required for building programs" >&2;}
18518    { (exit 1); exit 1; }; }
18519 fi
18520
18521 if test "$cf_enable_widec" = yes; then
18522
18523 for ac_func in \
18524 mblen \
18525 mbrlen \
18526 mbrtowc \
18527 mbsrtowcs \
18528 mbstowcs \
18529 mbtowc \
18530 wcsrtombs \
18531 wcstombs \
18532
18533 do
18534 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18535 echo "$as_me:18535: checking for $ac_func" >&5
18536 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18537 if eval "test \"\${$as_ac_var+set}\" = set"; then
18538   echo $ECHO_N "(cached) $ECHO_C" >&6
18539 else
18540   cat >"conftest.$ac_ext" <<_ACEOF
18541 #line 18541 "configure"
18542 #include "confdefs.h"
18543 #define $ac_func autoconf_temporary
18544 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18545 #undef $ac_func
18546
18547 #ifdef __cplusplus
18548 extern "C"
18549 #endif
18550
18551 /* We use char because int might match the return type of a gcc2
18552    builtin and then its argument prototype would still apply.  */
18553 char $ac_func (void);
18554
18555 int
18556 main (void)
18557 {
18558
18559 /* The GNU C library defines stubs for functions which it implements
18560     to always fail with ENOSYS.  Some functions are actually named
18561     something starting with __ and the normal name is an alias.  */
18562 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18563 #error found stub for $ac_func
18564 #endif
18565
18566         return $ac_func ();
18567   ;
18568   return 0;
18569 }
18570 _ACEOF
18571 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18572 if { (eval echo "$as_me:18572: \"$ac_link\"") >&5
18573   (eval $ac_link) 2>&5
18574   ac_status=$?
18575   echo "$as_me:18575: \$? = $ac_status" >&5
18576   (exit "$ac_status"); } &&
18577          { ac_try='test -s "conftest$ac_exeext"'
18578   { (eval echo "$as_me:18578: \"$ac_try\"") >&5
18579   (eval $ac_try) 2>&5
18580   ac_status=$?
18581   echo "$as_me:18581: \$? = $ac_status" >&5
18582   (exit "$ac_status"); }; }; then
18583   eval "$as_ac_var=yes"
18584 else
18585   echo "$as_me: failed program was:" >&5
18586 cat "conftest.$ac_ext" >&5
18587 eval "$as_ac_var=no"
18588 fi
18589 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18590 fi
18591 echo "$as_me:18591: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18592 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18593 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18594   cat >>confdefs.h <<EOF
18595 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18596 EOF
18597
18598 fi
18599 done
18600
18601 fi
18602
18603 echo "$as_me:18603: checking definition to turn on extended curses functions" >&5
18604 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18605 if test "${cf_cv_need_xopen_extension+set}" = set; then
18606   echo $ECHO_N "(cached) $ECHO_C" >&6
18607 else
18608
18609 cf_cv_need_xopen_extension=unknown
18610 cat >"conftest.$ac_ext" <<_ACEOF
18611 #line 18611 "configure"
18612 #include "confdefs.h"
18613
18614 #include <stdlib.h>
18615 #include <${cf_cv_ncurses_header:-curses.h}>
18616 int
18617 main (void)
18618 {
18619
18620 #if defined(NCURSES_VERSION_PATCH)
18621 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18622         make an error
18623 #endif
18624 #endif
18625 #ifdef NCURSES_WIDECHAR
18626 make an error   /* prefer to fall-through on the second checks */
18627 #endif
18628         cchar_t check;
18629         int check2 = curs_set((int)sizeof(check));
18630         long x = winnstr(stdscr, "", 0);
18631         int x1, y1;
18632         (void)check2;
18633         getbegyx(stdscr, y1, x1);
18634         (void)x;
18635         (void)y1;
18636         (void)x1;
18637
18638   ;
18639   return 0;
18640 }
18641 _ACEOF
18642 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18643 if { (eval echo "$as_me:18643: \"$ac_link\"") >&5
18644   (eval $ac_link) 2>&5
18645   ac_status=$?
18646   echo "$as_me:18646: \$? = $ac_status" >&5
18647   (exit "$ac_status"); } &&
18648          { ac_try='test -s "conftest$ac_exeext"'
18649   { (eval echo "$as_me:18649: \"$ac_try\"") >&5
18650   (eval $ac_try) 2>&5
18651   ac_status=$?
18652   echo "$as_me:18652: \$? = $ac_status" >&5
18653   (exit "$ac_status"); }; }; then
18654   cf_cv_need_xopen_extension=none
18655 else
18656   echo "$as_me: failed program was:" >&5
18657 cat "conftest.$ac_ext" >&5
18658
18659         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18660         do
18661                 cat >"conftest.$ac_ext" <<_ACEOF
18662 #line 18662 "configure"
18663 #include "confdefs.h"
18664
18665 #define $cf_try_xopen_extension 1
18666 #include <stdlib.h>
18667 #include <${cf_cv_ncurses_header:-curses.h}>
18668 int
18669 main (void)
18670 {
18671
18672                 cchar_t check;
18673                 int check2 = curs_set((int)sizeof(check));
18674                 long x = winnstr(stdscr, "", 0);
18675                 int x1, y1;
18676                 getbegyx(stdscr, y1, x1);
18677                 (void)check2;
18678                 (void)x;
18679                 (void)y1;
18680                 (void)x1;
18681
18682   ;
18683   return 0;
18684 }
18685 _ACEOF
18686 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18687 if { (eval echo "$as_me:18687: \"$ac_link\"") >&5
18688   (eval $ac_link) 2>&5
18689   ac_status=$?
18690   echo "$as_me:18690: \$? = $ac_status" >&5
18691   (exit "$ac_status"); } &&
18692          { ac_try='test -s "conftest$ac_exeext"'
18693   { (eval echo "$as_me:18693: \"$ac_try\"") >&5
18694   (eval $ac_try) 2>&5
18695   ac_status=$?
18696   echo "$as_me:18696: \$? = $ac_status" >&5
18697   (exit "$ac_status"); }; }; then
18698   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18699 else
18700   echo "$as_me: failed program was:" >&5
18701 cat "conftest.$ac_ext" >&5
18702 fi
18703 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18704         done
18705
18706 fi
18707 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18708
18709 fi
18710 echo "$as_me:18710: result: $cf_cv_need_xopen_extension" >&5
18711 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18712
18713 case "$cf_cv_need_xopen_extension" in
18714 (*_*)
18715
18716         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18717         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18718
18719         ;;
18720 esac
18721
18722 echo "$as_me:18722: checking for term.h" >&5
18723 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18724 if test "${cf_cv_term_header+set}" = set; then
18725   echo $ECHO_N "(cached) $ECHO_C" >&6
18726 else
18727
18728 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18729 # for <term.h> if we do not find the variant.
18730
18731 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18732
18733 case "${cf_cv_ncurses_header:-curses.h}" in
18734 (*/*)
18735         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18736         cf_header_list="$cf_header_item $cf_header_list"
18737         ;;
18738 esac
18739
18740 for cf_header in $cf_header_list
18741 do
18742         cat >"conftest.$ac_ext" <<_ACEOF
18743 #line 18743 "configure"
18744 #include "confdefs.h"
18745
18746 #include <${cf_cv_ncurses_header:-curses.h}>
18747 #include <${cf_header}>
18748 int
18749 main (void)
18750 {
18751 WINDOW *x; (void)x
18752   ;
18753   return 0;
18754 }
18755 _ACEOF
18756 rm -f "conftest.$ac_objext"
18757 if { (eval echo "$as_me:18757: \"$ac_compile\"") >&5
18758   (eval $ac_compile) 2>&5
18759   ac_status=$?
18760   echo "$as_me:18760: \$? = $ac_status" >&5
18761   (exit "$ac_status"); } &&
18762          { ac_try='test -s "conftest.$ac_objext"'
18763   { (eval echo "$as_me:18763: \"$ac_try\"") >&5
18764   (eval $ac_try) 2>&5
18765   ac_status=$?
18766   echo "$as_me:18766: \$? = $ac_status" >&5
18767   (exit "$ac_status"); }; }; then
18768   cf_cv_term_header=$cf_header
18769          break
18770 else
18771   echo "$as_me: failed program was:" >&5
18772 cat "conftest.$ac_ext" >&5
18773 cf_cv_term_header=no
18774 fi
18775 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18776 done
18777
18778 case "$cf_cv_term_header" in
18779 (no)
18780         # If curses is ncurses, some packagers still mess it up by trying to make
18781         # us use GNU termcap.  This handles the most common case.
18782         for cf_header in ncurses/term.h ncursesw/term.h
18783         do
18784                 cat >"conftest.$ac_ext" <<_ACEOF
18785 #line 18785 "configure"
18786 #include "confdefs.h"
18787
18788 #include <${cf_cv_ncurses_header:-curses.h}>
18789 #ifdef NCURSES_VERSION
18790 #include <${cf_header}>
18791 #else
18792 make an error
18793 #endif
18794 int
18795 main (void)
18796 {
18797 WINDOW *x; (void)x
18798   ;
18799   return 0;
18800 }
18801 _ACEOF
18802 rm -f "conftest.$ac_objext"
18803 if { (eval echo "$as_me:18803: \"$ac_compile\"") >&5
18804   (eval $ac_compile) 2>&5
18805   ac_status=$?
18806   echo "$as_me:18806: \$? = $ac_status" >&5
18807   (exit "$ac_status"); } &&
18808          { ac_try='test -s "conftest.$ac_objext"'
18809   { (eval echo "$as_me:18809: \"$ac_try\"") >&5
18810   (eval $ac_try) 2>&5
18811   ac_status=$?
18812   echo "$as_me:18812: \$? = $ac_status" >&5
18813   (exit "$ac_status"); }; }; then
18814   cf_cv_term_header=$cf_header
18815                          break
18816 else
18817   echo "$as_me: failed program was:" >&5
18818 cat "conftest.$ac_ext" >&5
18819 cf_cv_term_header=no
18820 fi
18821 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18822         done
18823         ;;
18824 esac
18825
18826 fi
18827 echo "$as_me:18827: result: $cf_cv_term_header" >&5
18828 echo "${ECHO_T}$cf_cv_term_header" >&6
18829
18830 case "$cf_cv_term_header" in
18831 (term.h)
18832
18833 cat >>confdefs.h <<\EOF
18834 #define HAVE_TERM_H 1
18835 EOF
18836
18837         ;;
18838 (ncurses/term.h)
18839
18840 cat >>confdefs.h <<\EOF
18841 #define HAVE_NCURSES_TERM_H 1
18842 EOF
18843
18844         ;;
18845 (ncursesw/term.h)
18846
18847 cat >>confdefs.h <<\EOF
18848 #define HAVE_NCURSESW_TERM_H 1
18849 EOF
18850
18851         ;;
18852 esac
18853
18854 echo "$as_me:18854: checking for unctrl.h" >&5
18855 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18856 if test "${cf_cv_unctrl_header+set}" = set; then
18857   echo $ECHO_N "(cached) $ECHO_C" >&6
18858 else
18859
18860 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18861 # for <unctrl.h> if we do not find the variant.
18862
18863 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18864
18865 case "${cf_cv_ncurses_header:-curses.h}" in
18866 (*/*)
18867         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18868         cf_header_list="$cf_header_item $cf_header_list"
18869         ;;
18870 esac
18871
18872 for cf_header in $cf_header_list
18873 do
18874         cat >"conftest.$ac_ext" <<_ACEOF
18875 #line 18875 "configure"
18876 #include "confdefs.h"
18877
18878 #include <${cf_cv_ncurses_header:-curses.h}>
18879 #include <${cf_header}>
18880 int
18881 main (void)
18882 {
18883 WINDOW *x; (void)x
18884   ;
18885   return 0;
18886 }
18887 _ACEOF
18888 rm -f "conftest.$ac_objext"
18889 if { (eval echo "$as_me:18889: \"$ac_compile\"") >&5
18890   (eval $ac_compile) 2>&5
18891   ac_status=$?
18892   echo "$as_me:18892: \$? = $ac_status" >&5
18893   (exit "$ac_status"); } &&
18894          { ac_try='test -s "conftest.$ac_objext"'
18895   { (eval echo "$as_me:18895: \"$ac_try\"") >&5
18896   (eval $ac_try) 2>&5
18897   ac_status=$?
18898   echo "$as_me:18898: \$? = $ac_status" >&5
18899   (exit "$ac_status"); }; }; then
18900   cf_cv_unctrl_header=$cf_header
18901          break
18902 else
18903   echo "$as_me: failed program was:" >&5
18904 cat "conftest.$ac_ext" >&5
18905 cf_cv_unctrl_header=no
18906 fi
18907 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18908 done
18909
18910 fi
18911 echo "$as_me:18911: result: $cf_cv_unctrl_header" >&5
18912 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18913
18914 case "$cf_cv_unctrl_header" in
18915 (no)
18916         { echo "$as_me:18916: WARNING: unctrl.h header not found" >&5
18917 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18918         ;;
18919 esac
18920
18921 case "$cf_cv_unctrl_header" in
18922 (unctrl.h)
18923
18924 cat >>confdefs.h <<\EOF
18925 #define HAVE_UNCTRL_H 1
18926 EOF
18927
18928         ;;
18929 (ncurses/unctrl.h)
18930
18931 cat >>confdefs.h <<\EOF
18932 #define HAVE_NCURSES_UNCTRL_H 1
18933 EOF
18934
18935         ;;
18936 (ncursesw/unctrl.h)
18937
18938 cat >>confdefs.h <<\EOF
18939 #define HAVE_NCURSESW_UNCTRL_H 1
18940 EOF
18941
18942         ;;
18943 esac
18944
18945 for cf_func in \
18946 alloc_pair \
18947 assume_default_colors \
18948 chgat \
18949 color_content \
18950 color_set \
18951 copywin \
18952 delscreen \
18953 dupwin \
18954 exit_curses \
18955 exit_terminfo \
18956 filter \
18957 getbegx \
18958 getcurx \
18959 getmaxx \
18960 getnstr \
18961 getparx \
18962 getwin \
18963 halfdelay \
18964 init_extended_color \
18965 mvderwin \
18966 mvvline \
18967 mvwin \
18968 mvwvline \
18969 napms \
18970 newpad \
18971 putwin \
18972 reset_color_pairs \
18973 resize_term \
18974 resizeterm \
18975 restartterm \
18976 ripoffline \
18977 scr_dump \
18978 setupterm \
18979 slk_color \
18980 slk_init \
18981 termattrs \
18982 termname \
18983 tgetent \
18984 tigetnum \
18985 tigetstr \
18986 tputs_sp \
18987 typeahead \
18988 unget_wch \
18989 use_default_colors \
18990 use_env \
18991 use_extended_names \
18992 use_screen \
18993 use_window \
18994 vid_puts \
18995 vidputs \
18996 vsscanf \
18997 vw_printw \
18998 wchgat \
18999 winsdelln \
19000 winsstr \
19001 wresize \
19002 wsyncdown \
19003 _tracef \
19004
19005 do
19006
19007 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19008
19009         echo "$as_me:19009: checking for ${cf_func}" >&5
19010 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19011
19012 echo "${as_me:-configure}:19012: testing ${cf_func} ..." 1>&5
19013
19014         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19015   echo $ECHO_N "(cached) $ECHO_C" >&6
19016 else
19017
19018                 eval cf_result='$ac_cv_func_'$cf_func
19019                 if test ".$cf_result" != ".no"; then
19020                         cat >"conftest.$ac_ext" <<_ACEOF
19021 #line 19021 "configure"
19022 #include "confdefs.h"
19023
19024 #ifdef HAVE_XCURSES
19025 #include <xcurses.h>
19026 char * XCursesProgramName = "test";
19027 #else
19028 #include <${cf_cv_ncurses_header:-curses.h}>
19029 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19030 #include <ncursesw/term.h>
19031 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19032 #include <ncurses/term.h>
19033 #elif defined(HAVE_TERM_H)
19034 #include <term.h>
19035 #endif
19036 #endif
19037
19038 int
19039 main (void)
19040 {
19041
19042 #ifndef ${cf_func}
19043 long foo = (long)(&${cf_func});
19044 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19045 if (foo + 1234L > 5678L)
19046         ${cf_cv_main_return:-return}(foo != 0);
19047 #endif
19048
19049   ;
19050   return 0;
19051 }
19052 _ACEOF
19053 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19054 if { (eval echo "$as_me:19054: \"$ac_link\"") >&5
19055   (eval $ac_link) 2>&5
19056   ac_status=$?
19057   echo "$as_me:19057: \$? = $ac_status" >&5
19058   (exit "$ac_status"); } &&
19059          { ac_try='test -s "conftest$ac_exeext"'
19060   { (eval echo "$as_me:19060: \"$ac_try\"") >&5
19061   (eval $ac_try) 2>&5
19062   ac_status=$?
19063   echo "$as_me:19063: \$? = $ac_status" >&5
19064   (exit "$ac_status"); }; }; then
19065   cf_result=yes
19066 else
19067   echo "$as_me: failed program was:" >&5
19068 cat "conftest.$ac_ext" >&5
19069 cf_result=no
19070 fi
19071 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19072                 fi
19073                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19074
19075 fi
19076
19077         # use the computed/retrieved cache-value:
19078         eval 'cf_result=$cf_cv_func_'$cf_func
19079         echo "$as_me:19079: result: $cf_result" >&5
19080 echo "${ECHO_T}$cf_result" >&6
19081         if test "$cf_result" != no; then
19082                 cat >>confdefs.h <<EOF
19083 #define HAVE_${cf_tr_func} 1
19084 EOF
19085
19086         fi
19087 done
19088
19089 for cf_func in tputs
19090 do
19091
19092 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19093
19094         echo "$as_me:19094: checking for ${cf_func}" >&5
19095 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19096
19097 echo "${as_me:-configure}:19097: testing ${cf_func} ..." 1>&5
19098
19099         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19100   echo $ECHO_N "(cached) $ECHO_C" >&6
19101 else
19102
19103                 eval cf_result='$ac_cv_func_'$cf_func
19104                 if test ".$cf_result" != ".no"; then
19105                         cat >"conftest.$ac_ext" <<_ACEOF
19106 #line 19106 "configure"
19107 #include "confdefs.h"
19108
19109 #ifdef HAVE_XCURSES
19110 #include <xcurses.h>
19111 char * XCursesProgramName = "test";
19112 #else
19113 #include <${cf_cv_ncurses_header:-curses.h}>
19114 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19115 #include <ncursesw/term.h>
19116 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19117 #include <ncurses/term.h>
19118 #elif defined(HAVE_TERM_H)
19119 #include <term.h>
19120 #endif
19121 #endif
19122
19123 int
19124 main (void)
19125 {
19126
19127 #ifndef ${cf_func}
19128 long foo = (long)(&${cf_func});
19129 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19130 if (foo + 1234L > 5678L)
19131         ${cf_cv_main_return:-return}(foo != 0);
19132 #endif
19133
19134   ;
19135   return 0;
19136 }
19137 _ACEOF
19138 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19139 if { (eval echo "$as_me:19139: \"$ac_link\"") >&5
19140   (eval $ac_link) 2>&5
19141   ac_status=$?
19142   echo "$as_me:19142: \$? = $ac_status" >&5
19143   (exit "$ac_status"); } &&
19144          { ac_try='test -s "conftest$ac_exeext"'
19145   { (eval echo "$as_me:19145: \"$ac_try\"") >&5
19146   (eval $ac_try) 2>&5
19147   ac_status=$?
19148   echo "$as_me:19148: \$? = $ac_status" >&5
19149   (exit "$ac_status"); }; }; then
19150   cf_result=yes
19151 else
19152   echo "$as_me: failed program was:" >&5
19153 cat "conftest.$ac_ext" >&5
19154 cf_result=no
19155 fi
19156 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19157                 fi
19158                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19159
19160 fi
19161
19162         # use the computed/retrieved cache-value:
19163         eval 'cf_result=$cf_cv_func_'$cf_func
19164         echo "$as_me:19164: result: $cf_result" >&5
19165 echo "${ECHO_T}$cf_result" >&6
19166         if test "$cf_result" != no; then
19167                 cat >>confdefs.h <<EOF
19168 #define HAVE_${cf_tr_func} 1
19169 EOF
19170
19171         fi
19172 done
19173
19174 if test "x$cf_cv_func_tputs" = xyes
19175 then
19176         cf_done=no
19177         for cf_arg in int char
19178         do
19179                 for cf_ret in int void
19180                 do
19181                         if test "$cf_ret" = void
19182                         then
19183                                 cf_return="/* nothing */"
19184                         else
19185                                 cf_return="return value"
19186                         fi
19187                         cat >"conftest.$ac_ext" <<_ACEOF
19188 #line 19188 "configure"
19189 #include "confdefs.h"
19190
19191 #include <${cf_cv_ncurses_header:-curses.h}>
19192 #include <$cf_cv_term_header>
19193
19194 static $cf_ret outc($cf_arg value) { $cf_return; }
19195
19196 int
19197 main (void)
19198 {
19199
19200         tputs("hello", 0, outc);
19201         ${cf_cv_main_return:-return}(0);
19202
19203   ;
19204   return 0;
19205 }
19206 _ACEOF
19207 rm -f "conftest.$ac_objext"
19208 if { (eval echo "$as_me:19208: \"$ac_compile\"") >&5
19209   (eval $ac_compile) 2>&5
19210   ac_status=$?
19211   echo "$as_me:19211: \$? = $ac_status" >&5
19212   (exit "$ac_status"); } &&
19213          { ac_try='test -s "conftest.$ac_objext"'
19214   { (eval echo "$as_me:19214: \"$ac_try\"") >&5
19215   (eval $ac_try) 2>&5
19216   ac_status=$?
19217   echo "$as_me:19217: \$? = $ac_status" >&5
19218   (exit "$ac_status"); }; }; then
19219
19220                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
19221
19222 echo "${as_me:-configure}:19222: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
19223
19224                 cat >>confdefs.h <<EOF
19225 #define TPUTS_ARG               $cf_arg
19226 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
19227 #define TPUTS_RETURN(value)     $cf_return
19228 EOF
19229                 cf_done=yes
19230                 break
19231
19232 else
19233   echo "$as_me: failed program was:" >&5
19234 cat "conftest.$ac_ext" >&5
19235 fi
19236 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19237                 done
19238                 test "$cf_done" = yes && break
19239         done
19240 fi
19241
19242 echo "$as_me:19242: checking for ncurses extended functions" >&5
19243 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
19244 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
19245   echo $ECHO_N "(cached) $ECHO_C" >&6
19246 else
19247
19248 cat >"conftest.$ac_ext" <<_ACEOF
19249 #line 19249 "configure"
19250 #include "confdefs.h"
19251
19252 #include <${cf_cv_ncurses_header:-curses.h}>
19253 int
19254 main (void)
19255 {
19256
19257 int x = NCURSES_EXT_FUNCS
19258
19259   ;
19260   return 0;
19261 }
19262 _ACEOF
19263 rm -f "conftest.$ac_objext"
19264 if { (eval echo "$as_me:19264: \"$ac_compile\"") >&5
19265   (eval $ac_compile) 2>&5
19266   ac_status=$?
19267   echo "$as_me:19267: \$? = $ac_status" >&5
19268   (exit "$ac_status"); } &&
19269          { ac_try='test -s "conftest.$ac_objext"'
19270   { (eval echo "$as_me:19270: \"$ac_try\"") >&5
19271   (eval $ac_try) 2>&5
19272   ac_status=$?
19273   echo "$as_me:19273: \$? = $ac_status" >&5
19274   (exit "$ac_status"); }; }; then
19275   cf_cv_ncurses_ext_funcs=defined
19276 else
19277   echo "$as_me: failed program was:" >&5
19278 cat "conftest.$ac_ext" >&5
19279
19280 cat >"conftest.$ac_ext" <<_ACEOF
19281 #line 19281 "configure"
19282 #include "confdefs.h"
19283
19284 #include <${cf_cv_ncurses_header:-curses.h}>
19285 int
19286 main (void)
19287 {
19288
19289         (void) assume_default_colors (0, 0);
19290         (void) curses_version ();
19291         (void) define_key (0, 0);
19292         (void) is_term_resized (0, 0);
19293         (void) key_defined (0);
19294         (void) keybound (0, 0);
19295         (void) keyok (0, 0);
19296         (void) resize_term (0, 0);
19297         (void) resizeterm (0, 0);
19298         (void) use_default_colors ();
19299         (void) use_extended_names (0);
19300         (void) wresize (0, 0, 0);
19301   ;
19302   return 0;
19303 }
19304 _ACEOF
19305 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19306 if { (eval echo "$as_me:19306: \"$ac_link\"") >&5
19307   (eval $ac_link) 2>&5
19308   ac_status=$?
19309   echo "$as_me:19309: \$? = $ac_status" >&5
19310   (exit "$ac_status"); } &&
19311          { ac_try='test -s "conftest$ac_exeext"'
19312   { (eval echo "$as_me:19312: \"$ac_try\"") >&5
19313   (eval $ac_try) 2>&5
19314   ac_status=$?
19315   echo "$as_me:19315: \$? = $ac_status" >&5
19316   (exit "$ac_status"); }; }; then
19317   cf_cv_ncurses_ext_funcs=yes
19318 else
19319   echo "$as_me: failed program was:" >&5
19320 cat "conftest.$ac_ext" >&5
19321 cf_cv_ncurses_ext_funcs=no
19322 fi
19323 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19324
19325 fi
19326 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19327
19328 fi
19329 echo "$as_me:19329: result: $cf_cv_ncurses_ext_funcs" >&5
19330 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19331 test "$cf_cv_ncurses_ext_funcs" = yes &&
19332 cat >>confdefs.h <<\EOF
19333 #define NCURSES_EXT_FUNCS 1
19334 EOF
19335
19336 if test "$cf_enable_widec" = yes
19337 then
19338         # workaround for systems with ncurses before 20111029, due to change of
19339         # feature test macro from _XPG5 to _XOPEN_SOURCE
19340         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19341         then
19342                 cf_define_xpg5=no
19343                 echo "$as_me:19343: checking if _XPG5 should be defined to enable wide-characters" >&5
19344 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19345
19346                 cat >"conftest.$ac_ext" <<_ACEOF
19347 #line 19347 "configure"
19348 #include "confdefs.h"
19349
19350 #include <${cf_cv_ncurses_header:-curses.h}>
19351 int
19352 main (void)
19353 {
19354 int x = _XPG5
19355   ;
19356   return 0;
19357 }
19358 _ACEOF
19359 rm -f "conftest.$ac_objext"
19360 if { (eval echo "$as_me:19360: \"$ac_compile\"") >&5
19361   (eval $ac_compile) 2>&5
19362   ac_status=$?
19363   echo "$as_me:19363: \$? = $ac_status" >&5
19364   (exit "$ac_status"); } &&
19365          { ac_try='test -s "conftest.$ac_objext"'
19366   { (eval echo "$as_me:19366: \"$ac_try\"") >&5
19367   (eval $ac_try) 2>&5
19368   ac_status=$?
19369   echo "$as_me:19369: \$? = $ac_status" >&5
19370   (exit "$ac_status"); }; }; then
19371   :
19372 else
19373   echo "$as_me: failed program was:" >&5
19374 cat "conftest.$ac_ext" >&5
19375 cf_save_cppflags="$CPPFLAGS"
19376                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19377                          cat >"conftest.$ac_ext" <<_ACEOF
19378 #line 19378 "configure"
19379 #include "confdefs.h"
19380
19381 #include <${cf_cv_ncurses_header:-curses.h}>
19382 int
19383 main (void)
19384 {
19385 int x = _XPG5
19386   ;
19387   return 0;
19388 }
19389 _ACEOF
19390 rm -f "conftest.$ac_objext"
19391 if { (eval echo "$as_me:19391: \"$ac_compile\"") >&5
19392   (eval $ac_compile) 2>&5
19393   ac_status=$?
19394   echo "$as_me:19394: \$? = $ac_status" >&5
19395   (exit "$ac_status"); } &&
19396          { ac_try='test -s "conftest.$ac_objext"'
19397   { (eval echo "$as_me:19397: \"$ac_try\"") >&5
19398   (eval $ac_try) 2>&5
19399   ac_status=$?
19400   echo "$as_me:19400: \$? = $ac_status" >&5
19401   (exit "$ac_status"); }; }; then
19402   cf_define_xpg5=yes
19403 else
19404   echo "$as_me: failed program was:" >&5
19405 cat "conftest.$ac_ext" >&5
19406 fi
19407 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19408                          CPPFLAGS="$cf_save_cppflags"
19409 fi
19410 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19411                 echo "$as_me:19411: result: $cf_define_xpg5" >&5
19412 echo "${ECHO_T}$cf_define_xpg5" >&6
19413
19414                 if test "$cf_define_xpg5" = yes
19415                 then
19416                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19417                 fi
19418         fi
19419
19420         echo "$as_me:19420: checking for wide-character functions" >&5
19421 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19422 if test "${cf_cv_widechar_funcs+set}" = set; then
19423   echo $ECHO_N "(cached) $ECHO_C" >&6
19424 else
19425
19426         cat >"conftest.$ac_ext" <<_ACEOF
19427 #line 19427 "configure"
19428 #include "confdefs.h"
19429
19430 #include <${cf_cv_ncurses_header:-curses.h}>
19431 int
19432 main (void)
19433 {
19434
19435                 static wchar_t src_wchar[2];
19436                 static cchar_t dst_cchar;
19437                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19438
19439   ;
19440   return 0;
19441 }
19442 _ACEOF
19443 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19444 if { (eval echo "$as_me:19444: \"$ac_link\"") >&5
19445   (eval $ac_link) 2>&5
19446   ac_status=$?
19447   echo "$as_me:19447: \$? = $ac_status" >&5
19448   (exit "$ac_status"); } &&
19449          { ac_try='test -s "conftest$ac_exeext"'
19450   { (eval echo "$as_me:19450: \"$ac_try\"") >&5
19451   (eval $ac_try) 2>&5
19452   ac_status=$?
19453   echo "$as_me:19453: \$? = $ac_status" >&5
19454   (exit "$ac_status"); }; }; then
19455   cf_cv_widechar_funcs=yes
19456 else
19457   echo "$as_me: failed program was:" >&5
19458 cat "conftest.$ac_ext" >&5
19459 cf_cv_widechar_funcs=no
19460 fi
19461 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19462
19463 fi
19464 echo "$as_me:19464: result: $cf_cv_widechar_funcs" >&5
19465 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19466         if test "$cf_cv_widechar_funcs" != no ; then
19467
19468 cat >>confdefs.h <<\EOF
19469 #define USE_WIDEC_SUPPORT 1
19470 EOF
19471
19472         else
19473                 cat >>confdefs.h <<\EOF
19474 #define USE_WIDEC_SUPPORT 0
19475 EOF
19476
19477         fi
19478 else
19479         cat >>confdefs.h <<\EOF
19480 #define USE_WIDEC_SUPPORT 0
19481 EOF
19482
19483 fi
19484
19485 echo "$as_me:19485: checking if $cf_cv_screen library uses pthreads" >&5
19486 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19487 if test "${cf_cv_use_pthreads+set}" = set; then
19488   echo $ECHO_N "(cached) $ECHO_C" >&6
19489 else
19490
19491 cat >"conftest.$ac_ext" <<_ACEOF
19492 #line 19492 "configure"
19493 #include "confdefs.h"
19494
19495 #include <${cf_cv_ncurses_header:-curses.h}>
19496 extern void _nc_init_pthreads(void);
19497
19498 int
19499 main (void)
19500 {
19501
19502         initscr();
19503         _nc_init_pthreads();
19504
19505   ;
19506   return 0;
19507 }
19508 _ACEOF
19509 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19510 if { (eval echo "$as_me:19510: \"$ac_link\"") >&5
19511   (eval $ac_link) 2>&5
19512   ac_status=$?
19513   echo "$as_me:19513: \$? = $ac_status" >&5
19514   (exit "$ac_status"); } &&
19515          { ac_try='test -s "conftest$ac_exeext"'
19516   { (eval echo "$as_me:19516: \"$ac_try\"") >&5
19517   (eval $ac_try) 2>&5
19518   ac_status=$?
19519   echo "$as_me:19519: \$? = $ac_status" >&5
19520   (exit "$ac_status"); }; }; then
19521   cf_cv_use_pthreads=yes
19522 else
19523   echo "$as_me: failed program was:" >&5
19524 cat "conftest.$ac_ext" >&5
19525 cf_cv_use_pthreads=no
19526 fi
19527 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19528
19529 fi
19530 echo "$as_me:19530: result: $cf_cv_use_pthreads" >&5
19531 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19532 test $cf_cv_use_pthreads = yes &&
19533 cat >>confdefs.h <<\EOF
19534 #define USE_PTHREADS 1
19535 EOF
19536
19537 echo "$as_me:19537: checking if sys/time.h works with sys/select.h" >&5
19538 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19539 if test "${cf_cv_sys_time_select+set}" = set; then
19540   echo $ECHO_N "(cached) $ECHO_C" >&6
19541 else
19542
19543 cat >"conftest.$ac_ext" <<_ACEOF
19544 #line 19544 "configure"
19545 #include "confdefs.h"
19546
19547 #include <sys/types.h>
19548 #ifdef HAVE_SYS_TIME_H
19549 #include <sys/time.h>
19550 #endif
19551 #ifdef HAVE_SYS_SELECT_H
19552 #include <sys/select.h>
19553 #endif
19554
19555 int
19556 main (void)
19557 {
19558
19559   ;
19560   return 0;
19561 }
19562 _ACEOF
19563 rm -f "conftest.$ac_objext"
19564 if { (eval echo "$as_me:19564: \"$ac_compile\"") >&5
19565   (eval $ac_compile) 2>&5
19566   ac_status=$?
19567   echo "$as_me:19567: \$? = $ac_status" >&5
19568   (exit "$ac_status"); } &&
19569          { ac_try='test -s "conftest.$ac_objext"'
19570   { (eval echo "$as_me:19570: \"$ac_try\"") >&5
19571   (eval $ac_try) 2>&5
19572   ac_status=$?
19573   echo "$as_me:19573: \$? = $ac_status" >&5
19574   (exit "$ac_status"); }; }; then
19575   cf_cv_sys_time_select=yes
19576 else
19577   echo "$as_me: failed program was:" >&5
19578 cat "conftest.$ac_ext" >&5
19579 cf_cv_sys_time_select=no
19580 fi
19581 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19582
19583 fi
19584
19585 echo "$as_me:19585: result: $cf_cv_sys_time_select" >&5
19586 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19587 test "$cf_cv_sys_time_select" = yes &&
19588 cat >>confdefs.h <<\EOF
19589 #define HAVE_SYS_TIME_SELECT 1
19590 EOF
19591
19592 # special check for test/ditto.c
19593
19594 echo "$as_me:19594: checking for openpty in -lutil" >&5
19595 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19596 if test "${ac_cv_lib_util_openpty+set}" = set; then
19597   echo $ECHO_N "(cached) $ECHO_C" >&6
19598 else
19599   ac_check_lib_save_LIBS=$LIBS
19600 LIBS="-lutil  $LIBS"
19601 cat >"conftest.$ac_ext" <<_ACEOF
19602 #line 19602 "configure"
19603 #include "confdefs.h"
19604
19605 /* Override any gcc2 internal prototype to avoid an error.  */
19606 #ifdef __cplusplus
19607 extern "C"
19608 #endif
19609 /* We use char because int might match the return type of a gcc2
19610    builtin and then its argument prototype would still apply.  */
19611 char openpty ();
19612 int
19613 main (void)
19614 {
19615 openpty ();
19616   ;
19617   return 0;
19618 }
19619 _ACEOF
19620 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19621 if { (eval echo "$as_me:19621: \"$ac_link\"") >&5
19622   (eval $ac_link) 2>&5
19623   ac_status=$?
19624   echo "$as_me:19624: \$? = $ac_status" >&5
19625   (exit "$ac_status"); } &&
19626          { ac_try='test -s "conftest$ac_exeext"'
19627   { (eval echo "$as_me:19627: \"$ac_try\"") >&5
19628   (eval $ac_try) 2>&5
19629   ac_status=$?
19630   echo "$as_me:19630: \$? = $ac_status" >&5
19631   (exit "$ac_status"); }; }; then
19632   ac_cv_lib_util_openpty=yes
19633 else
19634   echo "$as_me: failed program was:" >&5
19635 cat "conftest.$ac_ext" >&5
19636 ac_cv_lib_util_openpty=no
19637 fi
19638 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19639 LIBS=$ac_check_lib_save_LIBS
19640 fi
19641 echo "$as_me:19641: result: $ac_cv_lib_util_openpty" >&5
19642 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19643 if test "$ac_cv_lib_util_openpty" = yes; then
19644   cf_cv_lib_util=yes
19645 else
19646   cf_cv_lib_util=no
19647 fi
19648
19649 echo "$as_me:19649: checking for openpty header" >&5
19650 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19651 if test "${cf_cv_func_openpty+set}" = set; then
19652   echo $ECHO_N "(cached) $ECHO_C" >&6
19653 else
19654
19655         cf_save_LIBS="$LIBS"
19656         test "$cf_cv_lib_util" = yes && {
19657 cf_add_libs="$LIBS"
19658 # reverse order
19659 cf_add_0lib=
19660 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19661 # filter duplicates
19662 for cf_add_1lib in $cf_add_0lib; do
19663         for cf_add_2lib in $cf_add_libs; do
19664                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19665                         cf_add_1lib=
19666                         break
19667                 fi
19668         done
19669         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19670 done
19671 LIBS="$cf_add_libs"
19672  }
19673         for cf_header in pty.h libutil.h util.h
19674         do
19675         cat >"conftest.$ac_ext" <<_ACEOF
19676 #line 19676 "configure"
19677 #include "confdefs.h"
19678
19679 #include <$cf_header>
19680
19681 int
19682 main (void)
19683 {
19684
19685         int x = openpty((int *)0, (int *)0, (char *)0,
19686                                    (struct termios *)0, (struct winsize *)0);
19687
19688   ;
19689   return 0;
19690 }
19691 _ACEOF
19692 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19693 if { (eval echo "$as_me:19693: \"$ac_link\"") >&5
19694   (eval $ac_link) 2>&5
19695   ac_status=$?
19696   echo "$as_me:19696: \$? = $ac_status" >&5
19697   (exit "$ac_status"); } &&
19698          { ac_try='test -s "conftest$ac_exeext"'
19699   { (eval echo "$as_me:19699: \"$ac_try\"") >&5
19700   (eval $ac_try) 2>&5
19701   ac_status=$?
19702   echo "$as_me:19702: \$? = $ac_status" >&5
19703   (exit "$ac_status"); }; }; then
19704
19705                 cf_cv_func_openpty=$cf_header
19706                 break
19707
19708 else
19709   echo "$as_me: failed program was:" >&5
19710 cat "conftest.$ac_ext" >&5
19711
19712                 cf_cv_func_openpty=no
19713
19714 fi
19715 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19716         done
19717         LIBS="$cf_save_LIBS"
19718
19719 fi
19720 echo "$as_me:19720: result: $cf_cv_func_openpty" >&5
19721 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19722
19723 if test "$cf_cv_func_openpty" != no ; then
19724
19725 cat >>confdefs.h <<EOF
19726 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19727 EOF
19728
19729 cat >>confdefs.h <<\EOF
19730 #define USE_XTERM_PTY 1
19731 EOF
19732
19733         if test "x$cf_cv_lib_util" = xyes ; then
19734
19735 cf_add_libs="$TEST_LIBS"
19736 # reverse order
19737 cf_add_0lib=
19738 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19739 # filter duplicates
19740 for cf_add_1lib in $cf_add_0lib; do
19741         for cf_add_2lib in $cf_add_libs; do
19742                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19743                         cf_add_1lib=
19744                         break
19745                 fi
19746         done
19747         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19748 done
19749 TEST_LIBS="$cf_add_libs"
19750
19751         fi
19752 fi
19753
19754 echo "$as_me:19754: checking for function curses_version" >&5
19755 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19756 if test "${cf_cv_func_curses_version+set}" = set; then
19757   echo $ECHO_N "(cached) $ECHO_C" >&6
19758 else
19759
19760 if test "$cross_compiling" = yes; then
19761   cf_cv_func_curses_version=unknown
19762 else
19763   cat >"conftest.$ac_ext" <<_ACEOF
19764 #line 19764 "configure"
19765 #include "confdefs.h"
19766
19767 #include <${cf_cv_ncurses_header:-curses.h}>
19768 int main(void)
19769 {
19770         char temp[1024];
19771         sprintf(temp, "%s\\n", curses_version());
19772         ${cf_cv_main_return:-return}(0);
19773 }
19774
19775 _ACEOF
19776 rm -f "conftest$ac_exeext"
19777 if { (eval echo "$as_me:19777: \"$ac_link\"") >&5
19778   (eval $ac_link) 2>&5
19779   ac_status=$?
19780   echo "$as_me:19780: \$? = $ac_status" >&5
19781   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19782   { (eval echo "$as_me:19782: \"$ac_try\"") >&5
19783   (eval $ac_try) 2>&5
19784   ac_status=$?
19785   echo "$as_me:19785: \$? = $ac_status" >&5
19786   (exit "$ac_status"); }; }; then
19787   cf_cv_func_curses_version=yes
19788
19789 else
19790   echo "$as_me: program exited with status $ac_status" >&5
19791 echo "$as_me: failed program was:" >&5
19792 cat "conftest.$ac_ext" >&5
19793 cf_cv_func_curses_version=no
19794
19795 fi
19796 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19797 fi
19798 rm -f core
19799 fi
19800 echo "$as_me:19800: result: $cf_cv_func_curses_version" >&5
19801 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19802 test "$cf_cv_func_curses_version" = yes &&
19803 cat >>confdefs.h <<\EOF
19804 #define HAVE_CURSES_VERSION 1
19805 EOF
19806
19807 echo "$as_me:19807: checking for alternate character set array" >&5
19808 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19809 if test "${cf_cv_curses_acs_map+set}" = set; then
19810   echo $ECHO_N "(cached) $ECHO_C" >&6
19811 else
19812
19813 cf_cv_curses_acs_map=unknown
19814 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19815 do
19816 cat >"conftest.$ac_ext" <<_ACEOF
19817 #line 19817 "configure"
19818 #include "confdefs.h"
19819
19820 #include <${cf_cv_ncurses_header:-curses.h}>
19821
19822 int
19823 main (void)
19824 {
19825
19826 ${name}['k'] = ACS_PLUS
19827
19828   ;
19829   return 0;
19830 }
19831 _ACEOF
19832 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19833 if { (eval echo "$as_me:19833: \"$ac_link\"") >&5
19834   (eval $ac_link) 2>&5
19835   ac_status=$?
19836   echo "$as_me:19836: \$? = $ac_status" >&5
19837   (exit "$ac_status"); } &&
19838          { ac_try='test -s "conftest$ac_exeext"'
19839   { (eval echo "$as_me:19839: \"$ac_try\"") >&5
19840   (eval $ac_try) 2>&5
19841   ac_status=$?
19842   echo "$as_me:19842: \$? = $ac_status" >&5
19843   (exit "$ac_status"); }; }; then
19844   cf_cv_curses_acs_map=$name; break
19845 else
19846   echo "$as_me: failed program was:" >&5
19847 cat "conftest.$ac_ext" >&5
19848 fi
19849 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19850 done
19851
19852 fi
19853 echo "$as_me:19853: result: $cf_cv_curses_acs_map" >&5
19854 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19855
19856 test "$cf_cv_curses_acs_map" != unknown &&
19857 cat >>confdefs.h <<EOF
19858 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19859 EOF
19860
19861 if test "$cf_enable_widec" = yes; then
19862
19863 echo "$as_me:19863: checking for wide alternate character set array" >&5
19864 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19865 if test "${cf_cv_curses_wacs_map+set}" = set; then
19866   echo $ECHO_N "(cached) $ECHO_C" >&6
19867 else
19868
19869         cf_cv_curses_wacs_map=unknown
19870         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19871         do
19872         cat >"conftest.$ac_ext" <<_ACEOF
19873 #line 19873 "configure"
19874 #include "confdefs.h"
19875
19876 #ifndef _XOPEN_SOURCE_EXTENDED
19877 #define _XOPEN_SOURCE_EXTENDED
19878 #endif
19879 #include <${cf_cv_ncurses_header:-curses.h}>
19880 int
19881 main (void)
19882 {
19883 void *foo = &(${name}['k']); (void)foo
19884   ;
19885   return 0;
19886 }
19887 _ACEOF
19888 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19889 if { (eval echo "$as_me:19889: \"$ac_link\"") >&5
19890   (eval $ac_link) 2>&5
19891   ac_status=$?
19892   echo "$as_me:19892: \$? = $ac_status" >&5
19893   (exit "$ac_status"); } &&
19894          { ac_try='test -s "conftest$ac_exeext"'
19895   { (eval echo "$as_me:19895: \"$ac_try\"") >&5
19896   (eval $ac_try) 2>&5
19897   ac_status=$?
19898   echo "$as_me:19898: \$? = $ac_status" >&5
19899   (exit "$ac_status"); }; }; then
19900   cf_cv_curses_wacs_map=$name
19901          break
19902 else
19903   echo "$as_me: failed program was:" >&5
19904 cat "conftest.$ac_ext" >&5
19905 fi
19906 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19907         done
19908 fi
19909 echo "$as_me:19909: result: $cf_cv_curses_wacs_map" >&5
19910 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19911
19912 test "$cf_cv_curses_wacs_map" != unknown &&
19913 cat >>confdefs.h <<EOF
19914 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19915 EOF
19916
19917 echo "$as_me:19917: checking for wide alternate character constants" >&5
19918 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19919 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19920   echo $ECHO_N "(cached) $ECHO_C" >&6
19921 else
19922
19923 cf_cv_curses_wacs_symbols=no
19924 if test "$cf_cv_curses_wacs_map" != unknown
19925 then
19926         cat >"conftest.$ac_ext" <<_ACEOF
19927 #line 19927 "configure"
19928 #include "confdefs.h"
19929
19930 #ifndef _XOPEN_SOURCE_EXTENDED
19931 #define _XOPEN_SOURCE_EXTENDED
19932 #endif
19933 #include <${cf_cv_ncurses_header:-curses.h}>
19934 int
19935 main (void)
19936 {
19937 cchar_t *foo = WACS_PLUS;
19938          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
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_curses_wacs_symbols=yes
19956 else
19957   echo "$as_me: failed program was:" >&5
19958 cat "conftest.$ac_ext" >&5
19959 fi
19960 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19961 else
19962         cat >"conftest.$ac_ext" <<_ACEOF
19963 #line 19963 "configure"
19964 #include "confdefs.h"
19965
19966 #ifndef _XOPEN_SOURCE_EXTENDED
19967 #define _XOPEN_SOURCE_EXTENDED
19968 #endif
19969 #include <${cf_cv_ncurses_header:-curses.h}>
19970 int
19971 main (void)
19972 {
19973 cchar_t *foo = WACS_PLUS; (void)foo
19974   ;
19975   return 0;
19976 }
19977 _ACEOF
19978 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19979 if { (eval echo "$as_me:19979: \"$ac_link\"") >&5
19980   (eval $ac_link) 2>&5
19981   ac_status=$?
19982   echo "$as_me:19982: \$? = $ac_status" >&5
19983   (exit "$ac_status"); } &&
19984          { ac_try='test -s "conftest$ac_exeext"'
19985   { (eval echo "$as_me:19985: \"$ac_try\"") >&5
19986   (eval $ac_try) 2>&5
19987   ac_status=$?
19988   echo "$as_me:19988: \$? = $ac_status" >&5
19989   (exit "$ac_status"); }; }; then
19990   cf_cv_curses_wacs_symbols=yes
19991 else
19992   echo "$as_me: failed program was:" >&5
19993 cat "conftest.$ac_ext" >&5
19994 fi
19995 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19996 fi
19997
19998 fi
19999 echo "$as_me:19999: result: $cf_cv_curses_wacs_symbols" >&5
20000 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
20001
20002 test "$cf_cv_curses_wacs_symbols" != no &&
20003 cat >>confdefs.h <<\EOF
20004 #define CURSES_WACS_SYMBOLS 1
20005 EOF
20006
20007 fi
20008
20009 echo "$as_me:20009: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20010 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20011 cat >"conftest.$ac_ext" <<_ACEOF
20012 #line 20012 "configure"
20013 #include "confdefs.h"
20014
20015 #ifndef _XOPEN_SOURCE_EXTENDED
20016 #define _XOPEN_SOURCE_EXTENDED
20017 #endif
20018 #include <${cf_cv_ncurses_header:-curses.h}>
20019 int
20020 main (void)
20021 {
20022
20023 attr_t foo
20024
20025   ;
20026   return 0;
20027 }
20028 _ACEOF
20029 rm -f "conftest.$ac_objext"
20030 if { (eval echo "$as_me:20030: \"$ac_compile\"") >&5
20031   (eval $ac_compile) 2>&5
20032   ac_status=$?
20033   echo "$as_me:20033: \$? = $ac_status" >&5
20034   (exit "$ac_status"); } &&
20035          { ac_try='test -s "conftest.$ac_objext"'
20036   { (eval echo "$as_me:20036: \"$ac_try\"") >&5
20037   (eval $ac_try) 2>&5
20038   ac_status=$?
20039   echo "$as_me:20039: \$? = $ac_status" >&5
20040   (exit "$ac_status"); }; }; then
20041   cf_result=yes
20042 else
20043   echo "$as_me: failed program was:" >&5
20044 cat "conftest.$ac_ext" >&5
20045 cf_result=no
20046 fi
20047 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20048 echo "$as_me:20048: result: $cf_result" >&5
20049 echo "${ECHO_T}$cf_result" >&6
20050 if test "$cf_result" = yes ; then
20051
20052 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20053
20054 cat >>confdefs.h <<EOF
20055 #define $cf_result 1
20056 EOF
20057
20058 else
20059
20060 cat >>confdefs.h <<EOF
20061 #define attr_t long
20062 EOF
20063
20064 fi
20065
20066 if test "$cf_enable_widec" = yes; then
20067
20068 # This is needed on Tru64 5.0 to declare mbstate_t
20069 echo "$as_me:20069: checking if we must include wchar.h to declare mbstate_t" >&5
20070 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
20071 if test "${cf_cv_mbstate_t+set}" = set; then
20072   echo $ECHO_N "(cached) $ECHO_C" >&6
20073 else
20074
20075 cat >"conftest.$ac_ext" <<_ACEOF
20076 #line 20076 "configure"
20077 #include "confdefs.h"
20078
20079 #include <stdlib.h>
20080 #include <stdarg.h>
20081 #include <stdio.h>
20082 #ifdef HAVE_LIBUTF8_H
20083 #include <libutf8.h>
20084 #endif
20085 int
20086 main (void)
20087 {
20088 mbstate_t state
20089   ;
20090   return 0;
20091 }
20092 _ACEOF
20093 rm -f "conftest.$ac_objext"
20094 if { (eval echo "$as_me:20094: \"$ac_compile\"") >&5
20095   (eval $ac_compile) 2>&5
20096   ac_status=$?
20097   echo "$as_me:20097: \$? = $ac_status" >&5
20098   (exit "$ac_status"); } &&
20099          { ac_try='test -s "conftest.$ac_objext"'
20100   { (eval echo "$as_me:20100: \"$ac_try\"") >&5
20101   (eval $ac_try) 2>&5
20102   ac_status=$?
20103   echo "$as_me:20103: \$? = $ac_status" >&5
20104   (exit "$ac_status"); }; }; then
20105   cf_cv_mbstate_t=no
20106 else
20107   echo "$as_me: failed program was:" >&5
20108 cat "conftest.$ac_ext" >&5
20109 cat >"conftest.$ac_ext" <<_ACEOF
20110 #line 20110 "configure"
20111 #include "confdefs.h"
20112
20113 #include <stdlib.h>
20114 #include <stdarg.h>
20115 #include <stdio.h>
20116 #include <wchar.h>
20117 #ifdef HAVE_LIBUTF8_H
20118 #include <libutf8.h>
20119 #endif
20120 int
20121 main (void)
20122 {
20123 mbstate_t value
20124   ;
20125   return 0;
20126 }
20127 _ACEOF
20128 rm -f "conftest.$ac_objext"
20129 if { (eval echo "$as_me:20129: \"$ac_compile\"") >&5
20130   (eval $ac_compile) 2>&5
20131   ac_status=$?
20132   echo "$as_me:20132: \$? = $ac_status" >&5
20133   (exit "$ac_status"); } &&
20134          { ac_try='test -s "conftest.$ac_objext"'
20135   { (eval echo "$as_me:20135: \"$ac_try\"") >&5
20136   (eval $ac_try) 2>&5
20137   ac_status=$?
20138   echo "$as_me:20138: \$? = $ac_status" >&5
20139   (exit "$ac_status"); }; }; then
20140   cf_cv_mbstate_t=yes
20141 else
20142   echo "$as_me: failed program was:" >&5
20143 cat "conftest.$ac_ext" >&5
20144 cf_cv_mbstate_t=unknown
20145 fi
20146 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20147 fi
20148 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20149 fi
20150 echo "$as_me:20150: result: $cf_cv_mbstate_t" >&5
20151 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
20152
20153 if test "$cf_cv_mbstate_t" = yes ; then
20154
20155 cat >>confdefs.h <<\EOF
20156 #define NEED_WCHAR_H 1
20157 EOF
20158
20159         NEED_WCHAR_H=1
20160 fi
20161
20162 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
20163 if test "$cf_cv_mbstate_t" = unknown ; then
20164         NCURSES_MBSTATE_T=1
20165 fi
20166
20167 # if we find mbstate_t in either place, use substitution to provide a fallback.
20168 if test "$cf_cv_mbstate_t" != unknown ; then
20169         NCURSES_OK_MBSTATE_T=1
20170 fi
20171
20172 # This is needed on Tru64 5.0 to declare wchar_t
20173 echo "$as_me:20173: checking if we must include wchar.h to declare wchar_t" >&5
20174 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
20175 if test "${cf_cv_wchar_t+set}" = set; then
20176   echo $ECHO_N "(cached) $ECHO_C" >&6
20177 else
20178
20179 cat >"conftest.$ac_ext" <<_ACEOF
20180 #line 20180 "configure"
20181 #include "confdefs.h"
20182
20183 #include <stdlib.h>
20184 #include <stdarg.h>
20185 #include <stdio.h>
20186 #ifdef HAVE_LIBUTF8_H
20187 #include <libutf8.h>
20188 #endif
20189 int
20190 main (void)
20191 {
20192 wchar_t state
20193   ;
20194   return 0;
20195 }
20196 _ACEOF
20197 rm -f "conftest.$ac_objext"
20198 if { (eval echo "$as_me:20198: \"$ac_compile\"") >&5
20199   (eval $ac_compile) 2>&5
20200   ac_status=$?
20201   echo "$as_me:20201: \$? = $ac_status" >&5
20202   (exit "$ac_status"); } &&
20203          { ac_try='test -s "conftest.$ac_objext"'
20204   { (eval echo "$as_me:20204: \"$ac_try\"") >&5
20205   (eval $ac_try) 2>&5
20206   ac_status=$?
20207   echo "$as_me:20207: \$? = $ac_status" >&5
20208   (exit "$ac_status"); }; }; then
20209   cf_cv_wchar_t=no
20210 else
20211   echo "$as_me: failed program was:" >&5
20212 cat "conftest.$ac_ext" >&5
20213 cat >"conftest.$ac_ext" <<_ACEOF
20214 #line 20214 "configure"
20215 #include "confdefs.h"
20216
20217 #include <stdlib.h>
20218 #include <stdarg.h>
20219 #include <stdio.h>
20220 #include <wchar.h>
20221 #ifdef HAVE_LIBUTF8_H
20222 #include <libutf8.h>
20223 #endif
20224 int
20225 main (void)
20226 {
20227 wchar_t value
20228   ;
20229   return 0;
20230 }
20231 _ACEOF
20232 rm -f "conftest.$ac_objext"
20233 if { (eval echo "$as_me:20233: \"$ac_compile\"") >&5
20234   (eval $ac_compile) 2>&5
20235   ac_status=$?
20236   echo "$as_me:20236: \$? = $ac_status" >&5
20237   (exit "$ac_status"); } &&
20238          { ac_try='test -s "conftest.$ac_objext"'
20239   { (eval echo "$as_me:20239: \"$ac_try\"") >&5
20240   (eval $ac_try) 2>&5
20241   ac_status=$?
20242   echo "$as_me:20242: \$? = $ac_status" >&5
20243   (exit "$ac_status"); }; }; then
20244   cf_cv_wchar_t=yes
20245 else
20246   echo "$as_me: failed program was:" >&5
20247 cat "conftest.$ac_ext" >&5
20248 cf_cv_wchar_t=unknown
20249 fi
20250 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20251 fi
20252 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20253 fi
20254 echo "$as_me:20254: result: $cf_cv_wchar_t" >&5
20255 echo "${ECHO_T}$cf_cv_wchar_t" >&6
20256
20257 if test "$cf_cv_wchar_t" = yes ; then
20258
20259 cat >>confdefs.h <<\EOF
20260 #define NEED_WCHAR_H 1
20261 EOF
20262
20263         NEED_WCHAR_H=1
20264 fi
20265
20266 # if we do not find wchar_t in either place, use substitution to provide a fallback.
20267 if test "$cf_cv_wchar_t" = unknown ; then
20268         NCURSES_WCHAR_T=1
20269 fi
20270
20271 # if we find wchar_t in either place, use substitution to provide a fallback.
20272 if test "$cf_cv_wchar_t" != unknown ; then
20273         NCURSES_OK_WCHAR_T=1
20274 fi
20275
20276 # This is needed on Tru64 5.0 to declare wint_t
20277 echo "$as_me:20277: checking if we must include wchar.h to declare wint_t" >&5
20278 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
20279 if test "${cf_cv_wint_t+set}" = set; then
20280   echo $ECHO_N "(cached) $ECHO_C" >&6
20281 else
20282
20283 cat >"conftest.$ac_ext" <<_ACEOF
20284 #line 20284 "configure"
20285 #include "confdefs.h"
20286
20287 #include <stdlib.h>
20288 #include <stdarg.h>
20289 #include <stdio.h>
20290 #ifdef HAVE_LIBUTF8_H
20291 #include <libutf8.h>
20292 #endif
20293 int
20294 main (void)
20295 {
20296 wint_t state
20297   ;
20298   return 0;
20299 }
20300 _ACEOF
20301 rm -f "conftest.$ac_objext"
20302 if { (eval echo "$as_me:20302: \"$ac_compile\"") >&5
20303   (eval $ac_compile) 2>&5
20304   ac_status=$?
20305   echo "$as_me:20305: \$? = $ac_status" >&5
20306   (exit "$ac_status"); } &&
20307          { ac_try='test -s "conftest.$ac_objext"'
20308   { (eval echo "$as_me:20308: \"$ac_try\"") >&5
20309   (eval $ac_try) 2>&5
20310   ac_status=$?
20311   echo "$as_me:20311: \$? = $ac_status" >&5
20312   (exit "$ac_status"); }; }; then
20313   cf_cv_wint_t=no
20314 else
20315   echo "$as_me: failed program was:" >&5
20316 cat "conftest.$ac_ext" >&5
20317 cat >"conftest.$ac_ext" <<_ACEOF
20318 #line 20318 "configure"
20319 #include "confdefs.h"
20320
20321 #include <stdlib.h>
20322 #include <stdarg.h>
20323 #include <stdio.h>
20324 #include <wchar.h>
20325 #ifdef HAVE_LIBUTF8_H
20326 #include <libutf8.h>
20327 #endif
20328 int
20329 main (void)
20330 {
20331 wint_t value
20332   ;
20333   return 0;
20334 }
20335 _ACEOF
20336 rm -f "conftest.$ac_objext"
20337 if { (eval echo "$as_me:20337: \"$ac_compile\"") >&5
20338   (eval $ac_compile) 2>&5
20339   ac_status=$?
20340   echo "$as_me:20340: \$? = $ac_status" >&5
20341   (exit "$ac_status"); } &&
20342          { ac_try='test -s "conftest.$ac_objext"'
20343   { (eval echo "$as_me:20343: \"$ac_try\"") >&5
20344   (eval $ac_try) 2>&5
20345   ac_status=$?
20346   echo "$as_me:20346: \$? = $ac_status" >&5
20347   (exit "$ac_status"); }; }; then
20348   cf_cv_wint_t=yes
20349 else
20350   echo "$as_me: failed program was:" >&5
20351 cat "conftest.$ac_ext" >&5
20352 cf_cv_wint_t=unknown
20353 fi
20354 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20355 fi
20356 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20357 fi
20358 echo "$as_me:20358: result: $cf_cv_wint_t" >&5
20359 echo "${ECHO_T}$cf_cv_wint_t" >&6
20360
20361 if test "$cf_cv_wint_t" = yes ; then
20362
20363 cat >>confdefs.h <<\EOF
20364 #define NEED_WCHAR_H 1
20365 EOF
20366
20367         NEED_WCHAR_H=1
20368 fi
20369
20370 # if we do not find wint_t in either place, use substitution to provide a fallback.
20371 if test "$cf_cv_wint_t" = unknown ; then
20372         NCURSES_WINT_T=1
20373 fi
20374
20375 # if we find wint_t in either place, use substitution to provide a fallback.
20376 if test "$cf_cv_wint_t" != unknown ; then
20377         NCURSES_OK_WINT_T=1
20378 fi
20379
20380         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20381
20382 echo "$as_me:20382: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20383 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20384 cat >"conftest.$ac_ext" <<_ACEOF
20385 #line 20385 "configure"
20386 #include "confdefs.h"
20387
20388 #ifndef _XOPEN_SOURCE_EXTENDED
20389 #define _XOPEN_SOURCE_EXTENDED
20390 #endif
20391 #include <${cf_cv_ncurses_header:-curses.h}>
20392 int
20393 main (void)
20394 {
20395
20396 mbstate_t foo
20397
20398   ;
20399   return 0;
20400 }
20401 _ACEOF
20402 rm -f "conftest.$ac_objext"
20403 if { (eval echo "$as_me:20403: \"$ac_compile\"") >&5
20404   (eval $ac_compile) 2>&5
20405   ac_status=$?
20406   echo "$as_me:20406: \$? = $ac_status" >&5
20407   (exit "$ac_status"); } &&
20408          { ac_try='test -s "conftest.$ac_objext"'
20409   { (eval echo "$as_me:20409: \"$ac_try\"") >&5
20410   (eval $ac_try) 2>&5
20411   ac_status=$?
20412   echo "$as_me:20412: \$? = $ac_status" >&5
20413   (exit "$ac_status"); }; }; then
20414   cf_result=yes
20415 else
20416   echo "$as_me: failed program was:" >&5
20417 cat "conftest.$ac_ext" >&5
20418 cf_result=no
20419 fi
20420 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20421 echo "$as_me:20421: result: $cf_result" >&5
20422 echo "${ECHO_T}$cf_result" >&6
20423 if test "$cf_result" = yes ; then
20424
20425 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20426
20427 cat >>confdefs.h <<EOF
20428 #define $cf_result 1
20429 EOF
20430
20431 else
20432
20433 cat >>confdefs.h <<EOF
20434 #define mbstate_t long
20435 EOF
20436
20437 fi
20438
20439         fi
20440
20441         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20442
20443 echo "$as_me:20443: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20444 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20445 cat >"conftest.$ac_ext" <<_ACEOF
20446 #line 20446 "configure"
20447 #include "confdefs.h"
20448
20449 #ifndef _XOPEN_SOURCE_EXTENDED
20450 #define _XOPEN_SOURCE_EXTENDED
20451 #endif
20452 #include <${cf_cv_ncurses_header:-curses.h}>
20453 int
20454 main (void)
20455 {
20456
20457 wchar_t foo
20458
20459   ;
20460   return 0;
20461 }
20462 _ACEOF
20463 rm -f "conftest.$ac_objext"
20464 if { (eval echo "$as_me:20464: \"$ac_compile\"") >&5
20465   (eval $ac_compile) 2>&5
20466   ac_status=$?
20467   echo "$as_me:20467: \$? = $ac_status" >&5
20468   (exit "$ac_status"); } &&
20469          { ac_try='test -s "conftest.$ac_objext"'
20470   { (eval echo "$as_me:20470: \"$ac_try\"") >&5
20471   (eval $ac_try) 2>&5
20472   ac_status=$?
20473   echo "$as_me:20473: \$? = $ac_status" >&5
20474   (exit "$ac_status"); }; }; then
20475   cf_result=yes
20476 else
20477   echo "$as_me: failed program was:" >&5
20478 cat "conftest.$ac_ext" >&5
20479 cf_result=no
20480 fi
20481 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20482 echo "$as_me:20482: result: $cf_result" >&5
20483 echo "${ECHO_T}$cf_result" >&6
20484 if test "$cf_result" = yes ; then
20485
20486 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20487
20488 cat >>confdefs.h <<EOF
20489 #define $cf_result 1
20490 EOF
20491
20492 else
20493
20494 cat >>confdefs.h <<EOF
20495 #define wchar_t long
20496 EOF
20497
20498 fi
20499
20500         fi
20501
20502         if test "$NCURSES_OK_WINT_T" = 0 ; then
20503
20504 echo "$as_me:20504: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20505 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20506 cat >"conftest.$ac_ext" <<_ACEOF
20507 #line 20507 "configure"
20508 #include "confdefs.h"
20509
20510 #ifndef _XOPEN_SOURCE_EXTENDED
20511 #define _XOPEN_SOURCE_EXTENDED
20512 #endif
20513 #include <${cf_cv_ncurses_header:-curses.h}>
20514 int
20515 main (void)
20516 {
20517
20518 wint_t foo
20519
20520   ;
20521   return 0;
20522 }
20523 _ACEOF
20524 rm -f "conftest.$ac_objext"
20525 if { (eval echo "$as_me:20525: \"$ac_compile\"") >&5
20526   (eval $ac_compile) 2>&5
20527   ac_status=$?
20528   echo "$as_me:20528: \$? = $ac_status" >&5
20529   (exit "$ac_status"); } &&
20530          { ac_try='test -s "conftest.$ac_objext"'
20531   { (eval echo "$as_me:20531: \"$ac_try\"") >&5
20532   (eval $ac_try) 2>&5
20533   ac_status=$?
20534   echo "$as_me:20534: \$? = $ac_status" >&5
20535   (exit "$ac_status"); }; }; then
20536   cf_result=yes
20537 else
20538   echo "$as_me: failed program was:" >&5
20539 cat "conftest.$ac_ext" >&5
20540 cf_result=no
20541 fi
20542 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20543 echo "$as_me:20543: result: $cf_result" >&5
20544 echo "${ECHO_T}$cf_result" >&6
20545 if test "$cf_result" = yes ; then
20546
20547 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20548
20549 cat >>confdefs.h <<EOF
20550 #define $cf_result 1
20551 EOF
20552
20553 else
20554
20555 cat >>confdefs.h <<EOF
20556 #define wint_t long
20557 EOF
20558
20559 fi
20560
20561         fi
20562 fi
20563
20564 for cf_data in \
20565 TABSIZE \
20566 curscr \
20567 ospeed \
20568 boolnames \
20569 boolfnames \
20570 ttytype
20571 do
20572 echo "$as_me:20572: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20573 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20574
20575 cat >"conftest.$ac_ext" <<_ACEOF
20576 #line 20576 "configure"
20577 #include "confdefs.h"
20578
20579 #ifdef HAVE_XCURSES
20580 #include <xcurses.h>
20581 char * XCursesProgramName = "test";
20582 #else
20583 #include <${cf_cv_ncurses_header:-curses.h}>
20584 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20585 #include <ncursesw/term.h>
20586 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20587 #include <ncurses/term.h>
20588 #elif defined(HAVE_TERM_H)
20589 #include <term.h>
20590 #endif
20591 #endif
20592
20593 int
20594 main (void)
20595 {
20596
20597 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20598         const void *foo = (const void *)($cf_data);
20599 #else
20600         const void *foo = &($cf_data);
20601 #endif
20602         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20603
20604   ;
20605   return 0;
20606 }
20607 _ACEOF
20608 rm -f "conftest.$ac_objext"
20609 if { (eval echo "$as_me:20609: \"$ac_compile\"") >&5
20610   (eval $ac_compile) 2>&5
20611   ac_status=$?
20612   echo "$as_me:20612: \$? = $ac_status" >&5
20613   (exit "$ac_status"); } &&
20614          { ac_try='test -s "conftest.$ac_objext"'
20615   { (eval echo "$as_me:20615: \"$ac_try\"") >&5
20616   (eval $ac_try) 2>&5
20617   ac_status=$?
20618   echo "$as_me:20618: \$? = $ac_status" >&5
20619   (exit "$ac_status"); }; }; then
20620   cf_result=yes
20621
20622 else
20623   echo "$as_me: failed program was:" >&5
20624 cat "conftest.$ac_ext" >&5
20625 cf_result=no
20626 fi
20627 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20628 echo "$as_me:20628: result: $cf_result" >&5
20629 echo "${ECHO_T}$cf_result" >&6
20630
20631 if test "$cf_result" = yes ; then
20632
20633 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20634
20635         cat >>confdefs.h <<EOF
20636 #define $cf_result 1
20637 EOF
20638
20639 else
20640         echo "$as_me:20640: checking for data $cf_data in library" >&5
20641 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20642         # BSD linkers insist on making weak linkage, but resolve at runtime.
20643         if test "$cross_compiling" = yes; then
20644
20645         # cross-compiling
20646         cat >"conftest.$ac_ext" <<_ACEOF
20647 #line 20647 "configure"
20648 #include "confdefs.h"
20649
20650 #ifdef HAVE_XCURSES
20651 #include <xcurses.h>
20652 char * XCursesProgramName = "test";
20653 #else
20654 #include <${cf_cv_ncurses_header:-curses.h}>
20655 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20656 #include <ncursesw/term.h>
20657 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20658 #include <ncurses/term.h>
20659 #elif defined(HAVE_TERM_H)
20660 #include <term.h>
20661 #endif
20662 #endif
20663
20664 extern char $cf_data;
20665 int
20666 main (void)
20667 {
20668
20669         do {
20670
20671 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20672         const void *foo = (const void *)($cf_data);
20673 #else
20674         const void *foo = &($cf_data);
20675 #endif
20676         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20677
20678                 ${cf_cv_main_return:-return}(foo == 0);
20679         } while (0)
20680
20681   ;
20682   return 0;
20683 }
20684 _ACEOF
20685 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20686 if { (eval echo "$as_me:20686: \"$ac_link\"") >&5
20687   (eval $ac_link) 2>&5
20688   ac_status=$?
20689   echo "$as_me:20689: \$? = $ac_status" >&5
20690   (exit "$ac_status"); } &&
20691          { ac_try='test -s "conftest$ac_exeext"'
20692   { (eval echo "$as_me:20692: \"$ac_try\"") >&5
20693   (eval $ac_try) 2>&5
20694   ac_status=$?
20695   echo "$as_me:20695: \$? = $ac_status" >&5
20696   (exit "$ac_status"); }; }; then
20697   cf_result=yes
20698 else
20699   echo "$as_me: failed program was:" >&5
20700 cat "conftest.$ac_ext" >&5
20701 cf_result=no
20702 fi
20703 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20704
20705 else
20706   cat >"conftest.$ac_ext" <<_ACEOF
20707 #line 20707 "configure"
20708 #include "confdefs.h"
20709
20710 #ifdef HAVE_XCURSES
20711 #include <xcurses.h>
20712 char * XCursesProgramName = "test";
20713 #else
20714 #include <${cf_cv_ncurses_header:-curses.h}>
20715 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20716 #include <ncursesw/term.h>
20717 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20718 #include <ncurses/term.h>
20719 #elif defined(HAVE_TERM_H)
20720 #include <term.h>
20721 #endif
20722 #endif
20723
20724 extern char $cf_data;
20725 int main(void)
20726 {
20727
20728 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20729         const void *foo = (const void *)($cf_data);
20730 #else
20731         const void *foo = &($cf_data);
20732 #endif
20733         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20734
20735         ${cf_cv_main_return:-return}(foo == 0);
20736 }
20737 _ACEOF
20738 rm -f "conftest$ac_exeext"
20739 if { (eval echo "$as_me:20739: \"$ac_link\"") >&5
20740   (eval $ac_link) 2>&5
20741   ac_status=$?
20742   echo "$as_me:20742: \$? = $ac_status" >&5
20743   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20744   { (eval echo "$as_me:20744: \"$ac_try\"") >&5
20745   (eval $ac_try) 2>&5
20746   ac_status=$?
20747   echo "$as_me:20747: \$? = $ac_status" >&5
20748   (exit "$ac_status"); }; }; then
20749   cf_result=yes
20750
20751 else
20752   echo "$as_me: program exited with status $ac_status" >&5
20753 echo "$as_me: failed program was:" >&5
20754 cat "conftest.$ac_ext" >&5
20755 cf_result=no
20756 fi
20757 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20758 fi
20759         echo "$as_me:20759: result: $cf_result" >&5
20760 echo "${ECHO_T}$cf_result" >&6
20761         if test "$cf_result" = yes ; then
20762
20763 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20764
20765                 cat >>confdefs.h <<EOF
20766 #define $cf_result 1
20767 EOF
20768
20769                 # do not exit loop here, since we prefer system's declarations
20770         fi
20771 fi
20772 done
20773
20774 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20775 then
20776         echo "$as_me:20776: checking for X" >&5
20777 echo $ECHO_N "checking for X... $ECHO_C" >&6
20778
20779 # Check whether --with-x or --without-x was given.
20780 if test "${with_x+set}" = set; then
20781   withval="$with_x"
20782
20783 fi;
20784 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20785 if test "x$with_x" = xno; then
20786   # The user explicitly disabled X.
20787   have_x=disabled
20788 else
20789   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20790     # Both variables are already set.
20791     have_x=yes
20792   else
20793     if test "${ac_cv_have_x+set}" = set; then
20794   echo $ECHO_N "(cached) $ECHO_C" >&6
20795 else
20796   # One or both of the vars are not set, and there is no cached value.
20797 ac_x_includes=no ac_x_libraries=no
20798 rm -fr conftest.dir
20799 if mkdir conftest.dir; then
20800   cd conftest.dir
20801   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20802   cat >Imakefile <<'EOF'
20803 acfindx:
20804         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20805 EOF
20806   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20807     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20808     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20809     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20810     for ac_extension in a so sl dylib dll; do
20811       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20812          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20813         ac_im_usrlibdir=$ac_im_libdir; break
20814       fi
20815     done
20816     # Screen out bogus values from the imake configuration.  They are
20817     # bogus both because they are the default anyway, and because
20818     # using them would break gcc on systems where it needs fixed includes.
20819     case $ac_im_incroot in
20820         /usr/include) ;;
20821         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20822     esac
20823     case $ac_im_usrlibdir in
20824         /usr/lib | /lib) ;;
20825         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20826     esac
20827   fi
20828   cd ..
20829   rm -fr conftest.dir
20830 fi
20831
20832 # Standard set of common directories for X headers.
20833 # Check X11 before X11Rn because it is often a symlink to the current release.
20834 ac_x_header_dirs='
20835 /usr/X11/include
20836 /usr/X11R7/include
20837 /usr/X11R6/include
20838 /usr/X11R5/include
20839 /usr/X11R4/include
20840
20841 /opt/local/include
20842 /opt/X11/include
20843
20844 /usr/include/X11
20845 /usr/include/X11R7
20846 /usr/include/X11R6
20847 /usr/include/X11R5
20848 /usr/include/X11R4
20849
20850 /usr/local/X11/include
20851 /usr/local/X11R7/include
20852 /usr/local/X11R6/include
20853 /usr/local/X11R5/include
20854 /usr/local/X11R4/include
20855
20856 /usr/local/include/X11
20857 /usr/local/include/X11R7
20858 /usr/local/include/X11R6
20859 /usr/local/include/X11R5
20860 /usr/local/include/X11R4
20861
20862 /usr/X386/include
20863 /usr/x386/include
20864 /usr/XFree86/include/X11
20865
20866 /usr/include
20867 /usr/local/include
20868 /usr/unsupported/include
20869 /usr/athena/include
20870 /usr/local/x11r5/include
20871 /usr/lpp/Xamples/include
20872
20873 /usr/openwin/include
20874 /usr/openwin/share/include'
20875
20876 if test "$ac_x_includes" = no; then
20877   # Guess where to find include files, by looking for Intrinsic.h.
20878   # First, try using that file with no special directory specified.
20879   cat >"conftest.$ac_ext" <<_ACEOF
20880 #line 20880 "configure"
20881 #include "confdefs.h"
20882 #include <X11/Intrinsic.h>
20883 _ACEOF
20884 if { (eval echo "$as_me:20884: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20885   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20886   ac_status=$?
20887   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20888   rm -f conftest.er1
20889   cat conftest.err >&5
20890   echo "$as_me:20890: \$? = $ac_status" >&5
20891   (exit "$ac_status"); } >/dev/null; then
20892   if test -s conftest.err; then
20893     ac_cpp_err=$ac_c_preproc_warn_flag
20894   else
20895     ac_cpp_err=
20896   fi
20897 else
20898   ac_cpp_err=yes
20899 fi
20900 if test -z "$ac_cpp_err"; then
20901   # We can compile using X headers with no special include directory.
20902 ac_x_includes=
20903 else
20904   echo "$as_me: failed program was:" >&5
20905   cat "conftest.$ac_ext" >&5
20906   for ac_dir in $ac_x_header_dirs; do
20907   if test -r "$ac_dir/X11/Intrinsic.h"; then
20908     ac_x_includes=$ac_dir
20909     break
20910   fi
20911 done
20912 fi
20913 rm -f conftest.err "conftest.$ac_ext"
20914 fi # $ac_x_includes = no
20915
20916 if test "$ac_x_libraries" = no; then
20917   # Check for the libraries.
20918   # See if we find them without any special options.
20919   # Don't add to $LIBS permanently.
20920   ac_save_LIBS=$LIBS
20921   LIBS="-lXt $LIBS"
20922   cat >"conftest.$ac_ext" <<_ACEOF
20923 #line 20923 "configure"
20924 #include "confdefs.h"
20925 #include <X11/Intrinsic.h>
20926 int
20927 main (void)
20928 {
20929 XtMalloc (0)
20930   ;
20931   return 0;
20932 }
20933 _ACEOF
20934 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20935 if { (eval echo "$as_me:20935: \"$ac_link\"") >&5
20936   (eval $ac_link) 2>&5
20937   ac_status=$?
20938   echo "$as_me:20938: \$? = $ac_status" >&5
20939   (exit "$ac_status"); } &&
20940          { ac_try='test -s "conftest$ac_exeext"'
20941   { (eval echo "$as_me:20941: \"$ac_try\"") >&5
20942   (eval $ac_try) 2>&5
20943   ac_status=$?
20944   echo "$as_me:20944: \$? = $ac_status" >&5
20945   (exit "$ac_status"); }; }; then
20946   LIBS=$ac_save_LIBS
20947 # We can link X programs with no special library path.
20948 ac_x_libraries=
20949 else
20950   echo "$as_me: failed program was:" >&5
20951 cat "conftest.$ac_ext" >&5
20952 LIBS=$ac_save_LIBS
20953 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20954 do
20955   # Don't even attempt the hair of trying to link an X program!
20956   for ac_extension in a so sl dylib dll; do
20957     if test -r "$ac_dir/libXt.$ac_extension"; then
20958       ac_x_libraries=$ac_dir
20959       break 2
20960     fi
20961   done
20962 done
20963 fi
20964 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20965 fi # $ac_x_libraries = no
20966
20967 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20968   # Didn't find X anywhere.  Cache the known absence of X.
20969   ac_cv_have_x="have_x=no"
20970 else
20971   # Record where we found X for the cache.
20972   ac_cv_have_x="have_x=yes \
20973                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20974 fi
20975 fi
20976
20977   fi
20978   eval "$ac_cv_have_x"
20979 fi # $with_x != no
20980
20981 if test "$have_x" != yes; then
20982   echo "$as_me:20982: result: $have_x" >&5
20983 echo "${ECHO_T}$have_x" >&6
20984   no_x=yes
20985 else
20986   # If each of the values was on the command line, it overrides each guess.
20987   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20988   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20989   # Update the cache value to reflect the command line values.
20990   ac_cv_have_x="have_x=yes \
20991                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20992   echo "$as_me:20992: result: libraries $x_libraries, headers $x_includes" >&5
20993 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20994 fi
20995
20996         if test "$no_x" = yes; then
20997   # Not all programs may use this symbol, but it does not hurt to define it.
20998
20999 cat >>confdefs.h <<\EOF
21000 #define X_DISPLAY_MISSING 1
21001 EOF
21002
21003   X_CFLAGS=
21004   X_PRE_LIBS=
21005   X_LIBS=
21006   X_EXTRA_LIBS=
21007 else
21008   if test -n "$x_includes"; then
21009     X_CFLAGS="$X_CFLAGS -I$x_includes"
21010   fi
21011
21012   # It would also be nice to do this for all -L options, not just this one.
21013   if test -n "$x_libraries"; then
21014     X_LIBS="$X_LIBS -L$x_libraries"
21015     # For Solaris; some versions of Sun CC require a space after -R and
21016     # others require no space.  Words are not sufficient . . . .
21017     case `(uname -sr) 2>/dev/null` in
21018     "SunOS 5"*)
21019       echo "$as_me:21019: checking whether -R must be followed by a space" >&5
21020 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
21021       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
21022       cat >"conftest.$ac_ext" <<_ACEOF
21023 #line 21023 "configure"
21024 #include "confdefs.h"
21025
21026 int
21027 main (void)
21028 {
21029
21030   ;
21031   return 0;
21032 }
21033 _ACEOF
21034 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21035 if { (eval echo "$as_me:21035: \"$ac_link\"") >&5
21036   (eval $ac_link) 2>&5
21037   ac_status=$?
21038   echo "$as_me:21038: \$? = $ac_status" >&5
21039   (exit "$ac_status"); } &&
21040          { ac_try='test -s "conftest$ac_exeext"'
21041   { (eval echo "$as_me:21041: \"$ac_try\"") >&5
21042   (eval $ac_try) 2>&5
21043   ac_status=$?
21044   echo "$as_me:21044: \$? = $ac_status" >&5
21045   (exit "$ac_status"); }; }; then
21046   ac_R_nospace=yes
21047 else
21048   echo "$as_me: failed program was:" >&5
21049 cat "conftest.$ac_ext" >&5
21050 ac_R_nospace=no
21051 fi
21052 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21053       if test $ac_R_nospace = yes; then
21054         echo "$as_me:21054: result: no" >&5
21055 echo "${ECHO_T}no" >&6
21056         X_LIBS="$X_LIBS -R$x_libraries"
21057       else
21058         LIBS="$ac_xsave_LIBS -R $x_libraries"
21059         cat >"conftest.$ac_ext" <<_ACEOF
21060 #line 21060 "configure"
21061 #include "confdefs.h"
21062
21063 int
21064 main (void)
21065 {
21066
21067   ;
21068   return 0;
21069 }
21070 _ACEOF
21071 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21072 if { (eval echo "$as_me:21072: \"$ac_link\"") >&5
21073   (eval $ac_link) 2>&5
21074   ac_status=$?
21075   echo "$as_me:21075: \$? = $ac_status" >&5
21076   (exit "$ac_status"); } &&
21077          { ac_try='test -s "conftest$ac_exeext"'
21078   { (eval echo "$as_me:21078: \"$ac_try\"") >&5
21079   (eval $ac_try) 2>&5
21080   ac_status=$?
21081   echo "$as_me:21081: \$? = $ac_status" >&5
21082   (exit "$ac_status"); }; }; then
21083   ac_R_space=yes
21084 else
21085   echo "$as_me: failed program was:" >&5
21086 cat "conftest.$ac_ext" >&5
21087 ac_R_space=no
21088 fi
21089 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21090         if test $ac_R_space = yes; then
21091           echo "$as_me:21091: result: yes" >&5
21092 echo "${ECHO_T}yes" >&6
21093           X_LIBS="$X_LIBS -R $x_libraries"
21094         else
21095           echo "$as_me:21095: result: neither works" >&5
21096 echo "${ECHO_T}neither works" >&6
21097         fi
21098       fi
21099       LIBS=$ac_xsave_LIBS
21100     esac
21101   fi
21102
21103   # Check for system-dependent libraries X programs must link with.
21104   # Do this before checking for the system-independent R6 libraries
21105   # (-lICE), since we may need -lsocket or whatever for X linking.
21106
21107   if test "$ISC" = yes; then
21108     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
21109   else
21110     # Martyn Johnson says this is needed for Ultrix, if the X
21111     # libraries were built with DECnet support.  And Karl Berry says
21112     # the Alpha needs dnet_stub (dnet does not exist).
21113     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
21114     cat >"conftest.$ac_ext" <<_ACEOF
21115 #line 21115 "configure"
21116 #include "confdefs.h"
21117
21118 /* Override any gcc2 internal prototype to avoid an error.  */
21119 #ifdef __cplusplus
21120 extern "C"
21121 #endif
21122 /* We use char because int might match the return type of a gcc2
21123    builtin and then its argument prototype would still apply.  */
21124 char XOpenDisplay ();
21125 int
21126 main (void)
21127 {
21128 XOpenDisplay ();
21129   ;
21130   return 0;
21131 }
21132 _ACEOF
21133 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21134 if { (eval echo "$as_me:21134: \"$ac_link\"") >&5
21135   (eval $ac_link) 2>&5
21136   ac_status=$?
21137   echo "$as_me:21137: \$? = $ac_status" >&5
21138   (exit "$ac_status"); } &&
21139          { ac_try='test -s "conftest$ac_exeext"'
21140   { (eval echo "$as_me:21140: \"$ac_try\"") >&5
21141   (eval $ac_try) 2>&5
21142   ac_status=$?
21143   echo "$as_me:21143: \$? = $ac_status" >&5
21144   (exit "$ac_status"); }; }; then
21145   :
21146 else
21147   echo "$as_me: failed program was:" >&5
21148 cat "conftest.$ac_ext" >&5
21149 echo "$as_me:21149: checking for dnet_ntoa in -ldnet" >&5
21150 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
21151 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
21152   echo $ECHO_N "(cached) $ECHO_C" >&6
21153 else
21154   ac_check_lib_save_LIBS=$LIBS
21155 LIBS="-ldnet  $LIBS"
21156 cat >"conftest.$ac_ext" <<_ACEOF
21157 #line 21157 "configure"
21158 #include "confdefs.h"
21159
21160 /* Override any gcc2 internal prototype to avoid an error.  */
21161 #ifdef __cplusplus
21162 extern "C"
21163 #endif
21164 /* We use char because int might match the return type of a gcc2
21165    builtin and then its argument prototype would still apply.  */
21166 char dnet_ntoa ();
21167 int
21168 main (void)
21169 {
21170 dnet_ntoa ();
21171   ;
21172   return 0;
21173 }
21174 _ACEOF
21175 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21176 if { (eval echo "$as_me:21176: \"$ac_link\"") >&5
21177   (eval $ac_link) 2>&5
21178   ac_status=$?
21179   echo "$as_me:21179: \$? = $ac_status" >&5
21180   (exit "$ac_status"); } &&
21181          { ac_try='test -s "conftest$ac_exeext"'
21182   { (eval echo "$as_me:21182: \"$ac_try\"") >&5
21183   (eval $ac_try) 2>&5
21184   ac_status=$?
21185   echo "$as_me:21185: \$? = $ac_status" >&5
21186   (exit "$ac_status"); }; }; then
21187   ac_cv_lib_dnet_dnet_ntoa=yes
21188 else
21189   echo "$as_me: failed program was:" >&5
21190 cat "conftest.$ac_ext" >&5
21191 ac_cv_lib_dnet_dnet_ntoa=no
21192 fi
21193 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21194 LIBS=$ac_check_lib_save_LIBS
21195 fi
21196 echo "$as_me:21196: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
21197 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
21198 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
21199   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
21200 fi
21201
21202     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
21203       echo "$as_me:21203: checking for dnet_ntoa in -ldnet_stub" >&5
21204 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
21205 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
21206   echo $ECHO_N "(cached) $ECHO_C" >&6
21207 else
21208   ac_check_lib_save_LIBS=$LIBS
21209 LIBS="-ldnet_stub  $LIBS"
21210 cat >"conftest.$ac_ext" <<_ACEOF
21211 #line 21211 "configure"
21212 #include "confdefs.h"
21213
21214 /* Override any gcc2 internal prototype to avoid an error.  */
21215 #ifdef __cplusplus
21216 extern "C"
21217 #endif
21218 /* We use char because int might match the return type of a gcc2
21219    builtin and then its argument prototype would still apply.  */
21220 char dnet_ntoa ();
21221 int
21222 main (void)
21223 {
21224 dnet_ntoa ();
21225   ;
21226   return 0;
21227 }
21228 _ACEOF
21229 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21230 if { (eval echo "$as_me:21230: \"$ac_link\"") >&5
21231   (eval $ac_link) 2>&5
21232   ac_status=$?
21233   echo "$as_me:21233: \$? = $ac_status" >&5
21234   (exit "$ac_status"); } &&
21235          { ac_try='test -s "conftest$ac_exeext"'
21236   { (eval echo "$as_me:21236: \"$ac_try\"") >&5
21237   (eval $ac_try) 2>&5
21238   ac_status=$?
21239   echo "$as_me:21239: \$? = $ac_status" >&5
21240   (exit "$ac_status"); }; }; then
21241   ac_cv_lib_dnet_stub_dnet_ntoa=yes
21242 else
21243   echo "$as_me: failed program was:" >&5
21244 cat "conftest.$ac_ext" >&5
21245 ac_cv_lib_dnet_stub_dnet_ntoa=no
21246 fi
21247 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21248 LIBS=$ac_check_lib_save_LIBS
21249 fi
21250 echo "$as_me:21250: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
21251 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
21252 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
21253   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
21254 fi
21255
21256     fi
21257 fi
21258 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21259     LIBS="$ac_xsave_LIBS"
21260
21261     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
21262     # to get the SysV transport functions.
21263     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
21264     # needs -lnsl.
21265     # The nsl library prevents programs from opening the X display
21266     # on Irix 5.2, according to T.E. Dickey.
21267     # The functions gethostbyname, getservbyname, and inet_addr are
21268     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
21269     echo "$as_me:21269: checking for gethostbyname" >&5
21270 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
21271 if test "${ac_cv_func_gethostbyname+set}" = set; then
21272   echo $ECHO_N "(cached) $ECHO_C" >&6
21273 else
21274   cat >"conftest.$ac_ext" <<_ACEOF
21275 #line 21275 "configure"
21276 #include "confdefs.h"
21277 #define gethostbyname autoconf_temporary
21278 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21279 #undef gethostbyname
21280
21281 #ifdef __cplusplus
21282 extern "C"
21283 #endif
21284
21285 /* We use char because int might match the return type of a gcc2
21286    builtin and then its argument prototype would still apply.  */
21287 char gethostbyname (void);
21288
21289 int
21290 main (void)
21291 {
21292
21293 /* The GNU C library defines stubs for functions which it implements
21294     to always fail with ENOSYS.  Some functions are actually named
21295     something starting with __ and the normal name is an alias.  */
21296 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21297 #error found stub for gethostbyname
21298 #endif
21299
21300         return gethostbyname ();
21301   ;
21302   return 0;
21303 }
21304 _ACEOF
21305 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21306 if { (eval echo "$as_me:21306: \"$ac_link\"") >&5
21307   (eval $ac_link) 2>&5
21308   ac_status=$?
21309   echo "$as_me:21309: \$? = $ac_status" >&5
21310   (exit "$ac_status"); } &&
21311          { ac_try='test -s "conftest$ac_exeext"'
21312   { (eval echo "$as_me:21312: \"$ac_try\"") >&5
21313   (eval $ac_try) 2>&5
21314   ac_status=$?
21315   echo "$as_me:21315: \$? = $ac_status" >&5
21316   (exit "$ac_status"); }; }; then
21317   ac_cv_func_gethostbyname=yes
21318 else
21319   echo "$as_me: failed program was:" >&5
21320 cat "conftest.$ac_ext" >&5
21321 ac_cv_func_gethostbyname=no
21322 fi
21323 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21324 fi
21325 echo "$as_me:21325: result: $ac_cv_func_gethostbyname" >&5
21326 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21327
21328     if test $ac_cv_func_gethostbyname = no; then
21329       echo "$as_me:21329: checking for gethostbyname in -lnsl" >&5
21330 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21331 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21332   echo $ECHO_N "(cached) $ECHO_C" >&6
21333 else
21334   ac_check_lib_save_LIBS=$LIBS
21335 LIBS="-lnsl  $LIBS"
21336 cat >"conftest.$ac_ext" <<_ACEOF
21337 #line 21337 "configure"
21338 #include "confdefs.h"
21339
21340 /* Override any gcc2 internal prototype to avoid an error.  */
21341 #ifdef __cplusplus
21342 extern "C"
21343 #endif
21344 /* We use char because int might match the return type of a gcc2
21345    builtin and then its argument prototype would still apply.  */
21346 char gethostbyname ();
21347 int
21348 main (void)
21349 {
21350 gethostbyname ();
21351   ;
21352   return 0;
21353 }
21354 _ACEOF
21355 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21356 if { (eval echo "$as_me:21356: \"$ac_link\"") >&5
21357   (eval $ac_link) 2>&5
21358   ac_status=$?
21359   echo "$as_me:21359: \$? = $ac_status" >&5
21360   (exit "$ac_status"); } &&
21361          { ac_try='test -s "conftest$ac_exeext"'
21362   { (eval echo "$as_me:21362: \"$ac_try\"") >&5
21363   (eval $ac_try) 2>&5
21364   ac_status=$?
21365   echo "$as_me:21365: \$? = $ac_status" >&5
21366   (exit "$ac_status"); }; }; then
21367   ac_cv_lib_nsl_gethostbyname=yes
21368 else
21369   echo "$as_me: failed program was:" >&5
21370 cat "conftest.$ac_ext" >&5
21371 ac_cv_lib_nsl_gethostbyname=no
21372 fi
21373 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21374 LIBS=$ac_check_lib_save_LIBS
21375 fi
21376 echo "$as_me:21376: result: $ac_cv_lib_nsl_gethostbyname" >&5
21377 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21378 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21379   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21380 fi
21381
21382       if test $ac_cv_lib_nsl_gethostbyname = no; then
21383         echo "$as_me:21383: checking for gethostbyname in -lbsd" >&5
21384 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21385 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21386   echo $ECHO_N "(cached) $ECHO_C" >&6
21387 else
21388   ac_check_lib_save_LIBS=$LIBS
21389 LIBS="-lbsd  $LIBS"
21390 cat >"conftest.$ac_ext" <<_ACEOF
21391 #line 21391 "configure"
21392 #include "confdefs.h"
21393
21394 /* Override any gcc2 internal prototype to avoid an error.  */
21395 #ifdef __cplusplus
21396 extern "C"
21397 #endif
21398 /* We use char because int might match the return type of a gcc2
21399    builtin and then its argument prototype would still apply.  */
21400 char gethostbyname ();
21401 int
21402 main (void)
21403 {
21404 gethostbyname ();
21405   ;
21406   return 0;
21407 }
21408 _ACEOF
21409 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21410 if { (eval echo "$as_me:21410: \"$ac_link\"") >&5
21411   (eval $ac_link) 2>&5
21412   ac_status=$?
21413   echo "$as_me:21413: \$? = $ac_status" >&5
21414   (exit "$ac_status"); } &&
21415          { ac_try='test -s "conftest$ac_exeext"'
21416   { (eval echo "$as_me:21416: \"$ac_try\"") >&5
21417   (eval $ac_try) 2>&5
21418   ac_status=$?
21419   echo "$as_me:21419: \$? = $ac_status" >&5
21420   (exit "$ac_status"); }; }; then
21421   ac_cv_lib_bsd_gethostbyname=yes
21422 else
21423   echo "$as_me: failed program was:" >&5
21424 cat "conftest.$ac_ext" >&5
21425 ac_cv_lib_bsd_gethostbyname=no
21426 fi
21427 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21428 LIBS=$ac_check_lib_save_LIBS
21429 fi
21430 echo "$as_me:21430: result: $ac_cv_lib_bsd_gethostbyname" >&5
21431 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21432 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21433   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21434 fi
21435
21436       fi
21437     fi
21438
21439     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21440     # socket/setsockopt and other routines are undefined under SCO ODT
21441     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21442     # on later versions), says Simon Leinen: it contains gethostby*
21443     # variants that don't use the nameserver (or something).  -lsocket
21444     # must be given before -lnsl if both are needed.  We assume that
21445     # if connect needs -lnsl, so does gethostbyname.
21446     echo "$as_me:21446: checking for connect" >&5
21447 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21448 if test "${ac_cv_func_connect+set}" = set; then
21449   echo $ECHO_N "(cached) $ECHO_C" >&6
21450 else
21451   cat >"conftest.$ac_ext" <<_ACEOF
21452 #line 21452 "configure"
21453 #include "confdefs.h"
21454 #define connect autoconf_temporary
21455 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21456 #undef connect
21457
21458 #ifdef __cplusplus
21459 extern "C"
21460 #endif
21461
21462 /* We use char because int might match the return type of a gcc2
21463    builtin and then its argument prototype would still apply.  */
21464 char connect (void);
21465
21466 int
21467 main (void)
21468 {
21469
21470 /* The GNU C library defines stubs for functions which it implements
21471     to always fail with ENOSYS.  Some functions are actually named
21472     something starting with __ and the normal name is an alias.  */
21473 #if defined (__stub_connect) || defined (__stub___connect)
21474 #error found stub for connect
21475 #endif
21476
21477         return connect ();
21478   ;
21479   return 0;
21480 }
21481 _ACEOF
21482 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21483 if { (eval echo "$as_me:21483: \"$ac_link\"") >&5
21484   (eval $ac_link) 2>&5
21485   ac_status=$?
21486   echo "$as_me:21486: \$? = $ac_status" >&5
21487   (exit "$ac_status"); } &&
21488          { ac_try='test -s "conftest$ac_exeext"'
21489   { (eval echo "$as_me:21489: \"$ac_try\"") >&5
21490   (eval $ac_try) 2>&5
21491   ac_status=$?
21492   echo "$as_me:21492: \$? = $ac_status" >&5
21493   (exit "$ac_status"); }; }; then
21494   ac_cv_func_connect=yes
21495 else
21496   echo "$as_me: failed program was:" >&5
21497 cat "conftest.$ac_ext" >&5
21498 ac_cv_func_connect=no
21499 fi
21500 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21501 fi
21502 echo "$as_me:21502: result: $ac_cv_func_connect" >&5
21503 echo "${ECHO_T}$ac_cv_func_connect" >&6
21504
21505     if test $ac_cv_func_connect = no; then
21506       echo "$as_me:21506: checking for connect in -lsocket" >&5
21507 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21508 if test "${ac_cv_lib_socket_connect+set}" = set; then
21509   echo $ECHO_N "(cached) $ECHO_C" >&6
21510 else
21511   ac_check_lib_save_LIBS=$LIBS
21512 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21513 cat >"conftest.$ac_ext" <<_ACEOF
21514 #line 21514 "configure"
21515 #include "confdefs.h"
21516
21517 /* Override any gcc2 internal prototype to avoid an error.  */
21518 #ifdef __cplusplus
21519 extern "C"
21520 #endif
21521 /* We use char because int might match the return type of a gcc2
21522    builtin and then its argument prototype would still apply.  */
21523 char connect ();
21524 int
21525 main (void)
21526 {
21527 connect ();
21528   ;
21529   return 0;
21530 }
21531 _ACEOF
21532 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21533 if { (eval echo "$as_me:21533: \"$ac_link\"") >&5
21534   (eval $ac_link) 2>&5
21535   ac_status=$?
21536   echo "$as_me:21536: \$? = $ac_status" >&5
21537   (exit "$ac_status"); } &&
21538          { ac_try='test -s "conftest$ac_exeext"'
21539   { (eval echo "$as_me:21539: \"$ac_try\"") >&5
21540   (eval $ac_try) 2>&5
21541   ac_status=$?
21542   echo "$as_me:21542: \$? = $ac_status" >&5
21543   (exit "$ac_status"); }; }; then
21544   ac_cv_lib_socket_connect=yes
21545 else
21546   echo "$as_me: failed program was:" >&5
21547 cat "conftest.$ac_ext" >&5
21548 ac_cv_lib_socket_connect=no
21549 fi
21550 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21551 LIBS=$ac_check_lib_save_LIBS
21552 fi
21553 echo "$as_me:21553: result: $ac_cv_lib_socket_connect" >&5
21554 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21555 if test "$ac_cv_lib_socket_connect" = yes; then
21556   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21557 fi
21558
21559     fi
21560
21561     # Guillermo Gomez says -lposix is necessary on A/UX.
21562     echo "$as_me:21562: checking for remove" >&5
21563 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21564 if test "${ac_cv_func_remove+set}" = set; then
21565   echo $ECHO_N "(cached) $ECHO_C" >&6
21566 else
21567   cat >"conftest.$ac_ext" <<_ACEOF
21568 #line 21568 "configure"
21569 #include "confdefs.h"
21570 #define remove autoconf_temporary
21571 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21572 #undef remove
21573
21574 #ifdef __cplusplus
21575 extern "C"
21576 #endif
21577
21578 /* We use char because int might match the return type of a gcc2
21579    builtin and then its argument prototype would still apply.  */
21580 char remove (void);
21581
21582 int
21583 main (void)
21584 {
21585
21586 /* The GNU C library defines stubs for functions which it implements
21587     to always fail with ENOSYS.  Some functions are actually named
21588     something starting with __ and the normal name is an alias.  */
21589 #if defined (__stub_remove) || defined (__stub___remove)
21590 #error found stub for remove
21591 #endif
21592
21593         return remove ();
21594   ;
21595   return 0;
21596 }
21597 _ACEOF
21598 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21599 if { (eval echo "$as_me:21599: \"$ac_link\"") >&5
21600   (eval $ac_link) 2>&5
21601   ac_status=$?
21602   echo "$as_me:21602: \$? = $ac_status" >&5
21603   (exit "$ac_status"); } &&
21604          { ac_try='test -s "conftest$ac_exeext"'
21605   { (eval echo "$as_me:21605: \"$ac_try\"") >&5
21606   (eval $ac_try) 2>&5
21607   ac_status=$?
21608   echo "$as_me:21608: \$? = $ac_status" >&5
21609   (exit "$ac_status"); }; }; then
21610   ac_cv_func_remove=yes
21611 else
21612   echo "$as_me: failed program was:" >&5
21613 cat "conftest.$ac_ext" >&5
21614 ac_cv_func_remove=no
21615 fi
21616 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21617 fi
21618 echo "$as_me:21618: result: $ac_cv_func_remove" >&5
21619 echo "${ECHO_T}$ac_cv_func_remove" >&6
21620
21621     if test $ac_cv_func_remove = no; then
21622       echo "$as_me:21622: checking for remove in -lposix" >&5
21623 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21624 if test "${ac_cv_lib_posix_remove+set}" = set; then
21625   echo $ECHO_N "(cached) $ECHO_C" >&6
21626 else
21627   ac_check_lib_save_LIBS=$LIBS
21628 LIBS="-lposix  $LIBS"
21629 cat >"conftest.$ac_ext" <<_ACEOF
21630 #line 21630 "configure"
21631 #include "confdefs.h"
21632
21633 /* Override any gcc2 internal prototype to avoid an error.  */
21634 #ifdef __cplusplus
21635 extern "C"
21636 #endif
21637 /* We use char because int might match the return type of a gcc2
21638    builtin and then its argument prototype would still apply.  */
21639 char remove ();
21640 int
21641 main (void)
21642 {
21643 remove ();
21644   ;
21645   return 0;
21646 }
21647 _ACEOF
21648 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21649 if { (eval echo "$as_me:21649: \"$ac_link\"") >&5
21650   (eval $ac_link) 2>&5
21651   ac_status=$?
21652   echo "$as_me:21652: \$? = $ac_status" >&5
21653   (exit "$ac_status"); } &&
21654          { ac_try='test -s "conftest$ac_exeext"'
21655   { (eval echo "$as_me:21655: \"$ac_try\"") >&5
21656   (eval $ac_try) 2>&5
21657   ac_status=$?
21658   echo "$as_me:21658: \$? = $ac_status" >&5
21659   (exit "$ac_status"); }; }; then
21660   ac_cv_lib_posix_remove=yes
21661 else
21662   echo "$as_me: failed program was:" >&5
21663 cat "conftest.$ac_ext" >&5
21664 ac_cv_lib_posix_remove=no
21665 fi
21666 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21667 LIBS=$ac_check_lib_save_LIBS
21668 fi
21669 echo "$as_me:21669: result: $ac_cv_lib_posix_remove" >&5
21670 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21671 if test "$ac_cv_lib_posix_remove" = yes; then
21672   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21673 fi
21674
21675     fi
21676
21677     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21678     echo "$as_me:21678: checking for shmat" >&5
21679 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21680 if test "${ac_cv_func_shmat+set}" = set; then
21681   echo $ECHO_N "(cached) $ECHO_C" >&6
21682 else
21683   cat >"conftest.$ac_ext" <<_ACEOF
21684 #line 21684 "configure"
21685 #include "confdefs.h"
21686 #define shmat autoconf_temporary
21687 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21688 #undef shmat
21689
21690 #ifdef __cplusplus
21691 extern "C"
21692 #endif
21693
21694 /* We use char because int might match the return type of a gcc2
21695    builtin and then its argument prototype would still apply.  */
21696 char shmat (void);
21697
21698 int
21699 main (void)
21700 {
21701
21702 /* The GNU C library defines stubs for functions which it implements
21703     to always fail with ENOSYS.  Some functions are actually named
21704     something starting with __ and the normal name is an alias.  */
21705 #if defined (__stub_shmat) || defined (__stub___shmat)
21706 #error found stub for shmat
21707 #endif
21708
21709         return shmat ();
21710   ;
21711   return 0;
21712 }
21713 _ACEOF
21714 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21715 if { (eval echo "$as_me:21715: \"$ac_link\"") >&5
21716   (eval $ac_link) 2>&5
21717   ac_status=$?
21718   echo "$as_me:21718: \$? = $ac_status" >&5
21719   (exit "$ac_status"); } &&
21720          { ac_try='test -s "conftest$ac_exeext"'
21721   { (eval echo "$as_me:21721: \"$ac_try\"") >&5
21722   (eval $ac_try) 2>&5
21723   ac_status=$?
21724   echo "$as_me:21724: \$? = $ac_status" >&5
21725   (exit "$ac_status"); }; }; then
21726   ac_cv_func_shmat=yes
21727 else
21728   echo "$as_me: failed program was:" >&5
21729 cat "conftest.$ac_ext" >&5
21730 ac_cv_func_shmat=no
21731 fi
21732 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21733 fi
21734 echo "$as_me:21734: result: $ac_cv_func_shmat" >&5
21735 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21736
21737     if test $ac_cv_func_shmat = no; then
21738       echo "$as_me:21738: checking for shmat in -lipc" >&5
21739 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21740 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21741   echo $ECHO_N "(cached) $ECHO_C" >&6
21742 else
21743   ac_check_lib_save_LIBS=$LIBS
21744 LIBS="-lipc  $LIBS"
21745 cat >"conftest.$ac_ext" <<_ACEOF
21746 #line 21746 "configure"
21747 #include "confdefs.h"
21748
21749 /* Override any gcc2 internal prototype to avoid an error.  */
21750 #ifdef __cplusplus
21751 extern "C"
21752 #endif
21753 /* We use char because int might match the return type of a gcc2
21754    builtin and then its argument prototype would still apply.  */
21755 char shmat ();
21756 int
21757 main (void)
21758 {
21759 shmat ();
21760   ;
21761   return 0;
21762 }
21763 _ACEOF
21764 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21765 if { (eval echo "$as_me:21765: \"$ac_link\"") >&5
21766   (eval $ac_link) 2>&5
21767   ac_status=$?
21768   echo "$as_me:21768: \$? = $ac_status" >&5
21769   (exit "$ac_status"); } &&
21770          { ac_try='test -s "conftest$ac_exeext"'
21771   { (eval echo "$as_me:21771: \"$ac_try\"") >&5
21772   (eval $ac_try) 2>&5
21773   ac_status=$?
21774   echo "$as_me:21774: \$? = $ac_status" >&5
21775   (exit "$ac_status"); }; }; then
21776   ac_cv_lib_ipc_shmat=yes
21777 else
21778   echo "$as_me: failed program was:" >&5
21779 cat "conftest.$ac_ext" >&5
21780 ac_cv_lib_ipc_shmat=no
21781 fi
21782 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21783 LIBS=$ac_check_lib_save_LIBS
21784 fi
21785 echo "$as_me:21785: result: $ac_cv_lib_ipc_shmat" >&5
21786 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21787 if test "$ac_cv_lib_ipc_shmat" = yes; then
21788   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21789 fi
21790
21791     fi
21792   fi
21793
21794   # Check for libraries that X11R6 Xt/Xaw programs need.
21795   ac_save_LDFLAGS=$LDFLAGS
21796   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21797   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21798   # check for ICE first), but we must link in the order -lSM -lICE or
21799   # we get undefined symbols.  So assume we have SM if we have ICE.
21800   # These have to be linked with before -lX11, unlike the other
21801   # libraries we check for below, so use a different variable.
21802   # John Interrante, Karl Berry
21803   echo "$as_me:21803: checking for IceConnectionNumber in -lICE" >&5
21804 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21805 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21806   echo $ECHO_N "(cached) $ECHO_C" >&6
21807 else
21808   ac_check_lib_save_LIBS=$LIBS
21809 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21810 cat >"conftest.$ac_ext" <<_ACEOF
21811 #line 21811 "configure"
21812 #include "confdefs.h"
21813
21814 /* Override any gcc2 internal prototype to avoid an error.  */
21815 #ifdef __cplusplus
21816 extern "C"
21817 #endif
21818 /* We use char because int might match the return type of a gcc2
21819    builtin and then its argument prototype would still apply.  */
21820 char IceConnectionNumber ();
21821 int
21822 main (void)
21823 {
21824 IceConnectionNumber ();
21825   ;
21826   return 0;
21827 }
21828 _ACEOF
21829 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21830 if { (eval echo "$as_me:21830: \"$ac_link\"") >&5
21831   (eval $ac_link) 2>&5
21832   ac_status=$?
21833   echo "$as_me:21833: \$? = $ac_status" >&5
21834   (exit "$ac_status"); } &&
21835          { ac_try='test -s "conftest$ac_exeext"'
21836   { (eval echo "$as_me:21836: \"$ac_try\"") >&5
21837   (eval $ac_try) 2>&5
21838   ac_status=$?
21839   echo "$as_me:21839: \$? = $ac_status" >&5
21840   (exit "$ac_status"); }; }; then
21841   ac_cv_lib_ICE_IceConnectionNumber=yes
21842 else
21843   echo "$as_me: failed program was:" >&5
21844 cat "conftest.$ac_ext" >&5
21845 ac_cv_lib_ICE_IceConnectionNumber=no
21846 fi
21847 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21848 LIBS=$ac_check_lib_save_LIBS
21849 fi
21850 echo "$as_me:21850: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21851 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21852 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21853   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21854 fi
21855
21856   LDFLAGS=$ac_save_LDFLAGS
21857
21858 fi
21859
21860 fi
21861
21862 if test "$GCC" = yes || test "$GXX" = yes
21863 then
21864
21865 if test "$GCC" = yes || test "$GXX" = yes
21866 then
21867         case $CFLAGS in
21868         (*-Werror=*)
21869                 cf_temp_flags=
21870                 for cf_temp_scan in $CFLAGS
21871                 do
21872                         case "x$cf_temp_scan" in
21873                         (x-Werror=format*)
21874
21875         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21876         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21877
21878                                 ;;
21879                         (x-Werror=*)
21880
21881         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21882         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21883
21884                                 ;;
21885                         (*)
21886
21887         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21888         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21889
21890                                 ;;
21891                         esac
21892                 done
21893                 if test "x$CFLAGS" != "x$cf_temp_flags"
21894                 then
21895                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21896
21897 echo "${as_me:-configure}:21897: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21898
21899                         CFLAGS="$cf_temp_flags"
21900                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21901
21902 echo "${as_me:-configure}:21902: testing ... fixed $CFLAGS ..." 1>&5
21903
21904                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21905
21906 echo "${as_me:-configure}:21906: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21907
21908                 fi
21909                 ;;
21910         esac
21911 fi
21912
21913 if test "$GCC" = yes || test "$GXX" = yes
21914 then
21915         case $CPPFLAGS in
21916         (*-Werror=*)
21917                 cf_temp_flags=
21918                 for cf_temp_scan in $CPPFLAGS
21919                 do
21920                         case "x$cf_temp_scan" in
21921                         (x-Werror=format*)
21922
21923         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21924         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21925
21926                                 ;;
21927                         (x-Werror=*)
21928
21929         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21930         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21931
21932                                 ;;
21933                         (*)
21934
21935         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21936         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21937
21938                                 ;;
21939                         esac
21940                 done
21941                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
21942                 then
21943                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21944
21945 echo "${as_me:-configure}:21945: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21946
21947                         CPPFLAGS="$cf_temp_flags"
21948                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21949
21950 echo "${as_me:-configure}:21950: testing ... fixed $CPPFLAGS ..." 1>&5
21951
21952                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21953
21954 echo "${as_me:-configure}:21954: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21955
21956                 fi
21957                 ;;
21958         esac
21959 fi
21960
21961 if test "$GCC" = yes || test "$GXX" = yes
21962 then
21963         case $LDFLAGS in
21964         (*-Werror=*)
21965                 cf_temp_flags=
21966                 for cf_temp_scan in $LDFLAGS
21967                 do
21968                         case "x$cf_temp_scan" in
21969                         (x-Werror=format*)
21970
21971         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21972         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21973
21974                                 ;;
21975                         (x-Werror=*)
21976
21977         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21978         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21979
21980                                 ;;
21981                         (*)
21982
21983         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21984         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21985
21986                                 ;;
21987                         esac
21988                 done
21989                 if test "x$LDFLAGS" != "x$cf_temp_flags"
21990                 then
21991                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21992
21993 echo "${as_me:-configure}:21993: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21994
21995                         LDFLAGS="$cf_temp_flags"
21996                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21997
21998 echo "${as_me:-configure}:21998: testing ... fixed $LDFLAGS ..." 1>&5
21999
22000                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22001
22002 echo "${as_me:-configure}:22002: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22003
22004                 fi
22005                 ;;
22006         esac
22007 fi
22008
22009 echo "$as_me:22009: checking if you want to turn on gcc warnings" >&5
22010 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
22011
22012 # Check whether --enable-warnings or --disable-warnings was given.
22013 if test "${enable_warnings+set}" = set; then
22014   enableval="$enable_warnings"
22015   test "$enableval" != yes && enableval=no
22016         if test "$enableval" != "no" ; then
22017     enable_warnings=yes
22018         else
22019                 enable_warnings=no
22020         fi
22021 else
22022   enableval=no
22023         enable_warnings=no
22024
22025 fi;
22026 echo "$as_me:22026: result: $enable_warnings" >&5
22027 echo "${ECHO_T}$enable_warnings" >&6
22028 if test "$enable_warnings" = "yes"
22029 then
22030
22031 if test "$GCC" = yes || test "$GXX" = yes
22032 then
22033 cat > conftest.i <<EOF
22034 #ifndef GCC_PRINTF
22035 #define GCC_PRINTF 0
22036 #endif
22037 #ifndef GCC_SCANF
22038 #define GCC_SCANF 0
22039 #endif
22040 #ifndef GCC_NORETURN
22041 #define GCC_NORETURN /* nothing */
22042 #endif
22043 #ifndef GCC_UNUSED
22044 #define GCC_UNUSED /* nothing */
22045 #endif
22046 EOF
22047 if test "$GCC" = yes
22048 then
22049         { echo "$as_me:22049: checking for $CC __attribute__ directives..." >&5
22050 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
22051 cat > "conftest.$ac_ext" <<EOF
22052 #line 22052 "${as_me:-configure}"
22053 #include "confdefs.h"
22054 #include "conftest.h"
22055 #include "conftest.i"
22056 #if     GCC_PRINTF
22057 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
22058 #else
22059 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
22060 #endif
22061 #if     GCC_SCANF
22062 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
22063 #else
22064 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
22065 #endif
22066 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
22067 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
22068 extern GCC_NORETURN void foo(void);
22069 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
22070 EOF
22071         cf_printf_attribute=no
22072         cf_scanf_attribute=no
22073         for cf_attribute in scanf printf unused noreturn
22074         do
22075
22076 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
22077
22078                 cf_directive="__attribute__(($cf_attribute))"
22079                 echo "checking for $CC $cf_directive" 1>&5
22080
22081                 case "$cf_attribute" in
22082                 (printf)
22083                         cf_printf_attribute=yes
22084                         cat >conftest.h <<EOF
22085 #define GCC_$cf_ATTRIBUTE 1
22086 EOF
22087                         ;;
22088                 (scanf)
22089                         cf_scanf_attribute=yes
22090                         cat >conftest.h <<EOF
22091 #define GCC_$cf_ATTRIBUTE 1
22092 EOF
22093                         ;;
22094                 (*)
22095                         cat >conftest.h <<EOF
22096 #define GCC_$cf_ATTRIBUTE $cf_directive
22097 EOF
22098                         ;;
22099                 esac
22100
22101                 if { (eval echo "$as_me:22101: \"$ac_compile\"") >&5
22102   (eval $ac_compile) 2>&5
22103   ac_status=$?
22104   echo "$as_me:22104: \$? = $ac_status" >&5
22105   (exit "$ac_status"); }; then
22106                         test -n "$verbose" && echo "$as_me:22106: result: ... $cf_attribute" >&5
22107 echo "${ECHO_T}... $cf_attribute" >&6
22108                         cat conftest.h >>confdefs.h
22109                         case "$cf_attribute" in
22110                         (noreturn)
22111
22112 cat >>confdefs.h <<EOF
22113 #define GCC_NORETURN $cf_directive
22114 EOF
22115
22116                                 ;;
22117                         (printf)
22118                                 cf_value='/* nothing */'
22119                                 if test "$cf_printf_attribute" != no ; then
22120                                         cf_value='__attribute__((format(printf,fmt,var)))'
22121
22122 cat >>confdefs.h <<\EOF
22123 #define GCC_PRINTF 1
22124 EOF
22125
22126                                 fi
22127
22128 cat >>confdefs.h <<EOF
22129 #define GCC_PRINTFLIKE(fmt,var) $cf_value
22130 EOF
22131
22132                                 ;;
22133                         (scanf)
22134                                 cf_value='/* nothing */'
22135                                 if test "$cf_scanf_attribute" != no ; then
22136                                         cf_value='__attribute__((format(scanf,fmt,var)))'
22137
22138 cat >>confdefs.h <<\EOF
22139 #define GCC_SCANF 1
22140 EOF
22141
22142                                 fi
22143
22144 cat >>confdefs.h <<EOF
22145 #define GCC_SCANFLIKE(fmt,var) $cf_value
22146 EOF
22147
22148                                 ;;
22149                         (unused)
22150
22151 cat >>confdefs.h <<EOF
22152 #define GCC_UNUSED $cf_directive
22153 EOF
22154
22155                                 ;;
22156                         esac
22157                 fi
22158         done
22159 else
22160         ${FGREP-fgrep} define conftest.i >>confdefs.h
22161 fi
22162 rm -rf ./conftest*
22163 fi
22164
22165 if test "x$have_x" = xyes; then
22166
22167 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
22168 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
22169 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
22170 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
22171 for cf_X_CFLAGS in $X_CFLAGS
22172 do
22173         case "x$cf_X_CFLAGS" in
22174         x-[IUD]*)
22175                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
22176                 ;;
22177         *)
22178                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
22179                 ;;
22180         esac
22181 done
22182
22183 cat >"conftest.$ac_ext" <<_ACEOF
22184 #line 22184 "configure"
22185 #include "confdefs.h"
22186
22187 #include <stdlib.h>
22188 #include <X11/Intrinsic.h>
22189
22190 int
22191 main (void)
22192 {
22193 String foo = malloc(1); free((void*)foo)
22194   ;
22195   return 0;
22196 }
22197 _ACEOF
22198 rm -f "conftest.$ac_objext"
22199 if { (eval echo "$as_me:22199: \"$ac_compile\"") >&5
22200   (eval $ac_compile) 2>&5
22201   ac_status=$?
22202   echo "$as_me:22202: \$? = $ac_status" >&5
22203   (exit "$ac_status"); } &&
22204          { ac_try='test -s "conftest.$ac_objext"'
22205   { (eval echo "$as_me:22205: \"$ac_try\"") >&5
22206   (eval $ac_try) 2>&5
22207   ac_status=$?
22208   echo "$as_me:22208: \$? = $ac_status" >&5
22209   (exit "$ac_status"); }; }; then
22210
22211 echo "$as_me:22211: checking for X11/Xt const-feature" >&5
22212 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
22213 if test "${cf_cv_const_x_string+set}" = set; then
22214   echo $ECHO_N "(cached) $ECHO_C" >&6
22215 else
22216
22217         cat >"conftest.$ac_ext" <<_ACEOF
22218 #line 22218 "configure"
22219 #include "confdefs.h"
22220
22221 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
22222 #undef  XTSTRINGDEFINES /* X11R5 and later */
22223 #include <stdlib.h>
22224 #include <X11/Intrinsic.h>
22225
22226 int
22227 main (void)
22228 {
22229 String foo = malloc(1); *foo = 0
22230   ;
22231   return 0;
22232 }
22233 _ACEOF
22234 rm -f "conftest.$ac_objext"
22235 if { (eval echo "$as_me:22235: \"$ac_compile\"") >&5
22236   (eval $ac_compile) 2>&5
22237   ac_status=$?
22238   echo "$as_me:22238: \$? = $ac_status" >&5
22239   (exit "$ac_status"); } &&
22240          { ac_try='test -s "conftest.$ac_objext"'
22241   { (eval echo "$as_me:22241: \"$ac_try\"") >&5
22242   (eval $ac_try) 2>&5
22243   ac_status=$?
22244   echo "$as_me:22244: \$? = $ac_status" >&5
22245   (exit "$ac_status"); }; }; then
22246
22247                         cf_cv_const_x_string=no
22248
22249 else
22250   echo "$as_me: failed program was:" >&5
22251 cat "conftest.$ac_ext" >&5
22252
22253                         cf_cv_const_x_string=yes
22254
22255 fi
22256 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22257
22258 fi
22259 echo "$as_me:22259: result: $cf_cv_const_x_string" >&5
22260 echo "${ECHO_T}$cf_cv_const_x_string" >&6
22261
22262 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
22263 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
22264 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
22265
22266 case "$cf_cv_const_x_string" in
22267 (no)
22268
22269         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22270         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
22271
22272         ;;
22273 (*)
22274
22275         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22276         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
22277
22278         ;;
22279 esac
22280
22281 else
22282   echo "$as_me: failed program was:" >&5
22283 cat "conftest.$ac_ext" >&5
22284 fi
22285 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22286  fi
22287 cat > "conftest.$ac_ext" <<EOF
22288 #line 22288 "${as_me:-configure}"
22289 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
22290 EOF
22291 if test "$INTEL_COMPILER" = yes
22292 then
22293 # The "-wdXXX" options suppress warnings:
22294 # remark #1419: external declaration in primary source file
22295 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
22296 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
22297 # remark #193: zero used for undefined preprocessing identifier
22298 # remark #593: variable "curs_sb_left_arrow" was set but never used
22299 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
22300 # remark #869: parameter "tw" was never referenced
22301 # remark #981: operands are evaluated in unspecified order
22302 # warning #279: controlling expression is constant
22303
22304         { echo "$as_me:22304: checking for $CC warning options..." >&5
22305 echo "$as_me: checking for $CC warning options..." >&6;}
22306         cf_save_CFLAGS="$CFLAGS"
22307         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
22308         for cf_opt in \
22309                 wd1419 \
22310                 wd1683 \
22311                 wd1684 \
22312                 wd193 \
22313                 wd593 \
22314                 wd279 \
22315                 wd810 \
22316                 wd869 \
22317                 wd981
22318         do
22319                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22320                 if { (eval echo "$as_me:22320: \"$ac_compile\"") >&5
22321   (eval $ac_compile) 2>&5
22322   ac_status=$?
22323   echo "$as_me:22323: \$? = $ac_status" >&5
22324   (exit "$ac_status"); }; then
22325                         test -n "$verbose" && echo "$as_me:22325: result: ... -$cf_opt" >&5
22326 echo "${ECHO_T}... -$cf_opt" >&6
22327                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22328                 fi
22329         done
22330         CFLAGS="$cf_save_CFLAGS"
22331 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22332 then
22333         { echo "$as_me:22333: checking for $CC warning options..." >&5
22334 echo "$as_me: checking for $CC warning options..." >&6;}
22335         cf_save_CFLAGS="$CFLAGS"
22336         cf_warn_CONST=""
22337         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22338         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22339         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22340         for cf_opt in W Wall \
22341                 Wbad-function-cast \
22342                 Wcast-align \
22343                 Wcast-qual \
22344                 Wdeclaration-after-statement \
22345                 Wextra \
22346                 Winline \
22347                 Wmissing-declarations \
22348                 Wmissing-prototypes \
22349                 Wnested-externs \
22350                 Wpointer-arith \
22351                 Wshadow \
22352                 Wstrict-prototypes \
22353                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22354         do
22355                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22356                 if { (eval echo "$as_me:22356: \"$ac_compile\"") >&5
22357   (eval $ac_compile) 2>&5
22358   ac_status=$?
22359   echo "$as_me:22359: \$? = $ac_status" >&5
22360   (exit "$ac_status"); }; then
22361                         test -n "$verbose" && echo "$as_me:22361: result: ... -$cf_opt" >&5
22362 echo "${ECHO_T}... -$cf_opt" >&6
22363                         case "$cf_opt" in
22364                         (Winline)
22365                                 case "$GCC_VERSION" in
22366                                 ([34].*)
22367                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22368
22369 echo "${as_me:-configure}:22369: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22370
22371                                         continue;;
22372                                 esac
22373                                 ;;
22374                         (Wpointer-arith)
22375                                 case "$GCC_VERSION" in
22376                                 ([12].*)
22377                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22378
22379 echo "${as_me:-configure}:22379: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22380
22381                                         continue;;
22382                                 esac
22383                                 ;;
22384                         esac
22385                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22386                 fi
22387         done
22388         CFLAGS="$cf_save_CFLAGS"
22389 fi
22390 rm -rf ./conftest*
22391
22392 fi
22393
22394 fi
22395
22396 echo "$as_me:22396: checking if you want to use dmalloc for testing" >&5
22397 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22398
22399 # Check whether --with-dmalloc or --without-dmalloc was given.
22400 if test "${with_dmalloc+set}" = set; then
22401   withval="$with_dmalloc"
22402   case "x$withval" in
22403         (x|xno) ;;
22404         (*)
22405                 : "${with_cflags:=-g}"
22406                 : "${enable_leaks:=no}"
22407                 with_dmalloc=yes
22408
22409 cat >>confdefs.h <<EOF
22410 #define USE_DMALLOC 1
22411 EOF
22412
22413                 ;;
22414         esac
22415 else
22416   with_dmalloc=
22417 fi;
22418 echo "$as_me:22418: result: ${with_dmalloc:-no}" >&5
22419 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22420
22421 case ".$with_cflags" in
22422 (.*-g*)
22423         case .$CFLAGS in
22424         (.*-g*)
22425                 ;;
22426         (*)
22427
22428 cf_fix_cppflags=no
22429 cf_new_cflags=
22430 cf_new_cppflags=
22431 cf_new_extra_cppflags=
22432
22433 for cf_add_cflags in -g
22434 do
22435 case "$cf_fix_cppflags" in
22436 (no)
22437         case "$cf_add_cflags" in
22438         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22439                 case "$cf_add_cflags" in
22440                 (-D*)
22441                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22442
22443                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22444                                 && test -z "${cf_tst_cflags}" \
22445                                 && cf_fix_cppflags=yes
22446
22447                         if test "$cf_fix_cppflags" = yes ; then
22448
22449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22451
22452                                 continue
22453                         elif test "${cf_tst_cflags}" = "\"'" ; then
22454
22455         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22456         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22457
22458                                 continue
22459                         fi
22460                         ;;
22461                 esac
22462                 case "$CPPFLAGS" in
22463                 (*$cf_add_cflags)
22464                         ;;
22465                 (*)
22466                         case "$cf_add_cflags" in
22467                         (-D*)
22468                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22469
22470 CPPFLAGS=`echo "$CPPFLAGS" | \
22471         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22472                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22473
22474                                 ;;
22475                         esac
22476
22477         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22478         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22479
22480                         ;;
22481                 esac
22482                 ;;
22483         (*)
22484
22485         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22486         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22487
22488                 ;;
22489         esac
22490         ;;
22491 (yes)
22492
22493         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22494         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22495
22496         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22497
22498         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22499                 && test -z "${cf_tst_cflags}" \
22500                 && cf_fix_cppflags=no
22501         ;;
22502 esac
22503 done
22504
22505 if test -n "$cf_new_cflags" ; then
22506
22507         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22508         CFLAGS="${CFLAGS}$cf_new_cflags"
22509
22510 fi
22511
22512 if test -n "$cf_new_cppflags" ; then
22513
22514         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22515         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22516
22517 fi
22518
22519 if test -n "$cf_new_extra_cppflags" ; then
22520
22521         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22522         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22523
22524 fi
22525
22526                 ;;
22527         esac
22528         ;;
22529 esac
22530
22531 if test "$with_dmalloc" = yes ; then
22532         echo "$as_me:22532: checking for dmalloc.h" >&5
22533 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22534 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22535   echo $ECHO_N "(cached) $ECHO_C" >&6
22536 else
22537   cat >"conftest.$ac_ext" <<_ACEOF
22538 #line 22538 "configure"
22539 #include "confdefs.h"
22540 #include <dmalloc.h>
22541 _ACEOF
22542 if { (eval echo "$as_me:22542: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22543   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22544   ac_status=$?
22545   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22546   rm -f conftest.er1
22547   cat conftest.err >&5
22548   echo "$as_me:22548: \$? = $ac_status" >&5
22549   (exit "$ac_status"); } >/dev/null; then
22550   if test -s conftest.err; then
22551     ac_cpp_err=$ac_c_preproc_warn_flag
22552   else
22553     ac_cpp_err=
22554   fi
22555 else
22556   ac_cpp_err=yes
22557 fi
22558 if test -z "$ac_cpp_err"; then
22559   ac_cv_header_dmalloc_h=yes
22560 else
22561   echo "$as_me: failed program was:" >&5
22562   cat "conftest.$ac_ext" >&5
22563   ac_cv_header_dmalloc_h=no
22564 fi
22565 rm -f conftest.err "conftest.$ac_ext"
22566 fi
22567 echo "$as_me:22567: result: $ac_cv_header_dmalloc_h" >&5
22568 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22569 if test "$ac_cv_header_dmalloc_h" = yes; then
22570
22571 echo "$as_me:22571: checking for dmalloc_debug in -ldmalloc" >&5
22572 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22573 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22574   echo $ECHO_N "(cached) $ECHO_C" >&6
22575 else
22576   ac_check_lib_save_LIBS=$LIBS
22577 LIBS="-ldmalloc  $LIBS"
22578 cat >"conftest.$ac_ext" <<_ACEOF
22579 #line 22579 "configure"
22580 #include "confdefs.h"
22581
22582 /* Override any gcc2 internal prototype to avoid an error.  */
22583 #ifdef __cplusplus
22584 extern "C"
22585 #endif
22586 /* We use char because int might match the return type of a gcc2
22587    builtin and then its argument prototype would still apply.  */
22588 char dmalloc_debug ();
22589 int
22590 main (void)
22591 {
22592 dmalloc_debug ();
22593   ;
22594   return 0;
22595 }
22596 _ACEOF
22597 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22598 if { (eval echo "$as_me:22598: \"$ac_link\"") >&5
22599   (eval $ac_link) 2>&5
22600   ac_status=$?
22601   echo "$as_me:22601: \$? = $ac_status" >&5
22602   (exit "$ac_status"); } &&
22603          { ac_try='test -s "conftest$ac_exeext"'
22604   { (eval echo "$as_me:22604: \"$ac_try\"") >&5
22605   (eval $ac_try) 2>&5
22606   ac_status=$?
22607   echo "$as_me:22607: \$? = $ac_status" >&5
22608   (exit "$ac_status"); }; }; then
22609   ac_cv_lib_dmalloc_dmalloc_debug=yes
22610 else
22611   echo "$as_me: failed program was:" >&5
22612 cat "conftest.$ac_ext" >&5
22613 ac_cv_lib_dmalloc_dmalloc_debug=no
22614 fi
22615 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22616 LIBS=$ac_check_lib_save_LIBS
22617 fi
22618 echo "$as_me:22618: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22619 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22620 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22621   cat >>confdefs.h <<EOF
22622 #define HAVE_LIBDMALLOC 1
22623 EOF
22624
22625   LIBS="-ldmalloc $LIBS"
22626
22627 fi
22628
22629 fi
22630
22631 fi
22632
22633 echo "$as_me:22633: checking if you want to use dbmalloc for testing" >&5
22634 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22635
22636 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22637 if test "${with_dbmalloc+set}" = set; then
22638   withval="$with_dbmalloc"
22639   case "x$withval" in
22640         (x|xno) ;;
22641         (*)
22642                 : "${with_cflags:=-g}"
22643                 : "${enable_leaks:=no}"
22644                 with_dbmalloc=yes
22645
22646 cat >>confdefs.h <<EOF
22647 #define USE_DBMALLOC 1
22648 EOF
22649
22650                 ;;
22651         esac
22652 else
22653   with_dbmalloc=
22654 fi;
22655 echo "$as_me:22655: result: ${with_dbmalloc:-no}" >&5
22656 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22657
22658 case ".$with_cflags" in
22659 (.*-g*)
22660         case .$CFLAGS in
22661         (.*-g*)
22662                 ;;
22663         (*)
22664
22665 cf_fix_cppflags=no
22666 cf_new_cflags=
22667 cf_new_cppflags=
22668 cf_new_extra_cppflags=
22669
22670 for cf_add_cflags in -g
22671 do
22672 case "$cf_fix_cppflags" in
22673 (no)
22674         case "$cf_add_cflags" in
22675         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22676                 case "$cf_add_cflags" in
22677                 (-D*)
22678                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22679
22680                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22681                                 && test -z "${cf_tst_cflags}" \
22682                                 && cf_fix_cppflags=yes
22683
22684                         if test "$cf_fix_cppflags" = yes ; then
22685
22686         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22687         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22688
22689                                 continue
22690                         elif test "${cf_tst_cflags}" = "\"'" ; then
22691
22692         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22693         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22694
22695                                 continue
22696                         fi
22697                         ;;
22698                 esac
22699                 case "$CPPFLAGS" in
22700                 (*$cf_add_cflags)
22701                         ;;
22702                 (*)
22703                         case "$cf_add_cflags" in
22704                         (-D*)
22705                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22706
22707 CPPFLAGS=`echo "$CPPFLAGS" | \
22708         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22709                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22710
22711                                 ;;
22712                         esac
22713
22714         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22715         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22716
22717                         ;;
22718                 esac
22719                 ;;
22720         (*)
22721
22722         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22723         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22724
22725                 ;;
22726         esac
22727         ;;
22728 (yes)
22729
22730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22732
22733         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22734
22735         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22736                 && test -z "${cf_tst_cflags}" \
22737                 && cf_fix_cppflags=no
22738         ;;
22739 esac
22740 done
22741
22742 if test -n "$cf_new_cflags" ; then
22743
22744         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22745         CFLAGS="${CFLAGS}$cf_new_cflags"
22746
22747 fi
22748
22749 if test -n "$cf_new_cppflags" ; then
22750
22751         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22752         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22753
22754 fi
22755
22756 if test -n "$cf_new_extra_cppflags" ; then
22757
22758         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22759         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22760
22761 fi
22762
22763                 ;;
22764         esac
22765         ;;
22766 esac
22767
22768 if test "$with_dbmalloc" = yes ; then
22769         echo "$as_me:22769: checking for dbmalloc.h" >&5
22770 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22771 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22772   echo $ECHO_N "(cached) $ECHO_C" >&6
22773 else
22774   cat >"conftest.$ac_ext" <<_ACEOF
22775 #line 22775 "configure"
22776 #include "confdefs.h"
22777 #include <dbmalloc.h>
22778 _ACEOF
22779 if { (eval echo "$as_me:22779: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22780   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22781   ac_status=$?
22782   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22783   rm -f conftest.er1
22784   cat conftest.err >&5
22785   echo "$as_me:22785: \$? = $ac_status" >&5
22786   (exit "$ac_status"); } >/dev/null; then
22787   if test -s conftest.err; then
22788     ac_cpp_err=$ac_c_preproc_warn_flag
22789   else
22790     ac_cpp_err=
22791   fi
22792 else
22793   ac_cpp_err=yes
22794 fi
22795 if test -z "$ac_cpp_err"; then
22796   ac_cv_header_dbmalloc_h=yes
22797 else
22798   echo "$as_me: failed program was:" >&5
22799   cat "conftest.$ac_ext" >&5
22800   ac_cv_header_dbmalloc_h=no
22801 fi
22802 rm -f conftest.err "conftest.$ac_ext"
22803 fi
22804 echo "$as_me:22804: result: $ac_cv_header_dbmalloc_h" >&5
22805 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22806 if test "$ac_cv_header_dbmalloc_h" = yes; then
22807
22808 echo "$as_me:22808: checking for debug_malloc in -ldbmalloc" >&5
22809 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22810 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22811   echo $ECHO_N "(cached) $ECHO_C" >&6
22812 else
22813   ac_check_lib_save_LIBS=$LIBS
22814 LIBS="-ldbmalloc  $LIBS"
22815 cat >"conftest.$ac_ext" <<_ACEOF
22816 #line 22816 "configure"
22817 #include "confdefs.h"
22818
22819 /* Override any gcc2 internal prototype to avoid an error.  */
22820 #ifdef __cplusplus
22821 extern "C"
22822 #endif
22823 /* We use char because int might match the return type of a gcc2
22824    builtin and then its argument prototype would still apply.  */
22825 char debug_malloc ();
22826 int
22827 main (void)
22828 {
22829 debug_malloc ();
22830   ;
22831   return 0;
22832 }
22833 _ACEOF
22834 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22835 if { (eval echo "$as_me:22835: \"$ac_link\"") >&5
22836   (eval $ac_link) 2>&5
22837   ac_status=$?
22838   echo "$as_me:22838: \$? = $ac_status" >&5
22839   (exit "$ac_status"); } &&
22840          { ac_try='test -s "conftest$ac_exeext"'
22841   { (eval echo "$as_me:22841: \"$ac_try\"") >&5
22842   (eval $ac_try) 2>&5
22843   ac_status=$?
22844   echo "$as_me:22844: \$? = $ac_status" >&5
22845   (exit "$ac_status"); }; }; then
22846   ac_cv_lib_dbmalloc_debug_malloc=yes
22847 else
22848   echo "$as_me: failed program was:" >&5
22849 cat "conftest.$ac_ext" >&5
22850 ac_cv_lib_dbmalloc_debug_malloc=no
22851 fi
22852 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22853 LIBS=$ac_check_lib_save_LIBS
22854 fi
22855 echo "$as_me:22855: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22856 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22857 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22858   cat >>confdefs.h <<EOF
22859 #define HAVE_LIBDBMALLOC 1
22860 EOF
22861
22862   LIBS="-ldbmalloc $LIBS"
22863
22864 fi
22865
22866 fi
22867
22868 fi
22869
22870 echo "$as_me:22870: checking if you want to use valgrind for testing" >&5
22871 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22872
22873 # Check whether --with-valgrind or --without-valgrind was given.
22874 if test "${with_valgrind+set}" = set; then
22875   withval="$with_valgrind"
22876   case "x$withval" in
22877         (x|xno) ;;
22878         (*)
22879                 : "${with_cflags:=-g}"
22880                 : "${enable_leaks:=no}"
22881                 with_valgrind=yes
22882
22883 cat >>confdefs.h <<EOF
22884 #define USE_VALGRIND 1
22885 EOF
22886
22887                 ;;
22888         esac
22889 else
22890   with_valgrind=
22891 fi;
22892 echo "$as_me:22892: result: ${with_valgrind:-no}" >&5
22893 echo "${ECHO_T}${with_valgrind:-no}" >&6
22894
22895 case ".$with_cflags" in
22896 (.*-g*)
22897         case .$CFLAGS in
22898         (.*-g*)
22899                 ;;
22900         (*)
22901
22902 cf_fix_cppflags=no
22903 cf_new_cflags=
22904 cf_new_cppflags=
22905 cf_new_extra_cppflags=
22906
22907 for cf_add_cflags in -g
22908 do
22909 case "$cf_fix_cppflags" in
22910 (no)
22911         case "$cf_add_cflags" in
22912         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22913                 case "$cf_add_cflags" in
22914                 (-D*)
22915                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22916
22917                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22918                                 && test -z "${cf_tst_cflags}" \
22919                                 && cf_fix_cppflags=yes
22920
22921                         if test "$cf_fix_cppflags" = yes ; then
22922
22923         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22924         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22925
22926                                 continue
22927                         elif test "${cf_tst_cflags}" = "\"'" ; then
22928
22929         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22930         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22931
22932                                 continue
22933                         fi
22934                         ;;
22935                 esac
22936                 case "$CPPFLAGS" in
22937                 (*$cf_add_cflags)
22938                         ;;
22939                 (*)
22940                         case "$cf_add_cflags" in
22941                         (-D*)
22942                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22943
22944 CPPFLAGS=`echo "$CPPFLAGS" | \
22945         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22946                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22947
22948                                 ;;
22949                         esac
22950
22951         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22952         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22953
22954                         ;;
22955                 esac
22956                 ;;
22957         (*)
22958
22959         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22960         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22961
22962                 ;;
22963         esac
22964         ;;
22965 (yes)
22966
22967         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22968         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22969
22970         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22971
22972         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22973                 && test -z "${cf_tst_cflags}" \
22974                 && cf_fix_cppflags=no
22975         ;;
22976 esac
22977 done
22978
22979 if test -n "$cf_new_cflags" ; then
22980
22981         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22982         CFLAGS="${CFLAGS}$cf_new_cflags"
22983
22984 fi
22985
22986 if test -n "$cf_new_cppflags" ; then
22987
22988         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22989         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22990
22991 fi
22992
22993 if test -n "$cf_new_extra_cppflags" ; then
22994
22995         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22996         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22997
22998 fi
22999
23000                 ;;
23001         esac
23002         ;;
23003 esac
23004
23005 echo "$as_me:23005: checking if you want to perform memory-leak testing" >&5
23006 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
23007
23008 # Check whether --enable-leaks or --disable-leaks was given.
23009 if test "${enable_leaks+set}" = set; then
23010   enableval="$enable_leaks"
23011   enable_leaks=$enableval
23012 else
23013   enable_leaks=yes
23014 fi;
23015 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
23016 echo "$as_me:23016: result: $with_no_leaks" >&5
23017 echo "${ECHO_T}$with_no_leaks" >&6
23018
23019 if test "$enable_leaks" = no ; then
23020
23021 cat >>confdefs.h <<\EOF
23022 #define NO_LEAKS 1
23023 EOF
23024
23025 cat >>confdefs.h <<\EOF
23026 #define YY_NO_LEAKS 1
23027 EOF
23028
23029 fi
23030
23031 LD_RPATH_OPT=
23032 if test "x$cf_cv_enable_rpath" != xno
23033 then
23034         echo "$as_me:23034: checking for an rpath option" >&5
23035 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
23036         case "$cf_cv_system_name" in
23037         (irix*)
23038                 if test "$GCC" = yes; then
23039                         LD_RPATH_OPT="-Wl,-rpath,"
23040                 else
23041                         LD_RPATH_OPT="-rpath "
23042                 fi
23043                 ;;
23044         (linux*|gnu*|k*bsd*-gnu|freebsd*)
23045                 LD_RPATH_OPT="-Wl,-rpath,"
23046                 ;;
23047         (openbsd[2-9].*|mirbsd*)
23048                 LD_RPATH_OPT="-Wl,-rpath,"
23049                 ;;
23050         (dragonfly*)
23051                 LD_RPATH_OPT="-rpath "
23052                 ;;
23053         (netbsd*)
23054                 LD_RPATH_OPT="-Wl,-rpath,"
23055                 ;;
23056         (osf*|mls+*)
23057                 LD_RPATH_OPT="-rpath "
23058                 ;;
23059         (solaris2*)
23060                 LD_RPATH_OPT="-R"
23061                 ;;
23062         (*)
23063                 ;;
23064         esac
23065         echo "$as_me:23065: result: $LD_RPATH_OPT" >&5
23066 echo "${ECHO_T}$LD_RPATH_OPT" >&6
23067
23068         case "x$LD_RPATH_OPT" in
23069         (x-R*)
23070                 echo "$as_me:23070: checking if we need a space after rpath option" >&5
23071 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
23072                 cf_save_LIBS="$LIBS"
23073
23074 cf_add_libs="$LIBS"
23075 # reverse order
23076 cf_add_0lib=
23077 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
23078 # filter duplicates
23079 for cf_add_1lib in $cf_add_0lib; do
23080         for cf_add_2lib in $cf_add_libs; do
23081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
23082                         cf_add_1lib=
23083                         break
23084                 fi
23085         done
23086         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
23087 done
23088 LIBS="$cf_add_libs"
23089
23090                 cat >"conftest.$ac_ext" <<_ACEOF
23091 #line 23091 "configure"
23092 #include "confdefs.h"
23093
23094 int
23095 main (void)
23096 {
23097
23098   ;
23099   return 0;
23100 }
23101 _ACEOF
23102 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23103 if { (eval echo "$as_me:23103: \"$ac_link\"") >&5
23104   (eval $ac_link) 2>&5
23105   ac_status=$?
23106   echo "$as_me:23106: \$? = $ac_status" >&5
23107   (exit "$ac_status"); } &&
23108          { ac_try='test -s "conftest$ac_exeext"'
23109   { (eval echo "$as_me:23109: \"$ac_try\"") >&5
23110   (eval $ac_try) 2>&5
23111   ac_status=$?
23112   echo "$as_me:23112: \$? = $ac_status" >&5
23113   (exit "$ac_status"); }; }; then
23114   cf_rpath_space=no
23115 else
23116   echo "$as_me: failed program was:" >&5
23117 cat "conftest.$ac_ext" >&5
23118 cf_rpath_space=yes
23119 fi
23120 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23121                 LIBS="$cf_save_LIBS"
23122                 echo "$as_me:23122: result: $cf_rpath_space" >&5
23123 echo "${ECHO_T}$cf_rpath_space" >&6
23124                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
23125                 ;;
23126         esac
23127 fi
23128
23129 echo "$as_me:23129: checking if rpath-hack should be disabled" >&5
23130 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
23131
23132 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
23133 if test "${enable_rpath_hack+set}" = set; then
23134   enableval="$enable_rpath_hack"
23135   test "$enableval" != no && enableval=yes
23136         if test "$enableval" != "yes" ; then
23137     enable_rpath_hack=no
23138         else
23139                 enable_rpath_hack=yes
23140         fi
23141 else
23142   enableval=yes
23143         enable_rpath_hack=yes
23144
23145 fi;
23146 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
23147 echo "$as_me:23147: result: $cf_disable_rpath_hack" >&5
23148 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
23149
23150 if test "$enable_rpath_hack" = yes ; then
23151
23152 echo "$as_me:23152: checking for updated LDFLAGS" >&5
23153 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
23154 if test -n "$LD_RPATH_OPT" ; then
23155         echo "$as_me:23155: result: maybe" >&5
23156 echo "${ECHO_T}maybe" >&6
23157
23158         for ac_prog in ldd
23159 do
23160   # Extract the first word of "$ac_prog", so it can be a program name with args.
23161 set dummy $ac_prog; ac_word=$2
23162 echo "$as_me:23162: checking for $ac_word" >&5
23163 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23164 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
23165   echo $ECHO_N "(cached) $ECHO_C" >&6
23166 else
23167   if test -n "$cf_ldd_prog"; then
23168   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
23169 else
23170   ac_save_IFS=$IFS; IFS=$ac_path_separator
23171 ac_dummy="$PATH"
23172 for ac_dir in $ac_dummy; do
23173   IFS=$ac_save_IFS
23174   test -z "$ac_dir" && ac_dir=.
23175   $as_executable_p "$ac_dir/$ac_word" || continue
23176 ac_cv_prog_cf_ldd_prog="$ac_prog"
23177 echo "$as_me:23177: found $ac_dir/$ac_word" >&5
23178 break
23179 done
23180
23181 fi
23182 fi
23183 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
23184 if test -n "$cf_ldd_prog"; then
23185   echo "$as_me:23185: result: $cf_ldd_prog" >&5
23186 echo "${ECHO_T}$cf_ldd_prog" >&6
23187 else
23188   echo "$as_me:23188: result: no" >&5
23189 echo "${ECHO_T}no" >&6
23190 fi
23191
23192   test -n "$cf_ldd_prog" && break
23193 done
23194 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
23195
23196         cf_rpath_list="/usr/lib /lib"
23197         if test "$cf_ldd_prog" != no
23198         then
23199                 cf_rpath_oops=
23200
23201 cat >"conftest.$ac_ext" <<_ACEOF
23202 #line 23202 "configure"
23203 #include "confdefs.h"
23204 #include <stdio.h>
23205 int
23206 main (void)
23207 {
23208 printf("Hello");
23209   ;
23210   return 0;
23211 }
23212 _ACEOF
23213 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23214 if { (eval echo "$as_me:23214: \"$ac_link\"") >&5
23215   (eval $ac_link) 2>&5
23216   ac_status=$?
23217   echo "$as_me:23217: \$? = $ac_status" >&5
23218   (exit "$ac_status"); } &&
23219          { ac_try='test -s "conftest$ac_exeext"'
23220   { (eval echo "$as_me:23220: \"$ac_try\"") >&5
23221   (eval $ac_try) 2>&5
23222   ac_status=$?
23223   echo "$as_me:23223: \$? = $ac_status" >&5
23224   (exit "$ac_status"); }; }; then
23225   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
23226                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
23227 else
23228   echo "$as_me: failed program was:" >&5
23229 cat "conftest.$ac_ext" >&5
23230 fi
23231 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23232
23233                 # If we passed the link-test, but get a "not found" on a given library,
23234                 # this could be due to inept reconfiguration of gcc to make it only
23235                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
23236                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
23237                 # /usr/local libraries.
23238                 if test -n "$cf_rpath_oops"
23239                 then
23240                         for cf_rpath_src in $cf_rpath_oops
23241                         do
23242                                 for cf_rpath_dir in \
23243                                         /usr/local \
23244                                         /usr/pkg \
23245                                         /opt/sfw
23246                                 do
23247                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
23248                                         then
23249                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
23250
23251 echo "${as_me:-configure}:23251: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
23252
23253                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
23254                                                 break
23255                                         fi
23256                                 done
23257                         done
23258                 fi
23259         fi
23260
23261         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23262
23263 echo "${as_me:-configure}:23263: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23264
23265 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
23266
23267 echo "${as_me:-configure}:23267: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
23268
23269 cf_rpath_dst=
23270 for cf_rpath_src in $LDFLAGS
23271 do
23272         case "$cf_rpath_src" in
23273         (-L*)
23274
23275                 # check if this refers to a directory which we will ignore
23276                 cf_rpath_skip=no
23277                 if test -n "$cf_rpath_list"
23278                 then
23279                         for cf_rpath_item in $cf_rpath_list
23280                         do
23281                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23282                                 then
23283                                         cf_rpath_skip=yes
23284                                         break
23285                                 fi
23286                         done
23287                 fi
23288
23289                 if test "$cf_rpath_skip" = no
23290                 then
23291                         # transform the option
23292                         if test "$LD_RPATH_OPT" = "-R " ; then
23293                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23294                         else
23295                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23296                         fi
23297
23298                         # if we have not already added this, add it now
23299                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23300                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23301                         then
23302                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23303
23304 echo "${as_me:-configure}:23304: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23305
23306                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23307                         fi
23308                 fi
23309                 ;;
23310         esac
23311         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23312 done
23313 LDFLAGS=$cf_rpath_dst
23314
23315 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
23316
23317 echo "${as_me:-configure}:23317: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
23318
23319 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23320
23321 echo "${as_me:-configure}:23321: testing ...checking LIBS $LIBS ..." 1>&5
23322
23323 cf_rpath_dst=
23324 for cf_rpath_src in $LIBS
23325 do
23326         case "$cf_rpath_src" in
23327         (-L*)
23328
23329                 # check if this refers to a directory which we will ignore
23330                 cf_rpath_skip=no
23331                 if test -n "$cf_rpath_list"
23332                 then
23333                         for cf_rpath_item in $cf_rpath_list
23334                         do
23335                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23336                                 then
23337                                         cf_rpath_skip=yes
23338                                         break
23339                                 fi
23340                         done
23341                 fi
23342
23343                 if test "$cf_rpath_skip" = no
23344                 then
23345                         # transform the option
23346                         if test "$LD_RPATH_OPT" = "-R " ; then
23347                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23348                         else
23349                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23350                         fi
23351
23352                         # if we have not already added this, add it now
23353                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23354                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23355                         then
23356                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23357
23358 echo "${as_me:-configure}:23358: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23359
23360                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23361                         fi
23362                 fi
23363                 ;;
23364         esac
23365         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23366 done
23367 LIBS=$cf_rpath_dst
23368
23369 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23370
23371 echo "${as_me:-configure}:23371: testing ...checked LIBS $LIBS ..." 1>&5
23372
23373         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23374
23375 echo "${as_me:-configure}:23375: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23376
23377 else
23378         echo "$as_me:23378: result: no" >&5
23379 echo "${ECHO_T}no" >&6
23380 fi
23381
23382 fi
23383
23384 TEST_ARGS="$LIBS"
23385 LIBS=
23386
23387 ac_config_files="$ac_config_files Makefile"
23388 ac_config_commands="$ac_config_commands default"
23389 cat >confcache <<\_ACEOF
23390 # This file is a shell script that caches the results of configure
23391 # tests run on this system so they can be shared between configure
23392 # scripts and configure runs, see configure's option --config-cache.
23393 # It is not useful on other systems.  If it contains results you don't
23394 # want to keep, you may remove or edit it.
23395 #
23396 # config.status only pays attention to the cache file if you give it
23397 # the --recheck option to rerun configure.
23398 #
23399 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23400 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23401 # following values.
23402
23403 _ACEOF
23404
23405 # The following way of writing the cache mishandles newlines in values,
23406 # but we know of no workaround that is simple, portable, and efficient.
23407 # So, don't put newlines in cache variables' values.
23408 # Ultrix sh set writes to stderr and can't be redirected directly,
23409 # and sets the high bit in the cache file unless we assign to the vars.
23410 {
23411   (set) 2>&1 |
23412     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23413     *ac_space=\ *)
23414       # `set' does not quote correctly, so add quotes (double-quote
23415       # substitution turns \\\\ into \\, and sed turns \\ into \).
23416       sed -n \
23417         "s/'/'\\\\''/g;
23418           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23419       ;;
23420     *)
23421       # `set' quotes correctly as required by POSIX, so do not add quotes.
23422       sed -n \
23423         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23424       ;;
23425     esac;
23426 } |
23427   sed '
23428      t clear
23429      : clear
23430      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23431      t end
23432      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23433      : end' >>confcache
23434 if cmp -s $cache_file confcache; then :; else
23435   if test -w $cache_file; then
23436     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23437     cat confcache >$cache_file
23438   else
23439     echo "not updating unwritable cache $cache_file"
23440   fi
23441 fi
23442 rm -f confcache
23443
23444 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23445 # Let make expand exec_prefix.
23446 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23447
23448 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23449 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23450 # trailing colons and then remove the whole line if VPATH becomes empty
23451 # (actually we leave an empty line to preserve line numbers).
23452 if test "x$srcdir" = x.; then
23453   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23454 s/:*\$(srcdir):*/:/;
23455 s/:*\${srcdir}:*/:/;
23456 s/:*@srcdir@:*/:/;
23457 s/^\([^=]*=[    ]*\):*/\1/;
23458 s/:*$//;
23459 s/^[^=]*=[      ]*$//;
23460 }'
23461 fi
23462
23463 DEFS=-DHAVE_CONFIG_H
23464
23465 : "${CONFIG_STATUS=./config.status}"
23466 ac_clean_files_save=$ac_clean_files
23467 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23468 { echo "$as_me:23468: creating $CONFIG_STATUS" >&5
23469 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23470 cat >"$CONFIG_STATUS" <<_ACEOF
23471 #! $SHELL
23472 # Generated automatically by configure.
23473 # Run this file to recreate the current configuration.
23474 # Compiler output produced by configure, useful for debugging
23475 # configure, is in config.log if it exists.
23476
23477 debug=false
23478 SHELL=\${CONFIG_SHELL-$SHELL}
23479 ac_cs_invocation="\$0 \$@"
23480
23481 CLICOLOR_FORCE= GREP_OPTIONS=
23482 unset CLICOLOR_FORCE GREP_OPTIONS
23483 _ACEOF
23484
23485 cat >>"$CONFIG_STATUS" <<\_ACEOF
23486 # Be Bourne compatible
23487 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23488   emulate sh
23489   NULLCMD=:
23490 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23491   set -o posix
23492 fi
23493
23494 # Name of the executable.
23495 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23496
23497 if expr a : '\(a\)' >/dev/null 2>&1; then
23498   as_expr=expr
23499 else
23500   as_expr=false
23501 fi
23502
23503 rm -f conf$$ conf$$.exe conf$$.file
23504 echo >conf$$.file
23505 if ln -s conf$$.file conf$$ 2>/dev/null; then
23506   # We could just check for DJGPP; but this test a) works b) is more generic
23507   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23508   if test -f conf$$.exe; then
23509     # Don't use ln at all; we don't have any links
23510     as_ln_s='cp -p'
23511   else
23512     as_ln_s='ln -s'
23513   fi
23514 elif ln conf$$.file conf$$ 2>/dev/null; then
23515   as_ln_s=ln
23516 else
23517   as_ln_s='cp -p'
23518 fi
23519 rm -f conf$$ conf$$.exe conf$$.file
23520
23521 as_executable_p="test -f"
23522
23523 # Support unset when possible.
23524 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23525   as_unset="unset"
23526 else
23527   as_unset="false"
23528 fi
23529
23530 # NLS nuisances.
23531 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23532 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23533 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23534 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23535 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23536 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23537 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23538 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23539
23540 # IFS
23541 # We need space, tab and new line, in precisely that order.
23542 as_nl='
23543 '
23544 IFS="   $as_nl"
23545
23546 # CDPATH.
23547 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23548
23549 exec 6>&1
23550
23551 _ACEOF
23552
23553 # Files that config.status was made for.
23554 if test -n "$ac_config_files"; then
23555   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23556 fi
23557
23558 if test -n "$ac_config_headers"; then
23559   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23560 fi
23561
23562 if test -n "$ac_config_links"; then
23563   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23564 fi
23565
23566 if test -n "$ac_config_commands"; then
23567   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23568 fi
23569
23570 cat >>"$CONFIG_STATUS" <<\EOF
23571
23572 ac_cs_usage="\
23573 \`$as_me' instantiates files from templates according to the
23574 current configuration.
23575
23576 Usage: $0 [OPTIONS] [FILE]...
23577
23578   -h, --help       print this help, then exit
23579   -V, --version    print version number, then exit
23580   -d, --debug      don't remove temporary files
23581       --recheck    update $as_me by reconfiguring in the same conditions
23582   --file=FILE[:TEMPLATE]
23583                    instantiate the configuration file FILE
23584   --header=FILE[:TEMPLATE]
23585                    instantiate the configuration header FILE
23586
23587 Configuration files:
23588 $config_files
23589
23590 Configuration headers:
23591 $config_headers
23592
23593 Configuration commands:
23594 $config_commands
23595
23596 Report bugs to <dickey@invisible-island.net>."
23597 EOF
23598
23599 cat >>"$CONFIG_STATUS" <<EOF
23600 ac_cs_version="\\
23601 config.status
23602 configured by $0, generated by GNU Autoconf 2.52.20210509,
23603   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23604
23605 Copyright 2003-2020,2021        Thomas E. Dickey
23606 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23607 Free Software Foundation, Inc.
23608 This config.status script is free software; the Free Software Foundation
23609 gives unlimited permission to copy, distribute and modify it."
23610 srcdir="$srcdir"
23611 INSTALL="$INSTALL"
23612 EOF
23613
23614 cat >>"$CONFIG_STATUS" <<\EOF
23615 # If no file are specified by the user, then we need to provide default
23616 # value.  By we need to know if files were specified by the user.
23617 ac_need_defaults=:
23618 while test $# != 0
23619 do
23620   case $1 in
23621   --*=*)
23622     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23623     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23624     shift
23625     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23626     shift
23627     ;;
23628   -*);;
23629   *) # This is not an option, so the user has probably given explicit
23630      # arguments.
23631      ac_need_defaults=false;;
23632   esac
23633
23634   case $1 in
23635   # Handling of the options.
23636 EOF
23637 cat >>"$CONFIG_STATUS" <<EOF
23638   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23639     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23640     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23641 EOF
23642 cat >>"$CONFIG_STATUS" <<\EOF
23643   --version | --vers* | -V )
23644     echo "$ac_cs_version"; exit 0 ;;
23645   --he | --h)
23646     # Conflict between --help and --header
23647     { { echo "$as_me:23647: error: ambiguous option: $1
23648 Try \`$0 --help' for more information." >&5
23649 echo "$as_me: error: ambiguous option: $1
23650 Try \`$0 --help' for more information." >&2;}
23651    { (exit 1); exit 1; }; };;
23652   --help | --hel | -h )
23653     echo "$ac_cs_usage"; exit 0 ;;
23654   --debug | --d* | -d )
23655     debug=: ;;
23656   --file | --fil | --fi | --f )
23657     shift
23658     CONFIG_FILES="$CONFIG_FILES $1"
23659     ac_need_defaults=false;;
23660   --header | --heade | --head | --hea )
23661     shift
23662     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23663     ac_need_defaults=false;;
23664
23665   # This is an error.
23666   -*) { { echo "$as_me:23666: error: unrecognized option: $1
23667 Try \`$0 --help' for more information." >&5
23668 echo "$as_me: error: unrecognized option: $1
23669 Try \`$0 --help' for more information." >&2;}
23670    { (exit 1); exit 1; }; } ;;
23671
23672   *) ac_config_targets="$ac_config_targets $1" ;;
23673
23674   esac
23675   shift
23676 done
23677
23678 exec 5>>config.log
23679 cat >&5 << _ACEOF
23680
23681 ## ----------------------- ##
23682 ## Running config.status.  ##
23683 ## ----------------------- ##
23684
23685 This file was extended by $as_me 2.52.20210509, executed with
23686   CONFIG_FILES    = $CONFIG_FILES
23687   CONFIG_HEADERS  = $CONFIG_HEADERS
23688   CONFIG_LINKS    = $CONFIG_LINKS
23689   CONFIG_COMMANDS = $CONFIG_COMMANDS
23690   > "$ac_cs_invocation"
23691 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23692
23693 _ACEOF
23694 EOF
23695
23696 cat >>"$CONFIG_STATUS" <<EOF
23697 #
23698 # INIT-COMMANDS section.
23699 #
23700
23701 AWK="$AWK"
23702 ECHO_CC="$ECHO_CC"
23703 ECHO_LD="$ECHO_LD"
23704 SHOW_CC="$SHOW_LD"
23705
23706 EOF
23707
23708 cat >>"$CONFIG_STATUS" <<\EOF
23709 for ac_config_target in $ac_config_targets
23710 do
23711   case "$ac_config_target" in
23712   # Handling of arguments.
23713   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23714   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23715   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23716   *) { { echo "$as_me:23716: error: invalid argument: $ac_config_target" >&5
23717 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23718    { (exit 1); exit 1; }; };;
23719   esac
23720 done
23721
23722 # If the user did not use the arguments to specify the items to instantiate,
23723 # then the envvar interface is used.  Set only those that are not.
23724 # We use the long form for the default assignment because of an extremely
23725 # bizarre bug on SunOS 4.1.3.
23726 if "$ac_need_defaults"; then
23727   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23728   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23729   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23730 fi
23731
23732 # Create a temporary directory, and hook for its removal unless debugging.
23733 $debug ||
23734 {
23735   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23736   trap '{ (exit 1); exit 1; }' 1 2 13 15
23737 }
23738
23739 # Create a (secure) tmp directory for tmp files.
23740 : ${TMPDIR=/tmp}
23741 {
23742   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23743   test -n "$tmp" && test -d "$tmp"
23744 }  ||
23745 {
23746   tmp=$TMPDIR/cs$$-$RANDOM
23747   (umask 077 && mkdir $tmp)
23748 } ||
23749 {
23750    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23751    { (exit 1); exit 1; }
23752 }
23753
23754 EOF
23755
23756 cat >>"$CONFIG_STATUS" <<EOF
23757
23758 #
23759 # CONFIG_FILES section.
23760 #
23761
23762 # No need to generate the scripts if there are no CONFIG_FILES.
23763 # This happens for instance when ./config.status config.h
23764 if test -n "\$CONFIG_FILES"; then
23765   # Protect against being on the right side of a sed subst in config.status.
23766   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23767    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23768 s,@SHELL@,$SHELL,;t t
23769 s,@exec_prefix@,$exec_prefix,;t t
23770 s,@prefix@,$prefix,;t t
23771 s,@program_transform_name@,$program_transform_name,;t t
23772 s,@bindir@,$bindir,;t t
23773 s,@sbindir@,$sbindir,;t t
23774 s,@libexecdir@,$libexecdir,;t t
23775 s,@datarootdir@,$datarootdir,;t t
23776 s,@datadir@,$datadir,;t t
23777 s,@sysconfdir@,$sysconfdir,;t t
23778 s,@sharedstatedir@,$sharedstatedir,;t t
23779 s,@localstatedir@,$localstatedir,;t t
23780 s,@runstatedir@,$runstatedir,;t t
23781 s,@libdir@,$libdir,;t t
23782 s,@includedir@,$includedir,;t t
23783 s,@oldincludedir@,$oldincludedir,;t t
23784 s,@infodir@,$infodir,;t t
23785 s,@mandir@,$mandir,;t t
23786 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23787 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23788 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23789 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23790 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23791 s,@build_alias@,$build_alias,;t t
23792 s,@host_alias@,$host_alias,;t t
23793 s,@target_alias@,$target_alias,;t t
23794 s,@ECHO_C@,$ECHO_C,;t t
23795 s,@ECHO_N@,$ECHO_N,;t t
23796 s,@ECHO_T@,$ECHO_T,;t t
23797 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23798 s,@DEFS@,$DEFS,;t t
23799 s,@LIBS@,$LIBS,;t t
23800 s,@build@,$build,;t t
23801 s,@build_cpu@,$build_cpu,;t t
23802 s,@build_vendor@,$build_vendor,;t t
23803 s,@build_os@,$build_os,;t t
23804 s,@host@,$host,;t t
23805 s,@host_cpu@,$host_cpu,;t t
23806 s,@host_vendor@,$host_vendor,;t t
23807 s,@host_os@,$host_os,;t t
23808 s,@SET_MAKE@,$SET_MAKE,;t t
23809 s,@CC@,$CC,;t t
23810 s,@CFLAGS@,$CFLAGS,;t t
23811 s,@LDFLAGS@,$LDFLAGS,;t t
23812 s,@CPPFLAGS@,$CPPFLAGS,;t t
23813 s,@ac_ct_CC@,$ac_ct_CC,;t t
23814 s,@EXEEXT@,$EXEEXT,;t t
23815 s,@OBJEXT@,$OBJEXT,;t t
23816 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23817 s,@CPP@,$CPP,;t t
23818 s,@GREP@,$GREP,;t t
23819 s,@EGREP@,$EGREP,;t t
23820 s,@AWK@,$AWK,;t t
23821 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23822 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23823 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23824 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23825 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23826 s,@LINT@,$LINT,;t t
23827 s,@LINT_OPTS@,$LINT_OPTS,;t t
23828 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
23829 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
23830 s,@CTAGS@,$CTAGS,;t t
23831 s,@ETAGS@,$ETAGS,;t t
23832 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23833 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23834 s,@MATH_LIB@,$MATH_LIB,;t t
23835 s,@top_builddir@,$top_builddir,;t t
23836 s,@CC_G_OPT@,$CC_G_OPT,;t t
23837 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23838 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23839 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23840 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23841 s,@LD@,$LD,;t t
23842 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23843 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23844 s,@LD_MODEL@,$LD_MODEL,;t t
23845 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23846 s,@LIBTOOL@,$LIBTOOL,;t t
23847 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23848 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23849 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23850 s,@LIB_LINK@,$LIB_LINK,;t t
23851 s,@LINK_TESTS@,$LINK_TESTS,;t t
23852 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23853 s,@PACKAGE@,$PACKAGE,;t t
23854 s,@PTHREAD@,$PTHREAD,;t t
23855 s,@TEST_ARGS@,$TEST_ARGS,;t t
23856 s,@TEST_DEPS@,$TEST_DEPS,;t t
23857 s,@TEST_LIBS@,$TEST_LIBS,;t t
23858 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23859 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23860 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23861 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23862 s,@includesubdir@,$includesubdir,;t t
23863 s,@FGREP@,$FGREP,;t t
23864 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23865 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
23866 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23867 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23868 s,@ECHO_LT@,$ECHO_LT,;t t
23869 s,@ECHO_LD@,$ECHO_LD,;t t
23870 s,@RULE_CC@,$RULE_CC,;t t
23871 s,@SHOW_CC@,$SHOW_CC,;t t
23872 s,@ECHO_CC@,$ECHO_CC,;t t
23873 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23874 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23875 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23876 s,@X_CFLAGS@,$X_CFLAGS,;t t
23877 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23878 s,@X_LIBS@,$X_LIBS,;t t
23879 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23880 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23881 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23882 s,@RGB_PATH@,$RGB_PATH,;t t
23883 s,@no_x11_rgb@,$no_x11_rgb,;t t
23884 s,@FORM_NAME@,$FORM_NAME,;t t
23885 s,@MENU_NAME@,$MENU_NAME,;t t
23886 s,@PANEL_NAME@,$PANEL_NAME,;t t
23887 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23888 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23889 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23890 CEOF
23891
23892 EOF
23893
23894   cat >>"$CONFIG_STATUS" <<\EOF
23895   # Split the substitutions into bite-sized pieces for seds with
23896   # small command number limits, like on Digital OSF/1 and HP-UX.
23897   ac_max_sed_lines=48
23898   ac_sed_frag=1 # Number of current file.
23899   ac_beg=1 # First line for current file.
23900   ac_end=$ac_max_sed_lines # Line after last line for current file.
23901   ac_more_lines=:
23902   ac_sed_cmds=
23903   while "$ac_more_lines"; do
23904     if test "$ac_beg" -gt 1; then
23905       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23906     else
23907       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23908     fi
23909     if test ! -s $tmp/subs.frag; then
23910       ac_more_lines=false
23911     else
23912       # The purpose of the label and of the branching condition is to
23913       # speed up the sed processing (if there are no `@' at all, there
23914       # is no need to browse any of the substitutions).
23915       # These are the two extra sed commands mentioned above.
23916       (echo ':t
23917   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23918       # It is possible to make a multiline substitution using escaped newlines.
23919       # Ensure that we do not split the substitution between script fragments.
23920       ac_BEG=$ac_end
23921       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23922       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23923       if test -s $tmp/subs.next; then
23924         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23925         if test ! -s $tmp/subs.edit; then
23926           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23927           if test ! -s $tmp/subs.edit; then
23928             if test "$ac_beg" -gt 1; then
23929               ac_end=`expr "$ac_end" - 1`
23930               continue
23931             fi
23932           fi
23933         fi
23934       fi
23935
23936       if test -z "$ac_sed_cmds"; then
23937         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23938       else
23939         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23940       fi
23941       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23942       ac_beg=$ac_end
23943       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23944     fi
23945   done
23946   if test -z "$ac_sed_cmds"; then
23947     ac_sed_cmds=cat
23948   fi
23949 fi # test -n "$CONFIG_FILES"
23950
23951 EOF
23952 cat >>"$CONFIG_STATUS" <<\EOF
23953 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23954   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23955   case "$ac_file" in
23956   - | *:- | *:-:* ) # input from stdin
23957         cat >$tmp/stdin
23958         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23959         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23960   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23961         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23962   * )   ac_file_in=$ac_file.in ;;
23963   esac
23964
23965   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23966   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23967          X"$ac_file" : 'X\(//\)[^/]' \| \
23968          X"$ac_file" : 'X\(//\)$' \| \
23969          X"$ac_file" : 'X\(/\)' \| \
23970          .     : '\(.\)' 2>/dev/null ||
23971 echo X"$ac_file" |
23972     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23973           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23974           /^X\(\/\/\)$/{ s//\1/; q; }
23975           /^X\(\/\).*/{ s//\1/; q; }
23976           s/.*/./; q'`
23977   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23978     { case "$ac_dir" in
23979   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23980   *)                      as_incr_dir=.;;
23981 esac
23982 as_dummy="$ac_dir"
23983 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23984   case $as_mkdir_dir in
23985     # Skip DOS drivespec
23986     ?:) as_incr_dir=$as_mkdir_dir ;;
23987     *)
23988       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23989       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23990     ;;
23991   esac
23992 done; }
23993
23994     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23995     # A "../" for each directory in $ac_dir_suffix.
23996     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23997   else
23998     ac_dir_suffix= ac_dots=
23999   fi
24000
24001   case "$srcdir" in
24002   .)  ac_srcdir=.
24003       if test -z "$ac_dots"; then
24004          ac_top_srcdir=.
24005       else
24006          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
24007       fi ;;
24008   [\\/]* | ?:[\\/]* )
24009       ac_srcdir="$srcdir$ac_dir_suffix";
24010       ac_top_srcdir="$srcdir" ;;
24011   *) # Relative path.
24012     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
24013     ac_top_srcdir="$ac_dots$srcdir" ;;
24014   esac
24015
24016   case $INSTALL in
24017   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
24018   *) ac_INSTALL=$ac_dots$INSTALL ;;
24019   esac
24020
24021   if test x"$ac_file" != x-; then
24022     { echo "$as_me:24022: creating $ac_file" >&5
24023 echo "$as_me: creating $ac_file" >&6;}
24024     rm -f "$ac_file"
24025   fi
24026   # Let's still pretend it is `configure' which instantiates (i.e., don't
24027   # use $as_me), people would be surprised to read:
24028   #    /* config.h.  Generated automatically by config.status.  */
24029   configure_input="Generated automatically from `echo $ac_file_in |
24030                                                  sed 's,.*/,,'` by configure."
24031
24032   # First look for the input files in the build tree, otherwise in the
24033   # src tree.
24034   ac_file_inputs=`IFS=:
24035     for f in $ac_file_in; do
24036       case $f in
24037       -) echo $tmp/stdin ;;
24038       [\\/$]*)
24039          # Absolute (can't be DOS-style, as IFS=:)
24040          test -f "$f" || { { echo "$as_me:24040: error: cannot find input file: $f" >&5
24041 echo "$as_me: error: cannot find input file: $f" >&2;}
24042    { (exit 1); exit 1; }; }
24043          echo $f;;
24044       *) # Relative
24045          if test -f "$f"; then
24046            # Build tree
24047            echo $f
24048          elif test -f "$srcdir/$f"; then
24049            # Source tree
24050            echo "$srcdir/$f"
24051          else
24052            # /dev/null tree
24053            { { echo "$as_me:24053: error: cannot find input file: $f" >&5
24054 echo "$as_me: error: cannot find input file: $f" >&2;}
24055    { (exit 1); exit 1; }; }
24056          fi;;
24057       esac
24058     done` || { (exit 1); exit 1; }
24059 EOF
24060 cat >>"$CONFIG_STATUS" <<\EOF
24061   ac_warn_datarootdir=no
24062   if test x"$ac_file" != x-; then
24063     for ac_item in $ac_file_inputs
24064     do
24065       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
24066       if test -n "$ac_seen"; then
24067         ac_used=`grep '@datarootdir@' "$ac_item"`
24068         if test -z "$ac_used"; then
24069           { echo "$as_me:24069: WARNING: datarootdir was used implicitly but not set:
24070 $ac_seen" >&5
24071 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
24072 $ac_seen" >&2;}
24073           ac_warn_datarootdir=yes
24074         fi
24075       fi
24076       ac_seen=`grep '${datarootdir}' "$ac_item"`
24077       if test -n "$ac_seen"; then
24078         { echo "$as_me:24078: WARNING: datarootdir was used explicitly but not set:
24079 $ac_seen" >&5
24080 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
24081 $ac_seen" >&2;}
24082         ac_warn_datarootdir=yes
24083       fi
24084     done
24085   fi
24086
24087 if test "x$ac_warn_datarootdir" = xyes; then
24088   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
24089 fi
24090
24091 EOF
24092 cat >>"$CONFIG_STATUS" <<EOF
24093   sed "$ac_vpsub
24094 $extrasub
24095 EOF
24096 cat >>"$CONFIG_STATUS" <<\EOF
24097 :t
24098 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
24099 s,@configure_input@,$configure_input,;t t
24100 s,@srcdir@,$ac_srcdir,;t t
24101 s,@top_srcdir@,$ac_top_srcdir,;t t
24102 s,@INSTALL@,$ac_INSTALL,;t t
24103 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
24104   rm -f $tmp/stdin
24105   if test x"$ac_file" != x-; then
24106     cp "$tmp/out" "$ac_file"
24107
24108     for ac_name in prefix exec_prefix datarootdir
24109     do
24110         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
24111         if test -n "$ac_seen"; then
24112             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
24113             if test -z "$ac_init"; then
24114               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
24115               { echo "$as_me:24115: WARNING: Variable $ac_name is used but was not set:
24116 $ac_seen" >&5
24117 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
24118 $ac_seen" >&2;}
24119             fi
24120         fi
24121     done
24122     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
24123     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
24124     if test -s $tmp/out; then
24125       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
24126       { echo "$as_me:24126: WARNING: Some variables may not be substituted:
24127 $ac_seen" >&5
24128 echo "$as_me: WARNING: Some variables may not be substituted:
24129 $ac_seen" >&2;}
24130     fi
24131   else
24132     cat $tmp/out
24133   fi
24134   rm -f $tmp/out
24135
24136 done
24137 EOF
24138 cat >>"$CONFIG_STATUS" <<\EOF
24139
24140 #
24141 # CONFIG_HEADER section.
24142 #
24143
24144 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24145 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24146 #
24147 # ac_d sets the value in "#define NAME VALUE" lines.
24148 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24149 ac_dB='[        ].*$,\1#\2'
24150 ac_dC=' '
24151 ac_dD=',;t'
24152 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24153 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24154 ac_iB='\([      ]\),\1#\2define\3'
24155 ac_iC=' '
24156 ac_iD='\4,;t'
24157 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24158 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24159 ac_uB='$,\1#\2define\3'
24160 ac_uC=' '
24161 ac_uD=',;t'
24162
24163 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
24164   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24165   case "$ac_file" in
24166   - | *:- | *:-:* ) # input from stdin
24167         cat >$tmp/stdin
24168         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24169         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24170   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24171         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24172   * )   ac_file_in=$ac_file.in ;;
24173   esac
24174
24175   test x"$ac_file" != x- && { echo "$as_me:24175: creating $ac_file" >&5
24176 echo "$as_me: creating $ac_file" >&6;}
24177
24178   # First look for the input files in the build tree, otherwise in the
24179   # src tree.
24180   ac_file_inputs=`IFS=:
24181     for f in $ac_file_in; do
24182       case $f in
24183       -) echo $tmp/stdin ;;
24184       [\\/$]*)
24185          # Absolute (can't be DOS-style, as IFS=:)
24186          test -f "$f" || { { echo "$as_me:24186: error: cannot find input file: $f" >&5
24187 echo "$as_me: error: cannot find input file: $f" >&2;}
24188    { (exit 1); exit 1; }; }
24189          echo $f;;
24190       *) # Relative
24191          if test -f "$f"; then
24192            # Build tree
24193            echo $f
24194          elif test -f "$srcdir/$f"; then
24195            # Source tree
24196            echo "$srcdir/$f"
24197          else
24198            # /dev/null tree
24199            { { echo "$as_me:24199: error: cannot find input file: $f" >&5
24200 echo "$as_me: error: cannot find input file: $f" >&2;}
24201    { (exit 1); exit 1; }; }
24202          fi;;
24203       esac
24204     done` || { (exit 1); exit 1; }
24205   # Remove the trailing spaces.
24206   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
24207
24208 EOF
24209
24210 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
24211 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
24212 # be either 'cat' or 'sort'.
24213 cat confdefs.h | uniq >conftest.vals
24214
24215 # Break up conftest.vals because some shells have a limit on
24216 # the size of here documents, and old seds have small limits too.
24217
24218 rm -f conftest.tail
24219 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
24220 while grep . conftest.vals >/dev/null
24221 do
24222   # Write chunks of a limited-size here document to conftest.frag.
24223   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
24224   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
24225   echo 'CEOF' >> "$CONFIG_STATUS"
24226   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
24227   rm -f conftest.vals
24228   mv conftest.tail conftest.vals
24229 done
24230 rm -f conftest.vals
24231
24232 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
24233 # marker @DEFS@.
24234 echo '  cat >> conftest.edit <<CEOF
24235 /@DEFS@/r conftest.frag
24236 /@DEFS@/d
24237 CEOF
24238 sed -f conftest.edit $tmp/in > $tmp/out
24239 rm -f $tmp/in
24240 mv $tmp/out $tmp/in
24241 rm -f conftest.edit conftest.frag
24242 ' >> "$CONFIG_STATUS"
24243
24244 cat >>"$CONFIG_STATUS" <<\EOF
24245   # Let's still pretend it is `configure' which instantiates (i.e., don't
24246   # use $as_me), people would be surprised to read:
24247   #    /* config.h.  Generated automatically by config.status.  */
24248   if test x"$ac_file" = x-; then
24249     echo "/* Generated automatically by configure.  */" >$tmp/config.h
24250   else
24251     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
24252   fi
24253   cat $tmp/in >>$tmp/config.h
24254   rm -f $tmp/in
24255   if test x"$ac_file" != x-; then
24256     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
24257       { echo "$as_me:24257: $ac_file is unchanged" >&5
24258 echo "$as_me: $ac_file is unchanged" >&6;}
24259     else
24260       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24261          X"$ac_file" : 'X\(//\)[^/]' \| \
24262          X"$ac_file" : 'X\(//\)$' \| \
24263          X"$ac_file" : 'X\(/\)' \| \
24264          .     : '\(.\)' 2>/dev/null ||
24265 echo X"$ac_file" |
24266     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24267           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24268           /^X\(\/\/\)$/{ s//\1/; q; }
24269           /^X\(\/\).*/{ s//\1/; q; }
24270           s/.*/./; q'`
24271       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24272         { case "$ac_dir" in
24273   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24274   *)                      as_incr_dir=.;;
24275 esac
24276 as_dummy="$ac_dir"
24277 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24278   case $as_mkdir_dir in
24279     # Skip DOS drivespec
24280     ?:) as_incr_dir=$as_mkdir_dir ;;
24281     *)
24282       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24283       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24284     ;;
24285   esac
24286 done; }
24287
24288       fi
24289       rm -f "$ac_file"
24290       mv "$tmp/config.h" "$ac_file"
24291     fi
24292   else
24293     cat $tmp/config.h
24294     rm -f $tmp/config.h
24295   fi
24296 done
24297 EOF
24298 cat >>"$CONFIG_STATUS" <<\EOF
24299 #
24300 # CONFIG_COMMANDS section.
24301 #
24302 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
24303   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
24304   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
24305
24306   case "$ac_dest" in
24307     default )
24308
24309 for cf_dir in .
24310 do
24311         if test ! -d "$srcdir/$cf_dir" ; then
24312                 continue
24313         elif test -f "$srcdir/$cf_dir/programs" ; then
24314                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
24315         fi
24316 done
24317
24318         cat >>Makefile <<TEST_EOF
24319
24320 # These rules are generated so we do not rely on suffix rules, which do not
24321 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24322 # some, and the '\$x' confuses others).
24323 TEST_EOF
24324
24325 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24326 for N in $LIST
24327 do
24328         cat >>Makefile <<TEST_EOF
24329
24330 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24331         \$(srcdir)/test.priv.h \\
24332         ncurses_cfg.h
24333         $SHOW_CC
24334         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24335 TEST_EOF
24336 done
24337
24338 if test -f ../config.guess && test -f ../config.sub
24339 then
24340         cat >>Makefile <<TEST_EOF
24341
24342 # if we used CF_INHERIT for getting these files, we can remove them
24343 distclean::
24344         rm -f config.guess config.sub
24345 TEST_EOF
24346 fi
24347  ;;
24348   esac
24349 done
24350 EOF
24351
24352 cat >>"$CONFIG_STATUS" <<\EOF
24353
24354 { (exit 0); exit 0; }
24355 EOF
24356 chmod +x "$CONFIG_STATUS"
24357 ac_clean_files=$ac_clean_files_save
24358
24359 # configure is writing to config.log, and then calls config.status.
24360 # config.status does its own redirection, appending to config.log.
24361 # Unfortunately, on DOS this fails, as config.log is still kept open
24362 # by configure, so config.status won't be able to write to it; its
24363 # output is simply discarded.  So we exec the FD to /dev/null,
24364 # effectively closing config.log, so it can be properly (re)opened and
24365 # appended to by config.status.  When coming back to configure, we
24366 # need to make the FD available again.
24367 if test "$no_create" != yes; then
24368   ac_cs_success=:
24369   exec 5>/dev/null
24370   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24371   exec 5>>config.log
24372   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24373   # would make configure fail if this is the last instruction.
24374   "$ac_cs_success" || { (exit 1); exit 1; }
24375 fi
24376