]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
4e3373827756d00e4a3493fec1458f9fe81af783
[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 cf_fix_cppflags=no
4911 cf_new_cflags=
4912 cf_new_cppflags=
4913 cf_new_extra_cppflags=
4914
4915 for cf_add_cflags in $cf_temp_xopen_source
4916 do
4917 case "$cf_fix_cppflags" in
4918 (no)
4919         case "$cf_add_cflags" in
4920         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4921                 case "$cf_add_cflags" in
4922                 (-D*)
4923                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4924
4925                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4926                                 && test -z "${cf_tst_cflags}" \
4927                                 && cf_fix_cppflags=yes
4928
4929                         if test "$cf_fix_cppflags" = yes ; then
4930
4931         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4932         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4933
4934                                 continue
4935                         elif test "${cf_tst_cflags}" = "\"'" ; then
4936
4937         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4938         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4939
4940                                 continue
4941                         fi
4942                         ;;
4943                 esac
4944                 case "$CPPFLAGS" in
4945                 (*$cf_add_cflags)
4946                         ;;
4947                 (*)
4948                         case "$cf_add_cflags" in
4949                         (-D*)
4950                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4951
4952 CPPFLAGS=`echo "$CPPFLAGS" | \
4953         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4954                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4955
4956                                 ;;
4957                         esac
4958
4959         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4960         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4961
4962                         ;;
4963                 esac
4964                 ;;
4965         (*)
4966
4967         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4968         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4969
4970                 ;;
4971         esac
4972         ;;
4973 (yes)
4974
4975         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4976         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4977
4978         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4979
4980         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4981                 && test -z "${cf_tst_cflags}" \
4982                 && cf_fix_cppflags=no
4983         ;;
4984 esac
4985 done
4986
4987 if test -n "$cf_new_cflags" ; then
4988
4989         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4990         CFLAGS="${CFLAGS}$cf_new_cflags"
4991
4992 fi
4993
4994 if test -n "$cf_new_cppflags" ; then
4995
4996         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4997         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4998
4999 fi
5000
5001 if test -n "$cf_new_extra_cppflags" ; then
5002
5003         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5004         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5005
5006 fi
5007
5008 fi
5009
5010 if test "$cf_cv_posix_visible" = no; then
5011
5012 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5013
5014 cf_save_CFLAGS="$CFLAGS"
5015 cf_save_CPPFLAGS="$CPPFLAGS"
5016
5017 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5018         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5019                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5020
5021 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5022         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5023                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5024
5025 echo "$as_me:5025: checking if we should define _POSIX_C_SOURCE" >&5
5026 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5027 if test "${cf_cv_posix_c_source+set}" = set; then
5028   echo $ECHO_N "(cached) $ECHO_C" >&6
5029 else
5030
5031 echo "${as_me:-configure}:5031: testing if the symbol is already defined go no further ..." 1>&5
5032
5033         cat >"conftest.$ac_ext" <<_ACEOF
5034 #line 5034 "configure"
5035 #include "confdefs.h"
5036 #include <sys/types.h>
5037 int
5038 main (void)
5039 {
5040
5041 #ifndef _POSIX_C_SOURCE
5042 make an error
5043 #endif
5044   ;
5045   return 0;
5046 }
5047 _ACEOF
5048 rm -f "conftest.$ac_objext"
5049 if { (eval echo "$as_me:5049: \"$ac_compile\"") >&5
5050   (eval $ac_compile) 2>&5
5051   ac_status=$?
5052   echo "$as_me:5052: \$? = $ac_status" >&5
5053   (exit "$ac_status"); } &&
5054          { ac_try='test -s "conftest.$ac_objext"'
5055   { (eval echo "$as_me:5055: \"$ac_try\"") >&5
5056   (eval $ac_try) 2>&5
5057   ac_status=$?
5058   echo "$as_me:5058: \$? = $ac_status" >&5
5059   (exit "$ac_status"); }; }; then
5060   cf_cv_posix_c_source=no
5061 else
5062   echo "$as_me: failed program was:" >&5
5063 cat "conftest.$ac_ext" >&5
5064 cf_want_posix_source=no
5065          case .$cf_POSIX_C_SOURCE in
5066          (.[12]??*)
5067                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5068                 ;;
5069          (.2)
5070                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5071                 cf_want_posix_source=yes
5072                 ;;
5073          (.*)
5074                 cf_want_posix_source=yes
5075                 ;;
5076          esac
5077          if test "$cf_want_posix_source" = yes ; then
5078                 cat >"conftest.$ac_ext" <<_ACEOF
5079 #line 5079 "configure"
5080 #include "confdefs.h"
5081 #include <sys/types.h>
5082 int
5083 main (void)
5084 {
5085
5086 #ifdef _POSIX_SOURCE
5087 make an error
5088 #endif
5089   ;
5090   return 0;
5091 }
5092 _ACEOF
5093 rm -f "conftest.$ac_objext"
5094 if { (eval echo "$as_me:5094: \"$ac_compile\"") >&5
5095   (eval $ac_compile) 2>&5
5096   ac_status=$?
5097   echo "$as_me:5097: \$? = $ac_status" >&5
5098   (exit "$ac_status"); } &&
5099          { ac_try='test -s "conftest.$ac_objext"'
5100   { (eval echo "$as_me:5100: \"$ac_try\"") >&5
5101   (eval $ac_try) 2>&5
5102   ac_status=$?
5103   echo "$as_me:5103: \$? = $ac_status" >&5
5104   (exit "$ac_status"); }; }; then
5105   :
5106 else
5107   echo "$as_me: failed program was:" >&5
5108 cat "conftest.$ac_ext" >&5
5109 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5110 fi
5111 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5112          fi
5113
5114 echo "${as_me:-configure}:5114: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5115
5116          CFLAGS="$cf_trim_CFLAGS"
5117          CPPFLAGS="$cf_trim_CPPFLAGS"
5118
5119         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5120         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5121
5122 echo "${as_me:-configure}:5122: testing if the second compile does not leave our definition intact error ..." 1>&5
5123
5124          cat >"conftest.$ac_ext" <<_ACEOF
5125 #line 5125 "configure"
5126 #include "confdefs.h"
5127 #include <sys/types.h>
5128 int
5129 main (void)
5130 {
5131
5132 #ifndef _POSIX_C_SOURCE
5133 make an error
5134 #endif
5135   ;
5136   return 0;
5137 }
5138 _ACEOF
5139 rm -f "conftest.$ac_objext"
5140 if { (eval echo "$as_me:5140: \"$ac_compile\"") >&5
5141   (eval $ac_compile) 2>&5
5142   ac_status=$?
5143   echo "$as_me:5143: \$? = $ac_status" >&5
5144   (exit "$ac_status"); } &&
5145          { ac_try='test -s "conftest.$ac_objext"'
5146   { (eval echo "$as_me:5146: \"$ac_try\"") >&5
5147   (eval $ac_try) 2>&5
5148   ac_status=$?
5149   echo "$as_me:5149: \$? = $ac_status" >&5
5150   (exit "$ac_status"); }; }; then
5151   :
5152 else
5153   echo "$as_me: failed program was:" >&5
5154 cat "conftest.$ac_ext" >&5
5155 cf_cv_posix_c_source=no
5156 fi
5157 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5158          CFLAGS="$cf_save_CFLAGS"
5159          CPPFLAGS="$cf_save_CPPFLAGS"
5160
5161 fi
5162 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5163
5164 fi
5165 echo "$as_me:5165: result: $cf_cv_posix_c_source" >&5
5166 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5167
5168 if test "$cf_cv_posix_c_source" != no ; then
5169         CFLAGS="$cf_trim_CFLAGS"
5170         CPPFLAGS="$cf_trim_CPPFLAGS"
5171
5172 cf_fix_cppflags=no
5173 cf_new_cflags=
5174 cf_new_cppflags=
5175 cf_new_extra_cppflags=
5176
5177 for cf_add_cflags in $cf_cv_posix_c_source
5178 do
5179 case "$cf_fix_cppflags" in
5180 (no)
5181         case "$cf_add_cflags" in
5182         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5183                 case "$cf_add_cflags" in
5184                 (-D*)
5185                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5186
5187                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5188                                 && test -z "${cf_tst_cflags}" \
5189                                 && cf_fix_cppflags=yes
5190
5191                         if test "$cf_fix_cppflags" = yes ; then
5192
5193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5195
5196                                 continue
5197                         elif test "${cf_tst_cflags}" = "\"'" ; then
5198
5199         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5200         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5201
5202                                 continue
5203                         fi
5204                         ;;
5205                 esac
5206                 case "$CPPFLAGS" in
5207                 (*$cf_add_cflags)
5208                         ;;
5209                 (*)
5210                         case "$cf_add_cflags" in
5211                         (-D*)
5212                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5213
5214 CPPFLAGS=`echo "$CPPFLAGS" | \
5215         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5216                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5217
5218                                 ;;
5219                         esac
5220
5221         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5222         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5223
5224                         ;;
5225                 esac
5226                 ;;
5227         (*)
5228
5229         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5230         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5231
5232                 ;;
5233         esac
5234         ;;
5235 (yes)
5236
5237         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5238         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5239
5240         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5241
5242         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5243                 && test -z "${cf_tst_cflags}" \
5244                 && cf_fix_cppflags=no
5245         ;;
5246 esac
5247 done
5248
5249 if test -n "$cf_new_cflags" ; then
5250
5251         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5252         CFLAGS="${CFLAGS}$cf_new_cflags"
5253
5254 fi
5255
5256 if test -n "$cf_new_cppflags" ; then
5257
5258         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5259         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5260
5261 fi
5262
5263 if test -n "$cf_new_extra_cppflags" ; then
5264
5265         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5266         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5267
5268 fi
5269
5270 fi
5271
5272 fi # cf_cv_posix_visible
5273
5274         ;;
5275 esac
5276
5277 if test -n "$cf_xopen_source" ; then
5278
5279 cf_fix_cppflags=no
5280 cf_new_cflags=
5281 cf_new_cppflags=
5282 cf_new_extra_cppflags=
5283
5284 for cf_add_cflags in $cf_xopen_source
5285 do
5286 case "$cf_fix_cppflags" in
5287 (no)
5288         case "$cf_add_cflags" in
5289         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5290                 case "$cf_add_cflags" in
5291                 (-D*)
5292                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5293
5294                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5295                                 && test -z "${cf_tst_cflags}" \
5296                                 && cf_fix_cppflags=yes
5297
5298                         if test "$cf_fix_cppflags" = yes ; then
5299
5300         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5301         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5302
5303                                 continue
5304                         elif test "${cf_tst_cflags}" = "\"'" ; then
5305
5306         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5307         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5308
5309                                 continue
5310                         fi
5311                         ;;
5312                 esac
5313                 case "$CPPFLAGS" in
5314                 (*$cf_add_cflags)
5315                         ;;
5316                 (*)
5317                         case "$cf_add_cflags" in
5318                         (-D*)
5319                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5320
5321 CPPFLAGS=`echo "$CPPFLAGS" | \
5322         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5323                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5324
5325                                 ;;
5326                         esac
5327
5328         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5329         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5330
5331                         ;;
5332                 esac
5333                 ;;
5334         (*)
5335
5336         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5337         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5338
5339                 ;;
5340         esac
5341         ;;
5342 (yes)
5343
5344         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5345         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5346
5347         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5348
5349         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5350                 && test -z "${cf_tst_cflags}" \
5351                 && cf_fix_cppflags=no
5352         ;;
5353 esac
5354 done
5355
5356 if test -n "$cf_new_cflags" ; then
5357         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5358
5359 echo "${as_me:-configure}:5359: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5360
5361         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5362         CFLAGS="${CFLAGS}$cf_new_cflags"
5363
5364 fi
5365
5366 if test -n "$cf_new_cppflags" ; then
5367         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5368
5369 echo "${as_me:-configure}:5369: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5370
5371         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5372         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5373
5374 fi
5375
5376 if test -n "$cf_new_extra_cppflags" ; then
5377         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5378
5379 echo "${as_me:-configure}:5379: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5380
5381         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5382         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5383
5384 fi
5385
5386 fi
5387
5388 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5389         echo "$as_me:5389: checking if _XOPEN_SOURCE really is set" >&5
5390 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5391         cat >"conftest.$ac_ext" <<_ACEOF
5392 #line 5392 "configure"
5393 #include "confdefs.h"
5394 #include <stdlib.h>
5395 int
5396 main (void)
5397 {
5398
5399 #ifndef _XOPEN_SOURCE
5400 make an error
5401 #endif
5402   ;
5403   return 0;
5404 }
5405 _ACEOF
5406 rm -f "conftest.$ac_objext"
5407 if { (eval echo "$as_me:5407: \"$ac_compile\"") >&5
5408   (eval $ac_compile) 2>&5
5409   ac_status=$?
5410   echo "$as_me:5410: \$? = $ac_status" >&5
5411   (exit "$ac_status"); } &&
5412          { ac_try='test -s "conftest.$ac_objext"'
5413   { (eval echo "$as_me:5413: \"$ac_try\"") >&5
5414   (eval $ac_try) 2>&5
5415   ac_status=$?
5416   echo "$as_me:5416: \$? = $ac_status" >&5
5417   (exit "$ac_status"); }; }; then
5418   cf_XOPEN_SOURCE_set=yes
5419 else
5420   echo "$as_me: failed program was:" >&5
5421 cat "conftest.$ac_ext" >&5
5422 cf_XOPEN_SOURCE_set=no
5423 fi
5424 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5425         echo "$as_me:5425: result: $cf_XOPEN_SOURCE_set" >&5
5426 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5427         if test "$cf_XOPEN_SOURCE_set" = yes
5428         then
5429                 cat >"conftest.$ac_ext" <<_ACEOF
5430 #line 5430 "configure"
5431 #include "confdefs.h"
5432 #include <stdlib.h>
5433 int
5434 main (void)
5435 {
5436
5437 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5438 make an error
5439 #endif
5440   ;
5441   return 0;
5442 }
5443 _ACEOF
5444 rm -f "conftest.$ac_objext"
5445 if { (eval echo "$as_me:5445: \"$ac_compile\"") >&5
5446   (eval $ac_compile) 2>&5
5447   ac_status=$?
5448   echo "$as_me:5448: \$? = $ac_status" >&5
5449   (exit "$ac_status"); } &&
5450          { ac_try='test -s "conftest.$ac_objext"'
5451   { (eval echo "$as_me:5451: \"$ac_try\"") >&5
5452   (eval $ac_try) 2>&5
5453   ac_status=$?
5454   echo "$as_me:5454: \$? = $ac_status" >&5
5455   (exit "$ac_status"); }; }; then
5456   cf_XOPEN_SOURCE_set_ok=yes
5457 else
5458   echo "$as_me: failed program was:" >&5
5459 cat "conftest.$ac_ext" >&5
5460 cf_XOPEN_SOURCE_set_ok=no
5461 fi
5462 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5463                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5464                 then
5465                         { echo "$as_me:5465: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5466 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5467                 fi
5468         else
5469
5470 echo "$as_me:5470: checking if we should define _XOPEN_SOURCE" >&5
5471 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5472 if test "${cf_cv_xopen_source+set}" = set; then
5473   echo $ECHO_N "(cached) $ECHO_C" >&6
5474 else
5475
5476         cat >"conftest.$ac_ext" <<_ACEOF
5477 #line 5477 "configure"
5478 #include "confdefs.h"
5479
5480 #include <stdlib.h>
5481 #include <string.h>
5482 #include <sys/types.h>
5483
5484 int
5485 main (void)
5486 {
5487
5488 #ifndef _XOPEN_SOURCE
5489 make an error
5490 #endif
5491   ;
5492   return 0;
5493 }
5494 _ACEOF
5495 rm -f "conftest.$ac_objext"
5496 if { (eval echo "$as_me:5496: \"$ac_compile\"") >&5
5497   (eval $ac_compile) 2>&5
5498   ac_status=$?
5499   echo "$as_me:5499: \$? = $ac_status" >&5
5500   (exit "$ac_status"); } &&
5501          { ac_try='test -s "conftest.$ac_objext"'
5502   { (eval echo "$as_me:5502: \"$ac_try\"") >&5
5503   (eval $ac_try) 2>&5
5504   ac_status=$?
5505   echo "$as_me:5505: \$? = $ac_status" >&5
5506   (exit "$ac_status"); }; }; then
5507   cf_cv_xopen_source=no
5508 else
5509   echo "$as_me: failed program was:" >&5
5510 cat "conftest.$ac_ext" >&5
5511 cf_save="$CPPFLAGS"
5512
5513         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5514         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5515
5516          cat >"conftest.$ac_ext" <<_ACEOF
5517 #line 5517 "configure"
5518 #include "confdefs.h"
5519
5520 #include <stdlib.h>
5521 #include <string.h>
5522 #include <sys/types.h>
5523
5524 int
5525 main (void)
5526 {
5527
5528 #ifdef _XOPEN_SOURCE
5529 make an error
5530 #endif
5531   ;
5532   return 0;
5533 }
5534 _ACEOF
5535 rm -f "conftest.$ac_objext"
5536 if { (eval echo "$as_me:5536: \"$ac_compile\"") >&5
5537   (eval $ac_compile) 2>&5
5538   ac_status=$?
5539   echo "$as_me:5539: \$? = $ac_status" >&5
5540   (exit "$ac_status"); } &&
5541          { ac_try='test -s "conftest.$ac_objext"'
5542   { (eval echo "$as_me:5542: \"$ac_try\"") >&5
5543   (eval $ac_try) 2>&5
5544   ac_status=$?
5545   echo "$as_me:5545: \$? = $ac_status" >&5
5546   (exit "$ac_status"); }; }; then
5547   cf_cv_xopen_source=no
5548 else
5549   echo "$as_me: failed program was:" >&5
5550 cat "conftest.$ac_ext" >&5
5551 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5552 fi
5553 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5554         CPPFLAGS="$cf_save"
5555
5556 fi
5557 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5558
5559 fi
5560 echo "$as_me:5560: result: $cf_cv_xopen_source" >&5
5561 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5562
5563 if test "$cf_cv_xopen_source" != no ; then
5564
5565 CFLAGS=`echo "$CFLAGS" | \
5566         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5567                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5568
5569 CPPFLAGS=`echo "$CPPFLAGS" | \
5570         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5571                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5572
5573         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5574
5575 cf_fix_cppflags=no
5576 cf_new_cflags=
5577 cf_new_cppflags=
5578 cf_new_extra_cppflags=
5579
5580 for cf_add_cflags in $cf_temp_xopen_source
5581 do
5582 case "$cf_fix_cppflags" in
5583 (no)
5584         case "$cf_add_cflags" in
5585         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5586                 case "$cf_add_cflags" in
5587                 (-D*)
5588                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5589
5590                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5591                                 && test -z "${cf_tst_cflags}" \
5592                                 && cf_fix_cppflags=yes
5593
5594                         if test "$cf_fix_cppflags" = yes ; then
5595
5596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5598
5599                                 continue
5600                         elif test "${cf_tst_cflags}" = "\"'" ; then
5601
5602         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5603         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5604
5605                                 continue
5606                         fi
5607                         ;;
5608                 esac
5609                 case "$CPPFLAGS" in
5610                 (*$cf_add_cflags)
5611                         ;;
5612                 (*)
5613                         case "$cf_add_cflags" in
5614                         (-D*)
5615                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5616
5617 CPPFLAGS=`echo "$CPPFLAGS" | \
5618         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5619                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5620
5621                                 ;;
5622                         esac
5623
5624         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5625         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5626
5627                         ;;
5628                 esac
5629                 ;;
5630         (*)
5631
5632         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5633         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5634
5635                 ;;
5636         esac
5637         ;;
5638 (yes)
5639
5640         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5641         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5642
5643         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5644
5645         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5646                 && test -z "${cf_tst_cflags}" \
5647                 && cf_fix_cppflags=no
5648         ;;
5649 esac
5650 done
5651
5652 if test -n "$cf_new_cflags" ; then
5653
5654         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5655         CFLAGS="${CFLAGS}$cf_new_cflags"
5656
5657 fi
5658
5659 if test -n "$cf_new_cppflags" ; then
5660
5661         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5662         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5663
5664 fi
5665
5666 if test -n "$cf_new_extra_cppflags" ; then
5667
5668         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5669         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5670
5671 fi
5672
5673 fi
5674
5675         fi
5676 fi
5677 fi # cf_cv_posix_visible
5678
5679 echo "$as_me:5679: checking for signal global datatype" >&5
5680 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5681 if test "${cf_cv_sig_atomic_t+set}" = set; then
5682   echo $ECHO_N "(cached) $ECHO_C" >&6
5683 else
5684
5685         for cf_type in \
5686                 "volatile sig_atomic_t" \
5687                 "sig_atomic_t" \
5688                 "int"
5689         do
5690         cat >"conftest.$ac_ext" <<_ACEOF
5691 #line 5691 "configure"
5692 #include "confdefs.h"
5693
5694 #include <sys/types.h>
5695 #include <signal.h>
5696 #include <stdio.h>
5697
5698 extern $cf_type x;
5699 $cf_type x;
5700 static void handler(int sig)
5701 {
5702         (void)sig;
5703         x = 5;
5704 }
5705 int
5706 main (void)
5707 {
5708 signal(SIGINT, handler);
5709                  x = 1
5710   ;
5711   return 0;
5712 }
5713 _ACEOF
5714 rm -f "conftest.$ac_objext"
5715 if { (eval echo "$as_me:5715: \"$ac_compile\"") >&5
5716   (eval $ac_compile) 2>&5
5717   ac_status=$?
5718   echo "$as_me:5718: \$? = $ac_status" >&5
5719   (exit "$ac_status"); } &&
5720          { ac_try='test -s "conftest.$ac_objext"'
5721   { (eval echo "$as_me:5721: \"$ac_try\"") >&5
5722   (eval $ac_try) 2>&5
5723   ac_status=$?
5724   echo "$as_me:5724: \$? = $ac_status" >&5
5725   (exit "$ac_status"); }; }; then
5726   cf_cv_sig_atomic_t=$cf_type
5727 else
5728   echo "$as_me: failed program was:" >&5
5729 cat "conftest.$ac_ext" >&5
5730 cf_cv_sig_atomic_t=no
5731 fi
5732 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5733                 test "$cf_cv_sig_atomic_t" != no && break
5734         done
5735
5736 fi
5737
5738 echo "$as_me:5738: result: $cf_cv_sig_atomic_t" >&5
5739 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5740 test "$cf_cv_sig_atomic_t" != no &&
5741 cat >>confdefs.h <<EOF
5742 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5743 EOF
5744
5745 # Work around breakage on OS X
5746
5747 echo "$as_me:5747: checking if SIGWINCH is defined" >&5
5748 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5749 if test "${cf_cv_define_sigwinch+set}" = set; then
5750   echo $ECHO_N "(cached) $ECHO_C" >&6
5751 else
5752
5753         cat >"conftest.$ac_ext" <<_ACEOF
5754 #line 5754 "configure"
5755 #include "confdefs.h"
5756
5757 #include <sys/types.h>
5758 #include <sys/signal.h>
5759
5760 int
5761 main (void)
5762 {
5763 int x = SIGWINCH; (void)x
5764   ;
5765   return 0;
5766 }
5767 _ACEOF
5768 rm -f "conftest.$ac_objext"
5769 if { (eval echo "$as_me:5769: \"$ac_compile\"") >&5
5770   (eval $ac_compile) 2>&5
5771   ac_status=$?
5772   echo "$as_me:5772: \$? = $ac_status" >&5
5773   (exit "$ac_status"); } &&
5774          { ac_try='test -s "conftest.$ac_objext"'
5775   { (eval echo "$as_me:5775: \"$ac_try\"") >&5
5776   (eval $ac_try) 2>&5
5777   ac_status=$?
5778   echo "$as_me:5778: \$? = $ac_status" >&5
5779   (exit "$ac_status"); }; }; then
5780   cf_cv_define_sigwinch=yes
5781 else
5782   echo "$as_me: failed program was:" >&5
5783 cat "conftest.$ac_ext" >&5
5784 cat >"conftest.$ac_ext" <<_ACEOF
5785 #line 5785 "configure"
5786 #include "confdefs.h"
5787
5788 #undef _XOPEN_SOURCE
5789 #undef _POSIX_SOURCE
5790 #undef _POSIX_C_SOURCE
5791 #include <sys/types.h>
5792 #include <sys/signal.h>
5793
5794 int
5795 main (void)
5796 {
5797 int x = SIGWINCH; (void)x
5798   ;
5799   return 0;
5800 }
5801 _ACEOF
5802 rm -f "conftest.$ac_objext"
5803 if { (eval echo "$as_me:5803: \"$ac_compile\"") >&5
5804   (eval $ac_compile) 2>&5
5805   ac_status=$?
5806   echo "$as_me:5806: \$? = $ac_status" >&5
5807   (exit "$ac_status"); } &&
5808          { ac_try='test -s "conftest.$ac_objext"'
5809   { (eval echo "$as_me:5809: \"$ac_try\"") >&5
5810   (eval $ac_try) 2>&5
5811   ac_status=$?
5812   echo "$as_me:5812: \$? = $ac_status" >&5
5813   (exit "$ac_status"); }; }; then
5814   cf_cv_define_sigwinch=maybe
5815 else
5816   echo "$as_me: failed program was:" >&5
5817 cat "conftest.$ac_ext" >&5
5818 cf_cv_define_sigwinch=no
5819 fi
5820 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5821
5822 fi
5823 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5824
5825 fi
5826 echo "$as_me:5826: result: $cf_cv_define_sigwinch" >&5
5827 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5828
5829 if test "$cf_cv_define_sigwinch" = maybe ; then
5830 echo "$as_me:5830: checking for actual SIGWINCH definition" >&5
5831 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5832 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5833   echo $ECHO_N "(cached) $ECHO_C" >&6
5834 else
5835
5836 cf_cv_fixup_sigwinch=unknown
5837 cf_sigwinch=32
5838 while test "$cf_sigwinch" != 1
5839 do
5840         cat >"conftest.$ac_ext" <<_ACEOF
5841 #line 5841 "configure"
5842 #include "confdefs.h"
5843
5844 #undef _XOPEN_SOURCE
5845 #undef _POSIX_SOURCE
5846 #undef _POSIX_C_SOURCE
5847 #include <sys/types.h>
5848 #include <sys/signal.h>
5849
5850 int
5851 main (void)
5852 {
5853
5854 #if SIGWINCH != $cf_sigwinch
5855 make an error
5856 #endif
5857 int x = SIGWINCH; (void)x
5858   ;
5859   return 0;
5860 }
5861 _ACEOF
5862 rm -f "conftest.$ac_objext"
5863 if { (eval echo "$as_me:5863: \"$ac_compile\"") >&5
5864   (eval $ac_compile) 2>&5
5865   ac_status=$?
5866   echo "$as_me:5866: \$? = $ac_status" >&5
5867   (exit "$ac_status"); } &&
5868          { ac_try='test -s "conftest.$ac_objext"'
5869   { (eval echo "$as_me:5869: \"$ac_try\"") >&5
5870   (eval $ac_try) 2>&5
5871   ac_status=$?
5872   echo "$as_me:5872: \$? = $ac_status" >&5
5873   (exit "$ac_status"); }; }; then
5874   cf_cv_fixup_sigwinch=$cf_sigwinch
5875          break
5876 else
5877   echo "$as_me: failed program was:" >&5
5878 cat "conftest.$ac_ext" >&5
5879 fi
5880 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5881
5882 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
5883 done
5884
5885 fi
5886 echo "$as_me:5886: result: $cf_cv_fixup_sigwinch" >&5
5887 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5888
5889         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5890                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5891         fi
5892 fi
5893
5894 # Checks for CODESET support.
5895
5896 echo "$as_me:5896: checking for nl_langinfo and CODESET" >&5
5897 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5898 if test "${am_cv_langinfo_codeset+set}" = set; then
5899   echo $ECHO_N "(cached) $ECHO_C" >&6
5900 else
5901   cat >"conftest.$ac_ext" <<_ACEOF
5902 #line 5902 "configure"
5903 #include "confdefs.h"
5904 #include <langinfo.h>
5905 int
5906 main (void)
5907 {
5908 char* cs = nl_langinfo(CODESET); (void)cs
5909   ;
5910   return 0;
5911 }
5912 _ACEOF
5913 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5914 if { (eval echo "$as_me:5914: \"$ac_link\"") >&5
5915   (eval $ac_link) 2>&5
5916   ac_status=$?
5917   echo "$as_me:5917: \$? = $ac_status" >&5
5918   (exit "$ac_status"); } &&
5919          { ac_try='test -s "conftest$ac_exeext"'
5920   { (eval echo "$as_me:5920: \"$ac_try\"") >&5
5921   (eval $ac_try) 2>&5
5922   ac_status=$?
5923   echo "$as_me:5923: \$? = $ac_status" >&5
5924   (exit "$ac_status"); }; }; then
5925   am_cv_langinfo_codeset=yes
5926 else
5927   echo "$as_me: failed program was:" >&5
5928 cat "conftest.$ac_ext" >&5
5929 am_cv_langinfo_codeset=no
5930 fi
5931 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5932
5933 fi
5934 echo "$as_me:5934: result: $am_cv_langinfo_codeset" >&5
5935 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5936         if test "$am_cv_langinfo_codeset" = yes; then
5937
5938 cat >>confdefs.h <<\EOF
5939 #define HAVE_LANGINFO_CODESET 1
5940 EOF
5941
5942         fi
5943
5944 echo "$as_me:5944: checking if you want to use pkg-config" >&5
5945 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5946
5947 # Check whether --with-pkg-config or --without-pkg-config was given.
5948 if test "${with_pkg_config+set}" = set; then
5949   withval="$with_pkg_config"
5950   cf_pkg_config=$withval
5951 else
5952   cf_pkg_config=yes
5953 fi;
5954 echo "$as_me:5954: result: $cf_pkg_config" >&5
5955 echo "${ECHO_T}$cf_pkg_config" >&6
5956
5957 case "$cf_pkg_config" in
5958 (no)
5959         PKG_CONFIG=none
5960         ;;
5961 (yes)
5962
5963 if test -n "$ac_tool_prefix"; then
5964   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5965 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5966 echo "$as_me:5966: checking for $ac_word" >&5
5967 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5968 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5969   echo $ECHO_N "(cached) $ECHO_C" >&6
5970 else
5971   case $PKG_CONFIG in
5972   [\\/]* | ?:[\\/]*)
5973   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5974   ;;
5975   *)
5976   ac_save_IFS=$IFS; IFS=$ac_path_separator
5977 ac_dummy="$PATH"
5978 for ac_dir in $ac_dummy; do
5979   IFS=$ac_save_IFS
5980   test -z "$ac_dir" && ac_dir=.
5981   if $as_executable_p "$ac_dir/$ac_word"; then
5982    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5983    echo "$as_me:5983: found $ac_dir/$ac_word" >&5
5984    break
5985 fi
5986 done
5987
5988   ;;
5989 esac
5990 fi
5991 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5992
5993 if test -n "$PKG_CONFIG"; then
5994   echo "$as_me:5994: result: $PKG_CONFIG" >&5
5995 echo "${ECHO_T}$PKG_CONFIG" >&6
5996 else
5997   echo "$as_me:5997: result: no" >&5
5998 echo "${ECHO_T}no" >&6
5999 fi
6000
6001 fi
6002 if test -z "$ac_cv_path_PKG_CONFIG"; then
6003   ac_pt_PKG_CONFIG=$PKG_CONFIG
6004   # Extract the first word of "pkg-config", so it can be a program name with args.
6005 set dummy pkg-config; ac_word=$2
6006 echo "$as_me:6006: checking for $ac_word" >&5
6007 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6008 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6009   echo $ECHO_N "(cached) $ECHO_C" >&6
6010 else
6011   case $ac_pt_PKG_CONFIG in
6012   [\\/]* | ?:[\\/]*)
6013   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6014   ;;
6015   *)
6016   ac_save_IFS=$IFS; IFS=$ac_path_separator
6017 ac_dummy="$PATH"
6018 for ac_dir in $ac_dummy; do
6019   IFS=$ac_save_IFS
6020   test -z "$ac_dir" && ac_dir=.
6021   if $as_executable_p "$ac_dir/$ac_word"; then
6022    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
6023    echo "$as_me:6023: found $ac_dir/$ac_word" >&5
6024    break
6025 fi
6026 done
6027
6028   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6029   ;;
6030 esac
6031 fi
6032 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6033
6034 if test -n "$ac_pt_PKG_CONFIG"; then
6035   echo "$as_me:6035: result: $ac_pt_PKG_CONFIG" >&5
6036 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6037 else
6038   echo "$as_me:6038: result: no" >&5
6039 echo "${ECHO_T}no" >&6
6040 fi
6041
6042   PKG_CONFIG=$ac_pt_PKG_CONFIG
6043 else
6044   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6045 fi
6046
6047         ;;
6048 (*)
6049         PKG_CONFIG=$withval
6050         ;;
6051 esac
6052
6053 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6054 if test "$PKG_CONFIG" != none ; then
6055
6056 if test "x$prefix" != xNONE; then
6057         cf_path_syntax="$prefix"
6058 else
6059         cf_path_syntax="$ac_default_prefix"
6060 fi
6061
6062 case ".$PKG_CONFIG" in
6063 (.\$\(*\)*|.\'*\'*)
6064         ;;
6065 (..|./*|.\\*)
6066         ;;
6067 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6068         ;;
6069 (.\$\{*prefix\}*|.\$\{*dir\}*)
6070         eval PKG_CONFIG="$PKG_CONFIG"
6071         case ".$PKG_CONFIG" in
6072         (.NONE/*)
6073                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6074                 ;;
6075         esac
6076         ;;
6077 (.no|.NONE/*)
6078         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6079         ;;
6080 (*)
6081         { { echo "$as_me:6081: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6082 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6083    { (exit 1); exit 1; }; }
6084         ;;
6085 esac
6086
6087 elif test "x$cf_pkg_config" != xno ; then
6088         { echo "$as_me:6088: WARNING: pkg-config is not installed" >&5
6089 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6090 fi
6091
6092 echo "$as_me:6092: checking if you want to see long compiling messages" >&5
6093 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6094
6095 # Check whether --enable-echo or --disable-echo was given.
6096 if test "${enable_echo+set}" = set; then
6097   enableval="$enable_echo"
6098   test "$enableval" != no && enableval=yes
6099         if test "$enableval" != "yes" ; then
6100
6101         ECHO_LT='--silent'
6102         ECHO_LD='@echo linking $@;'
6103         RULE_CC='@echo compiling $<'
6104         SHOW_CC='@echo compiling $@'
6105         ECHO_CC='@'
6106
6107         else
6108
6109         ECHO_LT=''
6110         ECHO_LD=''
6111         RULE_CC=''
6112         SHOW_CC=''
6113         ECHO_CC=''
6114
6115         fi
6116 else
6117   enableval=yes
6118
6119         ECHO_LT=''
6120         ECHO_LD=''
6121         RULE_CC=''
6122         SHOW_CC=''
6123         ECHO_CC=''
6124
6125 fi;
6126 echo "$as_me:6126: result: $enableval" >&5
6127 echo "${ECHO_T}$enableval" >&6
6128
6129 echo "$as_me:6129: checking for ncurses wrap-prefix" >&5
6130 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6131
6132 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6133 if test "${with_ncurses_wrap_prefix+set}" = set; then
6134   withval="$with_ncurses_wrap_prefix"
6135   NCURSES_WRAP_PREFIX=$withval
6136 else
6137   NCURSES_WRAP_PREFIX=_nc_
6138 fi;
6139 echo "$as_me:6139: result: $NCURSES_WRAP_PREFIX" >&5
6140 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6141
6142 echo "$as_me:6142: checking if you want to check for wide-character functions" >&5
6143 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6144
6145 # Check whether --enable-widec or --disable-widec was given.
6146 if test "${enable_widec+set}" = set; then
6147   enableval="$enable_widec"
6148   test "$enableval" != no && enableval=yes
6149         if test "$enableval" != "yes" ; then
6150     cf_enable_widec=no
6151         else
6152                 cf_enable_widec=yes
6153         fi
6154 else
6155   enableval=yes
6156         cf_enable_widec=yes
6157
6158 fi;
6159 echo "$as_me:6159: result: $cf_enable_widec" >&5
6160 echo "${ECHO_T}$cf_enable_widec" >&6
6161
6162 echo "$as_me:6162: checking for specific curses-directory" >&5
6163 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6164
6165 # Check whether --with-curses-dir or --without-curses-dir was given.
6166 if test "${with_curses_dir+set}" = set; then
6167   withval="$with_curses_dir"
6168   cf_cv_curses_dir=$withval
6169 else
6170   cf_cv_curses_dir=no
6171 fi;
6172 echo "$as_me:6172: result: $cf_cv_curses_dir" >&5
6173 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6174
6175 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6176 then
6177
6178 if test "x$prefix" != xNONE; then
6179         cf_path_syntax="$prefix"
6180 else
6181         cf_path_syntax="$ac_default_prefix"
6182 fi
6183
6184 case ".$withval" in
6185 (.\$\(*\)*|.\'*\'*)
6186         ;;
6187 (..|./*|.\\*)
6188         ;;
6189 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6190         ;;
6191 (.\$\{*prefix\}*|.\$\{*dir\}*)
6192         eval withval="$withval"
6193         case ".$withval" in
6194         (.NONE/*)
6195                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6196                 ;;
6197         esac
6198         ;;
6199 (.no|.NONE/*)
6200         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6201         ;;
6202 (*)
6203         { { echo "$as_me:6203: error: expected a pathname, not \"$withval\"" >&5
6204 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6205    { (exit 1); exit 1; }; }
6206         ;;
6207 esac
6208
6209         if test -d "$cf_cv_curses_dir"
6210         then
6211
6212 if test -n "$cf_cv_curses_dir/include" ; then
6213   for cf_add_incdir in $cf_cv_curses_dir/include
6214   do
6215         while test "$cf_add_incdir" != /usr/include
6216         do
6217           if test -d "$cf_add_incdir"
6218           then
6219                 cf_have_incdir=no
6220                 if test -n "$CFLAGS$CPPFLAGS" ; then
6221                   # a loop is needed to ensure we can add subdirs of existing dirs
6222                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6223                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6224                           cf_have_incdir=yes; break
6225                         fi
6226                   done
6227                 fi
6228
6229                 if test "$cf_have_incdir" = no ; then
6230                   if test "$cf_add_incdir" = /usr/local/include ; then
6231                         if test "$GCC" = yes
6232                         then
6233                           cf_save_CPPFLAGS=$CPPFLAGS
6234
6235         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6236         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6237
6238                           cat >"conftest.$ac_ext" <<_ACEOF
6239 #line 6239 "configure"
6240 #include "confdefs.h"
6241 #include <stdio.h>
6242 int
6243 main (void)
6244 {
6245 printf("Hello")
6246   ;
6247   return 0;
6248 }
6249 _ACEOF
6250 rm -f "conftest.$ac_objext"
6251 if { (eval echo "$as_me:6251: \"$ac_compile\"") >&5
6252   (eval $ac_compile) 2>&5
6253   ac_status=$?
6254   echo "$as_me:6254: \$? = $ac_status" >&5
6255   (exit "$ac_status"); } &&
6256          { ac_try='test -s "conftest.$ac_objext"'
6257   { (eval echo "$as_me:6257: \"$ac_try\"") >&5
6258   (eval $ac_try) 2>&5
6259   ac_status=$?
6260   echo "$as_me:6260: \$? = $ac_status" >&5
6261   (exit "$ac_status"); }; }; then
6262   :
6263 else
6264   echo "$as_me: failed program was:" >&5
6265 cat "conftest.$ac_ext" >&5
6266 cf_have_incdir=yes
6267 fi
6268 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6269                           CPPFLAGS=$cf_save_CPPFLAGS
6270                         fi
6271                   fi
6272                 fi
6273
6274                 if test "$cf_have_incdir" = no ; then
6275                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6276
6277 echo "${as_me:-configure}:6277: testing adding $cf_add_incdir to include-path ..." 1>&5
6278
6279                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6280
6281                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6282                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6283                   cf_add_incdir="$cf_top_incdir"
6284                 else
6285                   break
6286                 fi
6287           else
6288                 break
6289           fi
6290         done
6291   done
6292 fi
6293
6294 if test -n "$cf_cv_curses_dir/lib" ; then
6295         for cf_add_libdir in $cf_cv_curses_dir/lib
6296         do
6297                 if test "$cf_add_libdir" = /usr/lib ; then
6298                         :
6299                 elif test -d "$cf_add_libdir"
6300                 then
6301                         cf_have_libdir=no
6302                         if test -n "$LDFLAGS$LIBS" ; then
6303                                 # a loop is needed to ensure we can add subdirs of existing dirs
6304                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6305                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6306                                                 cf_have_libdir=yes; break
6307                                         fi
6308                                 done
6309                         fi
6310                         if test "$cf_have_libdir" = no ; then
6311                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6312
6313 echo "${as_me:-configure}:6313: testing adding $cf_add_libdir to library-path ..." 1>&5
6314
6315                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6316                         fi
6317                 fi
6318         done
6319 fi
6320
6321         fi
6322 fi
6323
6324 cf_cv_screen=curses
6325
6326 echo "$as_me:6326: checking for specified curses library type" >&5
6327 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6328
6329 # Check whether --with-screen or --without-screen was given.
6330 if test "${with_screen+set}" = set; then
6331   withval="$with_screen"
6332   cf_cv_screen=$withval
6333 else
6334
6335 # Check whether --with-ncursesw or --without-ncursesw was given.
6336 if test "${with_ncursesw+set}" = set; then
6337   withval="$with_ncursesw"
6338   cf_cv_screen=ncursesw
6339 else
6340
6341 # Check whether --with-ncurses or --without-ncurses was given.
6342 if test "${with_ncurses+set}" = set; then
6343   withval="$with_ncurses"
6344   cf_cv_screen=ncurses
6345 else
6346
6347 # Check whether --with-pdcurses or --without-pdcurses was given.
6348 if test "${with_pdcurses+set}" = set; then
6349   withval="$with_pdcurses"
6350   cf_cv_screen=pdcurses
6351 else
6352
6353 # Check whether --with-curses-colr or --without-curses-colr was given.
6354 if test "${with_curses_colr+set}" = set; then
6355   withval="$with_curses_colr"
6356   cf_cv_screen=curses_colr
6357 else
6358
6359 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6360 if test "${with_curses_5lib+set}" = set; then
6361   withval="$with_curses_5lib"
6362   cf_cv_screen=curses_5lib
6363 fi;
6364 fi;
6365 fi;
6366 fi;
6367 fi;
6368 fi;
6369
6370 echo "$as_me:6370: result: $cf_cv_screen" >&5
6371 echo "${ECHO_T}$cf_cv_screen" >&6
6372
6373 case $cf_cv_screen in
6374 (curses|curses_*)
6375
6376 echo "$as_me:6376: checking for extra include directories" >&5
6377 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6378 if test "${cf_cv_curses_incdir+set}" = set; then
6379   echo $ECHO_N "(cached) $ECHO_C" >&6
6380 else
6381
6382 cf_cv_curses_incdir=no
6383 case "$host_os" in
6384 (hpux10.*)
6385         if test "x$cf_cv_screen" = "xcurses_colr"
6386         then
6387                 test -d /usr/include/curses_colr && \
6388                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6389         fi
6390         ;;
6391 (sunos3*|sunos4*)
6392         if test "x$cf_cv_screen" = "xcurses_5lib"
6393         then
6394                 test -d /usr/5lib && \
6395                 test -d /usr/5include && \
6396                 cf_cv_curses_incdir="-I/usr/5include"
6397         fi
6398         ;;
6399 esac
6400
6401 fi
6402 echo "$as_me:6402: result: $cf_cv_curses_incdir" >&5
6403 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6404 if test "$cf_cv_curses_incdir" != no
6405 then
6406
6407         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6408         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6409
6410 fi
6411
6412 echo "$as_me:6412: checking if we have identified curses headers" >&5
6413 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6414 if test "${cf_cv_ncurses_header+set}" = set; then
6415   echo $ECHO_N "(cached) $ECHO_C" >&6
6416 else
6417
6418 cf_cv_ncurses_header=none
6419 for cf_header in \
6420         ncurses.h  \
6421         curses.h  ncurses/ncurses.h ncurses/curses.h
6422 do
6423 cat >"conftest.$ac_ext" <<_ACEOF
6424 #line 6424 "configure"
6425 #include "confdefs.h"
6426 #include <${cf_header}>
6427 int
6428 main (void)
6429 {
6430 initscr(); tgoto("?", 0,0)
6431   ;
6432   return 0;
6433 }
6434 _ACEOF
6435 rm -f "conftest.$ac_objext"
6436 if { (eval echo "$as_me:6436: \"$ac_compile\"") >&5
6437   (eval $ac_compile) 2>&5
6438   ac_status=$?
6439   echo "$as_me:6439: \$? = $ac_status" >&5
6440   (exit "$ac_status"); } &&
6441          { ac_try='test -s "conftest.$ac_objext"'
6442   { (eval echo "$as_me:6442: \"$ac_try\"") >&5
6443   (eval $ac_try) 2>&5
6444   ac_status=$?
6445   echo "$as_me:6445: \$? = $ac_status" >&5
6446   (exit "$ac_status"); }; }; then
6447   cf_cv_ncurses_header=$cf_header; break
6448 else
6449   echo "$as_me: failed program was:" >&5
6450 cat "conftest.$ac_ext" >&5
6451 fi
6452 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6453 done
6454
6455 fi
6456 echo "$as_me:6456: result: $cf_cv_ncurses_header" >&5
6457 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6458
6459 if test "$cf_cv_ncurses_header" = none ; then
6460         { { echo "$as_me:6460: error: No curses header-files found" >&5
6461 echo "$as_me: error: No curses header-files found" >&2;}
6462    { (exit 1); exit 1; }; }
6463 fi
6464
6465 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6466
6467 for ac_header in $cf_cv_ncurses_header
6468 do
6469 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6470 echo "$as_me:6470: checking for $ac_header" >&5
6471 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6472 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6473   echo $ECHO_N "(cached) $ECHO_C" >&6
6474 else
6475   cat >"conftest.$ac_ext" <<_ACEOF
6476 #line 6476 "configure"
6477 #include "confdefs.h"
6478 #include <$ac_header>
6479 _ACEOF
6480 if { (eval echo "$as_me:6480: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6481   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6482   ac_status=$?
6483   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6484   rm -f conftest.er1
6485   cat conftest.err >&5
6486   echo "$as_me:6486: \$? = $ac_status" >&5
6487   (exit "$ac_status"); } >/dev/null; then
6488   if test -s conftest.err; then
6489     ac_cpp_err=$ac_c_preproc_warn_flag
6490   else
6491     ac_cpp_err=
6492   fi
6493 else
6494   ac_cpp_err=yes
6495 fi
6496 if test -z "$ac_cpp_err"; then
6497   eval "$as_ac_Header=yes"
6498 else
6499   echo "$as_me: failed program was:" >&5
6500   cat "conftest.$ac_ext" >&5
6501   eval "$as_ac_Header=no"
6502 fi
6503 rm -f conftest.err "conftest.$ac_ext"
6504 fi
6505 echo "$as_me:6505: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6506 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6507 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6508   cat >>confdefs.h <<EOF
6509 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6510 EOF
6511
6512 fi
6513 done
6514
6515 echo "$as_me:6515: checking for terminfo header" >&5
6516 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6517 if test "${cf_cv_term_header+set}" = set; then
6518   echo $ECHO_N "(cached) $ECHO_C" >&6
6519 else
6520
6521 case "${cf_cv_ncurses_header}" in
6522 (*/ncurses.h|*/ncursesw.h)
6523         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6524         ;;
6525 (*)
6526         cf_term_header=term.h
6527         ;;
6528 esac
6529
6530 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6531 do
6532 cat >"conftest.$ac_ext" <<_ACEOF
6533 #line 6533 "configure"
6534 #include "confdefs.h"
6535 #include <stdio.h>
6536 #include <${cf_cv_ncurses_header:-curses.h}>
6537 #include <$cf_test>
6538
6539 int
6540 main (void)
6541 {
6542 int x = auto_left_margin; (void)x
6543   ;
6544   return 0;
6545 }
6546 _ACEOF
6547 rm -f "conftest.$ac_objext"
6548 if { (eval echo "$as_me:6548: \"$ac_compile\"") >&5
6549   (eval $ac_compile) 2>&5
6550   ac_status=$?
6551   echo "$as_me:6551: \$? = $ac_status" >&5
6552   (exit "$ac_status"); } &&
6553          { ac_try='test -s "conftest.$ac_objext"'
6554   { (eval echo "$as_me:6554: \"$ac_try\"") >&5
6555   (eval $ac_try) 2>&5
6556   ac_status=$?
6557   echo "$as_me:6557: \$? = $ac_status" >&5
6558   (exit "$ac_status"); }; }; then
6559
6560         cf_cv_term_header="$cf_test"
6561 else
6562   echo "$as_me: failed program was:" >&5
6563 cat "conftest.$ac_ext" >&5
6564
6565         cf_cv_term_header=unknown
6566
6567 fi
6568 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6569         test "$cf_cv_term_header" != unknown && break
6570 done
6571
6572 fi
6573 echo "$as_me:6573: result: $cf_cv_term_header" >&5
6574 echo "${ECHO_T}$cf_cv_term_header" >&6
6575
6576 # Set definitions to allow ifdef'ing to accommodate subdirectories
6577
6578 case "$cf_cv_term_header" in
6579 (*term.h)
6580
6581 cat >>confdefs.h <<\EOF
6582 #define HAVE_TERM_H 1
6583 EOF
6584
6585         ;;
6586 esac
6587
6588 case "$cf_cv_term_header" in
6589 (ncurses/term.h)
6590
6591 cat >>confdefs.h <<\EOF
6592 #define HAVE_NCURSES_TERM_H 1
6593 EOF
6594
6595         ;;
6596 (ncursesw/term.h)
6597
6598 cat >>confdefs.h <<\EOF
6599 #define HAVE_NCURSESW_TERM_H 1
6600 EOF
6601
6602         ;;
6603 esac
6604
6605 echo "$as_me:6605: checking for ncurses version" >&5
6606 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6607 if test "${cf_cv_ncurses_version+set}" = set; then
6608   echo $ECHO_N "(cached) $ECHO_C" >&6
6609 else
6610
6611         cf_cv_ncurses_version=no
6612         cf_tempfile=out$$
6613         rm -f "$cf_tempfile"
6614         if test "$cross_compiling" = yes; then
6615
6616         # This will not work if the preprocessor splits the line after the
6617         # Autoconf token.  The 'unproto' program does that.
6618         cat > "conftest.$ac_ext" <<EOF
6619 #include <${cf_cv_ncurses_header:-curses.h}>
6620 #undef Autoconf
6621 #ifdef NCURSES_VERSION
6622 Autoconf NCURSES_VERSION
6623 #else
6624 #ifdef __NCURSES_H
6625 Autoconf "old"
6626 #endif
6627 ;
6628 #endif
6629 EOF
6630         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6631         { (eval echo "$as_me:6631: \"$cf_try\"") >&5
6632   (eval $cf_try) 2>&5
6633   ac_status=$?
6634   echo "$as_me:6634: \$? = $ac_status" >&5
6635   (exit "$ac_status"); }
6636         if test -f conftest.out ; then
6637                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6638                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6639                 rm -f conftest.out
6640         fi
6641
6642 else
6643   cat >"conftest.$ac_ext" <<_ACEOF
6644 #line 6644 "configure"
6645 #include "confdefs.h"
6646
6647 #include <${cf_cv_ncurses_header:-curses.h}>
6648 #include <stdio.h>
6649 int main(void)
6650 {
6651         FILE *fp = fopen("$cf_tempfile", "w");
6652 #ifdef NCURSES_VERSION
6653 # ifdef NCURSES_VERSION_PATCH
6654         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6655 # else
6656         fprintf(fp, "%s\\n", NCURSES_VERSION);
6657 # endif
6658 #else
6659 # ifdef __NCURSES_H
6660         fprintf(fp, "old\\n");
6661 # else
6662         make an error
6663 # endif
6664 #endif
6665         ${cf_cv_main_return:-return}(0);
6666 }
6667 _ACEOF
6668 rm -f "conftest$ac_exeext"
6669 if { (eval echo "$as_me:6669: \"$ac_link\"") >&5
6670   (eval $ac_link) 2>&5
6671   ac_status=$?
6672   echo "$as_me:6672: \$? = $ac_status" >&5
6673   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6674   { (eval echo "$as_me:6674: \"$ac_try\"") >&5
6675   (eval $ac_try) 2>&5
6676   ac_status=$?
6677   echo "$as_me:6677: \$? = $ac_status" >&5
6678   (exit "$ac_status"); }; }; then
6679
6680         cf_cv_ncurses_version=`cat $cf_tempfile`
6681 else
6682   echo "$as_me: program exited with status $ac_status" >&5
6683 echo "$as_me: failed program was:" >&5
6684 cat "conftest.$ac_ext" >&5
6685 fi
6686 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6687 fi
6688         rm -f "$cf_tempfile"
6689
6690 fi
6691 echo "$as_me:6691: result: $cf_cv_ncurses_version" >&5
6692 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6693 test "$cf_cv_ncurses_version" = no ||
6694 cat >>confdefs.h <<\EOF
6695 #define NCURSES 1
6696 EOF
6697
6698 echo "$as_me:6698: checking if we have identified curses libraries" >&5
6699 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6700 cat >"conftest.$ac_ext" <<_ACEOF
6701 #line 6701 "configure"
6702 #include "confdefs.h"
6703 #include <${cf_cv_ncurses_header:-curses.h}>
6704 int
6705 main (void)
6706 {
6707 initscr(); tgoto("?", 0,0)
6708   ;
6709   return 0;
6710 }
6711 _ACEOF
6712 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6713 if { (eval echo "$as_me:6713: \"$ac_link\"") >&5
6714   (eval $ac_link) 2>&5
6715   ac_status=$?
6716   echo "$as_me:6716: \$? = $ac_status" >&5
6717   (exit "$ac_status"); } &&
6718          { ac_try='test -s "conftest$ac_exeext"'
6719   { (eval echo "$as_me:6719: \"$ac_try\"") >&5
6720   (eval $ac_try) 2>&5
6721   ac_status=$?
6722   echo "$as_me:6722: \$? = $ac_status" >&5
6723   (exit "$ac_status"); }; }; then
6724   cf_result=yes
6725 else
6726   echo "$as_me: failed program was:" >&5
6727 cat "conftest.$ac_ext" >&5
6728 cf_result=no
6729 fi
6730 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6731 echo "$as_me:6731: result: $cf_result" >&5
6732 echo "${ECHO_T}$cf_result" >&6
6733
6734 if test "$cf_result" = no ; then
6735 case "$host_os" in
6736 (freebsd*)
6737         echo "$as_me:6737: checking for tgoto in -lmytinfo" >&5
6738 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6739 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6740   echo $ECHO_N "(cached) $ECHO_C" >&6
6741 else
6742   ac_check_lib_save_LIBS=$LIBS
6743 LIBS="-lmytinfo  $LIBS"
6744 cat >"conftest.$ac_ext" <<_ACEOF
6745 #line 6745 "configure"
6746 #include "confdefs.h"
6747
6748 /* Override any gcc2 internal prototype to avoid an error.  */
6749 #ifdef __cplusplus
6750 extern "C"
6751 #endif
6752 /* We use char because int might match the return type of a gcc2
6753    builtin and then its argument prototype would still apply.  */
6754 char tgoto ();
6755 int
6756 main (void)
6757 {
6758 tgoto ();
6759   ;
6760   return 0;
6761 }
6762 _ACEOF
6763 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6764 if { (eval echo "$as_me:6764: \"$ac_link\"") >&5
6765   (eval $ac_link) 2>&5
6766   ac_status=$?
6767   echo "$as_me:6767: \$? = $ac_status" >&5
6768   (exit "$ac_status"); } &&
6769          { ac_try='test -s "conftest$ac_exeext"'
6770   { (eval echo "$as_me:6770: \"$ac_try\"") >&5
6771   (eval $ac_try) 2>&5
6772   ac_status=$?
6773   echo "$as_me:6773: \$? = $ac_status" >&5
6774   (exit "$ac_status"); }; }; then
6775   ac_cv_lib_mytinfo_tgoto=yes
6776 else
6777   echo "$as_me: failed program was:" >&5
6778 cat "conftest.$ac_ext" >&5
6779 ac_cv_lib_mytinfo_tgoto=no
6780 fi
6781 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6782 LIBS=$ac_check_lib_save_LIBS
6783 fi
6784 echo "$as_me:6784: result: $ac_cv_lib_mytinfo_tgoto" >&5
6785 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6786 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6787
6788 cf_add_libs="$LIBS"
6789 # reverse order
6790 cf_add_0lib=
6791 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6792 # filter duplicates
6793 for cf_add_1lib in $cf_add_0lib; do
6794         for cf_add_2lib in $cf_add_libs; do
6795                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6796                         cf_add_1lib=
6797                         break
6798                 fi
6799         done
6800         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6801 done
6802 LIBS="$cf_add_libs"
6803
6804 fi
6805
6806         ;;
6807 (hpux10.*)
6808         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6809         # next (1998), and xcurses "newer" (2000).  There is no header file for
6810         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6811         # term.h) for cur_colr
6812         if test "x$cf_cv_screen" = "xcurses_colr"
6813         then
6814                 echo "$as_me:6814: checking for initscr in -lcur_colr" >&5
6815 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6816 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6817   echo $ECHO_N "(cached) $ECHO_C" >&6
6818 else
6819   ac_check_lib_save_LIBS=$LIBS
6820 LIBS="-lcur_colr  $LIBS"
6821 cat >"conftest.$ac_ext" <<_ACEOF
6822 #line 6822 "configure"
6823 #include "confdefs.h"
6824
6825 /* Override any gcc2 internal prototype to avoid an error.  */
6826 #ifdef __cplusplus
6827 extern "C"
6828 #endif
6829 /* We use char because int might match the return type of a gcc2
6830    builtin and then its argument prototype would still apply.  */
6831 char initscr ();
6832 int
6833 main (void)
6834 {
6835 initscr ();
6836   ;
6837   return 0;
6838 }
6839 _ACEOF
6840 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6841 if { (eval echo "$as_me:6841: \"$ac_link\"") >&5
6842   (eval $ac_link) 2>&5
6843   ac_status=$?
6844   echo "$as_me:6844: \$? = $ac_status" >&5
6845   (exit "$ac_status"); } &&
6846          { ac_try='test -s "conftest$ac_exeext"'
6847   { (eval echo "$as_me:6847: \"$ac_try\"") >&5
6848   (eval $ac_try) 2>&5
6849   ac_status=$?
6850   echo "$as_me:6850: \$? = $ac_status" >&5
6851   (exit "$ac_status"); }; }; then
6852   ac_cv_lib_cur_colr_initscr=yes
6853 else
6854   echo "$as_me: failed program was:" >&5
6855 cat "conftest.$ac_ext" >&5
6856 ac_cv_lib_cur_colr_initscr=no
6857 fi
6858 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6859 LIBS=$ac_check_lib_save_LIBS
6860 fi
6861 echo "$as_me:6861: result: $ac_cv_lib_cur_colr_initscr" >&5
6862 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6863 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
6864
6865 cf_add_libs="$LIBS"
6866 # reverse order
6867 cf_add_0lib=
6868 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6869 # filter duplicates
6870 for cf_add_1lib in $cf_add_0lib; do
6871         for cf_add_2lib in $cf_add_libs; do
6872                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6873                         cf_add_1lib=
6874                         break
6875                 fi
6876         done
6877         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6878 done
6879 LIBS="$cf_add_libs"
6880
6881                         ac_cv_func_initscr=yes
6882
6883 else
6884
6885                 echo "$as_me:6885: checking for initscr in -lHcurses" >&5
6886 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6887 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6888   echo $ECHO_N "(cached) $ECHO_C" >&6
6889 else
6890   ac_check_lib_save_LIBS=$LIBS
6891 LIBS="-lHcurses  $LIBS"
6892 cat >"conftest.$ac_ext" <<_ACEOF
6893 #line 6893 "configure"
6894 #include "confdefs.h"
6895
6896 /* Override any gcc2 internal prototype to avoid an error.  */
6897 #ifdef __cplusplus
6898 extern "C"
6899 #endif
6900 /* We use char because int might match the return type of a gcc2
6901    builtin and then its argument prototype would still apply.  */
6902 char initscr ();
6903 int
6904 main (void)
6905 {
6906 initscr ();
6907   ;
6908   return 0;
6909 }
6910 _ACEOF
6911 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6912 if { (eval echo "$as_me:6912: \"$ac_link\"") >&5
6913   (eval $ac_link) 2>&5
6914   ac_status=$?
6915   echo "$as_me:6915: \$? = $ac_status" >&5
6916   (exit "$ac_status"); } &&
6917          { ac_try='test -s "conftest$ac_exeext"'
6918   { (eval echo "$as_me:6918: \"$ac_try\"") >&5
6919   (eval $ac_try) 2>&5
6920   ac_status=$?
6921   echo "$as_me:6921: \$? = $ac_status" >&5
6922   (exit "$ac_status"); }; }; then
6923   ac_cv_lib_Hcurses_initscr=yes
6924 else
6925   echo "$as_me: failed program was:" >&5
6926 cat "conftest.$ac_ext" >&5
6927 ac_cv_lib_Hcurses_initscr=no
6928 fi
6929 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6930 LIBS=$ac_check_lib_save_LIBS
6931 fi
6932 echo "$as_me:6932: result: $ac_cv_lib_Hcurses_initscr" >&5
6933 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6934 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
6935
6936                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6937
6938 cf_add_libs="$LIBS"
6939 # reverse order
6940 cf_add_0lib=
6941 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6942 # filter duplicates
6943 for cf_add_1lib in $cf_add_0lib; do
6944         for cf_add_2lib in $cf_add_libs; do
6945                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6946                         cf_add_1lib=
6947                         break
6948                 fi
6949         done
6950         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6951 done
6952 LIBS="$cf_add_libs"
6953
6954         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6955         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6956
6957                         ac_cv_func_initscr=yes
6958
6959 fi
6960
6961 fi
6962
6963         fi
6964         ;;
6965 (linux*)
6966         case `arch 2>/dev/null` in
6967         (x86_64)
6968                 if test -d /lib64
6969                 then
6970
6971 if test -n "/lib64" ; then
6972         for cf_add_libdir in /lib64
6973         do
6974                 if test "$cf_add_libdir" = /usr/lib ; then
6975                         :
6976                 elif test -d "$cf_add_libdir"
6977                 then
6978                         cf_have_libdir=no
6979                         if test -n "$LDFLAGS$LIBS" ; then
6980                                 # a loop is needed to ensure we can add subdirs of existing dirs
6981                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6982                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6983                                                 cf_have_libdir=yes; break
6984                                         fi
6985                                 done
6986                         fi
6987                         if test "$cf_have_libdir" = no ; then
6988                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6989
6990 echo "${as_me:-configure}:6990: testing adding $cf_add_libdir to library-path ..." 1>&5
6991
6992                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6993                         fi
6994                 fi
6995         done
6996 fi
6997
6998                 else
6999
7000 if test -n "/lib" ; then
7001         for cf_add_libdir in /lib
7002         do
7003                 if test "$cf_add_libdir" = /usr/lib ; then
7004                         :
7005                 elif test -d "$cf_add_libdir"
7006                 then
7007                         cf_have_libdir=no
7008                         if test -n "$LDFLAGS$LIBS" ; then
7009                                 # a loop is needed to ensure we can add subdirs of existing dirs
7010                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7011                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7012                                                 cf_have_libdir=yes; break
7013                                         fi
7014                                 done
7015                         fi
7016                         if test "$cf_have_libdir" = no ; then
7017                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7018
7019 echo "${as_me:-configure}:7019: testing adding $cf_add_libdir to library-path ..." 1>&5
7020
7021                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7022                         fi
7023                 fi
7024         done
7025 fi
7026
7027                 fi
7028                 ;;
7029         (*)
7030
7031 if test -n "/lib" ; then
7032         for cf_add_libdir in /lib
7033         do
7034                 if test "$cf_add_libdir" = /usr/lib ; then
7035                         :
7036                 elif test -d "$cf_add_libdir"
7037                 then
7038                         cf_have_libdir=no
7039                         if test -n "$LDFLAGS$LIBS" ; then
7040                                 # a loop is needed to ensure we can add subdirs of existing dirs
7041                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7042                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7043                                                 cf_have_libdir=yes; break
7044                                         fi
7045                                 done
7046                         fi
7047                         if test "$cf_have_libdir" = no ; then
7048                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7049
7050 echo "${as_me:-configure}:7050: testing adding $cf_add_libdir to library-path ..." 1>&5
7051
7052                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7053                         fi
7054                 fi
7055         done
7056 fi
7057
7058                 ;;
7059         esac
7060         ;;
7061 (sunos3*|sunos4*)
7062         if test "x$cf_cv_screen" = "xcurses_5lib"
7063         then
7064                 if test -d /usr/5lib ; then
7065
7066 if test -n "/usr/5lib" ; then
7067         for cf_add_libdir in /usr/5lib
7068         do
7069                 if test "$cf_add_libdir" = /usr/lib ; then
7070                         :
7071                 elif test -d "$cf_add_libdir"
7072                 then
7073                         cf_have_libdir=no
7074                         if test -n "$LDFLAGS$LIBS" ; then
7075                                 # a loop is needed to ensure we can add subdirs of existing dirs
7076                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7077                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7078                                                 cf_have_libdir=yes; break
7079                                         fi
7080                                 done
7081                         fi
7082                         if test "$cf_have_libdir" = no ; then
7083                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7084
7085 echo "${as_me:-configure}:7085: testing adding $cf_add_libdir to library-path ..." 1>&5
7086
7087                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7088                         fi
7089                 fi
7090         done
7091 fi
7092
7093 cf_add_libs="$LIBS"
7094 # reverse order
7095 cf_add_0lib=
7096 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7097 # filter duplicates
7098 for cf_add_1lib in $cf_add_0lib; do
7099         for cf_add_2lib in $cf_add_libs; do
7100                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7101                         cf_add_1lib=
7102                         break
7103                 fi
7104         done
7105         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7106 done
7107 LIBS="$cf_add_libs"
7108
7109                 fi
7110         fi
7111         ac_cv_func_initscr=yes
7112         ;;
7113 esac
7114
7115 if test ".$ac_cv_func_initscr" != .yes ; then
7116         cf_save_LIBS="$LIBS"
7117
7118         if test ".${cf_cv_ncurses_version:-no}" != .no
7119         then
7120                 cf_check_list="ncurses curses cursesX"
7121         else
7122                 cf_check_list="cursesX curses ncurses"
7123         fi
7124
7125         # Check for library containing tgoto.  Do this before curses library
7126         # because it may be needed to link the test-case for initscr.
7127         if test "x$cf_term_lib" = x
7128         then
7129                 echo "$as_me:7129: checking for tgoto" >&5
7130 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7131 if test "${ac_cv_func_tgoto+set}" = set; then
7132   echo $ECHO_N "(cached) $ECHO_C" >&6
7133 else
7134   cat >"conftest.$ac_ext" <<_ACEOF
7135 #line 7135 "configure"
7136 #include "confdefs.h"
7137 #define tgoto autoconf_temporary
7138 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7139 #undef tgoto
7140
7141 #ifdef __cplusplus
7142 extern "C"
7143 #endif
7144
7145 /* We use char because int might match the return type of a gcc2
7146    builtin and then its argument prototype would still apply.  */
7147 char tgoto (void);
7148
7149 int
7150 main (void)
7151 {
7152
7153 /* The GNU C library defines stubs for functions which it implements
7154     to always fail with ENOSYS.  Some functions are actually named
7155     something starting with __ and the normal name is an alias.  */
7156 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7157 #error found stub for tgoto
7158 #endif
7159
7160         return tgoto ();
7161   ;
7162   return 0;
7163 }
7164 _ACEOF
7165 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7166 if { (eval echo "$as_me:7166: \"$ac_link\"") >&5
7167   (eval $ac_link) 2>&5
7168   ac_status=$?
7169   echo "$as_me:7169: \$? = $ac_status" >&5
7170   (exit "$ac_status"); } &&
7171          { ac_try='test -s "conftest$ac_exeext"'
7172   { (eval echo "$as_me:7172: \"$ac_try\"") >&5
7173   (eval $ac_try) 2>&5
7174   ac_status=$?
7175   echo "$as_me:7175: \$? = $ac_status" >&5
7176   (exit "$ac_status"); }; }; then
7177   ac_cv_func_tgoto=yes
7178 else
7179   echo "$as_me: failed program was:" >&5
7180 cat "conftest.$ac_ext" >&5
7181 ac_cv_func_tgoto=no
7182 fi
7183 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7184 fi
7185 echo "$as_me:7185: result: $ac_cv_func_tgoto" >&5
7186 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7187 if test "$ac_cv_func_tgoto" = yes; then
7188   cf_term_lib=predefined
7189 else
7190
7191                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7192                         do
7193                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7194 echo "$as_me:7194: checking for tgoto in -l$cf_term_lib" >&5
7195 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7196 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7197   echo $ECHO_N "(cached) $ECHO_C" >&6
7198 else
7199   ac_check_lib_save_LIBS=$LIBS
7200 LIBS="-l$cf_term_lib  $LIBS"
7201 cat >"conftest.$ac_ext" <<_ACEOF
7202 #line 7202 "configure"
7203 #include "confdefs.h"
7204
7205 /* Override any gcc2 internal prototype to avoid an error.  */
7206 #ifdef __cplusplus
7207 extern "C"
7208 #endif
7209 /* We use char because int might match the return type of a gcc2
7210    builtin and then its argument prototype would still apply.  */
7211 char tgoto ();
7212 int
7213 main (void)
7214 {
7215 tgoto ();
7216   ;
7217   return 0;
7218 }
7219 _ACEOF
7220 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7221 if { (eval echo "$as_me:7221: \"$ac_link\"") >&5
7222   (eval $ac_link) 2>&5
7223   ac_status=$?
7224   echo "$as_me:7224: \$? = $ac_status" >&5
7225   (exit "$ac_status"); } &&
7226          { ac_try='test -s "conftest$ac_exeext"'
7227   { (eval echo "$as_me:7227: \"$ac_try\"") >&5
7228   (eval $ac_try) 2>&5
7229   ac_status=$?
7230   echo "$as_me:7230: \$? = $ac_status" >&5
7231   (exit "$ac_status"); }; }; then
7232   eval "$as_ac_Lib=yes"
7233 else
7234   echo "$as_me: failed program was:" >&5
7235 cat "conftest.$ac_ext" >&5
7236 eval "$as_ac_Lib=no"
7237 fi
7238 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7239 LIBS=$ac_check_lib_save_LIBS
7240 fi
7241 echo "$as_me:7241: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7242 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7243 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7244
7245                                         : "${cf_nculib_root:=$cf_term_lib}"
7246                                         break
7247
7248 fi
7249
7250                         done
7251
7252 fi
7253
7254         fi
7255
7256         # Check for library containing initscr
7257         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7258         if test "x$cf_curs_lib" = x
7259         then
7260                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7261                 do
7262                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7263                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7264                                 echo "$as_me:7264: checking if we can link with $cf_curs_lib library" >&5
7265 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7266                                 cat >"conftest.$ac_ext" <<_ACEOF
7267 #line 7267 "configure"
7268 #include "confdefs.h"
7269 #include <${cf_cv_ncurses_header:-curses.h}>
7270 int
7271 main (void)
7272 {
7273 initscr()
7274   ;
7275   return 0;
7276 }
7277 _ACEOF
7278 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7279 if { (eval echo "$as_me:7279: \"$ac_link\"") >&5
7280   (eval $ac_link) 2>&5
7281   ac_status=$?
7282   echo "$as_me:7282: \$? = $ac_status" >&5
7283   (exit "$ac_status"); } &&
7284          { ac_try='test -s "conftest$ac_exeext"'
7285   { (eval echo "$as_me:7285: \"$ac_try\"") >&5
7286   (eval $ac_try) 2>&5
7287   ac_status=$?
7288   echo "$as_me:7288: \$? = $ac_status" >&5
7289   (exit "$ac_status"); }; }; then
7290   cf_result=yes
7291 else
7292   echo "$as_me: failed program was:" >&5
7293 cat "conftest.$ac_ext" >&5
7294 cf_result=no
7295 fi
7296 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7297                                 echo "$as_me:7297: result: $cf_result" >&5
7298 echo "${ECHO_T}$cf_result" >&6
7299                                 test "$cf_result" = yes && break
7300                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7301                                 cf_result=no
7302                         elif test "$cf_term_lib" != predefined ; then
7303                                 echo "$as_me:7303: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7304 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7305                                 cat >"conftest.$ac_ext" <<_ACEOF
7306 #line 7306 "configure"
7307 #include "confdefs.h"
7308 #include <${cf_cv_ncurses_header:-curses.h}>
7309 int
7310 main (void)
7311 {
7312 initscr(); tgoto((char *)0, 0, 0);
7313   ;
7314   return 0;
7315 }
7316 _ACEOF
7317 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7318 if { (eval echo "$as_me:7318: \"$ac_link\"") >&5
7319   (eval $ac_link) 2>&5
7320   ac_status=$?
7321   echo "$as_me:7321: \$? = $ac_status" >&5
7322   (exit "$ac_status"); } &&
7323          { ac_try='test -s "conftest$ac_exeext"'
7324   { (eval echo "$as_me:7324: \"$ac_try\"") >&5
7325   (eval $ac_try) 2>&5
7326   ac_status=$?
7327   echo "$as_me:7327: \$? = $ac_status" >&5
7328   (exit "$ac_status"); }; }; then
7329   cf_result=no
7330 else
7331   echo "$as_me: failed program was:" >&5
7332 cat "conftest.$ac_ext" >&5
7333
7334                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7335                                         cat >"conftest.$ac_ext" <<_ACEOF
7336 #line 7336 "configure"
7337 #include "confdefs.h"
7338 #include <${cf_cv_ncurses_header:-curses.h}>
7339 int
7340 main (void)
7341 {
7342 initscr()
7343   ;
7344   return 0;
7345 }
7346 _ACEOF
7347 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7348 if { (eval echo "$as_me:7348: \"$ac_link\"") >&5
7349   (eval $ac_link) 2>&5
7350   ac_status=$?
7351   echo "$as_me:7351: \$? = $ac_status" >&5
7352   (exit "$ac_status"); } &&
7353          { ac_try='test -s "conftest$ac_exeext"'
7354   { (eval echo "$as_me:7354: \"$ac_try\"") >&5
7355   (eval $ac_try) 2>&5
7356   ac_status=$?
7357   echo "$as_me:7357: \$? = $ac_status" >&5
7358   (exit "$ac_status"); }; }; then
7359   cf_result=yes
7360 else
7361   echo "$as_me: failed program was:" >&5
7362 cat "conftest.$ac_ext" >&5
7363 cf_result=error
7364 fi
7365 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7366
7367 fi
7368 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7369                                 echo "$as_me:7369: result: $cf_result" >&5
7370 echo "${ECHO_T}$cf_result" >&6
7371                                 test "$cf_result" != error && break
7372                         fi
7373                 done
7374         fi
7375         test "$cf_curs_lib" = unknown && { { echo "$as_me:7375: error: no curses library found" >&5
7376 echo "$as_me: error: no curses library found" >&2;}
7377    { (exit 1); exit 1; }; }
7378 fi
7379 fi
7380
7381         ;;
7382 (ncursesw*)
7383
7384 for ac_header in wchar.h
7385 do
7386 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7387 echo "$as_me:7387: checking for $ac_header" >&5
7388 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7389 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7390   echo $ECHO_N "(cached) $ECHO_C" >&6
7391 else
7392   cat >"conftest.$ac_ext" <<_ACEOF
7393 #line 7393 "configure"
7394 #include "confdefs.h"
7395 #include <$ac_header>
7396 _ACEOF
7397 if { (eval echo "$as_me:7397: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7398   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7399   ac_status=$?
7400   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7401   rm -f conftest.er1
7402   cat conftest.err >&5
7403   echo "$as_me:7403: \$? = $ac_status" >&5
7404   (exit "$ac_status"); } >/dev/null; then
7405   if test -s conftest.err; then
7406     ac_cpp_err=$ac_c_preproc_warn_flag
7407   else
7408     ac_cpp_err=
7409   fi
7410 else
7411   ac_cpp_err=yes
7412 fi
7413 if test -z "$ac_cpp_err"; then
7414   eval "$as_ac_Header=yes"
7415 else
7416   echo "$as_me: failed program was:" >&5
7417   cat "conftest.$ac_ext" >&5
7418   eval "$as_ac_Header=no"
7419 fi
7420 rm -f conftest.err "conftest.$ac_ext"
7421 fi
7422 echo "$as_me:7422: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7423 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7424 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7425   cat >>confdefs.h <<EOF
7426 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7427 EOF
7428
7429 fi
7430 done
7431
7432 echo "$as_me:7432: checking for multibyte character support" >&5
7433 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7434 if test "${cf_cv_utf8_lib+set}" = set; then
7435   echo $ECHO_N "(cached) $ECHO_C" >&6
7436 else
7437
7438         cf_save_LIBS="$LIBS"
7439         cat >"conftest.$ac_ext" <<_ACEOF
7440 #line 7440 "configure"
7441 #include "confdefs.h"
7442
7443 #include <stdlib.h>
7444 #include <stdio.h>
7445 #ifdef HAVE_WCHAR_H
7446 #include <wchar.h>
7447 #endif
7448
7449 int
7450 main (void)
7451 {
7452 putwc(0,0);
7453   ;
7454   return 0;
7455 }
7456 _ACEOF
7457 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7458 if { (eval echo "$as_me:7458: \"$ac_link\"") >&5
7459   (eval $ac_link) 2>&5
7460   ac_status=$?
7461   echo "$as_me:7461: \$? = $ac_status" >&5
7462   (exit "$ac_status"); } &&
7463          { ac_try='test -s "conftest$ac_exeext"'
7464   { (eval echo "$as_me:7464: \"$ac_try\"") >&5
7465   (eval $ac_try) 2>&5
7466   ac_status=$?
7467   echo "$as_me:7467: \$? = $ac_status" >&5
7468   (exit "$ac_status"); }; }; then
7469   cf_cv_utf8_lib=yes
7470 else
7471   echo "$as_me: failed program was:" >&5
7472 cat "conftest.$ac_ext" >&5
7473
7474 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7475 # will be set on completion of the AC_TRY_LINK below.
7476 cf_cv_header_path_utf8=
7477 cf_cv_library_path_utf8=
7478
7479 echo "${as_me:-configure}:7479: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7480
7481 cf_save_LIBS="$LIBS"
7482
7483 cat >"conftest.$ac_ext" <<_ACEOF
7484 #line 7484 "configure"
7485 #include "confdefs.h"
7486
7487 #include <libutf8.h>
7488 int
7489 main (void)
7490 {
7491 putwc(0,0);
7492   ;
7493   return 0;
7494 }
7495 _ACEOF
7496 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7497 if { (eval echo "$as_me:7497: \"$ac_link\"") >&5
7498   (eval $ac_link) 2>&5
7499   ac_status=$?
7500   echo "$as_me:7500: \$? = $ac_status" >&5
7501   (exit "$ac_status"); } &&
7502          { ac_try='test -s "conftest$ac_exeext"'
7503   { (eval echo "$as_me:7503: \"$ac_try\"") >&5
7504   (eval $ac_try) 2>&5
7505   ac_status=$?
7506   echo "$as_me:7506: \$? = $ac_status" >&5
7507   (exit "$ac_status"); }; }; then
7508
7509         cf_cv_find_linkage_utf8=yes
7510         cf_cv_header_path_utf8=/usr/include
7511         cf_cv_library_path_utf8=/usr/lib
7512
7513 else
7514   echo "$as_me: failed program was:" >&5
7515 cat "conftest.$ac_ext" >&5
7516
7517 LIBS="-lutf8  $cf_save_LIBS"
7518
7519 cat >"conftest.$ac_ext" <<_ACEOF
7520 #line 7520 "configure"
7521 #include "confdefs.h"
7522
7523 #include <libutf8.h>
7524 int
7525 main (void)
7526 {
7527 putwc(0,0);
7528   ;
7529   return 0;
7530 }
7531 _ACEOF
7532 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7533 if { (eval echo "$as_me:7533: \"$ac_link\"") >&5
7534   (eval $ac_link) 2>&5
7535   ac_status=$?
7536   echo "$as_me:7536: \$? = $ac_status" >&5
7537   (exit "$ac_status"); } &&
7538          { ac_try='test -s "conftest$ac_exeext"'
7539   { (eval echo "$as_me:7539: \"$ac_try\"") >&5
7540   (eval $ac_try) 2>&5
7541   ac_status=$?
7542   echo "$as_me:7542: \$? = $ac_status" >&5
7543   (exit "$ac_status"); }; }; then
7544
7545         cf_cv_find_linkage_utf8=yes
7546         cf_cv_header_path_utf8=/usr/include
7547         cf_cv_library_path_utf8=/usr/lib
7548         cf_cv_library_file_utf8="-lutf8"
7549
7550 else
7551   echo "$as_me: failed program was:" >&5
7552 cat "conftest.$ac_ext" >&5
7553
7554         cf_cv_find_linkage_utf8=no
7555         LIBS="$cf_save_LIBS"
7556
7557         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7558
7559 echo "${as_me:-configure}:7559: testing find linkage for utf8 library ..." 1>&5
7560
7561 echo "${as_me:-configure}:7561: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7562
7563         cf_save_CPPFLAGS="$CPPFLAGS"
7564         cf_test_CPPFLAGS="$CPPFLAGS"
7565
7566 cf_search=
7567
7568 # collect the current set of include-directories from compiler flags
7569 cf_header_path_list=""
7570 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7571         for cf_header_path in $CPPFLAGS $CFLAGS
7572         do
7573                 case "$cf_header_path" in
7574                 (-I*)
7575                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7576
7577 test "x$cf_header_path" != "xNONE" && \
7578 test -d "$cf_header_path" && \
7579  {
7580         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7581         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7582         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7583         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7584         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7585         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7586 }
7587
7588                         cf_header_path_list="$cf_header_path_list $cf_search"
7589                         ;;
7590                 esac
7591         done
7592 fi
7593
7594 # add the variations for the package we are looking for
7595
7596 cf_search=
7597
7598 test "x$prefix" != "xNONE" && \
7599 test -d "$prefix" && \
7600  {
7601         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7602         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7603         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7604         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7605         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7606         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7607 }
7608
7609 for cf_subdir_prefix in \
7610         /usr \
7611         /usr/local \
7612         /usr/pkg \
7613         /opt \
7614         /opt/local \
7615         $HOME
7616 do
7617
7618 test "x$cf_subdir_prefix" != "x$prefix" && \
7619 test -d "$cf_subdir_prefix" && \
7620 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7621         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7622         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7623         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7624         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7625         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7626         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7627 }
7628
7629 done
7630
7631 test "$includedir" != NONE && \
7632 test "$includedir" != "/usr/include" && \
7633 test -d "$includedir" && {
7634         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7635         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7636 }
7637
7638 test "$oldincludedir" != NONE && \
7639 test "$oldincludedir" != "/usr/include" && \
7640 test -d "$oldincludedir" && {
7641         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7642         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7643 }
7644
7645 cf_search="$cf_search $cf_header_path_list"
7646
7647         for cf_cv_header_path_utf8 in $cf_search
7648         do
7649                 if test -d "$cf_cv_header_path_utf8" ; then
7650                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7651
7652 echo "${as_me:-configure}:7652: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7653
7654                         CPPFLAGS="$cf_save_CPPFLAGS"
7655
7656         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7657         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7658
7659                         cat >"conftest.$ac_ext" <<_ACEOF
7660 #line 7660 "configure"
7661 #include "confdefs.h"
7662
7663 #include <libutf8.h>
7664 int
7665 main (void)
7666 {
7667 putwc(0,0);
7668   ;
7669   return 0;
7670 }
7671 _ACEOF
7672 rm -f "conftest.$ac_objext"
7673 if { (eval echo "$as_me:7673: \"$ac_compile\"") >&5
7674   (eval $ac_compile) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit "$ac_status"); } &&
7678          { ac_try='test -s "conftest.$ac_objext"'
7679   { (eval echo "$as_me:7679: \"$ac_try\"") >&5
7680   (eval $ac_try) 2>&5
7681   ac_status=$?
7682   echo "$as_me:7682: \$? = $ac_status" >&5
7683   (exit "$ac_status"); }; }; then
7684
7685                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7686
7687 echo "${as_me:-configure}:7687: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7688
7689                                 cf_cv_find_linkage_utf8=maybe
7690                                 cf_test_CPPFLAGS="$CPPFLAGS"
7691                                 break
7692 else
7693   echo "$as_me: failed program was:" >&5
7694 cat "conftest.$ac_ext" >&5
7695
7696                                 CPPFLAGS="$cf_save_CPPFLAGS"
7697
7698 fi
7699 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7700                 fi
7701         done
7702
7703         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7704
7705 echo "${as_me:-configure}:7705: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7706
7707                 cf_save_LIBS="$LIBS"
7708                 cf_save_LDFLAGS="$LDFLAGS"
7709
7710                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7711
7712 cf_search=
7713 cf_library_path_list=""
7714 if test -n "${LDFLAGS}${LIBS}" ; then
7715         for cf_library_path in $LDFLAGS $LIBS
7716         do
7717                 case "$cf_library_path" in
7718                 (-L*)
7719                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7720
7721 test "x$cf_library_path" != "xNONE" && \
7722 test -d "$cf_library_path" && \
7723  {
7724         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7725         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7726         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7727         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7728         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7729         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7730 }
7731
7732                         cf_library_path_list="$cf_library_path_list $cf_search"
7733                         ;;
7734                 esac
7735         done
7736 fi
7737
7738 cf_search=
7739
7740 test "x$prefix" != "xNONE" && \
7741 test -d "$prefix" && \
7742  {
7743         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7744         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7745         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7746         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7747         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7748         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7749 }
7750
7751 for cf_subdir_prefix in \
7752         /usr \
7753         /usr/local \
7754         /usr/pkg \
7755         /opt \
7756         /opt/local \
7757         $HOME
7758 do
7759
7760 test "x$cf_subdir_prefix" != "x$prefix" && \
7761 test -d "$cf_subdir_prefix" && \
7762 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7763         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7764         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7765         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7766         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7767         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7768         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7769 }
7770
7771 done
7772
7773 cf_search="$cf_library_path_list $cf_search"
7774
7775                         for cf_cv_library_path_utf8 in $cf_search
7776                         do
7777                                 if test -d "$cf_cv_library_path_utf8" ; then
7778                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7779
7780 echo "${as_me:-configure}:7780: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7781
7782                                         CPPFLAGS="$cf_test_CPPFLAGS"
7783                                         LIBS="-lutf8  $cf_save_LIBS"
7784                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7785                                         cat >"conftest.$ac_ext" <<_ACEOF
7786 #line 7786 "configure"
7787 #include "confdefs.h"
7788
7789 #include <libutf8.h>
7790 int
7791 main (void)
7792 {
7793 putwc(0,0);
7794   ;
7795   return 0;
7796 }
7797 _ACEOF
7798 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7799 if { (eval echo "$as_me:7799: \"$ac_link\"") >&5
7800   (eval $ac_link) 2>&5
7801   ac_status=$?
7802   echo "$as_me:7802: \$? = $ac_status" >&5
7803   (exit "$ac_status"); } &&
7804          { ac_try='test -s "conftest$ac_exeext"'
7805   { (eval echo "$as_me:7805: \"$ac_try\"") >&5
7806   (eval $ac_try) 2>&5
7807   ac_status=$?
7808   echo "$as_me:7808: \$? = $ac_status" >&5
7809   (exit "$ac_status"); }; }; then
7810
7811                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7812
7813 echo "${as_me:-configure}:7813: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7814
7815                                         cf_cv_find_linkage_utf8=yes
7816                                         cf_cv_library_file_utf8="-lutf8"
7817                                         break
7818 else
7819   echo "$as_me: failed program was:" >&5
7820 cat "conftest.$ac_ext" >&5
7821
7822                                         CPPFLAGS="$cf_save_CPPFLAGS"
7823                                         LIBS="$cf_save_LIBS"
7824                                         LDFLAGS="$cf_save_LDFLAGS"
7825
7826 fi
7827 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7828                                 fi
7829                         done
7830                         CPPFLAGS="$cf_save_CPPFLAGS"
7831                         LDFLAGS="$cf_save_LDFLAGS"
7832                 fi
7833
7834         else
7835                 cf_cv_find_linkage_utf8=no
7836         fi
7837
7838 fi
7839 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7840
7841 fi
7842 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7843
7844 LIBS="$cf_save_LIBS"
7845
7846 if test "$cf_cv_find_linkage_utf8" = yes ; then
7847 cf_cv_utf8_lib=add-on
7848 else
7849 cf_cv_utf8_lib=no
7850 fi
7851
7852 fi
7853 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7854 fi
7855 echo "$as_me:7855: result: $cf_cv_utf8_lib" >&5
7856 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7857
7858 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7859 # ncurses/ncursesw:
7860 if test "$cf_cv_utf8_lib" = "add-on" ; then
7861
7862 cat >>confdefs.h <<\EOF
7863 #define HAVE_LIBUTF8_H 1
7864 EOF
7865
7866 if test -n "$cf_cv_header_path_utf8" ; then
7867   for cf_add_incdir in $cf_cv_header_path_utf8
7868   do
7869         while test "$cf_add_incdir" != /usr/include
7870         do
7871           if test -d "$cf_add_incdir"
7872           then
7873                 cf_have_incdir=no
7874                 if test -n "$CFLAGS$CPPFLAGS" ; then
7875                   # a loop is needed to ensure we can add subdirs of existing dirs
7876                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7877                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7878                           cf_have_incdir=yes; break
7879                         fi
7880                   done
7881                 fi
7882
7883                 if test "$cf_have_incdir" = no ; then
7884                   if test "$cf_add_incdir" = /usr/local/include ; then
7885                         if test "$GCC" = yes
7886                         then
7887                           cf_save_CPPFLAGS=$CPPFLAGS
7888
7889         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7890         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7891
7892                           cat >"conftest.$ac_ext" <<_ACEOF
7893 #line 7893 "configure"
7894 #include "confdefs.h"
7895 #include <stdio.h>
7896 int
7897 main (void)
7898 {
7899 printf("Hello")
7900   ;
7901   return 0;
7902 }
7903 _ACEOF
7904 rm -f "conftest.$ac_objext"
7905 if { (eval echo "$as_me:7905: \"$ac_compile\"") >&5
7906   (eval $ac_compile) 2>&5
7907   ac_status=$?
7908   echo "$as_me:7908: \$? = $ac_status" >&5
7909   (exit "$ac_status"); } &&
7910          { ac_try='test -s "conftest.$ac_objext"'
7911   { (eval echo "$as_me:7911: \"$ac_try\"") >&5
7912   (eval $ac_try) 2>&5
7913   ac_status=$?
7914   echo "$as_me:7914: \$? = $ac_status" >&5
7915   (exit "$ac_status"); }; }; then
7916   :
7917 else
7918   echo "$as_me: failed program was:" >&5
7919 cat "conftest.$ac_ext" >&5
7920 cf_have_incdir=yes
7921 fi
7922 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7923                           CPPFLAGS=$cf_save_CPPFLAGS
7924                         fi
7925                   fi
7926                 fi
7927
7928                 if test "$cf_have_incdir" = no ; then
7929                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7930
7931 echo "${as_me:-configure}:7931: testing adding $cf_add_incdir to include-path ..." 1>&5
7932
7933                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7934
7935                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7936                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7937                   cf_add_incdir="$cf_top_incdir"
7938                 else
7939                   break
7940                 fi
7941           else
7942                 break
7943           fi
7944         done
7945   done
7946 fi
7947
7948 if test -n "$cf_cv_library_path_utf8" ; then
7949         for cf_add_libdir in $cf_cv_library_path_utf8
7950         do
7951                 if test "$cf_add_libdir" = /usr/lib ; then
7952                         :
7953                 elif test -d "$cf_add_libdir"
7954                 then
7955                         cf_have_libdir=no
7956                         if test -n "$LDFLAGS$LIBS" ; then
7957                                 # a loop is needed to ensure we can add subdirs of existing dirs
7958                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7959                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7960                                                 cf_have_libdir=yes; break
7961                                         fi
7962                                 done
7963                         fi
7964                         if test "$cf_have_libdir" = no ; then
7965                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7966
7967 echo "${as_me:-configure}:7967: testing adding $cf_add_libdir to library-path ..." 1>&5
7968
7969                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7970                         fi
7971                 fi
7972         done
7973 fi
7974
7975 cf_add_libs="$LIBS"
7976 # reverse order
7977 cf_add_0lib=
7978 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7979 # filter duplicates
7980 for cf_add_1lib in $cf_add_0lib; do
7981         for cf_add_2lib in $cf_add_libs; do
7982                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7983                         cf_add_1lib=
7984                         break
7985                 fi
7986         done
7987         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7988 done
7989 LIBS="$cf_add_libs"
7990
7991 fi
7992
7993 cf_ncuconfig_root=$cf_cv_screen
7994 cf_have_ncuconfig=no
7995
7996 if test "x${PKG_CONFIG:=none}" != xnone; then
7997         echo "$as_me:7997: checking pkg-config for $cf_ncuconfig_root" >&5
7998 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7999         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8000                 echo "$as_me:8000: result: yes" >&5
8001 echo "${ECHO_T}yes" >&6
8002
8003                 echo "$as_me:8003: checking if the $cf_ncuconfig_root package files work" >&5
8004 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8005                 cf_have_ncuconfig=unknown
8006
8007                 cf_save_CFLAGS="$CFLAGS"
8008                 cf_save_CPPFLAGS="$CPPFLAGS"
8009                 cf_save_LIBS="$LIBS"
8010
8011                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8012                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8013
8014                 # while -W for passing linker flags is prevalent, it is not "standard".
8015                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8016                 # incompatible _and_ non-standard -W option which gives an error.  Work
8017                 # around that pitfall.
8018                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8019                 (x*c[89]9@@*-W*)
8020
8021 cf_fix_cppflags=no
8022 cf_new_cflags=
8023 cf_new_cppflags=
8024 cf_new_extra_cppflags=
8025
8026 for cf_add_cflags in $cf_pkg_cflags
8027 do
8028 case "$cf_fix_cppflags" in
8029 (no)
8030         case "$cf_add_cflags" in
8031         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8032                 case "$cf_add_cflags" in
8033                 (-D*)
8034                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8035
8036                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8037                                 && test -z "${cf_tst_cflags}" \
8038                                 && cf_fix_cppflags=yes
8039
8040                         if test "$cf_fix_cppflags" = yes ; then
8041
8042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8044
8045                                 continue
8046                         elif test "${cf_tst_cflags}" = "\"'" ; then
8047
8048         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8049         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8050
8051                                 continue
8052                         fi
8053                         ;;
8054                 esac
8055                 case "$CPPFLAGS" in
8056                 (*$cf_add_cflags)
8057                         ;;
8058                 (*)
8059                         case "$cf_add_cflags" in
8060                         (-D*)
8061                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8062
8063 CPPFLAGS=`echo "$CPPFLAGS" | \
8064         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8065                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8066
8067                                 ;;
8068                         esac
8069
8070         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8071         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8072
8073                         ;;
8074                 esac
8075                 ;;
8076         (*)
8077
8078         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8079         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8080
8081                 ;;
8082         esac
8083         ;;
8084 (yes)
8085
8086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8088
8089         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8090
8091         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8092                 && test -z "${cf_tst_cflags}" \
8093                 && cf_fix_cppflags=no
8094         ;;
8095 esac
8096 done
8097
8098 if test -n "$cf_new_cflags" ; then
8099
8100         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8101         CFLAGS="${CFLAGS}$cf_new_cflags"
8102
8103 fi
8104
8105 if test -n "$cf_new_cppflags" ; then
8106
8107         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8108         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8109
8110 fi
8111
8112 if test -n "$cf_new_extra_cppflags" ; then
8113
8114         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8115         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8116
8117 fi
8118
8119 cf_add_libs="$LIBS"
8120 # reverse order
8121 cf_add_0lib=
8122 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8123 # filter duplicates
8124 for cf_add_1lib in $cf_add_0lib; do
8125         for cf_add_2lib in $cf_add_libs; do
8126                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8127                         cf_add_1lib=
8128                         break
8129                 fi
8130         done
8131         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8132 done
8133 LIBS="$cf_add_libs"
8134
8135                         cat >"conftest.$ac_ext" <<_ACEOF
8136 #line 8136 "configure"
8137 #include "confdefs.h"
8138 #include <${cf_cv_ncurses_header:-curses.h}>
8139 int
8140 main (void)
8141 {
8142 initscr(); mousemask(0,0); tigetstr((char *)0);
8143   ;
8144   return 0;
8145 }
8146 _ACEOF
8147 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8148 if { (eval echo "$as_me:8148: \"$ac_link\"") >&5
8149   (eval $ac_link) 2>&5
8150   ac_status=$?
8151   echo "$as_me:8151: \$? = $ac_status" >&5
8152   (exit "$ac_status"); } &&
8153          { ac_try='test -s "conftest$ac_exeext"'
8154   { (eval echo "$as_me:8154: \"$ac_try\"") >&5
8155   (eval $ac_try) 2>&5
8156   ac_status=$?
8157   echo "$as_me:8157: \$? = $ac_status" >&5
8158   (exit "$ac_status"); }; }; then
8159   if test "$cross_compiling" = yes; then
8160   cf_test_ncuconfig=maybe
8161 else
8162   cat >"conftest.$ac_ext" <<_ACEOF
8163 #line 8163 "configure"
8164 #include "confdefs.h"
8165 #include <${cf_cv_ncurses_header:-curses.h}>
8166                                         int main(void)
8167                                         { const char *xx = curses_version(); return (xx == 0); }
8168 _ACEOF
8169 rm -f "conftest$ac_exeext"
8170 if { (eval echo "$as_me:8170: \"$ac_link\"") >&5
8171   (eval $ac_link) 2>&5
8172   ac_status=$?
8173   echo "$as_me:8173: \$? = $ac_status" >&5
8174   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8175   { (eval echo "$as_me:8175: \"$ac_try\"") >&5
8176   (eval $ac_try) 2>&5
8177   ac_status=$?
8178   echo "$as_me:8178: \$? = $ac_status" >&5
8179   (exit "$ac_status"); }; }; then
8180   cf_test_ncuconfig=yes
8181 else
8182   echo "$as_me: program exited with status $ac_status" >&5
8183 echo "$as_me: failed program was:" >&5
8184 cat "conftest.$ac_ext" >&5
8185 cf_test_ncuconfig=no
8186 fi
8187 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8188 fi
8189 else
8190   echo "$as_me: failed program was:" >&5
8191 cat "conftest.$ac_ext" >&5
8192 cf_test_ncuconfig=no
8193 fi
8194 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8195
8196                         CFLAGS="$cf_save_CFLAGS"
8197                         CPPFLAGS="$cf_save_CPPFLAGS"
8198                         LIBS="$cf_save_LIBS"
8199
8200                         if test "x$cf_test_ncuconfig" != xyes; then
8201                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8202                                 cf_pkg_cflags="$cf_temp"
8203                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8204                                 cf_pkg_libs="$cf_temp"
8205                         fi
8206                         ;;
8207                 esac
8208
8209 cf_fix_cppflags=no
8210 cf_new_cflags=
8211 cf_new_cppflags=
8212 cf_new_extra_cppflags=
8213
8214 for cf_add_cflags in $cf_pkg_cflags
8215 do
8216 case "$cf_fix_cppflags" in
8217 (no)
8218         case "$cf_add_cflags" in
8219         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8220                 case "$cf_add_cflags" in
8221                 (-D*)
8222                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8223
8224                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8225                                 && test -z "${cf_tst_cflags}" \
8226                                 && cf_fix_cppflags=yes
8227
8228                         if test "$cf_fix_cppflags" = yes ; then
8229
8230         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8231         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8232
8233                                 continue
8234                         elif test "${cf_tst_cflags}" = "\"'" ; then
8235
8236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8238
8239                                 continue
8240                         fi
8241                         ;;
8242                 esac
8243                 case "$CPPFLAGS" in
8244                 (*$cf_add_cflags)
8245                         ;;
8246                 (*)
8247                         case "$cf_add_cflags" in
8248                         (-D*)
8249                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8250
8251 CPPFLAGS=`echo "$CPPFLAGS" | \
8252         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8253                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8254
8255                                 ;;
8256                         esac
8257
8258         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8259         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8260
8261                         ;;
8262                 esac
8263                 ;;
8264         (*)
8265
8266         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8267         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8268
8269                 ;;
8270         esac
8271         ;;
8272 (yes)
8273
8274         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8275         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8276
8277         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8278
8279         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8280                 && test -z "${cf_tst_cflags}" \
8281                 && cf_fix_cppflags=no
8282         ;;
8283 esac
8284 done
8285
8286 if test -n "$cf_new_cflags" ; then
8287
8288         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8289         CFLAGS="${CFLAGS}$cf_new_cflags"
8290
8291 fi
8292
8293 if test -n "$cf_new_cppflags" ; then
8294
8295         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8296         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8297
8298 fi
8299
8300 if test -n "$cf_new_extra_cppflags" ; then
8301
8302         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8303         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8304
8305 fi
8306
8307 cf_add_libs="$LIBS"
8308 # reverse order
8309 cf_add_0lib=
8310 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8311 # filter duplicates
8312 for cf_add_1lib in $cf_add_0lib; do
8313         for cf_add_2lib in $cf_add_libs; do
8314                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8315                         cf_add_1lib=
8316                         break
8317                 fi
8318         done
8319         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8320 done
8321 LIBS="$cf_add_libs"
8322
8323                 cat >"conftest.$ac_ext" <<_ACEOF
8324 #line 8324 "configure"
8325 #include "confdefs.h"
8326 #include <${cf_cv_ncurses_header:-curses.h}>
8327 int
8328 main (void)
8329 {
8330 initscr(); mousemask(0,0); tigetstr((char *)0);
8331   ;
8332   return 0;
8333 }
8334 _ACEOF
8335 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8336 if { (eval echo "$as_me:8336: \"$ac_link\"") >&5
8337   (eval $ac_link) 2>&5
8338   ac_status=$?
8339   echo "$as_me:8339: \$? = $ac_status" >&5
8340   (exit "$ac_status"); } &&
8341          { ac_try='test -s "conftest$ac_exeext"'
8342   { (eval echo "$as_me:8342: \"$ac_try\"") >&5
8343   (eval $ac_try) 2>&5
8344   ac_status=$?
8345   echo "$as_me:8345: \$? = $ac_status" >&5
8346   (exit "$ac_status"); }; }; then
8347   if test "$cross_compiling" = yes; then
8348   cf_have_ncuconfig=maybe
8349 else
8350   cat >"conftest.$ac_ext" <<_ACEOF
8351 #line 8351 "configure"
8352 #include "confdefs.h"
8353 #include <${cf_cv_ncurses_header:-curses.h}>
8354                                 int main(void)
8355                                 { const char *xx = curses_version(); return (xx == 0); }
8356 _ACEOF
8357 rm -f "conftest$ac_exeext"
8358 if { (eval echo "$as_me:8358: \"$ac_link\"") >&5
8359   (eval $ac_link) 2>&5
8360   ac_status=$?
8361   echo "$as_me:8361: \$? = $ac_status" >&5
8362   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8363   { (eval echo "$as_me:8363: \"$ac_try\"") >&5
8364   (eval $ac_try) 2>&5
8365   ac_status=$?
8366   echo "$as_me:8366: \$? = $ac_status" >&5
8367   (exit "$ac_status"); }; }; then
8368   cf_have_ncuconfig=yes
8369 else
8370   echo "$as_me: program exited with status $ac_status" >&5
8371 echo "$as_me: failed program was:" >&5
8372 cat "conftest.$ac_ext" >&5
8373 cf_have_ncuconfig=no
8374 fi
8375 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8376 fi
8377 else
8378   echo "$as_me: failed program was:" >&5
8379 cat "conftest.$ac_ext" >&5
8380 cf_have_ncuconfig=no
8381 fi
8382 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8383                 echo "$as_me:8383: result: $cf_have_ncuconfig" >&5
8384 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8385                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8386                 if test "$cf_have_ncuconfig" != "yes"
8387                 then
8388                         CPPFLAGS="$cf_save_CPPFLAGS"
8389                         LIBS="$cf_save_LIBS"
8390                         NCURSES_CONFIG_PKG=none
8391                 else
8392
8393 cat >>confdefs.h <<\EOF
8394 #define NCURSES 1
8395 EOF
8396
8397                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8398
8399 echo "$as_me:8399: checking for terminfo header" >&5
8400 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8401 if test "${cf_cv_term_header+set}" = set; then
8402   echo $ECHO_N "(cached) $ECHO_C" >&6
8403 else
8404
8405 case "${cf_cv_ncurses_header}" in
8406 (*/ncurses.h|*/ncursesw.h)
8407         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8408         ;;
8409 (*)
8410         cf_term_header=term.h
8411         ;;
8412 esac
8413
8414 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8415 do
8416 cat >"conftest.$ac_ext" <<_ACEOF
8417 #line 8417 "configure"
8418 #include "confdefs.h"
8419 #include <stdio.h>
8420 #include <${cf_cv_ncurses_header:-curses.h}>
8421 #include <$cf_test>
8422
8423 int
8424 main (void)
8425 {
8426 int x = auto_left_margin; (void)x
8427   ;
8428   return 0;
8429 }
8430 _ACEOF
8431 rm -f "conftest.$ac_objext"
8432 if { (eval echo "$as_me:8432: \"$ac_compile\"") >&5
8433   (eval $ac_compile) 2>&5
8434   ac_status=$?
8435   echo "$as_me:8435: \$? = $ac_status" >&5
8436   (exit "$ac_status"); } &&
8437          { ac_try='test -s "conftest.$ac_objext"'
8438   { (eval echo "$as_me:8438: \"$ac_try\"") >&5
8439   (eval $ac_try) 2>&5
8440   ac_status=$?
8441   echo "$as_me:8441: \$? = $ac_status" >&5
8442   (exit "$ac_status"); }; }; then
8443
8444         cf_cv_term_header="$cf_test"
8445 else
8446   echo "$as_me: failed program was:" >&5
8447 cat "conftest.$ac_ext" >&5
8448
8449         cf_cv_term_header=unknown
8450
8451 fi
8452 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8453         test "$cf_cv_term_header" != unknown && break
8454 done
8455
8456 fi
8457 echo "$as_me:8457: result: $cf_cv_term_header" >&5
8458 echo "${ECHO_T}$cf_cv_term_header" >&6
8459
8460 # Set definitions to allow ifdef'ing to accommodate subdirectories
8461
8462 case "$cf_cv_term_header" in
8463 (*term.h)
8464
8465 cat >>confdefs.h <<\EOF
8466 #define HAVE_TERM_H 1
8467 EOF
8468
8469         ;;
8470 esac
8471
8472 case "$cf_cv_term_header" in
8473 (ncurses/term.h)
8474
8475 cat >>confdefs.h <<\EOF
8476 #define HAVE_NCURSES_TERM_H 1
8477 EOF
8478
8479         ;;
8480 (ncursesw/term.h)
8481
8482 cat >>confdefs.h <<\EOF
8483 #define HAVE_NCURSESW_TERM_H 1
8484 EOF
8485
8486         ;;
8487 esac
8488
8489                 fi
8490
8491         else
8492                 echo "$as_me:8492: result: no" >&5
8493 echo "${ECHO_T}no" >&6
8494                 NCURSES_CONFIG_PKG=none
8495         fi
8496 else
8497         NCURSES_CONFIG_PKG=none
8498 fi
8499
8500 if test "x$cf_have_ncuconfig" = "xno"; then
8501         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8502
8503 if test -n "$ac_tool_prefix"; then
8504   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8505   do
8506     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8507 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8508 echo "$as_me:8508: checking for $ac_word" >&5
8509 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8510 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8511   echo $ECHO_N "(cached) $ECHO_C" >&6
8512 else
8513   if test -n "$NCURSES_CONFIG"; then
8514   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8515 else
8516   ac_save_IFS=$IFS; IFS=$ac_path_separator
8517 ac_dummy="$PATH"
8518 for ac_dir in $ac_dummy; do
8519   IFS=$ac_save_IFS
8520   test -z "$ac_dir" && ac_dir=.
8521   $as_executable_p "$ac_dir/$ac_word" || continue
8522 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8523 echo "$as_me:8523: found $ac_dir/$ac_word" >&5
8524 break
8525 done
8526
8527 fi
8528 fi
8529 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8530 if test -n "$NCURSES_CONFIG"; then
8531   echo "$as_me:8531: result: $NCURSES_CONFIG" >&5
8532 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8533 else
8534   echo "$as_me:8534: result: no" >&5
8535 echo "${ECHO_T}no" >&6
8536 fi
8537
8538     test -n "$NCURSES_CONFIG" && break
8539   done
8540 fi
8541 if test -z "$NCURSES_CONFIG"; then
8542   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8543   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8544 do
8545   # Extract the first word of "$ac_prog", so it can be a program name with args.
8546 set dummy $ac_prog; ac_word=$2
8547 echo "$as_me:8547: checking for $ac_word" >&5
8548 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8549 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8550   echo $ECHO_N "(cached) $ECHO_C" >&6
8551 else
8552   if test -n "$ac_ct_NCURSES_CONFIG"; then
8553   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8554 else
8555   ac_save_IFS=$IFS; IFS=$ac_path_separator
8556 ac_dummy="$PATH"
8557 for ac_dir in $ac_dummy; do
8558   IFS=$ac_save_IFS
8559   test -z "$ac_dir" && ac_dir=.
8560   $as_executable_p "$ac_dir/$ac_word" || continue
8561 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8562 echo "$as_me:8562: found $ac_dir/$ac_word" >&5
8563 break
8564 done
8565
8566 fi
8567 fi
8568 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8569 if test -n "$ac_ct_NCURSES_CONFIG"; then
8570   echo "$as_me:8570: result: $ac_ct_NCURSES_CONFIG" >&5
8571 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8572 else
8573   echo "$as_me:8573: result: no" >&5
8574 echo "${ECHO_T}no" >&6
8575 fi
8576
8577   test -n "$ac_ct_NCURSES_CONFIG" && break
8578 done
8579 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8580
8581   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8582 fi
8583
8584         if test "$NCURSES_CONFIG" != none ; then
8585
8586 cf_fix_cppflags=no
8587 cf_new_cflags=
8588 cf_new_cppflags=
8589 cf_new_extra_cppflags=
8590
8591 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8592 do
8593 case "$cf_fix_cppflags" in
8594 (no)
8595         case "$cf_add_cflags" in
8596         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8597                 case "$cf_add_cflags" in
8598                 (-D*)
8599                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8600
8601                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8602                                 && test -z "${cf_tst_cflags}" \
8603                                 && cf_fix_cppflags=yes
8604
8605                         if test "$cf_fix_cppflags" = yes ; then
8606
8607         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8608         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8609
8610                                 continue
8611                         elif test "${cf_tst_cflags}" = "\"'" ; then
8612
8613         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8614         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8615
8616                                 continue
8617                         fi
8618                         ;;
8619                 esac
8620                 case "$CPPFLAGS" in
8621                 (*$cf_add_cflags)
8622                         ;;
8623                 (*)
8624                         case "$cf_add_cflags" in
8625                         (-D*)
8626                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8627
8628 CPPFLAGS=`echo "$CPPFLAGS" | \
8629         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8630                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8631
8632                                 ;;
8633                         esac
8634
8635         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8636         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8637
8638                         ;;
8639                 esac
8640                 ;;
8641         (*)
8642
8643         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8644         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8645
8646                 ;;
8647         esac
8648         ;;
8649 (yes)
8650
8651         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8652         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8653
8654         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8655
8656         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8657                 && test -z "${cf_tst_cflags}" \
8658                 && cf_fix_cppflags=no
8659         ;;
8660 esac
8661 done
8662
8663 if test -n "$cf_new_cflags" ; then
8664
8665         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8666         CFLAGS="${CFLAGS}$cf_new_cflags"
8667
8668 fi
8669
8670 if test -n "$cf_new_cppflags" ; then
8671
8672         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8673         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8674
8675 fi
8676
8677 if test -n "$cf_new_extra_cppflags" ; then
8678
8679         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8680         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8681
8682 fi
8683
8684 cf_add_libs="$LIBS"
8685 # reverse order
8686 cf_add_0lib=
8687 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8688 # filter duplicates
8689 for cf_add_1lib in $cf_add_0lib; do
8690         for cf_add_2lib in $cf_add_libs; do
8691                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8692                         cf_add_1lib=
8693                         break
8694                 fi
8695         done
8696         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8697 done
8698 LIBS="$cf_add_libs"
8699
8700                 # even with config script, some packages use no-override for curses.h
8701
8702 echo "$as_me:8702: checking if we have identified curses headers" >&5
8703 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8704 if test "${cf_cv_ncurses_header+set}" = set; then
8705   echo $ECHO_N "(cached) $ECHO_C" >&6
8706 else
8707
8708 cf_cv_ncurses_header=none
8709 for cf_header in \
8710         ncurses.h $cf_cv_screen/ncurses.h \
8711         curses.h $cf_cv_screen/curses.h
8712 do
8713 cat >"conftest.$ac_ext" <<_ACEOF
8714 #line 8714 "configure"
8715 #include "confdefs.h"
8716 #include <${cf_header}>
8717 int
8718 main (void)
8719 {
8720 initscr(); tgoto("?", 0,0)
8721   ;
8722   return 0;
8723 }
8724 _ACEOF
8725 rm -f "conftest.$ac_objext"
8726 if { (eval echo "$as_me:8726: \"$ac_compile\"") >&5
8727   (eval $ac_compile) 2>&5
8728   ac_status=$?
8729   echo "$as_me:8729: \$? = $ac_status" >&5
8730   (exit "$ac_status"); } &&
8731          { ac_try='test -s "conftest.$ac_objext"'
8732   { (eval echo "$as_me:8732: \"$ac_try\"") >&5
8733   (eval $ac_try) 2>&5
8734   ac_status=$?
8735   echo "$as_me:8735: \$? = $ac_status" >&5
8736   (exit "$ac_status"); }; }; then
8737   cf_cv_ncurses_header=$cf_header; break
8738 else
8739   echo "$as_me: failed program was:" >&5
8740 cat "conftest.$ac_ext" >&5
8741 fi
8742 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8743 done
8744
8745 fi
8746 echo "$as_me:8746: result: $cf_cv_ncurses_header" >&5
8747 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8748
8749 if test "$cf_cv_ncurses_header" = none ; then
8750         { { echo "$as_me:8750: error: No curses header-files found" >&5
8751 echo "$as_me: error: No curses header-files found" >&2;}
8752    { (exit 1); exit 1; }; }
8753 fi
8754
8755 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8756
8757 for ac_header in $cf_cv_ncurses_header
8758 do
8759 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8760 echo "$as_me:8760: checking for $ac_header" >&5
8761 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8762 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8763   echo $ECHO_N "(cached) $ECHO_C" >&6
8764 else
8765   cat >"conftest.$ac_ext" <<_ACEOF
8766 #line 8766 "configure"
8767 #include "confdefs.h"
8768 #include <$ac_header>
8769 _ACEOF
8770 if { (eval echo "$as_me:8770: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8771   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8772   ac_status=$?
8773   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8774   rm -f conftest.er1
8775   cat conftest.err >&5
8776   echo "$as_me:8776: \$? = $ac_status" >&5
8777   (exit "$ac_status"); } >/dev/null; then
8778   if test -s conftest.err; then
8779     ac_cpp_err=$ac_c_preproc_warn_flag
8780   else
8781     ac_cpp_err=
8782   fi
8783 else
8784   ac_cpp_err=yes
8785 fi
8786 if test -z "$ac_cpp_err"; then
8787   eval "$as_ac_Header=yes"
8788 else
8789   echo "$as_me: failed program was:" >&5
8790   cat "conftest.$ac_ext" >&5
8791   eval "$as_ac_Header=no"
8792 fi
8793 rm -f conftest.err "conftest.$ac_ext"
8794 fi
8795 echo "$as_me:8795: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8796 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8797 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8798   cat >>confdefs.h <<EOF
8799 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8800 EOF
8801
8802 fi
8803 done
8804
8805 cat >>confdefs.h <<\EOF
8806 #define NCURSES 1
8807 EOF
8808
8809 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8810
8811                 cat >>confdefs.h <<EOF
8812 #define $cf_nculib_ROOT 1
8813 EOF
8814
8815                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8816
8817         else
8818
8819 cf_ncuhdr_root=$cf_cv_screen
8820
8821 test -n "$cf_cv_curses_dir" && \
8822 test "$cf_cv_curses_dir" != "no" && { \
8823
8824 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8825   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8826   do
8827         while test "$cf_add_incdir" != /usr/include
8828         do
8829           if test -d "$cf_add_incdir"
8830           then
8831                 cf_have_incdir=no
8832                 if test -n "$CFLAGS$CPPFLAGS" ; then
8833                   # a loop is needed to ensure we can add subdirs of existing dirs
8834                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8835                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8836                           cf_have_incdir=yes; break
8837                         fi
8838                   done
8839                 fi
8840
8841                 if test "$cf_have_incdir" = no ; then
8842                   if test "$cf_add_incdir" = /usr/local/include ; then
8843                         if test "$GCC" = yes
8844                         then
8845                           cf_save_CPPFLAGS=$CPPFLAGS
8846
8847         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8848         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8849
8850                           cat >"conftest.$ac_ext" <<_ACEOF
8851 #line 8851 "configure"
8852 #include "confdefs.h"
8853 #include <stdio.h>
8854 int
8855 main (void)
8856 {
8857 printf("Hello")
8858   ;
8859   return 0;
8860 }
8861 _ACEOF
8862 rm -f "conftest.$ac_objext"
8863 if { (eval echo "$as_me:8863: \"$ac_compile\"") >&5
8864   (eval $ac_compile) 2>&5
8865   ac_status=$?
8866   echo "$as_me:8866: \$? = $ac_status" >&5
8867   (exit "$ac_status"); } &&
8868          { ac_try='test -s "conftest.$ac_objext"'
8869   { (eval echo "$as_me:8869: \"$ac_try\"") >&5
8870   (eval $ac_try) 2>&5
8871   ac_status=$?
8872   echo "$as_me:8872: \$? = $ac_status" >&5
8873   (exit "$ac_status"); }; }; then
8874   :
8875 else
8876   echo "$as_me: failed program was:" >&5
8877 cat "conftest.$ac_ext" >&5
8878 cf_have_incdir=yes
8879 fi
8880 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8881                           CPPFLAGS=$cf_save_CPPFLAGS
8882                         fi
8883                   fi
8884                 fi
8885
8886                 if test "$cf_have_incdir" = no ; then
8887                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8888
8889 echo "${as_me:-configure}:8889: testing adding $cf_add_incdir to include-path ..." 1>&5
8890
8891                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8892
8893                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8894                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8895                   cf_add_incdir="$cf_top_incdir"
8896                 else
8897                   break
8898                 fi
8899           else
8900                 break
8901           fi
8902         done
8903   done
8904 fi
8905
8906 }
8907
8908 echo "$as_me:8908: checking for $cf_ncuhdr_root header in include-path" >&5
8909 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8910 if test "${cf_cv_ncurses_h+set}" = set; then
8911   echo $ECHO_N "(cached) $ECHO_C" >&6
8912 else
8913
8914         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8915         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8916         for cf_header in $cf_header_list
8917         do
8918
8919         cat >"conftest.$ac_ext" <<_ACEOF
8920 #line 8920 "configure"
8921 #include "confdefs.h"
8922
8923 #include <$cf_header>
8924 int
8925 main (void)
8926 {
8927
8928 #ifdef NCURSES_VERSION
8929
8930 printf("%s\\n", NCURSES_VERSION);
8931 #else
8932 #ifdef __NCURSES_H
8933 printf("old\\n");
8934 #else
8935         make an error
8936 #endif
8937 #endif
8938
8939   ;
8940   return 0;
8941 }
8942 _ACEOF
8943 rm -f "conftest.$ac_objext"
8944 if { (eval echo "$as_me:8944: \"$ac_compile\"") >&5
8945   (eval $ac_compile) 2>&5
8946   ac_status=$?
8947   echo "$as_me:8947: \$? = $ac_status" >&5
8948   (exit "$ac_status"); } &&
8949          { ac_try='test -s "conftest.$ac_objext"'
8950   { (eval echo "$as_me:8950: \"$ac_try\"") >&5
8951   (eval $ac_try) 2>&5
8952   ac_status=$?
8953   echo "$as_me:8953: \$? = $ac_status" >&5
8954   (exit "$ac_status"); }; }; then
8955   cf_cv_ncurses_h=$cf_header
8956
8957 else
8958   echo "$as_me: failed program was:" >&5
8959 cat "conftest.$ac_ext" >&5
8960 cf_cv_ncurses_h=no
8961 fi
8962 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8963
8964                 test "$cf_cv_ncurses_h" != no && break
8965         done
8966
8967 fi
8968 echo "$as_me:8968: result: $cf_cv_ncurses_h" >&5
8969 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8970
8971 if test "$cf_cv_ncurses_h" != no ; then
8972         cf_cv_ncurses_header=$cf_cv_ncurses_h
8973 else
8974
8975 echo "$as_me:8975: checking for $cf_ncuhdr_root include-path" >&5
8976 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8977 if test "${cf_cv_ncurses_h2+set}" = set; then
8978   echo $ECHO_N "(cached) $ECHO_C" >&6
8979 else
8980
8981         test -n "$verbose" && echo
8982
8983 cf_search=
8984
8985 # collect the current set of include-directories from compiler flags
8986 cf_header_path_list=""
8987 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8988         for cf_header_path in $CPPFLAGS $CFLAGS
8989         do
8990                 case "$cf_header_path" in
8991                 (-I*)
8992                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8993
8994 test "x$cf_header_path" != "xNONE" && \
8995 test -d "$cf_header_path" && \
8996  {
8997         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8998         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8999         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9000         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9001         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9002         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"
9003 }
9004
9005                         cf_header_path_list="$cf_header_path_list $cf_search"
9006                         ;;
9007                 esac
9008         done
9009 fi
9010
9011 # add the variations for the package we are looking for
9012
9013 cf_search=
9014
9015 test "x$prefix" != "xNONE" && \
9016 test -d "$prefix" && \
9017  {
9018         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9019         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
9020         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9021         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9022         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9023         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9024 }
9025
9026 for cf_subdir_prefix in \
9027         /usr \
9028         /usr/local \
9029         /usr/pkg \
9030         /opt \
9031         /opt/local \
9032         $HOME
9033 do
9034
9035 test "x$cf_subdir_prefix" != "x$prefix" && \
9036 test -d "$cf_subdir_prefix" && \
9037 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9038         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9039         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
9040         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9041         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9042         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9043         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"
9044 }
9045
9046 done
9047
9048 test "$includedir" != NONE && \
9049 test "$includedir" != "/usr/include" && \
9050 test -d "$includedir" && {
9051         test -d "$includedir" &&    cf_search="$cf_search $includedir"
9052         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9053 }
9054
9055 test "$oldincludedir" != NONE && \
9056 test "$oldincludedir" != "/usr/include" && \
9057 test -d "$oldincludedir" && {
9058         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
9059         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9060 }
9061
9062 cf_search="$cf_search $cf_header_path_list"
9063
9064         test -n "$verbose" && echo "search path $cf_search"
9065         cf_save2_CPPFLAGS="$CPPFLAGS"
9066         for cf_incdir in $cf_search
9067         do
9068
9069 if test -n "$cf_incdir" ; then
9070   for cf_add_incdir in $cf_incdir
9071   do
9072         while test "$cf_add_incdir" != /usr/include
9073         do
9074           if test -d "$cf_add_incdir"
9075           then
9076                 cf_have_incdir=no
9077                 if test -n "$CFLAGS$CPPFLAGS" ; then
9078                   # a loop is needed to ensure we can add subdirs of existing dirs
9079                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9080                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9081                           cf_have_incdir=yes; break
9082                         fi
9083                   done
9084                 fi
9085
9086                 if test "$cf_have_incdir" = no ; then
9087                   if test "$cf_add_incdir" = /usr/local/include ; then
9088                         if test "$GCC" = yes
9089                         then
9090                           cf_save_CPPFLAGS=$CPPFLAGS
9091
9092         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9093         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9094
9095                           cat >"conftest.$ac_ext" <<_ACEOF
9096 #line 9096 "configure"
9097 #include "confdefs.h"
9098 #include <stdio.h>
9099 int
9100 main (void)
9101 {
9102 printf("Hello")
9103   ;
9104   return 0;
9105 }
9106 _ACEOF
9107 rm -f "conftest.$ac_objext"
9108 if { (eval echo "$as_me:9108: \"$ac_compile\"") >&5
9109   (eval $ac_compile) 2>&5
9110   ac_status=$?
9111   echo "$as_me:9111: \$? = $ac_status" >&5
9112   (exit "$ac_status"); } &&
9113          { ac_try='test -s "conftest.$ac_objext"'
9114   { (eval echo "$as_me:9114: \"$ac_try\"") >&5
9115   (eval $ac_try) 2>&5
9116   ac_status=$?
9117   echo "$as_me:9117: \$? = $ac_status" >&5
9118   (exit "$ac_status"); }; }; then
9119   :
9120 else
9121   echo "$as_me: failed program was:" >&5
9122 cat "conftest.$ac_ext" >&5
9123 cf_have_incdir=yes
9124 fi
9125 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9126                           CPPFLAGS=$cf_save_CPPFLAGS
9127                         fi
9128                   fi
9129                 fi
9130
9131                 if test "$cf_have_incdir" = no ; then
9132                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9133
9134 echo "${as_me:-configure}:9134: testing adding $cf_add_incdir to include-path ..." 1>&5
9135
9136                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9137
9138                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9139                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9140                   cf_add_incdir="$cf_top_incdir"
9141                 else
9142                   break
9143                 fi
9144           else
9145                 break
9146           fi
9147         done
9148   done
9149 fi
9150
9151                 for cf_header in \
9152                         ncurses.h \
9153                         curses.h
9154                 do
9155
9156         cat >"conftest.$ac_ext" <<_ACEOF
9157 #line 9157 "configure"
9158 #include "confdefs.h"
9159
9160 #include <$cf_header>
9161 int
9162 main (void)
9163 {
9164
9165 #ifdef NCURSES_VERSION
9166
9167 printf("%s\\n", NCURSES_VERSION);
9168 #else
9169 #ifdef __NCURSES_H
9170 printf("old\\n");
9171 #else
9172         make an error
9173 #endif
9174 #endif
9175
9176   ;
9177   return 0;
9178 }
9179 _ACEOF
9180 rm -f "conftest.$ac_objext"
9181 if { (eval echo "$as_me:9181: \"$ac_compile\"") >&5
9182   (eval $ac_compile) 2>&5
9183   ac_status=$?
9184   echo "$as_me:9184: \$? = $ac_status" >&5
9185   (exit "$ac_status"); } &&
9186          { ac_try='test -s "conftest.$ac_objext"'
9187   { (eval echo "$as_me:9187: \"$ac_try\"") >&5
9188   (eval $ac_try) 2>&5
9189   ac_status=$?
9190   echo "$as_me:9190: \$? = $ac_status" >&5
9191   (exit "$ac_status"); }; }; then
9192   cf_cv_ncurses_h2=$cf_header
9193
9194 else
9195   echo "$as_me: failed program was:" >&5
9196 cat "conftest.$ac_ext" >&5
9197 cf_cv_ncurses_h2=no
9198 fi
9199 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9200
9201                         if test "$cf_cv_ncurses_h2" != no ; then
9202                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9203                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9204                                 break
9205                         fi
9206                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9207                 done
9208                 CPPFLAGS="$cf_save2_CPPFLAGS"
9209                 test "$cf_cv_ncurses_h2" != no && break
9210         done
9211         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9211: error: not found" >&5
9212 echo "$as_me: error: not found" >&2;}
9213    { (exit 1); exit 1; }; }
9214
9215 fi
9216 echo "$as_me:9216: result: $cf_cv_ncurses_h2" >&5
9217 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9218
9219         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9220         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9221         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9222                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9223         fi
9224
9225 if test -n "$cf_1st_incdir" ; then
9226   for cf_add_incdir in $cf_1st_incdir
9227   do
9228         while test "$cf_add_incdir" != /usr/include
9229         do
9230           if test -d "$cf_add_incdir"
9231           then
9232                 cf_have_incdir=no
9233                 if test -n "$CFLAGS$CPPFLAGS" ; then
9234                   # a loop is needed to ensure we can add subdirs of existing dirs
9235                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9236                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9237                           cf_have_incdir=yes; break
9238                         fi
9239                   done
9240                 fi
9241
9242                 if test "$cf_have_incdir" = no ; then
9243                   if test "$cf_add_incdir" = /usr/local/include ; then
9244                         if test "$GCC" = yes
9245                         then
9246                           cf_save_CPPFLAGS=$CPPFLAGS
9247
9248         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9249         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9250
9251                           cat >"conftest.$ac_ext" <<_ACEOF
9252 #line 9252 "configure"
9253 #include "confdefs.h"
9254 #include <stdio.h>
9255 int
9256 main (void)
9257 {
9258 printf("Hello")
9259   ;
9260   return 0;
9261 }
9262 _ACEOF
9263 rm -f "conftest.$ac_objext"
9264 if { (eval echo "$as_me:9264: \"$ac_compile\"") >&5
9265   (eval $ac_compile) 2>&5
9266   ac_status=$?
9267   echo "$as_me:9267: \$? = $ac_status" >&5
9268   (exit "$ac_status"); } &&
9269          { ac_try='test -s "conftest.$ac_objext"'
9270   { (eval echo "$as_me:9270: \"$ac_try\"") >&5
9271   (eval $ac_try) 2>&5
9272   ac_status=$?
9273   echo "$as_me:9273: \$? = $ac_status" >&5
9274   (exit "$ac_status"); }; }; then
9275   :
9276 else
9277   echo "$as_me: failed program was:" >&5
9278 cat "conftest.$ac_ext" >&5
9279 cf_have_incdir=yes
9280 fi
9281 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9282                           CPPFLAGS=$cf_save_CPPFLAGS
9283                         fi
9284                   fi
9285                 fi
9286
9287                 if test "$cf_have_incdir" = no ; then
9288                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9289
9290 echo "${as_me:-configure}:9290: testing adding $cf_add_incdir to include-path ..." 1>&5
9291
9292                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9293
9294                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9295                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9296                   cf_add_incdir="$cf_top_incdir"
9297                 else
9298                   break
9299                 fi
9300           else
9301                 break
9302           fi
9303         done
9304   done
9305 fi
9306
9307 fi
9308
9309 # Set definitions to allow ifdef'ing for ncurses.h
9310
9311 case "$cf_cv_ncurses_header" in
9312 (*ncurses.h)
9313
9314 cat >>confdefs.h <<\EOF
9315 #define HAVE_NCURSES_H 1
9316 EOF
9317
9318         ;;
9319 esac
9320
9321 case "$cf_cv_ncurses_header" in
9322 (ncurses/curses.h|ncurses/ncurses.h)
9323
9324 cat >>confdefs.h <<\EOF
9325 #define HAVE_NCURSES_NCURSES_H 1
9326 EOF
9327
9328         ;;
9329 (ncursesw/curses.h|ncursesw/ncurses.h)
9330
9331 cat >>confdefs.h <<\EOF
9332 #define HAVE_NCURSESW_NCURSES_H 1
9333 EOF
9334
9335         ;;
9336 esac
9337
9338 echo "$as_me:9338: checking for terminfo header" >&5
9339 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9340 if test "${cf_cv_term_header+set}" = set; then
9341   echo $ECHO_N "(cached) $ECHO_C" >&6
9342 else
9343
9344 case "${cf_cv_ncurses_header}" in
9345 (*/ncurses.h|*/ncursesw.h)
9346         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9347         ;;
9348 (*)
9349         cf_term_header=term.h
9350         ;;
9351 esac
9352
9353 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9354 do
9355 cat >"conftest.$ac_ext" <<_ACEOF
9356 #line 9356 "configure"
9357 #include "confdefs.h"
9358 #include <stdio.h>
9359 #include <${cf_cv_ncurses_header:-curses.h}>
9360 #include <$cf_test>
9361
9362 int
9363 main (void)
9364 {
9365 int x = auto_left_margin; (void)x
9366   ;
9367   return 0;
9368 }
9369 _ACEOF
9370 rm -f "conftest.$ac_objext"
9371 if { (eval echo "$as_me:9371: \"$ac_compile\"") >&5
9372   (eval $ac_compile) 2>&5
9373   ac_status=$?
9374   echo "$as_me:9374: \$? = $ac_status" >&5
9375   (exit "$ac_status"); } &&
9376          { ac_try='test -s "conftest.$ac_objext"'
9377   { (eval echo "$as_me:9377: \"$ac_try\"") >&5
9378   (eval $ac_try) 2>&5
9379   ac_status=$?
9380   echo "$as_me:9380: \$? = $ac_status" >&5
9381   (exit "$ac_status"); }; }; then
9382
9383         cf_cv_term_header="$cf_test"
9384 else
9385   echo "$as_me: failed program was:" >&5
9386 cat "conftest.$ac_ext" >&5
9387
9388         cf_cv_term_header=unknown
9389
9390 fi
9391 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9392         test "$cf_cv_term_header" != unknown && break
9393 done
9394
9395 fi
9396 echo "$as_me:9396: result: $cf_cv_term_header" >&5
9397 echo "${ECHO_T}$cf_cv_term_header" >&6
9398
9399 # Set definitions to allow ifdef'ing to accommodate subdirectories
9400
9401 case "$cf_cv_term_header" in
9402 (*term.h)
9403
9404 cat >>confdefs.h <<\EOF
9405 #define HAVE_TERM_H 1
9406 EOF
9407
9408         ;;
9409 esac
9410
9411 case "$cf_cv_term_header" in
9412 (ncurses/term.h)
9413
9414 cat >>confdefs.h <<\EOF
9415 #define HAVE_NCURSES_TERM_H 1
9416 EOF
9417
9418         ;;
9419 (ncursesw/term.h)
9420
9421 cat >>confdefs.h <<\EOF
9422 #define HAVE_NCURSESW_TERM_H 1
9423 EOF
9424
9425         ;;
9426 esac
9427
9428 # some applications need this, but should check for NCURSES_VERSION
9429
9430 cat >>confdefs.h <<\EOF
9431 #define NCURSES 1
9432 EOF
9433
9434 echo "$as_me:9434: checking for ncurses version" >&5
9435 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9436 if test "${cf_cv_ncurses_version+set}" = set; then
9437   echo $ECHO_N "(cached) $ECHO_C" >&6
9438 else
9439
9440         cf_cv_ncurses_version=no
9441         cf_tempfile=out$$
9442         rm -f "$cf_tempfile"
9443         if test "$cross_compiling" = yes; then
9444
9445         # This will not work if the preprocessor splits the line after the
9446         # Autoconf token.  The 'unproto' program does that.
9447         cat > "conftest.$ac_ext" <<EOF
9448 #include <${cf_cv_ncurses_header:-curses.h}>
9449 #undef Autoconf
9450 #ifdef NCURSES_VERSION
9451 Autoconf NCURSES_VERSION
9452 #else
9453 #ifdef __NCURSES_H
9454 Autoconf "old"
9455 #endif
9456 ;
9457 #endif
9458 EOF
9459         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9460         { (eval echo "$as_me:9460: \"$cf_try\"") >&5
9461   (eval $cf_try) 2>&5
9462   ac_status=$?
9463   echo "$as_me:9463: \$? = $ac_status" >&5
9464   (exit "$ac_status"); }
9465         if test -f conftest.out ; then
9466                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9467                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9468                 rm -f conftest.out
9469         fi
9470
9471 else
9472   cat >"conftest.$ac_ext" <<_ACEOF
9473 #line 9473 "configure"
9474 #include "confdefs.h"
9475
9476 #include <${cf_cv_ncurses_header:-curses.h}>
9477 #include <stdio.h>
9478 int main(void)
9479 {
9480         FILE *fp = fopen("$cf_tempfile", "w");
9481 #ifdef NCURSES_VERSION
9482 # ifdef NCURSES_VERSION_PATCH
9483         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9484 # else
9485         fprintf(fp, "%s\\n", NCURSES_VERSION);
9486 # endif
9487 #else
9488 # ifdef __NCURSES_H
9489         fprintf(fp, "old\\n");
9490 # else
9491         make an error
9492 # endif
9493 #endif
9494         ${cf_cv_main_return:-return}(0);
9495 }
9496 _ACEOF
9497 rm -f "conftest$ac_exeext"
9498 if { (eval echo "$as_me:9498: \"$ac_link\"") >&5
9499   (eval $ac_link) 2>&5
9500   ac_status=$?
9501   echo "$as_me:9501: \$? = $ac_status" >&5
9502   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9503   { (eval echo "$as_me:9503: \"$ac_try\"") >&5
9504   (eval $ac_try) 2>&5
9505   ac_status=$?
9506   echo "$as_me:9506: \$? = $ac_status" >&5
9507   (exit "$ac_status"); }; }; then
9508
9509         cf_cv_ncurses_version=`cat $cf_tempfile`
9510 else
9511   echo "$as_me: program exited with status $ac_status" >&5
9512 echo "$as_me: failed program was:" >&5
9513 cat "conftest.$ac_ext" >&5
9514 fi
9515 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9516 fi
9517         rm -f "$cf_tempfile"
9518
9519 fi
9520 echo "$as_me:9520: result: $cf_cv_ncurses_version" >&5
9521 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9522 test "$cf_cv_ncurses_version" = no ||
9523 cat >>confdefs.h <<\EOF
9524 #define NCURSES 1
9525 EOF
9526
9527 cf_nculib_root=$cf_cv_screen
9528         # This works, except for the special case where we find gpm, but
9529         # ncurses is in a nonstandard location via $LIBS, and we really want
9530         # to link gpm.
9531 cf_ncurses_LIBS=""
9532 cf_ncurses_SAVE="$LIBS"
9533 echo "$as_me:9533: checking for Gpm_Open in -lgpm" >&5
9534 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9535 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9536   echo $ECHO_N "(cached) $ECHO_C" >&6
9537 else
9538   ac_check_lib_save_LIBS=$LIBS
9539 LIBS="-lgpm  $LIBS"
9540 cat >"conftest.$ac_ext" <<_ACEOF
9541 #line 9541 "configure"
9542 #include "confdefs.h"
9543
9544 /* Override any gcc2 internal prototype to avoid an error.  */
9545 #ifdef __cplusplus
9546 extern "C"
9547 #endif
9548 /* We use char because int might match the return type of a gcc2
9549    builtin and then its argument prototype would still apply.  */
9550 char Gpm_Open ();
9551 int
9552 main (void)
9553 {
9554 Gpm_Open ();
9555   ;
9556   return 0;
9557 }
9558 _ACEOF
9559 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9560 if { (eval echo "$as_me:9560: \"$ac_link\"") >&5
9561   (eval $ac_link) 2>&5
9562   ac_status=$?
9563   echo "$as_me:9563: \$? = $ac_status" >&5
9564   (exit "$ac_status"); } &&
9565          { ac_try='test -s "conftest$ac_exeext"'
9566   { (eval echo "$as_me:9566: \"$ac_try\"") >&5
9567   (eval $ac_try) 2>&5
9568   ac_status=$?
9569   echo "$as_me:9569: \$? = $ac_status" >&5
9570   (exit "$ac_status"); }; }; then
9571   ac_cv_lib_gpm_Gpm_Open=yes
9572 else
9573   echo "$as_me: failed program was:" >&5
9574 cat "conftest.$ac_ext" >&5
9575 ac_cv_lib_gpm_Gpm_Open=no
9576 fi
9577 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9578 LIBS=$ac_check_lib_save_LIBS
9579 fi
9580 echo "$as_me:9580: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9581 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9582 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9583   echo "$as_me:9583: checking for initscr in -lgpm" >&5
9584 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9585 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9586   echo $ECHO_N "(cached) $ECHO_C" >&6
9587 else
9588   ac_check_lib_save_LIBS=$LIBS
9589 LIBS="-lgpm  $LIBS"
9590 cat >"conftest.$ac_ext" <<_ACEOF
9591 #line 9591 "configure"
9592 #include "confdefs.h"
9593
9594 /* Override any gcc2 internal prototype to avoid an error.  */
9595 #ifdef __cplusplus
9596 extern "C"
9597 #endif
9598 /* We use char because int might match the return type of a gcc2
9599    builtin and then its argument prototype would still apply.  */
9600 char initscr ();
9601 int
9602 main (void)
9603 {
9604 initscr ();
9605   ;
9606   return 0;
9607 }
9608 _ACEOF
9609 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9610 if { (eval echo "$as_me:9610: \"$ac_link\"") >&5
9611   (eval $ac_link) 2>&5
9612   ac_status=$?
9613   echo "$as_me:9613: \$? = $ac_status" >&5
9614   (exit "$ac_status"); } &&
9615          { ac_try='test -s "conftest$ac_exeext"'
9616   { (eval echo "$as_me:9616: \"$ac_try\"") >&5
9617   (eval $ac_try) 2>&5
9618   ac_status=$?
9619   echo "$as_me:9619: \$? = $ac_status" >&5
9620   (exit "$ac_status"); }; }; then
9621   ac_cv_lib_gpm_initscr=yes
9622 else
9623   echo "$as_me: failed program was:" >&5
9624 cat "conftest.$ac_ext" >&5
9625 ac_cv_lib_gpm_initscr=no
9626 fi
9627 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9628 LIBS=$ac_check_lib_save_LIBS
9629 fi
9630 echo "$as_me:9630: result: $ac_cv_lib_gpm_initscr" >&5
9631 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9632 if test "$ac_cv_lib_gpm_initscr" = yes; then
9633   LIBS="$cf_ncurses_SAVE"
9634 else
9635   cf_ncurses_LIBS="-lgpm"
9636 fi
9637
9638 fi
9639
9640 case "$host_os" in
9641 (freebsd*)
9642         # This is only necessary if you are linking against an obsolete
9643         # version of ncurses (but it should do no harm, since it's static).
9644         if test "$cf_nculib_root" = ncurses ; then
9645                 echo "$as_me:9645: checking for tgoto in -lmytinfo" >&5
9646 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9647 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9648   echo $ECHO_N "(cached) $ECHO_C" >&6
9649 else
9650   ac_check_lib_save_LIBS=$LIBS
9651 LIBS="-lmytinfo  $LIBS"
9652 cat >"conftest.$ac_ext" <<_ACEOF
9653 #line 9653 "configure"
9654 #include "confdefs.h"
9655
9656 /* Override any gcc2 internal prototype to avoid an error.  */
9657 #ifdef __cplusplus
9658 extern "C"
9659 #endif
9660 /* We use char because int might match the return type of a gcc2
9661    builtin and then its argument prototype would still apply.  */
9662 char tgoto ();
9663 int
9664 main (void)
9665 {
9666 tgoto ();
9667   ;
9668   return 0;
9669 }
9670 _ACEOF
9671 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9672 if { (eval echo "$as_me:9672: \"$ac_link\"") >&5
9673   (eval $ac_link) 2>&5
9674   ac_status=$?
9675   echo "$as_me:9675: \$? = $ac_status" >&5
9676   (exit "$ac_status"); } &&
9677          { ac_try='test -s "conftest$ac_exeext"'
9678   { (eval echo "$as_me:9678: \"$ac_try\"") >&5
9679   (eval $ac_try) 2>&5
9680   ac_status=$?
9681   echo "$as_me:9681: \$? = $ac_status" >&5
9682   (exit "$ac_status"); }; }; then
9683   ac_cv_lib_mytinfo_tgoto=yes
9684 else
9685   echo "$as_me: failed program was:" >&5
9686 cat "conftest.$ac_ext" >&5
9687 ac_cv_lib_mytinfo_tgoto=no
9688 fi
9689 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9690 LIBS=$ac_check_lib_save_LIBS
9691 fi
9692 echo "$as_me:9692: result: $ac_cv_lib_mytinfo_tgoto" >&5
9693 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9694 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9695   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9696 fi
9697
9698         fi
9699         ;;
9700 esac
9701
9702 cf_add_libs="$LIBS"
9703 # reverse order
9704 cf_add_0lib=
9705 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9706 # filter duplicates
9707 for cf_add_1lib in $cf_add_0lib; do
9708         for cf_add_2lib in $cf_add_libs; do
9709                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9710                         cf_add_1lib=
9711                         break
9712                 fi
9713         done
9714         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9715 done
9716 LIBS="$cf_add_libs"
9717
9718 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9719 then
9720
9721 cf_add_libs="$LIBS"
9722 # reverse order
9723 cf_add_0lib=
9724 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9725 # filter duplicates
9726 for cf_add_1lib in $cf_add_0lib; do
9727         for cf_add_2lib in $cf_add_libs; do
9728                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9729                         cf_add_1lib=
9730                         break
9731                 fi
9732         done
9733         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9734 done
9735 LIBS="$cf_add_libs"
9736
9737 else
9738
9739         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9740         cf_libdir=""
9741         echo "$as_me:9741: checking for initscr" >&5
9742 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9743 if test "${ac_cv_func_initscr+set}" = set; then
9744   echo $ECHO_N "(cached) $ECHO_C" >&6
9745 else
9746   cat >"conftest.$ac_ext" <<_ACEOF
9747 #line 9747 "configure"
9748 #include "confdefs.h"
9749 #define initscr autoconf_temporary
9750 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9751 #undef initscr
9752
9753 #ifdef __cplusplus
9754 extern "C"
9755 #endif
9756
9757 /* We use char because int might match the return type of a gcc2
9758    builtin and then its argument prototype would still apply.  */
9759 char initscr (void);
9760
9761 int
9762 main (void)
9763 {
9764
9765 /* The GNU C library defines stubs for functions which it implements
9766     to always fail with ENOSYS.  Some functions are actually named
9767     something starting with __ and the normal name is an alias.  */
9768 #if defined (__stub_initscr) || defined (__stub___initscr)
9769 #error found stub for initscr
9770 #endif
9771
9772         return initscr ();
9773   ;
9774   return 0;
9775 }
9776 _ACEOF
9777 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9778 if { (eval echo "$as_me:9778: \"$ac_link\"") >&5
9779   (eval $ac_link) 2>&5
9780   ac_status=$?
9781   echo "$as_me:9781: \$? = $ac_status" >&5
9782   (exit "$ac_status"); } &&
9783          { ac_try='test -s "conftest$ac_exeext"'
9784   { (eval echo "$as_me:9784: \"$ac_try\"") >&5
9785   (eval $ac_try) 2>&5
9786   ac_status=$?
9787   echo "$as_me:9787: \$? = $ac_status" >&5
9788   (exit "$ac_status"); }; }; then
9789   ac_cv_func_initscr=yes
9790 else
9791   echo "$as_me: failed program was:" >&5
9792 cat "conftest.$ac_ext" >&5
9793 ac_cv_func_initscr=no
9794 fi
9795 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9796 fi
9797 echo "$as_me:9797: result: $ac_cv_func_initscr" >&5
9798 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9799 if test "$ac_cv_func_initscr" = yes; then
9800   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9801 else
9802
9803                 cf_save_LIBS="$LIBS"
9804                 echo "$as_me:9804: checking for initscr in -l$cf_nculib_root" >&5
9805 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9806                 LIBS="-l$cf_nculib_root $LIBS"
9807                 cat >"conftest.$ac_ext" <<_ACEOF
9808 #line 9808 "configure"
9809 #include "confdefs.h"
9810 #include <${cf_cv_ncurses_header:-curses.h}>
9811 int
9812 main (void)
9813 {
9814 initscr()
9815   ;
9816   return 0;
9817 }
9818 _ACEOF
9819 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9820 if { (eval echo "$as_me:9820: \"$ac_link\"") >&5
9821   (eval $ac_link) 2>&5
9822   ac_status=$?
9823   echo "$as_me:9823: \$? = $ac_status" >&5
9824   (exit "$ac_status"); } &&
9825          { ac_try='test -s "conftest$ac_exeext"'
9826   { (eval echo "$as_me:9826: \"$ac_try\"") >&5
9827   (eval $ac_try) 2>&5
9828   ac_status=$?
9829   echo "$as_me:9829: \$? = $ac_status" >&5
9830   (exit "$ac_status"); }; }; then
9831   echo "$as_me:9831: result: yes" >&5
9832 echo "${ECHO_T}yes" >&6
9833                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9834
9835 else
9836   echo "$as_me: failed program was:" >&5
9837 cat "conftest.$ac_ext" >&5
9838 echo "$as_me:9838: result: no" >&5
9839 echo "${ECHO_T}no" >&6
9840
9841 cf_search=
9842 cf_library_path_list=""
9843 if test -n "${LDFLAGS}${LIBS}" ; then
9844         for cf_library_path in $LDFLAGS $LIBS
9845         do
9846                 case "$cf_library_path" in
9847                 (-L*)
9848                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9849
9850 test "x$cf_library_path" != "xNONE" && \
9851 test -d "$cf_library_path" && \
9852  {
9853         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9854         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9855         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9856         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9857         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9858         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"
9859 }
9860
9861                         cf_library_path_list="$cf_library_path_list $cf_search"
9862                         ;;
9863                 esac
9864         done
9865 fi
9866
9867 cf_search=
9868
9869 test "x$prefix" != "xNONE" && \
9870 test -d "$prefix" && \
9871  {
9872         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9873         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9874         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9875         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9876         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9877         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9878 }
9879
9880 for cf_subdir_prefix in \
9881         /usr \
9882         /usr/local \
9883         /usr/pkg \
9884         /opt \
9885         /opt/local \
9886         $HOME
9887 do
9888
9889 test "x$cf_subdir_prefix" != "x$prefix" && \
9890 test -d "$cf_subdir_prefix" && \
9891 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9892         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9893         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9894         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9895         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9896         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9897         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"
9898 }
9899
9900 done
9901
9902 cf_search="$cf_library_path_list $cf_search"
9903
9904                         for cf_libdir in $cf_search
9905                         do
9906                                 echo "$as_me:9906: checking for -l$cf_nculib_root in $cf_libdir" >&5
9907 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9908                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9909                                 cat >"conftest.$ac_ext" <<_ACEOF
9910 #line 9910 "configure"
9911 #include "confdefs.h"
9912 #include <${cf_cv_ncurses_header:-curses.h}>
9913 int
9914 main (void)
9915 {
9916 initscr()
9917   ;
9918   return 0;
9919 }
9920 _ACEOF
9921 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9922 if { (eval echo "$as_me:9922: \"$ac_link\"") >&5
9923   (eval $ac_link) 2>&5
9924   ac_status=$?
9925   echo "$as_me:9925: \$? = $ac_status" >&5
9926   (exit "$ac_status"); } &&
9927          { ac_try='test -s "conftest$ac_exeext"'
9928   { (eval echo "$as_me:9928: \"$ac_try\"") >&5
9929   (eval $ac_try) 2>&5
9930   ac_status=$?
9931   echo "$as_me:9931: \$? = $ac_status" >&5
9932   (exit "$ac_status"); }; }; then
9933   echo "$as_me:9933: result: yes" >&5
9934 echo "${ECHO_T}yes" >&6
9935                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9936                                          break
9937 else
9938   echo "$as_me: failed program was:" >&5
9939 cat "conftest.$ac_ext" >&5
9940 echo "$as_me:9940: result: no" >&5
9941 echo "${ECHO_T}no" >&6
9942                                          LIBS="$cf_save_LIBS"
9943 fi
9944 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9945                         done
9946
9947 fi
9948 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9949
9950 fi
9951
9952 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9953
9954 if test "$cf_found_library" = no ; then
9955         { { echo "$as_me:9955: error: Cannot link $cf_nculib_root library" >&5
9956 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9957    { (exit 1); exit 1; }; }
9958 fi
9959
9960 fi
9961
9962 if test -n "$cf_ncurses_LIBS" ; then
9963         echo "$as_me:9963: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9964 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9965         cf_ncurses_SAVE="$LIBS"
9966         for p in $cf_ncurses_LIBS ; do
9967                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9968                 if test "$q" != "$LIBS" ; then
9969                         LIBS="$q"
9970                 fi
9971         done
9972         cat >"conftest.$ac_ext" <<_ACEOF
9973 #line 9973 "configure"
9974 #include "confdefs.h"
9975 #include <${cf_cv_ncurses_header:-curses.h}>
9976 int
9977 main (void)
9978 {
9979 initscr(); mousemask(0,0); tigetstr((char *)0);
9980   ;
9981   return 0;
9982 }
9983 _ACEOF
9984 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9985 if { (eval echo "$as_me:9985: \"$ac_link\"") >&5
9986   (eval $ac_link) 2>&5
9987   ac_status=$?
9988   echo "$as_me:9988: \$? = $ac_status" >&5
9989   (exit "$ac_status"); } &&
9990          { ac_try='test -s "conftest$ac_exeext"'
9991   { (eval echo "$as_me:9991: \"$ac_try\"") >&5
9992   (eval $ac_try) 2>&5
9993   ac_status=$?
9994   echo "$as_me:9994: \$? = $ac_status" >&5
9995   (exit "$ac_status"); }; }; then
9996   echo "$as_me:9996: result: yes" >&5
9997 echo "${ECHO_T}yes" >&6
9998 else
9999   echo "$as_me: failed program was:" >&5
10000 cat "conftest.$ac_ext" >&5
10001 echo "$as_me:10001: result: no" >&5
10002 echo "${ECHO_T}no" >&6
10003                  LIBS="$cf_ncurses_SAVE"
10004 fi
10005 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10006 fi
10007
10008 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10009
10010 cat >>confdefs.h <<EOF
10011 #define $cf_nculib_ROOT 1
10012 EOF
10013
10014         fi
10015 else
10016         NCURSES_CONFIG=none
10017 fi
10018
10019         ;;
10020 (ncurses*)
10021
10022 cf_ncuconfig_root=$cf_cv_screen
10023 cf_have_ncuconfig=no
10024
10025 if test "x${PKG_CONFIG:=none}" != xnone; then
10026         echo "$as_me:10026: checking pkg-config for $cf_ncuconfig_root" >&5
10027 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10028         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
10029                 echo "$as_me:10029: result: yes" >&5
10030 echo "${ECHO_T}yes" >&6
10031
10032                 echo "$as_me:10032: checking if the $cf_ncuconfig_root package files work" >&5
10033 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10034                 cf_have_ncuconfig=unknown
10035
10036                 cf_save_CFLAGS="$CFLAGS"
10037                 cf_save_CPPFLAGS="$CPPFLAGS"
10038                 cf_save_LIBS="$LIBS"
10039
10040                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10041                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
10042
10043                 # while -W for passing linker flags is prevalent, it is not "standard".
10044                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10045                 # incompatible _and_ non-standard -W option which gives an error.  Work
10046                 # around that pitfall.
10047                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10048                 (x*c[89]9@@*-W*)
10049
10050 cf_fix_cppflags=no
10051 cf_new_cflags=
10052 cf_new_cppflags=
10053 cf_new_extra_cppflags=
10054
10055 for cf_add_cflags in $cf_pkg_cflags
10056 do
10057 case "$cf_fix_cppflags" in
10058 (no)
10059         case "$cf_add_cflags" in
10060         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10061                 case "$cf_add_cflags" in
10062                 (-D*)
10063                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10064
10065                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10066                                 && test -z "${cf_tst_cflags}" \
10067                                 && cf_fix_cppflags=yes
10068
10069                         if test "$cf_fix_cppflags" = yes ; then
10070
10071         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10072         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10073
10074                                 continue
10075                         elif test "${cf_tst_cflags}" = "\"'" ; then
10076
10077         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10078         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10079
10080                                 continue
10081                         fi
10082                         ;;
10083                 esac
10084                 case "$CPPFLAGS" in
10085                 (*$cf_add_cflags)
10086                         ;;
10087                 (*)
10088                         case "$cf_add_cflags" in
10089                         (-D*)
10090                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10091
10092 CPPFLAGS=`echo "$CPPFLAGS" | \
10093         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10094                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10095
10096                                 ;;
10097                         esac
10098
10099         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10100         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10101
10102                         ;;
10103                 esac
10104                 ;;
10105         (*)
10106
10107         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10108         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10109
10110                 ;;
10111         esac
10112         ;;
10113 (yes)
10114
10115         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10116         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10117
10118         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10119
10120         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10121                 && test -z "${cf_tst_cflags}" \
10122                 && cf_fix_cppflags=no
10123         ;;
10124 esac
10125 done
10126
10127 if test -n "$cf_new_cflags" ; then
10128
10129         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10130         CFLAGS="${CFLAGS}$cf_new_cflags"
10131
10132 fi
10133
10134 if test -n "$cf_new_cppflags" ; then
10135
10136         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10137         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10138
10139 fi
10140
10141 if test -n "$cf_new_extra_cppflags" ; then
10142
10143         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10144         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10145
10146 fi
10147
10148 cf_add_libs="$LIBS"
10149 # reverse order
10150 cf_add_0lib=
10151 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10152 # filter duplicates
10153 for cf_add_1lib in $cf_add_0lib; do
10154         for cf_add_2lib in $cf_add_libs; do
10155                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10156                         cf_add_1lib=
10157                         break
10158                 fi
10159         done
10160         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10161 done
10162 LIBS="$cf_add_libs"
10163
10164                         cat >"conftest.$ac_ext" <<_ACEOF
10165 #line 10165 "configure"
10166 #include "confdefs.h"
10167 #include <${cf_cv_ncurses_header:-curses.h}>
10168 int
10169 main (void)
10170 {
10171 initscr(); mousemask(0,0); tigetstr((char *)0);
10172   ;
10173   return 0;
10174 }
10175 _ACEOF
10176 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10177 if { (eval echo "$as_me:10177: \"$ac_link\"") >&5
10178   (eval $ac_link) 2>&5
10179   ac_status=$?
10180   echo "$as_me:10180: \$? = $ac_status" >&5
10181   (exit "$ac_status"); } &&
10182          { ac_try='test -s "conftest$ac_exeext"'
10183   { (eval echo "$as_me:10183: \"$ac_try\"") >&5
10184   (eval $ac_try) 2>&5
10185   ac_status=$?
10186   echo "$as_me:10186: \$? = $ac_status" >&5
10187   (exit "$ac_status"); }; }; then
10188   if test "$cross_compiling" = yes; then
10189   cf_test_ncuconfig=maybe
10190 else
10191   cat >"conftest.$ac_ext" <<_ACEOF
10192 #line 10192 "configure"
10193 #include "confdefs.h"
10194 #include <${cf_cv_ncurses_header:-curses.h}>
10195                                         int main(void)
10196                                         { const char *xx = curses_version(); return (xx == 0); }
10197 _ACEOF
10198 rm -f "conftest$ac_exeext"
10199 if { (eval echo "$as_me:10199: \"$ac_link\"") >&5
10200   (eval $ac_link) 2>&5
10201   ac_status=$?
10202   echo "$as_me:10202: \$? = $ac_status" >&5
10203   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10204   { (eval echo "$as_me:10204: \"$ac_try\"") >&5
10205   (eval $ac_try) 2>&5
10206   ac_status=$?
10207   echo "$as_me:10207: \$? = $ac_status" >&5
10208   (exit "$ac_status"); }; }; then
10209   cf_test_ncuconfig=yes
10210 else
10211   echo "$as_me: program exited with status $ac_status" >&5
10212 echo "$as_me: failed program was:" >&5
10213 cat "conftest.$ac_ext" >&5
10214 cf_test_ncuconfig=no
10215 fi
10216 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10217 fi
10218 else
10219   echo "$as_me: failed program was:" >&5
10220 cat "conftest.$ac_ext" >&5
10221 cf_test_ncuconfig=no
10222 fi
10223 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10224
10225                         CFLAGS="$cf_save_CFLAGS"
10226                         CPPFLAGS="$cf_save_CPPFLAGS"
10227                         LIBS="$cf_save_LIBS"
10228
10229                         if test "x$cf_test_ncuconfig" != xyes; then
10230                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10231                                 cf_pkg_cflags="$cf_temp"
10232                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10233                                 cf_pkg_libs="$cf_temp"
10234                         fi
10235                         ;;
10236                 esac
10237
10238 cf_fix_cppflags=no
10239 cf_new_cflags=
10240 cf_new_cppflags=
10241 cf_new_extra_cppflags=
10242
10243 for cf_add_cflags in $cf_pkg_cflags
10244 do
10245 case "$cf_fix_cppflags" in
10246 (no)
10247         case "$cf_add_cflags" in
10248         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10249                 case "$cf_add_cflags" in
10250                 (-D*)
10251                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10252
10253                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10254                                 && test -z "${cf_tst_cflags}" \
10255                                 && cf_fix_cppflags=yes
10256
10257                         if test "$cf_fix_cppflags" = yes ; then
10258
10259         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10260         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10261
10262                                 continue
10263                         elif test "${cf_tst_cflags}" = "\"'" ; then
10264
10265         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10266         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10267
10268                                 continue
10269                         fi
10270                         ;;
10271                 esac
10272                 case "$CPPFLAGS" in
10273                 (*$cf_add_cflags)
10274                         ;;
10275                 (*)
10276                         case "$cf_add_cflags" in
10277                         (-D*)
10278                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10279
10280 CPPFLAGS=`echo "$CPPFLAGS" | \
10281         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10282                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10283
10284                                 ;;
10285                         esac
10286
10287         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10288         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10289
10290                         ;;
10291                 esac
10292                 ;;
10293         (*)
10294
10295         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10296         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10297
10298                 ;;
10299         esac
10300         ;;
10301 (yes)
10302
10303         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10304         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10305
10306         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10307
10308         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10309                 && test -z "${cf_tst_cflags}" \
10310                 && cf_fix_cppflags=no
10311         ;;
10312 esac
10313 done
10314
10315 if test -n "$cf_new_cflags" ; then
10316
10317         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10318         CFLAGS="${CFLAGS}$cf_new_cflags"
10319
10320 fi
10321
10322 if test -n "$cf_new_cppflags" ; then
10323
10324         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10325         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10326
10327 fi
10328
10329 if test -n "$cf_new_extra_cppflags" ; then
10330
10331         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10332         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10333
10334 fi
10335
10336 cf_add_libs="$LIBS"
10337 # reverse order
10338 cf_add_0lib=
10339 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10340 # filter duplicates
10341 for cf_add_1lib in $cf_add_0lib; do
10342         for cf_add_2lib in $cf_add_libs; do
10343                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10344                         cf_add_1lib=
10345                         break
10346                 fi
10347         done
10348         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10349 done
10350 LIBS="$cf_add_libs"
10351
10352                 cat >"conftest.$ac_ext" <<_ACEOF
10353 #line 10353 "configure"
10354 #include "confdefs.h"
10355 #include <${cf_cv_ncurses_header:-curses.h}>
10356 int
10357 main (void)
10358 {
10359 initscr(); mousemask(0,0); tigetstr((char *)0);
10360   ;
10361   return 0;
10362 }
10363 _ACEOF
10364 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10365 if { (eval echo "$as_me:10365: \"$ac_link\"") >&5
10366   (eval $ac_link) 2>&5
10367   ac_status=$?
10368   echo "$as_me:10368: \$? = $ac_status" >&5
10369   (exit "$ac_status"); } &&
10370          { ac_try='test -s "conftest$ac_exeext"'
10371   { (eval echo "$as_me:10371: \"$ac_try\"") >&5
10372   (eval $ac_try) 2>&5
10373   ac_status=$?
10374   echo "$as_me:10374: \$? = $ac_status" >&5
10375   (exit "$ac_status"); }; }; then
10376   if test "$cross_compiling" = yes; then
10377   cf_have_ncuconfig=maybe
10378 else
10379   cat >"conftest.$ac_ext" <<_ACEOF
10380 #line 10380 "configure"
10381 #include "confdefs.h"
10382 #include <${cf_cv_ncurses_header:-curses.h}>
10383                                 int main(void)
10384                                 { const char *xx = curses_version(); return (xx == 0); }
10385 _ACEOF
10386 rm -f "conftest$ac_exeext"
10387 if { (eval echo "$as_me:10387: \"$ac_link\"") >&5
10388   (eval $ac_link) 2>&5
10389   ac_status=$?
10390   echo "$as_me:10390: \$? = $ac_status" >&5
10391   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10392   { (eval echo "$as_me:10392: \"$ac_try\"") >&5
10393   (eval $ac_try) 2>&5
10394   ac_status=$?
10395   echo "$as_me:10395: \$? = $ac_status" >&5
10396   (exit "$ac_status"); }; }; then
10397   cf_have_ncuconfig=yes
10398 else
10399   echo "$as_me: program exited with status $ac_status" >&5
10400 echo "$as_me: failed program was:" >&5
10401 cat "conftest.$ac_ext" >&5
10402 cf_have_ncuconfig=no
10403 fi
10404 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10405 fi
10406 else
10407   echo "$as_me: failed program was:" >&5
10408 cat "conftest.$ac_ext" >&5
10409 cf_have_ncuconfig=no
10410 fi
10411 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10412                 echo "$as_me:10412: result: $cf_have_ncuconfig" >&5
10413 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10414                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10415                 if test "$cf_have_ncuconfig" != "yes"
10416                 then
10417                         CPPFLAGS="$cf_save_CPPFLAGS"
10418                         LIBS="$cf_save_LIBS"
10419                         NCURSES_CONFIG_PKG=none
10420                 else
10421
10422 cat >>confdefs.h <<\EOF
10423 #define NCURSES 1
10424 EOF
10425
10426                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10427
10428 echo "$as_me:10428: checking for terminfo header" >&5
10429 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10430 if test "${cf_cv_term_header+set}" = set; then
10431   echo $ECHO_N "(cached) $ECHO_C" >&6
10432 else
10433
10434 case "${cf_cv_ncurses_header}" in
10435 (*/ncurses.h|*/ncursesw.h)
10436         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10437         ;;
10438 (*)
10439         cf_term_header=term.h
10440         ;;
10441 esac
10442
10443 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10444 do
10445 cat >"conftest.$ac_ext" <<_ACEOF
10446 #line 10446 "configure"
10447 #include "confdefs.h"
10448 #include <stdio.h>
10449 #include <${cf_cv_ncurses_header:-curses.h}>
10450 #include <$cf_test>
10451
10452 int
10453 main (void)
10454 {
10455 int x = auto_left_margin; (void)x
10456   ;
10457   return 0;
10458 }
10459 _ACEOF
10460 rm -f "conftest.$ac_objext"
10461 if { (eval echo "$as_me:10461: \"$ac_compile\"") >&5
10462   (eval $ac_compile) 2>&5
10463   ac_status=$?
10464   echo "$as_me:10464: \$? = $ac_status" >&5
10465   (exit "$ac_status"); } &&
10466          { ac_try='test -s "conftest.$ac_objext"'
10467   { (eval echo "$as_me:10467: \"$ac_try\"") >&5
10468   (eval $ac_try) 2>&5
10469   ac_status=$?
10470   echo "$as_me:10470: \$? = $ac_status" >&5
10471   (exit "$ac_status"); }; }; then
10472
10473         cf_cv_term_header="$cf_test"
10474 else
10475   echo "$as_me: failed program was:" >&5
10476 cat "conftest.$ac_ext" >&5
10477
10478         cf_cv_term_header=unknown
10479
10480 fi
10481 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10482         test "$cf_cv_term_header" != unknown && break
10483 done
10484
10485 fi
10486 echo "$as_me:10486: result: $cf_cv_term_header" >&5
10487 echo "${ECHO_T}$cf_cv_term_header" >&6
10488
10489 # Set definitions to allow ifdef'ing to accommodate subdirectories
10490
10491 case "$cf_cv_term_header" in
10492 (*term.h)
10493
10494 cat >>confdefs.h <<\EOF
10495 #define HAVE_TERM_H 1
10496 EOF
10497
10498         ;;
10499 esac
10500
10501 case "$cf_cv_term_header" in
10502 (ncurses/term.h)
10503
10504 cat >>confdefs.h <<\EOF
10505 #define HAVE_NCURSES_TERM_H 1
10506 EOF
10507
10508         ;;
10509 (ncursesw/term.h)
10510
10511 cat >>confdefs.h <<\EOF
10512 #define HAVE_NCURSESW_TERM_H 1
10513 EOF
10514
10515         ;;
10516 esac
10517
10518                 fi
10519
10520         else
10521                 echo "$as_me:10521: result: no" >&5
10522 echo "${ECHO_T}no" >&6
10523                 NCURSES_CONFIG_PKG=none
10524         fi
10525 else
10526         NCURSES_CONFIG_PKG=none
10527 fi
10528
10529 if test "x$cf_have_ncuconfig" = "xno"; then
10530         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10531
10532 if test -n "$ac_tool_prefix"; then
10533   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10534   do
10535     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10536 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10537 echo "$as_me:10537: checking for $ac_word" >&5
10538 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10539 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10540   echo $ECHO_N "(cached) $ECHO_C" >&6
10541 else
10542   if test -n "$NCURSES_CONFIG"; then
10543   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10544 else
10545   ac_save_IFS=$IFS; IFS=$ac_path_separator
10546 ac_dummy="$PATH"
10547 for ac_dir in $ac_dummy; do
10548   IFS=$ac_save_IFS
10549   test -z "$ac_dir" && ac_dir=.
10550   $as_executable_p "$ac_dir/$ac_word" || continue
10551 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10552 echo "$as_me:10552: found $ac_dir/$ac_word" >&5
10553 break
10554 done
10555
10556 fi
10557 fi
10558 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10559 if test -n "$NCURSES_CONFIG"; then
10560   echo "$as_me:10560: result: $NCURSES_CONFIG" >&5
10561 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10562 else
10563   echo "$as_me:10563: result: no" >&5
10564 echo "${ECHO_T}no" >&6
10565 fi
10566
10567     test -n "$NCURSES_CONFIG" && break
10568   done
10569 fi
10570 if test -z "$NCURSES_CONFIG"; then
10571   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10572   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10573 do
10574   # Extract the first word of "$ac_prog", so it can be a program name with args.
10575 set dummy $ac_prog; ac_word=$2
10576 echo "$as_me:10576: checking for $ac_word" >&5
10577 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10578 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10579   echo $ECHO_N "(cached) $ECHO_C" >&6
10580 else
10581   if test -n "$ac_ct_NCURSES_CONFIG"; then
10582   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10583 else
10584   ac_save_IFS=$IFS; IFS=$ac_path_separator
10585 ac_dummy="$PATH"
10586 for ac_dir in $ac_dummy; do
10587   IFS=$ac_save_IFS
10588   test -z "$ac_dir" && ac_dir=.
10589   $as_executable_p "$ac_dir/$ac_word" || continue
10590 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10591 echo "$as_me:10591: found $ac_dir/$ac_word" >&5
10592 break
10593 done
10594
10595 fi
10596 fi
10597 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10598 if test -n "$ac_ct_NCURSES_CONFIG"; then
10599   echo "$as_me:10599: result: $ac_ct_NCURSES_CONFIG" >&5
10600 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10601 else
10602   echo "$as_me:10602: result: no" >&5
10603 echo "${ECHO_T}no" >&6
10604 fi
10605
10606   test -n "$ac_ct_NCURSES_CONFIG" && break
10607 done
10608 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10609
10610   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10611 fi
10612
10613         if test "$NCURSES_CONFIG" != none ; then
10614
10615 cf_fix_cppflags=no
10616 cf_new_cflags=
10617 cf_new_cppflags=
10618 cf_new_extra_cppflags=
10619
10620 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10621 do
10622 case "$cf_fix_cppflags" in
10623 (no)
10624         case "$cf_add_cflags" in
10625         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10626                 case "$cf_add_cflags" in
10627                 (-D*)
10628                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10629
10630                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10631                                 && test -z "${cf_tst_cflags}" \
10632                                 && cf_fix_cppflags=yes
10633
10634                         if test "$cf_fix_cppflags" = yes ; then
10635
10636         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10637         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10638
10639                                 continue
10640                         elif test "${cf_tst_cflags}" = "\"'" ; then
10641
10642         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10643         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10644
10645                                 continue
10646                         fi
10647                         ;;
10648                 esac
10649                 case "$CPPFLAGS" in
10650                 (*$cf_add_cflags)
10651                         ;;
10652                 (*)
10653                         case "$cf_add_cflags" in
10654                         (-D*)
10655                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10656
10657 CPPFLAGS=`echo "$CPPFLAGS" | \
10658         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10659                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10660
10661                                 ;;
10662                         esac
10663
10664         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10665         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10666
10667                         ;;
10668                 esac
10669                 ;;
10670         (*)
10671
10672         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10673         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10674
10675                 ;;
10676         esac
10677         ;;
10678 (yes)
10679
10680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10682
10683         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10684
10685         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10686                 && test -z "${cf_tst_cflags}" \
10687                 && cf_fix_cppflags=no
10688         ;;
10689 esac
10690 done
10691
10692 if test -n "$cf_new_cflags" ; then
10693
10694         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10695         CFLAGS="${CFLAGS}$cf_new_cflags"
10696
10697 fi
10698
10699 if test -n "$cf_new_cppflags" ; then
10700
10701         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10702         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10703
10704 fi
10705
10706 if test -n "$cf_new_extra_cppflags" ; then
10707
10708         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10709         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10710
10711 fi
10712
10713 cf_add_libs="$LIBS"
10714 # reverse order
10715 cf_add_0lib=
10716 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10717 # filter duplicates
10718 for cf_add_1lib in $cf_add_0lib; do
10719         for cf_add_2lib in $cf_add_libs; do
10720                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10721                         cf_add_1lib=
10722                         break
10723                 fi
10724         done
10725         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10726 done
10727 LIBS="$cf_add_libs"
10728
10729                 # even with config script, some packages use no-override for curses.h
10730
10731 echo "$as_me:10731: checking if we have identified curses headers" >&5
10732 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10733 if test "${cf_cv_ncurses_header+set}" = set; then
10734   echo $ECHO_N "(cached) $ECHO_C" >&6
10735 else
10736
10737 cf_cv_ncurses_header=none
10738 for cf_header in \
10739         ncurses.h $cf_cv_screen/ncurses.h \
10740         curses.h $cf_cv_screen/curses.h
10741 do
10742 cat >"conftest.$ac_ext" <<_ACEOF
10743 #line 10743 "configure"
10744 #include "confdefs.h"
10745 #include <${cf_header}>
10746 int
10747 main (void)
10748 {
10749 initscr(); tgoto("?", 0,0)
10750   ;
10751   return 0;
10752 }
10753 _ACEOF
10754 rm -f "conftest.$ac_objext"
10755 if { (eval echo "$as_me:10755: \"$ac_compile\"") >&5
10756   (eval $ac_compile) 2>&5
10757   ac_status=$?
10758   echo "$as_me:10758: \$? = $ac_status" >&5
10759   (exit "$ac_status"); } &&
10760          { ac_try='test -s "conftest.$ac_objext"'
10761   { (eval echo "$as_me:10761: \"$ac_try\"") >&5
10762   (eval $ac_try) 2>&5
10763   ac_status=$?
10764   echo "$as_me:10764: \$? = $ac_status" >&5
10765   (exit "$ac_status"); }; }; then
10766   cf_cv_ncurses_header=$cf_header; break
10767 else
10768   echo "$as_me: failed program was:" >&5
10769 cat "conftest.$ac_ext" >&5
10770 fi
10771 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10772 done
10773
10774 fi
10775 echo "$as_me:10775: result: $cf_cv_ncurses_header" >&5
10776 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10777
10778 if test "$cf_cv_ncurses_header" = none ; then
10779         { { echo "$as_me:10779: error: No curses header-files found" >&5
10780 echo "$as_me: error: No curses header-files found" >&2;}
10781    { (exit 1); exit 1; }; }
10782 fi
10783
10784 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10785
10786 for ac_header in $cf_cv_ncurses_header
10787 do
10788 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10789 echo "$as_me:10789: checking for $ac_header" >&5
10790 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10791 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10792   echo $ECHO_N "(cached) $ECHO_C" >&6
10793 else
10794   cat >"conftest.$ac_ext" <<_ACEOF
10795 #line 10795 "configure"
10796 #include "confdefs.h"
10797 #include <$ac_header>
10798 _ACEOF
10799 if { (eval echo "$as_me:10799: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10800   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10801   ac_status=$?
10802   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10803   rm -f conftest.er1
10804   cat conftest.err >&5
10805   echo "$as_me:10805: \$? = $ac_status" >&5
10806   (exit "$ac_status"); } >/dev/null; then
10807   if test -s conftest.err; then
10808     ac_cpp_err=$ac_c_preproc_warn_flag
10809   else
10810     ac_cpp_err=
10811   fi
10812 else
10813   ac_cpp_err=yes
10814 fi
10815 if test -z "$ac_cpp_err"; then
10816   eval "$as_ac_Header=yes"
10817 else
10818   echo "$as_me: failed program was:" >&5
10819   cat "conftest.$ac_ext" >&5
10820   eval "$as_ac_Header=no"
10821 fi
10822 rm -f conftest.err "conftest.$ac_ext"
10823 fi
10824 echo "$as_me:10824: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10825 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10826 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10827   cat >>confdefs.h <<EOF
10828 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10829 EOF
10830
10831 fi
10832 done
10833
10834 cat >>confdefs.h <<\EOF
10835 #define NCURSES 1
10836 EOF
10837
10838 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10839
10840                 cat >>confdefs.h <<EOF
10841 #define $cf_nculib_ROOT 1
10842 EOF
10843
10844                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10845
10846         else
10847
10848 cf_ncuhdr_root=$cf_cv_screen
10849
10850 test -n "$cf_cv_curses_dir" && \
10851 test "$cf_cv_curses_dir" != "no" && { \
10852
10853 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10854   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10855   do
10856         while test "$cf_add_incdir" != /usr/include
10857         do
10858           if test -d "$cf_add_incdir"
10859           then
10860                 cf_have_incdir=no
10861                 if test -n "$CFLAGS$CPPFLAGS" ; then
10862                   # a loop is needed to ensure we can add subdirs of existing dirs
10863                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10864                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10865                           cf_have_incdir=yes; break
10866                         fi
10867                   done
10868                 fi
10869
10870                 if test "$cf_have_incdir" = no ; then
10871                   if test "$cf_add_incdir" = /usr/local/include ; then
10872                         if test "$GCC" = yes
10873                         then
10874                           cf_save_CPPFLAGS=$CPPFLAGS
10875
10876         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10877         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10878
10879                           cat >"conftest.$ac_ext" <<_ACEOF
10880 #line 10880 "configure"
10881 #include "confdefs.h"
10882 #include <stdio.h>
10883 int
10884 main (void)
10885 {
10886 printf("Hello")
10887   ;
10888   return 0;
10889 }
10890 _ACEOF
10891 rm -f "conftest.$ac_objext"
10892 if { (eval echo "$as_me:10892: \"$ac_compile\"") >&5
10893   (eval $ac_compile) 2>&5
10894   ac_status=$?
10895   echo "$as_me:10895: \$? = $ac_status" >&5
10896   (exit "$ac_status"); } &&
10897          { ac_try='test -s "conftest.$ac_objext"'
10898   { (eval echo "$as_me:10898: \"$ac_try\"") >&5
10899   (eval $ac_try) 2>&5
10900   ac_status=$?
10901   echo "$as_me:10901: \$? = $ac_status" >&5
10902   (exit "$ac_status"); }; }; then
10903   :
10904 else
10905   echo "$as_me: failed program was:" >&5
10906 cat "conftest.$ac_ext" >&5
10907 cf_have_incdir=yes
10908 fi
10909 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10910                           CPPFLAGS=$cf_save_CPPFLAGS
10911                         fi
10912                   fi
10913                 fi
10914
10915                 if test "$cf_have_incdir" = no ; then
10916                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10917
10918 echo "${as_me:-configure}:10918: testing adding $cf_add_incdir to include-path ..." 1>&5
10919
10920                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10921
10922                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10923                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10924                   cf_add_incdir="$cf_top_incdir"
10925                 else
10926                   break
10927                 fi
10928           else
10929                 break
10930           fi
10931         done
10932   done
10933 fi
10934
10935 }
10936
10937 echo "$as_me:10937: checking for $cf_ncuhdr_root header in include-path" >&5
10938 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10939 if test "${cf_cv_ncurses_h+set}" = set; then
10940   echo $ECHO_N "(cached) $ECHO_C" >&6
10941 else
10942
10943         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10944         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10945         for cf_header in $cf_header_list
10946         do
10947
10948         cat >"conftest.$ac_ext" <<_ACEOF
10949 #line 10949 "configure"
10950 #include "confdefs.h"
10951
10952 #include <$cf_header>
10953 int
10954 main (void)
10955 {
10956
10957 #ifdef NCURSES_VERSION
10958
10959 printf("%s\\n", NCURSES_VERSION);
10960 #else
10961 #ifdef __NCURSES_H
10962 printf("old\\n");
10963 #else
10964         make an error
10965 #endif
10966 #endif
10967
10968   ;
10969   return 0;
10970 }
10971 _ACEOF
10972 rm -f "conftest.$ac_objext"
10973 if { (eval echo "$as_me:10973: \"$ac_compile\"") >&5
10974   (eval $ac_compile) 2>&5
10975   ac_status=$?
10976   echo "$as_me:10976: \$? = $ac_status" >&5
10977   (exit "$ac_status"); } &&
10978          { ac_try='test -s "conftest.$ac_objext"'
10979   { (eval echo "$as_me:10979: \"$ac_try\"") >&5
10980   (eval $ac_try) 2>&5
10981   ac_status=$?
10982   echo "$as_me:10982: \$? = $ac_status" >&5
10983   (exit "$ac_status"); }; }; then
10984   cf_cv_ncurses_h=$cf_header
10985
10986 else
10987   echo "$as_me: failed program was:" >&5
10988 cat "conftest.$ac_ext" >&5
10989 cf_cv_ncurses_h=no
10990 fi
10991 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10992
10993                 test "$cf_cv_ncurses_h" != no && break
10994         done
10995
10996 fi
10997 echo "$as_me:10997: result: $cf_cv_ncurses_h" >&5
10998 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10999
11000 if test "$cf_cv_ncurses_h" != no ; then
11001         cf_cv_ncurses_header=$cf_cv_ncurses_h
11002 else
11003
11004 echo "$as_me:11004: checking for $cf_ncuhdr_root include-path" >&5
11005 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11006 if test "${cf_cv_ncurses_h2+set}" = set; then
11007   echo $ECHO_N "(cached) $ECHO_C" >&6
11008 else
11009
11010         test -n "$verbose" && echo
11011
11012 cf_search=
11013
11014 # collect the current set of include-directories from compiler flags
11015 cf_header_path_list=""
11016 if test -n "${CFLAGS}${CPPFLAGS}" ; then
11017         for cf_header_path in $CPPFLAGS $CFLAGS
11018         do
11019                 case "$cf_header_path" in
11020                 (-I*)
11021                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11022
11023 test "x$cf_header_path" != "xNONE" && \
11024 test -d "$cf_header_path" && \
11025  {
11026         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
11027         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
11028         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11029         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11030         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11031         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"
11032 }
11033
11034                         cf_header_path_list="$cf_header_path_list $cf_search"
11035                         ;;
11036                 esac
11037         done
11038 fi
11039
11040 # add the variations for the package we are looking for
11041
11042 cf_search=
11043
11044 test "x$prefix" != "xNONE" && \
11045 test -d "$prefix" && \
11046  {
11047         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
11048         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
11049         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11050         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11051         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11052         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
11053 }
11054
11055 for cf_subdir_prefix in \
11056         /usr \
11057         /usr/local \
11058         /usr/pkg \
11059         /opt \
11060         /opt/local \
11061         $HOME
11062 do
11063
11064 test "x$cf_subdir_prefix" != "x$prefix" && \
11065 test -d "$cf_subdir_prefix" && \
11066 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11067         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11068         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11069         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11070         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11071         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11072         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"
11073 }
11074
11075 done
11076
11077 test "$includedir" != NONE && \
11078 test "$includedir" != "/usr/include" && \
11079 test -d "$includedir" && {
11080         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11081         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11082 }
11083
11084 test "$oldincludedir" != NONE && \
11085 test "$oldincludedir" != "/usr/include" && \
11086 test -d "$oldincludedir" && {
11087         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11088         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11089 }
11090
11091 cf_search="$cf_search $cf_header_path_list"
11092
11093         test -n "$verbose" && echo "search path $cf_search"
11094         cf_save2_CPPFLAGS="$CPPFLAGS"
11095         for cf_incdir in $cf_search
11096         do
11097
11098 if test -n "$cf_incdir" ; then
11099   for cf_add_incdir in $cf_incdir
11100   do
11101         while test "$cf_add_incdir" != /usr/include
11102         do
11103           if test -d "$cf_add_incdir"
11104           then
11105                 cf_have_incdir=no
11106                 if test -n "$CFLAGS$CPPFLAGS" ; then
11107                   # a loop is needed to ensure we can add subdirs of existing dirs
11108                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11109                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11110                           cf_have_incdir=yes; break
11111                         fi
11112                   done
11113                 fi
11114
11115                 if test "$cf_have_incdir" = no ; then
11116                   if test "$cf_add_incdir" = /usr/local/include ; then
11117                         if test "$GCC" = yes
11118                         then
11119                           cf_save_CPPFLAGS=$CPPFLAGS
11120
11121         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11122         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11123
11124                           cat >"conftest.$ac_ext" <<_ACEOF
11125 #line 11125 "configure"
11126 #include "confdefs.h"
11127 #include <stdio.h>
11128 int
11129 main (void)
11130 {
11131 printf("Hello")
11132   ;
11133   return 0;
11134 }
11135 _ACEOF
11136 rm -f "conftest.$ac_objext"
11137 if { (eval echo "$as_me:11137: \"$ac_compile\"") >&5
11138   (eval $ac_compile) 2>&5
11139   ac_status=$?
11140   echo "$as_me:11140: \$? = $ac_status" >&5
11141   (exit "$ac_status"); } &&
11142          { ac_try='test -s "conftest.$ac_objext"'
11143   { (eval echo "$as_me:11143: \"$ac_try\"") >&5
11144   (eval $ac_try) 2>&5
11145   ac_status=$?
11146   echo "$as_me:11146: \$? = $ac_status" >&5
11147   (exit "$ac_status"); }; }; then
11148   :
11149 else
11150   echo "$as_me: failed program was:" >&5
11151 cat "conftest.$ac_ext" >&5
11152 cf_have_incdir=yes
11153 fi
11154 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11155                           CPPFLAGS=$cf_save_CPPFLAGS
11156                         fi
11157                   fi
11158                 fi
11159
11160                 if test "$cf_have_incdir" = no ; then
11161                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11162
11163 echo "${as_me:-configure}:11163: testing adding $cf_add_incdir to include-path ..." 1>&5
11164
11165                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11166
11167                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11168                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11169                   cf_add_incdir="$cf_top_incdir"
11170                 else
11171                   break
11172                 fi
11173           else
11174                 break
11175           fi
11176         done
11177   done
11178 fi
11179
11180                 for cf_header in \
11181                         ncurses.h \
11182                         curses.h
11183                 do
11184
11185         cat >"conftest.$ac_ext" <<_ACEOF
11186 #line 11186 "configure"
11187 #include "confdefs.h"
11188
11189 #include <$cf_header>
11190 int
11191 main (void)
11192 {
11193
11194 #ifdef NCURSES_VERSION
11195
11196 printf("%s\\n", NCURSES_VERSION);
11197 #else
11198 #ifdef __NCURSES_H
11199 printf("old\\n");
11200 #else
11201         make an error
11202 #endif
11203 #endif
11204
11205   ;
11206   return 0;
11207 }
11208 _ACEOF
11209 rm -f "conftest.$ac_objext"
11210 if { (eval echo "$as_me:11210: \"$ac_compile\"") >&5
11211   (eval $ac_compile) 2>&5
11212   ac_status=$?
11213   echo "$as_me:11213: \$? = $ac_status" >&5
11214   (exit "$ac_status"); } &&
11215          { ac_try='test -s "conftest.$ac_objext"'
11216   { (eval echo "$as_me:11216: \"$ac_try\"") >&5
11217   (eval $ac_try) 2>&5
11218   ac_status=$?
11219   echo "$as_me:11219: \$? = $ac_status" >&5
11220   (exit "$ac_status"); }; }; then
11221   cf_cv_ncurses_h2=$cf_header
11222
11223 else
11224   echo "$as_me: failed program was:" >&5
11225 cat "conftest.$ac_ext" >&5
11226 cf_cv_ncurses_h2=no
11227 fi
11228 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11229
11230                         if test "$cf_cv_ncurses_h2" != no ; then
11231                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11232                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11233                                 break
11234                         fi
11235                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11236                 done
11237                 CPPFLAGS="$cf_save2_CPPFLAGS"
11238                 test "$cf_cv_ncurses_h2" != no && break
11239         done
11240         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11240: error: not found" >&5
11241 echo "$as_me: error: not found" >&2;}
11242    { (exit 1); exit 1; }; }
11243
11244 fi
11245 echo "$as_me:11245: result: $cf_cv_ncurses_h2" >&5
11246 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11247
11248         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11249         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11250         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11251                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11252         fi
11253
11254 if test -n "$cf_1st_incdir" ; then
11255   for cf_add_incdir in $cf_1st_incdir
11256   do
11257         while test "$cf_add_incdir" != /usr/include
11258         do
11259           if test -d "$cf_add_incdir"
11260           then
11261                 cf_have_incdir=no
11262                 if test -n "$CFLAGS$CPPFLAGS" ; then
11263                   # a loop is needed to ensure we can add subdirs of existing dirs
11264                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11265                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11266                           cf_have_incdir=yes; break
11267                         fi
11268                   done
11269                 fi
11270
11271                 if test "$cf_have_incdir" = no ; then
11272                   if test "$cf_add_incdir" = /usr/local/include ; then
11273                         if test "$GCC" = yes
11274                         then
11275                           cf_save_CPPFLAGS=$CPPFLAGS
11276
11277         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11278         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11279
11280                           cat >"conftest.$ac_ext" <<_ACEOF
11281 #line 11281 "configure"
11282 #include "confdefs.h"
11283 #include <stdio.h>
11284 int
11285 main (void)
11286 {
11287 printf("Hello")
11288   ;
11289   return 0;
11290 }
11291 _ACEOF
11292 rm -f "conftest.$ac_objext"
11293 if { (eval echo "$as_me:11293: \"$ac_compile\"") >&5
11294   (eval $ac_compile) 2>&5
11295   ac_status=$?
11296   echo "$as_me:11296: \$? = $ac_status" >&5
11297   (exit "$ac_status"); } &&
11298          { ac_try='test -s "conftest.$ac_objext"'
11299   { (eval echo "$as_me:11299: \"$ac_try\"") >&5
11300   (eval $ac_try) 2>&5
11301   ac_status=$?
11302   echo "$as_me:11302: \$? = $ac_status" >&5
11303   (exit "$ac_status"); }; }; then
11304   :
11305 else
11306   echo "$as_me: failed program was:" >&5
11307 cat "conftest.$ac_ext" >&5
11308 cf_have_incdir=yes
11309 fi
11310 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11311                           CPPFLAGS=$cf_save_CPPFLAGS
11312                         fi
11313                   fi
11314                 fi
11315
11316                 if test "$cf_have_incdir" = no ; then
11317                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11318
11319 echo "${as_me:-configure}:11319: testing adding $cf_add_incdir to include-path ..." 1>&5
11320
11321                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11322
11323                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11324                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11325                   cf_add_incdir="$cf_top_incdir"
11326                 else
11327                   break
11328                 fi
11329           else
11330                 break
11331           fi
11332         done
11333   done
11334 fi
11335
11336 fi
11337
11338 # Set definitions to allow ifdef'ing for ncurses.h
11339
11340 case "$cf_cv_ncurses_header" in
11341 (*ncurses.h)
11342
11343 cat >>confdefs.h <<\EOF
11344 #define HAVE_NCURSES_H 1
11345 EOF
11346
11347         ;;
11348 esac
11349
11350 case "$cf_cv_ncurses_header" in
11351 (ncurses/curses.h|ncurses/ncurses.h)
11352
11353 cat >>confdefs.h <<\EOF
11354 #define HAVE_NCURSES_NCURSES_H 1
11355 EOF
11356
11357         ;;
11358 (ncursesw/curses.h|ncursesw/ncurses.h)
11359
11360 cat >>confdefs.h <<\EOF
11361 #define HAVE_NCURSESW_NCURSES_H 1
11362 EOF
11363
11364         ;;
11365 esac
11366
11367 echo "$as_me:11367: checking for terminfo header" >&5
11368 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11369 if test "${cf_cv_term_header+set}" = set; then
11370   echo $ECHO_N "(cached) $ECHO_C" >&6
11371 else
11372
11373 case "${cf_cv_ncurses_header}" in
11374 (*/ncurses.h|*/ncursesw.h)
11375         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11376         ;;
11377 (*)
11378         cf_term_header=term.h
11379         ;;
11380 esac
11381
11382 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11383 do
11384 cat >"conftest.$ac_ext" <<_ACEOF
11385 #line 11385 "configure"
11386 #include "confdefs.h"
11387 #include <stdio.h>
11388 #include <${cf_cv_ncurses_header:-curses.h}>
11389 #include <$cf_test>
11390
11391 int
11392 main (void)
11393 {
11394 int x = auto_left_margin; (void)x
11395   ;
11396   return 0;
11397 }
11398 _ACEOF
11399 rm -f "conftest.$ac_objext"
11400 if { (eval echo "$as_me:11400: \"$ac_compile\"") >&5
11401   (eval $ac_compile) 2>&5
11402   ac_status=$?
11403   echo "$as_me:11403: \$? = $ac_status" >&5
11404   (exit "$ac_status"); } &&
11405          { ac_try='test -s "conftest.$ac_objext"'
11406   { (eval echo "$as_me:11406: \"$ac_try\"") >&5
11407   (eval $ac_try) 2>&5
11408   ac_status=$?
11409   echo "$as_me:11409: \$? = $ac_status" >&5
11410   (exit "$ac_status"); }; }; then
11411
11412         cf_cv_term_header="$cf_test"
11413 else
11414   echo "$as_me: failed program was:" >&5
11415 cat "conftest.$ac_ext" >&5
11416
11417         cf_cv_term_header=unknown
11418
11419 fi
11420 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11421         test "$cf_cv_term_header" != unknown && break
11422 done
11423
11424 fi
11425 echo "$as_me:11425: result: $cf_cv_term_header" >&5
11426 echo "${ECHO_T}$cf_cv_term_header" >&6
11427
11428 # Set definitions to allow ifdef'ing to accommodate subdirectories
11429
11430 case "$cf_cv_term_header" in
11431 (*term.h)
11432
11433 cat >>confdefs.h <<\EOF
11434 #define HAVE_TERM_H 1
11435 EOF
11436
11437         ;;
11438 esac
11439
11440 case "$cf_cv_term_header" in
11441 (ncurses/term.h)
11442
11443 cat >>confdefs.h <<\EOF
11444 #define HAVE_NCURSES_TERM_H 1
11445 EOF
11446
11447         ;;
11448 (ncursesw/term.h)
11449
11450 cat >>confdefs.h <<\EOF
11451 #define HAVE_NCURSESW_TERM_H 1
11452 EOF
11453
11454         ;;
11455 esac
11456
11457 # some applications need this, but should check for NCURSES_VERSION
11458
11459 cat >>confdefs.h <<\EOF
11460 #define NCURSES 1
11461 EOF
11462
11463 echo "$as_me:11463: checking for ncurses version" >&5
11464 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11465 if test "${cf_cv_ncurses_version+set}" = set; then
11466   echo $ECHO_N "(cached) $ECHO_C" >&6
11467 else
11468
11469         cf_cv_ncurses_version=no
11470         cf_tempfile=out$$
11471         rm -f "$cf_tempfile"
11472         if test "$cross_compiling" = yes; then
11473
11474         # This will not work if the preprocessor splits the line after the
11475         # Autoconf token.  The 'unproto' program does that.
11476         cat > "conftest.$ac_ext" <<EOF
11477 #include <${cf_cv_ncurses_header:-curses.h}>
11478 #undef Autoconf
11479 #ifdef NCURSES_VERSION
11480 Autoconf NCURSES_VERSION
11481 #else
11482 #ifdef __NCURSES_H
11483 Autoconf "old"
11484 #endif
11485 ;
11486 #endif
11487 EOF
11488         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11489         { (eval echo "$as_me:11489: \"$cf_try\"") >&5
11490   (eval $cf_try) 2>&5
11491   ac_status=$?
11492   echo "$as_me:11492: \$? = $ac_status" >&5
11493   (exit "$ac_status"); }
11494         if test -f conftest.out ; then
11495                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11496                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11497                 rm -f conftest.out
11498         fi
11499
11500 else
11501   cat >"conftest.$ac_ext" <<_ACEOF
11502 #line 11502 "configure"
11503 #include "confdefs.h"
11504
11505 #include <${cf_cv_ncurses_header:-curses.h}>
11506 #include <stdio.h>
11507 int main(void)
11508 {
11509         FILE *fp = fopen("$cf_tempfile", "w");
11510 #ifdef NCURSES_VERSION
11511 # ifdef NCURSES_VERSION_PATCH
11512         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11513 # else
11514         fprintf(fp, "%s\\n", NCURSES_VERSION);
11515 # endif
11516 #else
11517 # ifdef __NCURSES_H
11518         fprintf(fp, "old\\n");
11519 # else
11520         make an error
11521 # endif
11522 #endif
11523         ${cf_cv_main_return:-return}(0);
11524 }
11525 _ACEOF
11526 rm -f "conftest$ac_exeext"
11527 if { (eval echo "$as_me:11527: \"$ac_link\"") >&5
11528   (eval $ac_link) 2>&5
11529   ac_status=$?
11530   echo "$as_me:11530: \$? = $ac_status" >&5
11531   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11532   { (eval echo "$as_me:11532: \"$ac_try\"") >&5
11533   (eval $ac_try) 2>&5
11534   ac_status=$?
11535   echo "$as_me:11535: \$? = $ac_status" >&5
11536   (exit "$ac_status"); }; }; then
11537
11538         cf_cv_ncurses_version=`cat $cf_tempfile`
11539 else
11540   echo "$as_me: program exited with status $ac_status" >&5
11541 echo "$as_me: failed program was:" >&5
11542 cat "conftest.$ac_ext" >&5
11543 fi
11544 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11545 fi
11546         rm -f "$cf_tempfile"
11547
11548 fi
11549 echo "$as_me:11549: result: $cf_cv_ncurses_version" >&5
11550 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11551 test "$cf_cv_ncurses_version" = no ||
11552 cat >>confdefs.h <<\EOF
11553 #define NCURSES 1
11554 EOF
11555
11556 cf_nculib_root=$cf_cv_screen
11557         # This works, except for the special case where we find gpm, but
11558         # ncurses is in a nonstandard location via $LIBS, and we really want
11559         # to link gpm.
11560 cf_ncurses_LIBS=""
11561 cf_ncurses_SAVE="$LIBS"
11562 echo "$as_me:11562: checking for Gpm_Open in -lgpm" >&5
11563 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11564 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11565   echo $ECHO_N "(cached) $ECHO_C" >&6
11566 else
11567   ac_check_lib_save_LIBS=$LIBS
11568 LIBS="-lgpm  $LIBS"
11569 cat >"conftest.$ac_ext" <<_ACEOF
11570 #line 11570 "configure"
11571 #include "confdefs.h"
11572
11573 /* Override any gcc2 internal prototype to avoid an error.  */
11574 #ifdef __cplusplus
11575 extern "C"
11576 #endif
11577 /* We use char because int might match the return type of a gcc2
11578    builtin and then its argument prototype would still apply.  */
11579 char Gpm_Open ();
11580 int
11581 main (void)
11582 {
11583 Gpm_Open ();
11584   ;
11585   return 0;
11586 }
11587 _ACEOF
11588 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11589 if { (eval echo "$as_me:11589: \"$ac_link\"") >&5
11590   (eval $ac_link) 2>&5
11591   ac_status=$?
11592   echo "$as_me:11592: \$? = $ac_status" >&5
11593   (exit "$ac_status"); } &&
11594          { ac_try='test -s "conftest$ac_exeext"'
11595   { (eval echo "$as_me:11595: \"$ac_try\"") >&5
11596   (eval $ac_try) 2>&5
11597   ac_status=$?
11598   echo "$as_me:11598: \$? = $ac_status" >&5
11599   (exit "$ac_status"); }; }; then
11600   ac_cv_lib_gpm_Gpm_Open=yes
11601 else
11602   echo "$as_me: failed program was:" >&5
11603 cat "conftest.$ac_ext" >&5
11604 ac_cv_lib_gpm_Gpm_Open=no
11605 fi
11606 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11607 LIBS=$ac_check_lib_save_LIBS
11608 fi
11609 echo "$as_me:11609: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11610 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11611 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11612   echo "$as_me:11612: checking for initscr in -lgpm" >&5
11613 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11614 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11615   echo $ECHO_N "(cached) $ECHO_C" >&6
11616 else
11617   ac_check_lib_save_LIBS=$LIBS
11618 LIBS="-lgpm  $LIBS"
11619 cat >"conftest.$ac_ext" <<_ACEOF
11620 #line 11620 "configure"
11621 #include "confdefs.h"
11622
11623 /* Override any gcc2 internal prototype to avoid an error.  */
11624 #ifdef __cplusplus
11625 extern "C"
11626 #endif
11627 /* We use char because int might match the return type of a gcc2
11628    builtin and then its argument prototype would still apply.  */
11629 char initscr ();
11630 int
11631 main (void)
11632 {
11633 initscr ();
11634   ;
11635   return 0;
11636 }
11637 _ACEOF
11638 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11639 if { (eval echo "$as_me:11639: \"$ac_link\"") >&5
11640   (eval $ac_link) 2>&5
11641   ac_status=$?
11642   echo "$as_me:11642: \$? = $ac_status" >&5
11643   (exit "$ac_status"); } &&
11644          { ac_try='test -s "conftest$ac_exeext"'
11645   { (eval echo "$as_me:11645: \"$ac_try\"") >&5
11646   (eval $ac_try) 2>&5
11647   ac_status=$?
11648   echo "$as_me:11648: \$? = $ac_status" >&5
11649   (exit "$ac_status"); }; }; then
11650   ac_cv_lib_gpm_initscr=yes
11651 else
11652   echo "$as_me: failed program was:" >&5
11653 cat "conftest.$ac_ext" >&5
11654 ac_cv_lib_gpm_initscr=no
11655 fi
11656 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11657 LIBS=$ac_check_lib_save_LIBS
11658 fi
11659 echo "$as_me:11659: result: $ac_cv_lib_gpm_initscr" >&5
11660 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11661 if test "$ac_cv_lib_gpm_initscr" = yes; then
11662   LIBS="$cf_ncurses_SAVE"
11663 else
11664   cf_ncurses_LIBS="-lgpm"
11665 fi
11666
11667 fi
11668
11669 case "$host_os" in
11670 (freebsd*)
11671         # This is only necessary if you are linking against an obsolete
11672         # version of ncurses (but it should do no harm, since it's static).
11673         if test "$cf_nculib_root" = ncurses ; then
11674                 echo "$as_me:11674: checking for tgoto in -lmytinfo" >&5
11675 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11676 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11677   echo $ECHO_N "(cached) $ECHO_C" >&6
11678 else
11679   ac_check_lib_save_LIBS=$LIBS
11680 LIBS="-lmytinfo  $LIBS"
11681 cat >"conftest.$ac_ext" <<_ACEOF
11682 #line 11682 "configure"
11683 #include "confdefs.h"
11684
11685 /* Override any gcc2 internal prototype to avoid an error.  */
11686 #ifdef __cplusplus
11687 extern "C"
11688 #endif
11689 /* We use char because int might match the return type of a gcc2
11690    builtin and then its argument prototype would still apply.  */
11691 char tgoto ();
11692 int
11693 main (void)
11694 {
11695 tgoto ();
11696   ;
11697   return 0;
11698 }
11699 _ACEOF
11700 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11701 if { (eval echo "$as_me:11701: \"$ac_link\"") >&5
11702   (eval $ac_link) 2>&5
11703   ac_status=$?
11704   echo "$as_me:11704: \$? = $ac_status" >&5
11705   (exit "$ac_status"); } &&
11706          { ac_try='test -s "conftest$ac_exeext"'
11707   { (eval echo "$as_me:11707: \"$ac_try\"") >&5
11708   (eval $ac_try) 2>&5
11709   ac_status=$?
11710   echo "$as_me:11710: \$? = $ac_status" >&5
11711   (exit "$ac_status"); }; }; then
11712   ac_cv_lib_mytinfo_tgoto=yes
11713 else
11714   echo "$as_me: failed program was:" >&5
11715 cat "conftest.$ac_ext" >&5
11716 ac_cv_lib_mytinfo_tgoto=no
11717 fi
11718 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11719 LIBS=$ac_check_lib_save_LIBS
11720 fi
11721 echo "$as_me:11721: result: $ac_cv_lib_mytinfo_tgoto" >&5
11722 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11723 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11724   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11725 fi
11726
11727         fi
11728         ;;
11729 esac
11730
11731 cf_add_libs="$LIBS"
11732 # reverse order
11733 cf_add_0lib=
11734 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11735 # filter duplicates
11736 for cf_add_1lib in $cf_add_0lib; do
11737         for cf_add_2lib in $cf_add_libs; do
11738                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11739                         cf_add_1lib=
11740                         break
11741                 fi
11742         done
11743         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11744 done
11745 LIBS="$cf_add_libs"
11746
11747 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11748 then
11749
11750 cf_add_libs="$LIBS"
11751 # reverse order
11752 cf_add_0lib=
11753 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11754 # filter duplicates
11755 for cf_add_1lib in $cf_add_0lib; do
11756         for cf_add_2lib in $cf_add_libs; do
11757                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11758                         cf_add_1lib=
11759                         break
11760                 fi
11761         done
11762         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11763 done
11764 LIBS="$cf_add_libs"
11765
11766 else
11767
11768         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11769         cf_libdir=""
11770         echo "$as_me:11770: checking for initscr" >&5
11771 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11772 if test "${ac_cv_func_initscr+set}" = set; then
11773   echo $ECHO_N "(cached) $ECHO_C" >&6
11774 else
11775   cat >"conftest.$ac_ext" <<_ACEOF
11776 #line 11776 "configure"
11777 #include "confdefs.h"
11778 #define initscr autoconf_temporary
11779 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11780 #undef initscr
11781
11782 #ifdef __cplusplus
11783 extern "C"
11784 #endif
11785
11786 /* We use char because int might match the return type of a gcc2
11787    builtin and then its argument prototype would still apply.  */
11788 char initscr (void);
11789
11790 int
11791 main (void)
11792 {
11793
11794 /* The GNU C library defines stubs for functions which it implements
11795     to always fail with ENOSYS.  Some functions are actually named
11796     something starting with __ and the normal name is an alias.  */
11797 #if defined (__stub_initscr) || defined (__stub___initscr)
11798 #error found stub for initscr
11799 #endif
11800
11801         return initscr ();
11802   ;
11803   return 0;
11804 }
11805 _ACEOF
11806 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11807 if { (eval echo "$as_me:11807: \"$ac_link\"") >&5
11808   (eval $ac_link) 2>&5
11809   ac_status=$?
11810   echo "$as_me:11810: \$? = $ac_status" >&5
11811   (exit "$ac_status"); } &&
11812          { ac_try='test -s "conftest$ac_exeext"'
11813   { (eval echo "$as_me:11813: \"$ac_try\"") >&5
11814   (eval $ac_try) 2>&5
11815   ac_status=$?
11816   echo "$as_me:11816: \$? = $ac_status" >&5
11817   (exit "$ac_status"); }; }; then
11818   ac_cv_func_initscr=yes
11819 else
11820   echo "$as_me: failed program was:" >&5
11821 cat "conftest.$ac_ext" >&5
11822 ac_cv_func_initscr=no
11823 fi
11824 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11825 fi
11826 echo "$as_me:11826: result: $ac_cv_func_initscr" >&5
11827 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11828 if test "$ac_cv_func_initscr" = yes; then
11829   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11830 else
11831
11832                 cf_save_LIBS="$LIBS"
11833                 echo "$as_me:11833: checking for initscr in -l$cf_nculib_root" >&5
11834 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11835                 LIBS="-l$cf_nculib_root $LIBS"
11836                 cat >"conftest.$ac_ext" <<_ACEOF
11837 #line 11837 "configure"
11838 #include "confdefs.h"
11839 #include <${cf_cv_ncurses_header:-curses.h}>
11840 int
11841 main (void)
11842 {
11843 initscr()
11844   ;
11845   return 0;
11846 }
11847 _ACEOF
11848 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11849 if { (eval echo "$as_me:11849: \"$ac_link\"") >&5
11850   (eval $ac_link) 2>&5
11851   ac_status=$?
11852   echo "$as_me:11852: \$? = $ac_status" >&5
11853   (exit "$ac_status"); } &&
11854          { ac_try='test -s "conftest$ac_exeext"'
11855   { (eval echo "$as_me:11855: \"$ac_try\"") >&5
11856   (eval $ac_try) 2>&5
11857   ac_status=$?
11858   echo "$as_me:11858: \$? = $ac_status" >&5
11859   (exit "$ac_status"); }; }; then
11860   echo "$as_me:11860: result: yes" >&5
11861 echo "${ECHO_T}yes" >&6
11862                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11863
11864 else
11865   echo "$as_me: failed program was:" >&5
11866 cat "conftest.$ac_ext" >&5
11867 echo "$as_me:11867: result: no" >&5
11868 echo "${ECHO_T}no" >&6
11869
11870 cf_search=
11871 cf_library_path_list=""
11872 if test -n "${LDFLAGS}${LIBS}" ; then
11873         for cf_library_path in $LDFLAGS $LIBS
11874         do
11875                 case "$cf_library_path" in
11876                 (-L*)
11877                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11878
11879 test "x$cf_library_path" != "xNONE" && \
11880 test -d "$cf_library_path" && \
11881  {
11882         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11883         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11884         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11885         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11886         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11887         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"
11888 }
11889
11890                         cf_library_path_list="$cf_library_path_list $cf_search"
11891                         ;;
11892                 esac
11893         done
11894 fi
11895
11896 cf_search=
11897
11898 test "x$prefix" != "xNONE" && \
11899 test -d "$prefix" && \
11900  {
11901         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11902         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11903         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11904         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11905         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11906         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11907 }
11908
11909 for cf_subdir_prefix in \
11910         /usr \
11911         /usr/local \
11912         /usr/pkg \
11913         /opt \
11914         /opt/local \
11915         $HOME
11916 do
11917
11918 test "x$cf_subdir_prefix" != "x$prefix" && \
11919 test -d "$cf_subdir_prefix" && \
11920 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11921         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11922         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11923         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11924         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11925         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11926         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"
11927 }
11928
11929 done
11930
11931 cf_search="$cf_library_path_list $cf_search"
11932
11933                         for cf_libdir in $cf_search
11934                         do
11935                                 echo "$as_me:11935: checking for -l$cf_nculib_root in $cf_libdir" >&5
11936 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11937                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11938                                 cat >"conftest.$ac_ext" <<_ACEOF
11939 #line 11939 "configure"
11940 #include "confdefs.h"
11941 #include <${cf_cv_ncurses_header:-curses.h}>
11942 int
11943 main (void)
11944 {
11945 initscr()
11946   ;
11947   return 0;
11948 }
11949 _ACEOF
11950 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11951 if { (eval echo "$as_me:11951: \"$ac_link\"") >&5
11952   (eval $ac_link) 2>&5
11953   ac_status=$?
11954   echo "$as_me:11954: \$? = $ac_status" >&5
11955   (exit "$ac_status"); } &&
11956          { ac_try='test -s "conftest$ac_exeext"'
11957   { (eval echo "$as_me:11957: \"$ac_try\"") >&5
11958   (eval $ac_try) 2>&5
11959   ac_status=$?
11960   echo "$as_me:11960: \$? = $ac_status" >&5
11961   (exit "$ac_status"); }; }; then
11962   echo "$as_me:11962: result: yes" >&5
11963 echo "${ECHO_T}yes" >&6
11964                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11965                                          break
11966 else
11967   echo "$as_me: failed program was:" >&5
11968 cat "conftest.$ac_ext" >&5
11969 echo "$as_me:11969: result: no" >&5
11970 echo "${ECHO_T}no" >&6
11971                                          LIBS="$cf_save_LIBS"
11972 fi
11973 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11974                         done
11975
11976 fi
11977 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11978
11979 fi
11980
11981 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11982
11983 if test "$cf_found_library" = no ; then
11984         { { echo "$as_me:11984: error: Cannot link $cf_nculib_root library" >&5
11985 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11986    { (exit 1); exit 1; }; }
11987 fi
11988
11989 fi
11990
11991 if test -n "$cf_ncurses_LIBS" ; then
11992         echo "$as_me:11992: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11993 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11994         cf_ncurses_SAVE="$LIBS"
11995         for p in $cf_ncurses_LIBS ; do
11996                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11997                 if test "$q" != "$LIBS" ; then
11998                         LIBS="$q"
11999                 fi
12000         done
12001         cat >"conftest.$ac_ext" <<_ACEOF
12002 #line 12002 "configure"
12003 #include "confdefs.h"
12004 #include <${cf_cv_ncurses_header:-curses.h}>
12005 int
12006 main (void)
12007 {
12008 initscr(); mousemask(0,0); tigetstr((char *)0);
12009   ;
12010   return 0;
12011 }
12012 _ACEOF
12013 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12014 if { (eval echo "$as_me:12014: \"$ac_link\"") >&5
12015   (eval $ac_link) 2>&5
12016   ac_status=$?
12017   echo "$as_me:12017: \$? = $ac_status" >&5
12018   (exit "$ac_status"); } &&
12019          { ac_try='test -s "conftest$ac_exeext"'
12020   { (eval echo "$as_me:12020: \"$ac_try\"") >&5
12021   (eval $ac_try) 2>&5
12022   ac_status=$?
12023   echo "$as_me:12023: \$? = $ac_status" >&5
12024   (exit "$ac_status"); }; }; then
12025   echo "$as_me:12025: result: yes" >&5
12026 echo "${ECHO_T}yes" >&6
12027 else
12028   echo "$as_me: failed program was:" >&5
12029 cat "conftest.$ac_ext" >&5
12030 echo "$as_me:12030: result: no" >&5
12031 echo "${ECHO_T}no" >&6
12032                  LIBS="$cf_ncurses_SAVE"
12033 fi
12034 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12035 fi
12036
12037 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12038
12039 cat >>confdefs.h <<EOF
12040 #define $cf_nculib_ROOT 1
12041 EOF
12042
12043         fi
12044 else
12045         NCURSES_CONFIG=none
12046 fi
12047
12048         ;;
12049 (pdcurses)
12050         echo "$as_me:12050: checking for X" >&5
12051 echo $ECHO_N "checking for X... $ECHO_C" >&6
12052
12053 # Check whether --with-x or --without-x was given.
12054 if test "${with_x+set}" = set; then
12055   withval="$with_x"
12056
12057 fi;
12058 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12059 if test "x$with_x" = xno; then
12060   # The user explicitly disabled X.
12061   have_x=disabled
12062 else
12063   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12064     # Both variables are already set.
12065     have_x=yes
12066   else
12067     if test "${ac_cv_have_x+set}" = set; then
12068   echo $ECHO_N "(cached) $ECHO_C" >&6
12069 else
12070   # One or both of the vars are not set, and there is no cached value.
12071 ac_x_includes=no ac_x_libraries=no
12072 rm -fr conftest.dir
12073 if mkdir conftest.dir; then
12074   cd conftest.dir
12075   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12076   cat >Imakefile <<'EOF'
12077 acfindx:
12078         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12079 EOF
12080   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12081     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12082     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12083     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12084     for ac_extension in a so sl dylib dll; do
12085       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12086          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12087         ac_im_usrlibdir=$ac_im_libdir; break
12088       fi
12089     done
12090     # Screen out bogus values from the imake configuration.  They are
12091     # bogus both because they are the default anyway, and because
12092     # using them would break gcc on systems where it needs fixed includes.
12093     case $ac_im_incroot in
12094         /usr/include) ;;
12095         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12096     esac
12097     case $ac_im_usrlibdir in
12098         /usr/lib | /lib) ;;
12099         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12100     esac
12101   fi
12102   cd ..
12103   rm -fr conftest.dir
12104 fi
12105
12106 # Standard set of common directories for X headers.
12107 # Check X11 before X11Rn because it is often a symlink to the current release.
12108 ac_x_header_dirs='
12109 /usr/X11/include
12110 /usr/X11R7/include
12111 /usr/X11R6/include
12112 /usr/X11R5/include
12113 /usr/X11R4/include
12114
12115 /opt/local/include
12116 /opt/X11/include
12117
12118 /usr/include/X11
12119 /usr/include/X11R7
12120 /usr/include/X11R6
12121 /usr/include/X11R5
12122 /usr/include/X11R4
12123
12124 /usr/local/X11/include
12125 /usr/local/X11R7/include
12126 /usr/local/X11R6/include
12127 /usr/local/X11R5/include
12128 /usr/local/X11R4/include
12129
12130 /usr/local/include/X11
12131 /usr/local/include/X11R7
12132 /usr/local/include/X11R6
12133 /usr/local/include/X11R5
12134 /usr/local/include/X11R4
12135
12136 /usr/X386/include
12137 /usr/x386/include
12138 /usr/XFree86/include/X11
12139
12140 /usr/include
12141 /usr/local/include
12142 /usr/unsupported/include
12143 /usr/athena/include
12144 /usr/local/x11r5/include
12145 /usr/lpp/Xamples/include
12146
12147 /usr/openwin/include
12148 /usr/openwin/share/include'
12149
12150 if test "$ac_x_includes" = no; then
12151   # Guess where to find include files, by looking for Intrinsic.h.
12152   # First, try using that file with no special directory specified.
12153   cat >"conftest.$ac_ext" <<_ACEOF
12154 #line 12154 "configure"
12155 #include "confdefs.h"
12156 #include <X11/Intrinsic.h>
12157 _ACEOF
12158 if { (eval echo "$as_me:12158: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12159   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12160   ac_status=$?
12161   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12162   rm -f conftest.er1
12163   cat conftest.err >&5
12164   echo "$as_me:12164: \$? = $ac_status" >&5
12165   (exit "$ac_status"); } >/dev/null; then
12166   if test -s conftest.err; then
12167     ac_cpp_err=$ac_c_preproc_warn_flag
12168   else
12169     ac_cpp_err=
12170   fi
12171 else
12172   ac_cpp_err=yes
12173 fi
12174 if test -z "$ac_cpp_err"; then
12175   # We can compile using X headers with no special include directory.
12176 ac_x_includes=
12177 else
12178   echo "$as_me: failed program was:" >&5
12179   cat "conftest.$ac_ext" >&5
12180   for ac_dir in $ac_x_header_dirs; do
12181   if test -r "$ac_dir/X11/Intrinsic.h"; then
12182     ac_x_includes=$ac_dir
12183     break
12184   fi
12185 done
12186 fi
12187 rm -f conftest.err "conftest.$ac_ext"
12188 fi # $ac_x_includes = no
12189
12190 if test "$ac_x_libraries" = no; then
12191   # Check for the libraries.
12192   # See if we find them without any special options.
12193   # Don't add to $LIBS permanently.
12194   ac_save_LIBS=$LIBS
12195   LIBS="-lXt $LIBS"
12196   cat >"conftest.$ac_ext" <<_ACEOF
12197 #line 12197 "configure"
12198 #include "confdefs.h"
12199 #include <X11/Intrinsic.h>
12200 int
12201 main (void)
12202 {
12203 XtMalloc (0)
12204   ;
12205   return 0;
12206 }
12207 _ACEOF
12208 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12209 if { (eval echo "$as_me:12209: \"$ac_link\"") >&5
12210   (eval $ac_link) 2>&5
12211   ac_status=$?
12212   echo "$as_me:12212: \$? = $ac_status" >&5
12213   (exit "$ac_status"); } &&
12214          { ac_try='test -s "conftest$ac_exeext"'
12215   { (eval echo "$as_me:12215: \"$ac_try\"") >&5
12216   (eval $ac_try) 2>&5
12217   ac_status=$?
12218   echo "$as_me:12218: \$? = $ac_status" >&5
12219   (exit "$ac_status"); }; }; then
12220   LIBS=$ac_save_LIBS
12221 # We can link X programs with no special library path.
12222 ac_x_libraries=
12223 else
12224   echo "$as_me: failed program was:" >&5
12225 cat "conftest.$ac_ext" >&5
12226 LIBS=$ac_save_LIBS
12227 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12228 do
12229   # Don't even attempt the hair of trying to link an X program!
12230   for ac_extension in a so sl dylib dll; do
12231     if test -r "$ac_dir/libXt.$ac_extension"; then
12232       ac_x_libraries=$ac_dir
12233       break 2
12234     fi
12235   done
12236 done
12237 fi
12238 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12239 fi # $ac_x_libraries = no
12240
12241 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12242   # Didn't find X anywhere.  Cache the known absence of X.
12243   ac_cv_have_x="have_x=no"
12244 else
12245   # Record where we found X for the cache.
12246   ac_cv_have_x="have_x=yes \
12247                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12248 fi
12249 fi
12250
12251   fi
12252   eval "$ac_cv_have_x"
12253 fi # $with_x != no
12254
12255 if test "$have_x" != yes; then
12256   echo "$as_me:12256: result: $have_x" >&5
12257 echo "${ECHO_T}$have_x" >&6
12258   no_x=yes
12259 else
12260   # If each of the values was on the command line, it overrides each guess.
12261   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12262   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12263   # Update the cache value to reflect the command line values.
12264   ac_cv_have_x="have_x=yes \
12265                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12266   echo "$as_me:12266: result: libraries $x_libraries, headers $x_includes" >&5
12267 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12268 fi
12269
12270 if test "$no_x" = yes; then
12271   # Not all programs may use this symbol, but it does not hurt to define it.
12272
12273 cat >>confdefs.h <<\EOF
12274 #define X_DISPLAY_MISSING 1
12275 EOF
12276
12277   X_CFLAGS=
12278   X_PRE_LIBS=
12279   X_LIBS=
12280   X_EXTRA_LIBS=
12281 else
12282   if test -n "$x_includes"; then
12283     X_CFLAGS="$X_CFLAGS -I$x_includes"
12284   fi
12285
12286   # It would also be nice to do this for all -L options, not just this one.
12287   if test -n "$x_libraries"; then
12288     X_LIBS="$X_LIBS -L$x_libraries"
12289     # For Solaris; some versions of Sun CC require a space after -R and
12290     # others require no space.  Words are not sufficient . . . .
12291     case `(uname -sr) 2>/dev/null` in
12292     "SunOS 5"*)
12293       echo "$as_me:12293: checking whether -R must be followed by a space" >&5
12294 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12295       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12296       cat >"conftest.$ac_ext" <<_ACEOF
12297 #line 12297 "configure"
12298 #include "confdefs.h"
12299
12300 int
12301 main (void)
12302 {
12303
12304   ;
12305   return 0;
12306 }
12307 _ACEOF
12308 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12309 if { (eval echo "$as_me:12309: \"$ac_link\"") >&5
12310   (eval $ac_link) 2>&5
12311   ac_status=$?
12312   echo "$as_me:12312: \$? = $ac_status" >&5
12313   (exit "$ac_status"); } &&
12314          { ac_try='test -s "conftest$ac_exeext"'
12315   { (eval echo "$as_me:12315: \"$ac_try\"") >&5
12316   (eval $ac_try) 2>&5
12317   ac_status=$?
12318   echo "$as_me:12318: \$? = $ac_status" >&5
12319   (exit "$ac_status"); }; }; then
12320   ac_R_nospace=yes
12321 else
12322   echo "$as_me: failed program was:" >&5
12323 cat "conftest.$ac_ext" >&5
12324 ac_R_nospace=no
12325 fi
12326 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12327       if test $ac_R_nospace = yes; then
12328         echo "$as_me:12328: result: no" >&5
12329 echo "${ECHO_T}no" >&6
12330         X_LIBS="$X_LIBS -R$x_libraries"
12331       else
12332         LIBS="$ac_xsave_LIBS -R $x_libraries"
12333         cat >"conftest.$ac_ext" <<_ACEOF
12334 #line 12334 "configure"
12335 #include "confdefs.h"
12336
12337 int
12338 main (void)
12339 {
12340
12341   ;
12342   return 0;
12343 }
12344 _ACEOF
12345 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12346 if { (eval echo "$as_me:12346: \"$ac_link\"") >&5
12347   (eval $ac_link) 2>&5
12348   ac_status=$?
12349   echo "$as_me:12349: \$? = $ac_status" >&5
12350   (exit "$ac_status"); } &&
12351          { ac_try='test -s "conftest$ac_exeext"'
12352   { (eval echo "$as_me:12352: \"$ac_try\"") >&5
12353   (eval $ac_try) 2>&5
12354   ac_status=$?
12355   echo "$as_me:12355: \$? = $ac_status" >&5
12356   (exit "$ac_status"); }; }; then
12357   ac_R_space=yes
12358 else
12359   echo "$as_me: failed program was:" >&5
12360 cat "conftest.$ac_ext" >&5
12361 ac_R_space=no
12362 fi
12363 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12364         if test $ac_R_space = yes; then
12365           echo "$as_me:12365: result: yes" >&5
12366 echo "${ECHO_T}yes" >&6
12367           X_LIBS="$X_LIBS -R $x_libraries"
12368         else
12369           echo "$as_me:12369: result: neither works" >&5
12370 echo "${ECHO_T}neither works" >&6
12371         fi
12372       fi
12373       LIBS=$ac_xsave_LIBS
12374     esac
12375   fi
12376
12377   # Check for system-dependent libraries X programs must link with.
12378   # Do this before checking for the system-independent R6 libraries
12379   # (-lICE), since we may need -lsocket or whatever for X linking.
12380
12381   if test "$ISC" = yes; then
12382     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12383   else
12384     # Martyn Johnson says this is needed for Ultrix, if the X
12385     # libraries were built with DECnet support.  And Karl Berry says
12386     # the Alpha needs dnet_stub (dnet does not exist).
12387     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12388     cat >"conftest.$ac_ext" <<_ACEOF
12389 #line 12389 "configure"
12390 #include "confdefs.h"
12391
12392 /* Override any gcc2 internal prototype to avoid an error.  */
12393 #ifdef __cplusplus
12394 extern "C"
12395 #endif
12396 /* We use char because int might match the return type of a gcc2
12397    builtin and then its argument prototype would still apply.  */
12398 char XOpenDisplay ();
12399 int
12400 main (void)
12401 {
12402 XOpenDisplay ();
12403   ;
12404   return 0;
12405 }
12406 _ACEOF
12407 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12408 if { (eval echo "$as_me:12408: \"$ac_link\"") >&5
12409   (eval $ac_link) 2>&5
12410   ac_status=$?
12411   echo "$as_me:12411: \$? = $ac_status" >&5
12412   (exit "$ac_status"); } &&
12413          { ac_try='test -s "conftest$ac_exeext"'
12414   { (eval echo "$as_me:12414: \"$ac_try\"") >&5
12415   (eval $ac_try) 2>&5
12416   ac_status=$?
12417   echo "$as_me:12417: \$? = $ac_status" >&5
12418   (exit "$ac_status"); }; }; then
12419   :
12420 else
12421   echo "$as_me: failed program was:" >&5
12422 cat "conftest.$ac_ext" >&5
12423 echo "$as_me:12423: checking for dnet_ntoa in -ldnet" >&5
12424 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12425 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12426   echo $ECHO_N "(cached) $ECHO_C" >&6
12427 else
12428   ac_check_lib_save_LIBS=$LIBS
12429 LIBS="-ldnet  $LIBS"
12430 cat >"conftest.$ac_ext" <<_ACEOF
12431 #line 12431 "configure"
12432 #include "confdefs.h"
12433
12434 /* Override any gcc2 internal prototype to avoid an error.  */
12435 #ifdef __cplusplus
12436 extern "C"
12437 #endif
12438 /* We use char because int might match the return type of a gcc2
12439    builtin and then its argument prototype would still apply.  */
12440 char dnet_ntoa ();
12441 int
12442 main (void)
12443 {
12444 dnet_ntoa ();
12445   ;
12446   return 0;
12447 }
12448 _ACEOF
12449 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12450 if { (eval echo "$as_me:12450: \"$ac_link\"") >&5
12451   (eval $ac_link) 2>&5
12452   ac_status=$?
12453   echo "$as_me:12453: \$? = $ac_status" >&5
12454   (exit "$ac_status"); } &&
12455          { ac_try='test -s "conftest$ac_exeext"'
12456   { (eval echo "$as_me:12456: \"$ac_try\"") >&5
12457   (eval $ac_try) 2>&5
12458   ac_status=$?
12459   echo "$as_me:12459: \$? = $ac_status" >&5
12460   (exit "$ac_status"); }; }; then
12461   ac_cv_lib_dnet_dnet_ntoa=yes
12462 else
12463   echo "$as_me: failed program was:" >&5
12464 cat "conftest.$ac_ext" >&5
12465 ac_cv_lib_dnet_dnet_ntoa=no
12466 fi
12467 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12468 LIBS=$ac_check_lib_save_LIBS
12469 fi
12470 echo "$as_me:12470: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12471 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12472 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12473   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12474 fi
12475
12476     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12477       echo "$as_me:12477: checking for dnet_ntoa in -ldnet_stub" >&5
12478 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12479 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12480   echo $ECHO_N "(cached) $ECHO_C" >&6
12481 else
12482   ac_check_lib_save_LIBS=$LIBS
12483 LIBS="-ldnet_stub  $LIBS"
12484 cat >"conftest.$ac_ext" <<_ACEOF
12485 #line 12485 "configure"
12486 #include "confdefs.h"
12487
12488 /* Override any gcc2 internal prototype to avoid an error.  */
12489 #ifdef __cplusplus
12490 extern "C"
12491 #endif
12492 /* We use char because int might match the return type of a gcc2
12493    builtin and then its argument prototype would still apply.  */
12494 char dnet_ntoa ();
12495 int
12496 main (void)
12497 {
12498 dnet_ntoa ();
12499   ;
12500   return 0;
12501 }
12502 _ACEOF
12503 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12504 if { (eval echo "$as_me:12504: \"$ac_link\"") >&5
12505   (eval $ac_link) 2>&5
12506   ac_status=$?
12507   echo "$as_me:12507: \$? = $ac_status" >&5
12508   (exit "$ac_status"); } &&
12509          { ac_try='test -s "conftest$ac_exeext"'
12510   { (eval echo "$as_me:12510: \"$ac_try\"") >&5
12511   (eval $ac_try) 2>&5
12512   ac_status=$?
12513   echo "$as_me:12513: \$? = $ac_status" >&5
12514   (exit "$ac_status"); }; }; then
12515   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12516 else
12517   echo "$as_me: failed program was:" >&5
12518 cat "conftest.$ac_ext" >&5
12519 ac_cv_lib_dnet_stub_dnet_ntoa=no
12520 fi
12521 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12522 LIBS=$ac_check_lib_save_LIBS
12523 fi
12524 echo "$as_me:12524: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12525 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12526 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12527   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12528 fi
12529
12530     fi
12531 fi
12532 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12533     LIBS="$ac_xsave_LIBS"
12534
12535     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12536     # to get the SysV transport functions.
12537     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12538     # needs -lnsl.
12539     # The nsl library prevents programs from opening the X display
12540     # on Irix 5.2, according to T.E. Dickey.
12541     # The functions gethostbyname, getservbyname, and inet_addr are
12542     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12543     echo "$as_me:12543: checking for gethostbyname" >&5
12544 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12545 if test "${ac_cv_func_gethostbyname+set}" = set; then
12546   echo $ECHO_N "(cached) $ECHO_C" >&6
12547 else
12548   cat >"conftest.$ac_ext" <<_ACEOF
12549 #line 12549 "configure"
12550 #include "confdefs.h"
12551 #define gethostbyname autoconf_temporary
12552 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12553 #undef gethostbyname
12554
12555 #ifdef __cplusplus
12556 extern "C"
12557 #endif
12558
12559 /* We use char because int might match the return type of a gcc2
12560    builtin and then its argument prototype would still apply.  */
12561 char gethostbyname (void);
12562
12563 int
12564 main (void)
12565 {
12566
12567 /* The GNU C library defines stubs for functions which it implements
12568     to always fail with ENOSYS.  Some functions are actually named
12569     something starting with __ and the normal name is an alias.  */
12570 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12571 #error found stub for gethostbyname
12572 #endif
12573
12574         return gethostbyname ();
12575   ;
12576   return 0;
12577 }
12578 _ACEOF
12579 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12580 if { (eval echo "$as_me:12580: \"$ac_link\"") >&5
12581   (eval $ac_link) 2>&5
12582   ac_status=$?
12583   echo "$as_me:12583: \$? = $ac_status" >&5
12584   (exit "$ac_status"); } &&
12585          { ac_try='test -s "conftest$ac_exeext"'
12586   { (eval echo "$as_me:12586: \"$ac_try\"") >&5
12587   (eval $ac_try) 2>&5
12588   ac_status=$?
12589   echo "$as_me:12589: \$? = $ac_status" >&5
12590   (exit "$ac_status"); }; }; then
12591   ac_cv_func_gethostbyname=yes
12592 else
12593   echo "$as_me: failed program was:" >&5
12594 cat "conftest.$ac_ext" >&5
12595 ac_cv_func_gethostbyname=no
12596 fi
12597 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12598 fi
12599 echo "$as_me:12599: result: $ac_cv_func_gethostbyname" >&5
12600 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12601
12602     if test $ac_cv_func_gethostbyname = no; then
12603       echo "$as_me:12603: checking for gethostbyname in -lnsl" >&5
12604 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12605 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12606   echo $ECHO_N "(cached) $ECHO_C" >&6
12607 else
12608   ac_check_lib_save_LIBS=$LIBS
12609 LIBS="-lnsl  $LIBS"
12610 cat >"conftest.$ac_ext" <<_ACEOF
12611 #line 12611 "configure"
12612 #include "confdefs.h"
12613
12614 /* Override any gcc2 internal prototype to avoid an error.  */
12615 #ifdef __cplusplus
12616 extern "C"
12617 #endif
12618 /* We use char because int might match the return type of a gcc2
12619    builtin and then its argument prototype would still apply.  */
12620 char gethostbyname ();
12621 int
12622 main (void)
12623 {
12624 gethostbyname ();
12625   ;
12626   return 0;
12627 }
12628 _ACEOF
12629 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12630 if { (eval echo "$as_me:12630: \"$ac_link\"") >&5
12631   (eval $ac_link) 2>&5
12632   ac_status=$?
12633   echo "$as_me:12633: \$? = $ac_status" >&5
12634   (exit "$ac_status"); } &&
12635          { ac_try='test -s "conftest$ac_exeext"'
12636   { (eval echo "$as_me:12636: \"$ac_try\"") >&5
12637   (eval $ac_try) 2>&5
12638   ac_status=$?
12639   echo "$as_me:12639: \$? = $ac_status" >&5
12640   (exit "$ac_status"); }; }; then
12641   ac_cv_lib_nsl_gethostbyname=yes
12642 else
12643   echo "$as_me: failed program was:" >&5
12644 cat "conftest.$ac_ext" >&5
12645 ac_cv_lib_nsl_gethostbyname=no
12646 fi
12647 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12648 LIBS=$ac_check_lib_save_LIBS
12649 fi
12650 echo "$as_me:12650: result: $ac_cv_lib_nsl_gethostbyname" >&5
12651 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12652 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12653   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12654 fi
12655
12656       if test $ac_cv_lib_nsl_gethostbyname = no; then
12657         echo "$as_me:12657: checking for gethostbyname in -lbsd" >&5
12658 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12659 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12660   echo $ECHO_N "(cached) $ECHO_C" >&6
12661 else
12662   ac_check_lib_save_LIBS=$LIBS
12663 LIBS="-lbsd  $LIBS"
12664 cat >"conftest.$ac_ext" <<_ACEOF
12665 #line 12665 "configure"
12666 #include "confdefs.h"
12667
12668 /* Override any gcc2 internal prototype to avoid an error.  */
12669 #ifdef __cplusplus
12670 extern "C"
12671 #endif
12672 /* We use char because int might match the return type of a gcc2
12673    builtin and then its argument prototype would still apply.  */
12674 char gethostbyname ();
12675 int
12676 main (void)
12677 {
12678 gethostbyname ();
12679   ;
12680   return 0;
12681 }
12682 _ACEOF
12683 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12684 if { (eval echo "$as_me:12684: \"$ac_link\"") >&5
12685   (eval $ac_link) 2>&5
12686   ac_status=$?
12687   echo "$as_me:12687: \$? = $ac_status" >&5
12688   (exit "$ac_status"); } &&
12689          { ac_try='test -s "conftest$ac_exeext"'
12690   { (eval echo "$as_me:12690: \"$ac_try\"") >&5
12691   (eval $ac_try) 2>&5
12692   ac_status=$?
12693   echo "$as_me:12693: \$? = $ac_status" >&5
12694   (exit "$ac_status"); }; }; then
12695   ac_cv_lib_bsd_gethostbyname=yes
12696 else
12697   echo "$as_me: failed program was:" >&5
12698 cat "conftest.$ac_ext" >&5
12699 ac_cv_lib_bsd_gethostbyname=no
12700 fi
12701 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12702 LIBS=$ac_check_lib_save_LIBS
12703 fi
12704 echo "$as_me:12704: result: $ac_cv_lib_bsd_gethostbyname" >&5
12705 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12706 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
12707   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12708 fi
12709
12710       fi
12711     fi
12712
12713     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12714     # socket/setsockopt and other routines are undefined under SCO ODT
12715     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12716     # on later versions), says Simon Leinen: it contains gethostby*
12717     # variants that don't use the nameserver (or something).  -lsocket
12718     # must be given before -lnsl if both are needed.  We assume that
12719     # if connect needs -lnsl, so does gethostbyname.
12720     echo "$as_me:12720: checking for connect" >&5
12721 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12722 if test "${ac_cv_func_connect+set}" = set; then
12723   echo $ECHO_N "(cached) $ECHO_C" >&6
12724 else
12725   cat >"conftest.$ac_ext" <<_ACEOF
12726 #line 12726 "configure"
12727 #include "confdefs.h"
12728 #define connect autoconf_temporary
12729 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12730 #undef connect
12731
12732 #ifdef __cplusplus
12733 extern "C"
12734 #endif
12735
12736 /* We use char because int might match the return type of a gcc2
12737    builtin and then its argument prototype would still apply.  */
12738 char connect (void);
12739
12740 int
12741 main (void)
12742 {
12743
12744 /* The GNU C library defines stubs for functions which it implements
12745     to always fail with ENOSYS.  Some functions are actually named
12746     something starting with __ and the normal name is an alias.  */
12747 #if defined (__stub_connect) || defined (__stub___connect)
12748 #error found stub for connect
12749 #endif
12750
12751         return connect ();
12752   ;
12753   return 0;
12754 }
12755 _ACEOF
12756 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12757 if { (eval echo "$as_me:12757: \"$ac_link\"") >&5
12758   (eval $ac_link) 2>&5
12759   ac_status=$?
12760   echo "$as_me:12760: \$? = $ac_status" >&5
12761   (exit "$ac_status"); } &&
12762          { ac_try='test -s "conftest$ac_exeext"'
12763   { (eval echo "$as_me:12763: \"$ac_try\"") >&5
12764   (eval $ac_try) 2>&5
12765   ac_status=$?
12766   echo "$as_me:12766: \$? = $ac_status" >&5
12767   (exit "$ac_status"); }; }; then
12768   ac_cv_func_connect=yes
12769 else
12770   echo "$as_me: failed program was:" >&5
12771 cat "conftest.$ac_ext" >&5
12772 ac_cv_func_connect=no
12773 fi
12774 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12775 fi
12776 echo "$as_me:12776: result: $ac_cv_func_connect" >&5
12777 echo "${ECHO_T}$ac_cv_func_connect" >&6
12778
12779     if test $ac_cv_func_connect = no; then
12780       echo "$as_me:12780: checking for connect in -lsocket" >&5
12781 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12782 if test "${ac_cv_lib_socket_connect+set}" = set; then
12783   echo $ECHO_N "(cached) $ECHO_C" >&6
12784 else
12785   ac_check_lib_save_LIBS=$LIBS
12786 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12787 cat >"conftest.$ac_ext" <<_ACEOF
12788 #line 12788 "configure"
12789 #include "confdefs.h"
12790
12791 /* Override any gcc2 internal prototype to avoid an error.  */
12792 #ifdef __cplusplus
12793 extern "C"
12794 #endif
12795 /* We use char because int might match the return type of a gcc2
12796    builtin and then its argument prototype would still apply.  */
12797 char connect ();
12798 int
12799 main (void)
12800 {
12801 connect ();
12802   ;
12803   return 0;
12804 }
12805 _ACEOF
12806 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12807 if { (eval echo "$as_me:12807: \"$ac_link\"") >&5
12808   (eval $ac_link) 2>&5
12809   ac_status=$?
12810   echo "$as_me:12810: \$? = $ac_status" >&5
12811   (exit "$ac_status"); } &&
12812          { ac_try='test -s "conftest$ac_exeext"'
12813   { (eval echo "$as_me:12813: \"$ac_try\"") >&5
12814   (eval $ac_try) 2>&5
12815   ac_status=$?
12816   echo "$as_me:12816: \$? = $ac_status" >&5
12817   (exit "$ac_status"); }; }; then
12818   ac_cv_lib_socket_connect=yes
12819 else
12820   echo "$as_me: failed program was:" >&5
12821 cat "conftest.$ac_ext" >&5
12822 ac_cv_lib_socket_connect=no
12823 fi
12824 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12825 LIBS=$ac_check_lib_save_LIBS
12826 fi
12827 echo "$as_me:12827: result: $ac_cv_lib_socket_connect" >&5
12828 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12829 if test "$ac_cv_lib_socket_connect" = yes; then
12830   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12831 fi
12832
12833     fi
12834
12835     # Guillermo Gomez says -lposix is necessary on A/UX.
12836     echo "$as_me:12836: checking for remove" >&5
12837 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12838 if test "${ac_cv_func_remove+set}" = set; then
12839   echo $ECHO_N "(cached) $ECHO_C" >&6
12840 else
12841   cat >"conftest.$ac_ext" <<_ACEOF
12842 #line 12842 "configure"
12843 #include "confdefs.h"
12844 #define remove autoconf_temporary
12845 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12846 #undef remove
12847
12848 #ifdef __cplusplus
12849 extern "C"
12850 #endif
12851
12852 /* We use char because int might match the return type of a gcc2
12853    builtin and then its argument prototype would still apply.  */
12854 char remove (void);
12855
12856 int
12857 main (void)
12858 {
12859
12860 /* The GNU C library defines stubs for functions which it implements
12861     to always fail with ENOSYS.  Some functions are actually named
12862     something starting with __ and the normal name is an alias.  */
12863 #if defined (__stub_remove) || defined (__stub___remove)
12864 #error found stub for remove
12865 #endif
12866
12867         return remove ();
12868   ;
12869   return 0;
12870 }
12871 _ACEOF
12872 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12873 if { (eval echo "$as_me:12873: \"$ac_link\"") >&5
12874   (eval $ac_link) 2>&5
12875   ac_status=$?
12876   echo "$as_me:12876: \$? = $ac_status" >&5
12877   (exit "$ac_status"); } &&
12878          { ac_try='test -s "conftest$ac_exeext"'
12879   { (eval echo "$as_me:12879: \"$ac_try\"") >&5
12880   (eval $ac_try) 2>&5
12881   ac_status=$?
12882   echo "$as_me:12882: \$? = $ac_status" >&5
12883   (exit "$ac_status"); }; }; then
12884   ac_cv_func_remove=yes
12885 else
12886   echo "$as_me: failed program was:" >&5
12887 cat "conftest.$ac_ext" >&5
12888 ac_cv_func_remove=no
12889 fi
12890 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12891 fi
12892 echo "$as_me:12892: result: $ac_cv_func_remove" >&5
12893 echo "${ECHO_T}$ac_cv_func_remove" >&6
12894
12895     if test $ac_cv_func_remove = no; then
12896       echo "$as_me:12896: checking for remove in -lposix" >&5
12897 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12898 if test "${ac_cv_lib_posix_remove+set}" = set; then
12899   echo $ECHO_N "(cached) $ECHO_C" >&6
12900 else
12901   ac_check_lib_save_LIBS=$LIBS
12902 LIBS="-lposix  $LIBS"
12903 cat >"conftest.$ac_ext" <<_ACEOF
12904 #line 12904 "configure"
12905 #include "confdefs.h"
12906
12907 /* Override any gcc2 internal prototype to avoid an error.  */
12908 #ifdef __cplusplus
12909 extern "C"
12910 #endif
12911 /* We use char because int might match the return type of a gcc2
12912    builtin and then its argument prototype would still apply.  */
12913 char remove ();
12914 int
12915 main (void)
12916 {
12917 remove ();
12918   ;
12919   return 0;
12920 }
12921 _ACEOF
12922 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12923 if { (eval echo "$as_me:12923: \"$ac_link\"") >&5
12924   (eval $ac_link) 2>&5
12925   ac_status=$?
12926   echo "$as_me:12926: \$? = $ac_status" >&5
12927   (exit "$ac_status"); } &&
12928          { ac_try='test -s "conftest$ac_exeext"'
12929   { (eval echo "$as_me:12929: \"$ac_try\"") >&5
12930   (eval $ac_try) 2>&5
12931   ac_status=$?
12932   echo "$as_me:12932: \$? = $ac_status" >&5
12933   (exit "$ac_status"); }; }; then
12934   ac_cv_lib_posix_remove=yes
12935 else
12936   echo "$as_me: failed program was:" >&5
12937 cat "conftest.$ac_ext" >&5
12938 ac_cv_lib_posix_remove=no
12939 fi
12940 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12941 LIBS=$ac_check_lib_save_LIBS
12942 fi
12943 echo "$as_me:12943: result: $ac_cv_lib_posix_remove" >&5
12944 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12945 if test "$ac_cv_lib_posix_remove" = yes; then
12946   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12947 fi
12948
12949     fi
12950
12951     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12952     echo "$as_me:12952: checking for shmat" >&5
12953 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12954 if test "${ac_cv_func_shmat+set}" = set; then
12955   echo $ECHO_N "(cached) $ECHO_C" >&6
12956 else
12957   cat >"conftest.$ac_ext" <<_ACEOF
12958 #line 12958 "configure"
12959 #include "confdefs.h"
12960 #define shmat autoconf_temporary
12961 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12962 #undef shmat
12963
12964 #ifdef __cplusplus
12965 extern "C"
12966 #endif
12967
12968 /* We use char because int might match the return type of a gcc2
12969    builtin and then its argument prototype would still apply.  */
12970 char shmat (void);
12971
12972 int
12973 main (void)
12974 {
12975
12976 /* The GNU C library defines stubs for functions which it implements
12977     to always fail with ENOSYS.  Some functions are actually named
12978     something starting with __ and the normal name is an alias.  */
12979 #if defined (__stub_shmat) || defined (__stub___shmat)
12980 #error found stub for shmat
12981 #endif
12982
12983         return shmat ();
12984   ;
12985   return 0;
12986 }
12987 _ACEOF
12988 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12989 if { (eval echo "$as_me:12989: \"$ac_link\"") >&5
12990   (eval $ac_link) 2>&5
12991   ac_status=$?
12992   echo "$as_me:12992: \$? = $ac_status" >&5
12993   (exit "$ac_status"); } &&
12994          { ac_try='test -s "conftest$ac_exeext"'
12995   { (eval echo "$as_me:12995: \"$ac_try\"") >&5
12996   (eval $ac_try) 2>&5
12997   ac_status=$?
12998   echo "$as_me:12998: \$? = $ac_status" >&5
12999   (exit "$ac_status"); }; }; then
13000   ac_cv_func_shmat=yes
13001 else
13002   echo "$as_me: failed program was:" >&5
13003 cat "conftest.$ac_ext" >&5
13004 ac_cv_func_shmat=no
13005 fi
13006 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13007 fi
13008 echo "$as_me:13008: result: $ac_cv_func_shmat" >&5
13009 echo "${ECHO_T}$ac_cv_func_shmat" >&6
13010
13011     if test $ac_cv_func_shmat = no; then
13012       echo "$as_me:13012: checking for shmat in -lipc" >&5
13013 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13014 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13015   echo $ECHO_N "(cached) $ECHO_C" >&6
13016 else
13017   ac_check_lib_save_LIBS=$LIBS
13018 LIBS="-lipc  $LIBS"
13019 cat >"conftest.$ac_ext" <<_ACEOF
13020 #line 13020 "configure"
13021 #include "confdefs.h"
13022
13023 /* Override any gcc2 internal prototype to avoid an error.  */
13024 #ifdef __cplusplus
13025 extern "C"
13026 #endif
13027 /* We use char because int might match the return type of a gcc2
13028    builtin and then its argument prototype would still apply.  */
13029 char shmat ();
13030 int
13031 main (void)
13032 {
13033 shmat ();
13034   ;
13035   return 0;
13036 }
13037 _ACEOF
13038 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13039 if { (eval echo "$as_me:13039: \"$ac_link\"") >&5
13040   (eval $ac_link) 2>&5
13041   ac_status=$?
13042   echo "$as_me:13042: \$? = $ac_status" >&5
13043   (exit "$ac_status"); } &&
13044          { ac_try='test -s "conftest$ac_exeext"'
13045   { (eval echo "$as_me:13045: \"$ac_try\"") >&5
13046   (eval $ac_try) 2>&5
13047   ac_status=$?
13048   echo "$as_me:13048: \$? = $ac_status" >&5
13049   (exit "$ac_status"); }; }; then
13050   ac_cv_lib_ipc_shmat=yes
13051 else
13052   echo "$as_me: failed program was:" >&5
13053 cat "conftest.$ac_ext" >&5
13054 ac_cv_lib_ipc_shmat=no
13055 fi
13056 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13057 LIBS=$ac_check_lib_save_LIBS
13058 fi
13059 echo "$as_me:13059: result: $ac_cv_lib_ipc_shmat" >&5
13060 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
13061 if test "$ac_cv_lib_ipc_shmat" = yes; then
13062   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13063 fi
13064
13065     fi
13066   fi
13067
13068   # Check for libraries that X11R6 Xt/Xaw programs need.
13069   ac_save_LDFLAGS=$LDFLAGS
13070   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13071   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13072   # check for ICE first), but we must link in the order -lSM -lICE or
13073   # we get undefined symbols.  So assume we have SM if we have ICE.
13074   # These have to be linked with before -lX11, unlike the other
13075   # libraries we check for below, so use a different variable.
13076   # John Interrante, Karl Berry
13077   echo "$as_me:13077: checking for IceConnectionNumber in -lICE" >&5
13078 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13079 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13080   echo $ECHO_N "(cached) $ECHO_C" >&6
13081 else
13082   ac_check_lib_save_LIBS=$LIBS
13083 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13084 cat >"conftest.$ac_ext" <<_ACEOF
13085 #line 13085 "configure"
13086 #include "confdefs.h"
13087
13088 /* Override any gcc2 internal prototype to avoid an error.  */
13089 #ifdef __cplusplus
13090 extern "C"
13091 #endif
13092 /* We use char because int might match the return type of a gcc2
13093    builtin and then its argument prototype would still apply.  */
13094 char IceConnectionNumber ();
13095 int
13096 main (void)
13097 {
13098 IceConnectionNumber ();
13099   ;
13100   return 0;
13101 }
13102 _ACEOF
13103 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13104 if { (eval echo "$as_me:13104: \"$ac_link\"") >&5
13105   (eval $ac_link) 2>&5
13106   ac_status=$?
13107   echo "$as_me:13107: \$? = $ac_status" >&5
13108   (exit "$ac_status"); } &&
13109          { ac_try='test -s "conftest$ac_exeext"'
13110   { (eval echo "$as_me:13110: \"$ac_try\"") >&5
13111   (eval $ac_try) 2>&5
13112   ac_status=$?
13113   echo "$as_me:13113: \$? = $ac_status" >&5
13114   (exit "$ac_status"); }; }; then
13115   ac_cv_lib_ICE_IceConnectionNumber=yes
13116 else
13117   echo "$as_me: failed program was:" >&5
13118 cat "conftest.$ac_ext" >&5
13119 ac_cv_lib_ICE_IceConnectionNumber=no
13120 fi
13121 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13122 LIBS=$ac_check_lib_save_LIBS
13123 fi
13124 echo "$as_me:13124: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13125 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13126 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13127   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13128 fi
13129
13130   LDFLAGS=$ac_save_LDFLAGS
13131
13132 fi
13133
13134 cf_x_athena=${cf_x_athena:-Xaw}
13135
13136 echo "$as_me:13136: checking if you want to link with Xaw 3d library" >&5
13137 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13138 withval=
13139
13140 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13141 if test "${with_Xaw3d+set}" = set; then
13142   withval="$with_Xaw3d"
13143
13144 fi;
13145 if test "$withval" = yes ; then
13146         cf_x_athena=Xaw3d
13147         echo "$as_me:13147: result: yes" >&5
13148 echo "${ECHO_T}yes" >&6
13149 else
13150         echo "$as_me:13150: result: no" >&5
13151 echo "${ECHO_T}no" >&6
13152 fi
13153
13154 echo "$as_me:13154: checking if you want to link with Xaw 3d xft library" >&5
13155 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13156 withval=
13157
13158 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13159 if test "${with_Xaw3dxft+set}" = set; then
13160   withval="$with_Xaw3dxft"
13161
13162 fi;
13163 if test "$withval" = yes ; then
13164         cf_x_athena=Xaw3dxft
13165         echo "$as_me:13165: result: yes" >&5
13166 echo "${ECHO_T}yes" >&6
13167 else
13168         echo "$as_me:13168: result: no" >&5
13169 echo "${ECHO_T}no" >&6
13170 fi
13171
13172 echo "$as_me:13172: checking if you want to link with neXT Athena library" >&5
13173 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13174 withval=
13175
13176 # Check whether --with-neXtaw or --without-neXtaw was given.
13177 if test "${with_neXtaw+set}" = set; then
13178   withval="$with_neXtaw"
13179
13180 fi;
13181 if test "$withval" = yes ; then
13182         cf_x_athena=neXtaw
13183         echo "$as_me:13183: result: yes" >&5
13184 echo "${ECHO_T}yes" >&6
13185 else
13186         echo "$as_me:13186: result: no" >&5
13187 echo "${ECHO_T}no" >&6
13188 fi
13189
13190 echo "$as_me:13190: checking if you want to link with Athena-Plus library" >&5
13191 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13192 withval=
13193
13194 # Check whether --with-XawPlus or --without-XawPlus was given.
13195 if test "${with_XawPlus+set}" = set; then
13196   withval="$with_XawPlus"
13197
13198 fi;
13199 if test "$withval" = yes ; then
13200         cf_x_athena=XawPlus
13201         echo "$as_me:13201: result: yes" >&5
13202 echo "${ECHO_T}yes" >&6
13203 else
13204         echo "$as_me:13204: result: no" >&5
13205 echo "${ECHO_T}no" >&6
13206 fi
13207
13208 cf_x_athena_lib=""
13209
13210 if test "$PKG_CONFIG" != none ; then
13211         cf_athena_list=
13212         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13213         for cf_athena_pkg in \
13214                 $cf_athena_list \
13215                 ${cf_x_athena} \
13216                 ${cf_x_athena}-devel \
13217                 lib${cf_x_athena} \
13218                 lib${cf_x_athena}-devel
13219         do
13220
13221 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13222         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13223
13224 echo "${as_me:-configure}:13224: testing found package $cf_athena_pkg ..." 1>&5
13225
13226         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13227         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13228         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13229
13230 echo "${as_me:-configure}:13230: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13231
13232         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13233
13234 echo "${as_me:-configure}:13234: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13235
13236 cf_fix_cppflags=no
13237 cf_new_cflags=
13238 cf_new_cppflags=
13239 cf_new_extra_cppflags=
13240
13241 for cf_add_cflags in $cf_pkgconfig_incs
13242 do
13243 case "$cf_fix_cppflags" in
13244 (no)
13245         case "$cf_add_cflags" in
13246         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13247                 case "$cf_add_cflags" in
13248                 (-D*)
13249                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13250
13251                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13252                                 && test -z "${cf_tst_cflags}" \
13253                                 && cf_fix_cppflags=yes
13254
13255                         if test "$cf_fix_cppflags" = yes ; then
13256
13257         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13258         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13259
13260                                 continue
13261                         elif test "${cf_tst_cflags}" = "\"'" ; then
13262
13263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13265
13266                                 continue
13267                         fi
13268                         ;;
13269                 esac
13270                 case "$CPPFLAGS" in
13271                 (*$cf_add_cflags)
13272                         ;;
13273                 (*)
13274                         case "$cf_add_cflags" in
13275                         (-D*)
13276                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13277
13278 CPPFLAGS=`echo "$CPPFLAGS" | \
13279         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13280                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13281
13282                                 ;;
13283                         esac
13284
13285         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13286         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13287
13288                         ;;
13289                 esac
13290                 ;;
13291         (*)
13292
13293         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13294         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13295
13296                 ;;
13297         esac
13298         ;;
13299 (yes)
13300
13301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13303
13304         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13305
13306         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13307                 && test -z "${cf_tst_cflags}" \
13308                 && cf_fix_cppflags=no
13309         ;;
13310 esac
13311 done
13312
13313 if test -n "$cf_new_cflags" ; then
13314
13315         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13316         CFLAGS="${CFLAGS}$cf_new_cflags"
13317
13318 fi
13319
13320 if test -n "$cf_new_cppflags" ; then
13321
13322         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13323         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13324
13325 fi
13326
13327 if test -n "$cf_new_extra_cppflags" ; then
13328
13329         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13330         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13331
13332 fi
13333
13334 cf_add_libs="$LIBS"
13335 # reverse order
13336 cf_add_0lib=
13337 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13338 # filter duplicates
13339 for cf_add_1lib in $cf_add_0lib; do
13340         for cf_add_2lib in $cf_add_libs; do
13341                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13342                         cf_add_1lib=
13343                         break
13344                 fi
13345         done
13346         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13347 done
13348 LIBS="$cf_add_libs"
13349
13350                         cf_x_athena_lib="$cf_pkgconfig_libs"
13351
13352 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13353
13354                         cat >>confdefs.h <<EOF
13355 #define $cf_x_athena_LIBS 1
13356 EOF
13357
13358         for cf_trim_lib in Xmu Xt X11
13359         do
13360                 case "$LIBS" in
13361                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13362                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13363                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13364
13365 echo "${as_me:-configure}:13365: testing ..trimmed $LIBS ..." 1>&5
13366
13367                         ;;
13368                 esac
13369         done
13370
13371 echo "$as_me:13371: checking for usable $cf_x_athena/Xmu package" >&5
13372 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13373 if test "${cf_cv_xaw_compat+set}" = set; then
13374   echo $ECHO_N "(cached) $ECHO_C" >&6
13375 else
13376
13377 cat >"conftest.$ac_ext" <<_ACEOF
13378 #line 13378 "configure"
13379 #include "confdefs.h"
13380
13381 #include <X11/Xmu/CharSet.h>
13382
13383 int
13384 main (void)
13385 {
13386
13387 int check = XmuCompareISOLatin1("big", "small");
13388 (void)check;
13389
13390   ;
13391   return 0;
13392 }
13393 _ACEOF
13394 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13395 if { (eval echo "$as_me:13395: \"$ac_link\"") >&5
13396   (eval $ac_link) 2>&5
13397   ac_status=$?
13398   echo "$as_me:13398: \$? = $ac_status" >&5
13399   (exit "$ac_status"); } &&
13400          { ac_try='test -s "conftest$ac_exeext"'
13401   { (eval echo "$as_me:13401: \"$ac_try\"") >&5
13402   (eval $ac_try) 2>&5
13403   ac_status=$?
13404   echo "$as_me:13404: \$? = $ac_status" >&5
13405   (exit "$ac_status"); }; }; then
13406   cf_cv_xaw_compat=yes
13407 else
13408   echo "$as_me: failed program was:" >&5
13409 cat "conftest.$ac_ext" >&5
13410 cf_cv_xaw_compat=no
13411 fi
13412 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13413 fi
13414 echo "$as_me:13414: result: $cf_cv_xaw_compat" >&5
13415 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13416
13417                         if test "$cf_cv_xaw_compat" = no
13418                         then
13419                                 # workaround for broken ".pc" files...
13420                                 case "$cf_x_athena_lib" in
13421                                 (*-lXmu*)
13422                                         ;;
13423                                 (*)
13424                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13425
13426 echo "${as_me:-configure}:13426: testing work around broken package ..." 1>&5
13427
13428                                         cf_save_xmu="$LIBS"
13429                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13430
13431 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13432         test -n "$verbose" && echo "    found package xmu" 1>&6
13433
13434 echo "${as_me:-configure}:13434: testing found package xmu ..." 1>&5
13435
13436         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13437         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13438         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13439
13440 echo "${as_me:-configure}:13440: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13441
13442         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13443
13444 echo "${as_me:-configure}:13444: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13445
13446 cf_fix_cppflags=no
13447 cf_new_cflags=
13448 cf_new_cppflags=
13449 cf_new_extra_cppflags=
13450
13451 for cf_add_cflags in $cf_pkgconfig_incs
13452 do
13453 case "$cf_fix_cppflags" in
13454 (no)
13455         case "$cf_add_cflags" in
13456         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13457                 case "$cf_add_cflags" in
13458                 (-D*)
13459                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13460
13461                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13462                                 && test -z "${cf_tst_cflags}" \
13463                                 && cf_fix_cppflags=yes
13464
13465                         if test "$cf_fix_cppflags" = yes ; then
13466
13467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13469
13470                                 continue
13471                         elif test "${cf_tst_cflags}" = "\"'" ; then
13472
13473         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13474         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13475
13476                                 continue
13477                         fi
13478                         ;;
13479                 esac
13480                 case "$CPPFLAGS" in
13481                 (*$cf_add_cflags)
13482                         ;;
13483                 (*)
13484                         case "$cf_add_cflags" in
13485                         (-D*)
13486                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13487
13488 CPPFLAGS=`echo "$CPPFLAGS" | \
13489         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13490                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13491
13492                                 ;;
13493                         esac
13494
13495         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13496         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13497
13498                         ;;
13499                 esac
13500                 ;;
13501         (*)
13502
13503         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13504         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13505
13506                 ;;
13507         esac
13508         ;;
13509 (yes)
13510
13511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13513
13514         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13515
13516         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13517                 && test -z "${cf_tst_cflags}" \
13518                 && cf_fix_cppflags=no
13519         ;;
13520 esac
13521 done
13522
13523 if test -n "$cf_new_cflags" ; then
13524
13525         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13526         CFLAGS="${CFLAGS}$cf_new_cflags"
13527
13528 fi
13529
13530 if test -n "$cf_new_cppflags" ; then
13531
13532         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13533         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13534
13535 fi
13536
13537 if test -n "$cf_new_extra_cppflags" ; then
13538
13539         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13540         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13541
13542 fi
13543
13544 cf_add_libs="$LIBS"
13545 # reverse order
13546 cf_add_0lib=
13547 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13548 # filter duplicates
13549 for cf_add_1lib in $cf_add_0lib; do
13550         for cf_add_2lib in $cf_add_libs; do
13551                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13552                         cf_add_1lib=
13553                         break
13554                 fi
13555         done
13556         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13557 done
13558 LIBS="$cf_add_libs"
13559
13560                                                         LIBS="$cf_save_xmu"
13561
13562 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13563
13564 echo "${as_me:-configure}:13564: testing ...before $LIBS ..." 1>&5
13565
13566 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13567 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13568
13569 echo "${as_me:-configure}:13569: testing ...after  $LIBS ..." 1>&5
13570
13571 else
13572         cf_pkgconfig_incs=
13573         cf_pkgconfig_libs=
13574
13575 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13576
13577 echo "${as_me:-configure}:13577: testing ...before $LIBS ..." 1>&5
13578
13579 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13580 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13581
13582 echo "${as_me:-configure}:13582: testing ...after  $LIBS ..." 1>&5
13583
13584 fi
13585
13586         for cf_trim_lib in Xmu Xt X11
13587         do
13588                 case "$LIBS" in
13589                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13590                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13591                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13592
13593 echo "${as_me:-configure}:13593: testing ..trimmed $LIBS ..." 1>&5
13594
13595                         ;;
13596                 esac
13597         done
13598
13599                                         ;;
13600                                 esac
13601                         fi
13602
13603                         break
13604 else
13605         cf_pkgconfig_incs=
13606         cf_pkgconfig_libs=
13607         :
13608 fi
13609
13610         done
13611 fi
13612
13613 if test -z "$cf_x_athena_lib" ; then
13614
13615 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13616         test -n "$verbose" && echo "    found package Xext" 1>&6
13617
13618 echo "${as_me:-configure}:13618: testing found package Xext ..." 1>&5
13619
13620         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13621         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13622         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13623
13624 echo "${as_me:-configure}:13624: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13625
13626         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13627
13628 echo "${as_me:-configure}:13628: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13629
13630 cf_fix_cppflags=no
13631 cf_new_cflags=
13632 cf_new_cppflags=
13633 cf_new_extra_cppflags=
13634
13635 for cf_add_cflags in $cf_pkgconfig_incs
13636 do
13637 case "$cf_fix_cppflags" in
13638 (no)
13639         case "$cf_add_cflags" in
13640         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13641                 case "$cf_add_cflags" in
13642                 (-D*)
13643                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13644
13645                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13646                                 && test -z "${cf_tst_cflags}" \
13647                                 && cf_fix_cppflags=yes
13648
13649                         if test "$cf_fix_cppflags" = yes ; then
13650
13651         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13652         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13653
13654                                 continue
13655                         elif test "${cf_tst_cflags}" = "\"'" ; then
13656
13657         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13658         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13659
13660                                 continue
13661                         fi
13662                         ;;
13663                 esac
13664                 case "$CPPFLAGS" in
13665                 (*$cf_add_cflags)
13666                         ;;
13667                 (*)
13668                         case "$cf_add_cflags" in
13669                         (-D*)
13670                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13671
13672 CPPFLAGS=`echo "$CPPFLAGS" | \
13673         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13674                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13675
13676                                 ;;
13677                         esac
13678
13679         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13680         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13681
13682                         ;;
13683                 esac
13684                 ;;
13685         (*)
13686
13687         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13688         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13689
13690                 ;;
13691         esac
13692         ;;
13693 (yes)
13694
13695         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13696         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13697
13698         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13699
13700         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13701                 && test -z "${cf_tst_cflags}" \
13702                 && cf_fix_cppflags=no
13703         ;;
13704 esac
13705 done
13706
13707 if test -n "$cf_new_cflags" ; then
13708
13709         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13710         CFLAGS="${CFLAGS}$cf_new_cflags"
13711
13712 fi
13713
13714 if test -n "$cf_new_cppflags" ; then
13715
13716         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13717         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13718
13719 fi
13720
13721 if test -n "$cf_new_extra_cppflags" ; then
13722
13723         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13724         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13725
13726 fi
13727
13728 cf_add_libs="$LIBS"
13729 # reverse order
13730 cf_add_0lib=
13731 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13732 # filter duplicates
13733 for cf_add_1lib in $cf_add_0lib; do
13734         for cf_add_2lib in $cf_add_libs; do
13735                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13736                         cf_add_1lib=
13737                         break
13738                 fi
13739         done
13740         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13741 done
13742 LIBS="$cf_add_libs"
13743
13744         :
13745 else
13746         cf_pkgconfig_incs=
13747         cf_pkgconfig_libs=
13748
13749         echo "$as_me:13749: checking for XextCreateExtension in -lXext" >&5
13750 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13751 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13752   echo $ECHO_N "(cached) $ECHO_C" >&6
13753 else
13754   ac_check_lib_save_LIBS=$LIBS
13755 LIBS="-lXext  $LIBS"
13756 cat >"conftest.$ac_ext" <<_ACEOF
13757 #line 13757 "configure"
13758 #include "confdefs.h"
13759
13760 /* Override any gcc2 internal prototype to avoid an error.  */
13761 #ifdef __cplusplus
13762 extern "C"
13763 #endif
13764 /* We use char because int might match the return type of a gcc2
13765    builtin and then its argument prototype would still apply.  */
13766 char XextCreateExtension ();
13767 int
13768 main (void)
13769 {
13770 XextCreateExtension ();
13771   ;
13772   return 0;
13773 }
13774 _ACEOF
13775 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13776 if { (eval echo "$as_me:13776: \"$ac_link\"") >&5
13777   (eval $ac_link) 2>&5
13778   ac_status=$?
13779   echo "$as_me:13779: \$? = $ac_status" >&5
13780   (exit "$ac_status"); } &&
13781          { ac_try='test -s "conftest$ac_exeext"'
13782   { (eval echo "$as_me:13782: \"$ac_try\"") >&5
13783   (eval $ac_try) 2>&5
13784   ac_status=$?
13785   echo "$as_me:13785: \$? = $ac_status" >&5
13786   (exit "$ac_status"); }; }; then
13787   ac_cv_lib_Xext_XextCreateExtension=yes
13788 else
13789   echo "$as_me: failed program was:" >&5
13790 cat "conftest.$ac_ext" >&5
13791 ac_cv_lib_Xext_XextCreateExtension=no
13792 fi
13793 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13794 LIBS=$ac_check_lib_save_LIBS
13795 fi
13796 echo "$as_me:13796: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13797 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13798 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
13799
13800 cf_add_libs="$LIBS"
13801 # reverse order
13802 cf_add_0lib=
13803 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13804 # filter duplicates
13805 for cf_add_1lib in $cf_add_0lib; do
13806         for cf_add_2lib in $cf_add_libs; do
13807                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13808                         cf_add_1lib=
13809                         break
13810                 fi
13811         done
13812         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13813 done
13814 LIBS="$cf_add_libs"
13815
13816 fi
13817
13818 fi
13819
13820 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13821 # in some cases has installed dummy files in the former, other cases replaced
13822 # it with a link to the new location).  This complicates the configure script.
13823 # Check for that pitfall, and recover using pkg-config
13824 #
13825 # If none of these are set, the configuration is almost certainly broken.
13826 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13827 then
13828
13829 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
13830         test -n "$verbose" && echo "    found package x11" 1>&6
13831
13832 echo "${as_me:-configure}:13832: testing found package x11 ..." 1>&5
13833
13834         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
13835         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
13836         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13837
13838 echo "${as_me:-configure}:13838: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13839
13840         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13841
13842 echo "${as_me:-configure}:13842: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13843
13844 cf_fix_cppflags=no
13845 cf_new_cflags=
13846 cf_new_cppflags=
13847 cf_new_extra_cppflags=
13848
13849 for cf_add_cflags in $cf_pkgconfig_incs
13850 do
13851 case "$cf_fix_cppflags" in
13852 (no)
13853         case "$cf_add_cflags" in
13854         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13855                 case "$cf_add_cflags" in
13856                 (-D*)
13857                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13858
13859                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13860                                 && test -z "${cf_tst_cflags}" \
13861                                 && cf_fix_cppflags=yes
13862
13863                         if test "$cf_fix_cppflags" = yes ; then
13864
13865         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13866         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13867
13868                                 continue
13869                         elif test "${cf_tst_cflags}" = "\"'" ; then
13870
13871         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13872         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13873
13874                                 continue
13875                         fi
13876                         ;;
13877                 esac
13878                 case "$CPPFLAGS" in
13879                 (*$cf_add_cflags)
13880                         ;;
13881                 (*)
13882                         case "$cf_add_cflags" in
13883                         (-D*)
13884                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13885
13886 CPPFLAGS=`echo "$CPPFLAGS" | \
13887         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13888                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13889
13890                                 ;;
13891                         esac
13892
13893         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13894         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13895
13896                         ;;
13897                 esac
13898                 ;;
13899         (*)
13900
13901         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13902         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13903
13904                 ;;
13905         esac
13906         ;;
13907 (yes)
13908
13909         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13910         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13911
13912         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13913
13914         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13915                 && test -z "${cf_tst_cflags}" \
13916                 && cf_fix_cppflags=no
13917         ;;
13918 esac
13919 done
13920
13921 if test -n "$cf_new_cflags" ; then
13922
13923         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13924         CFLAGS="${CFLAGS}$cf_new_cflags"
13925
13926 fi
13927
13928 if test -n "$cf_new_cppflags" ; then
13929
13930         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13931         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13932
13933 fi
13934
13935 if test -n "$cf_new_extra_cppflags" ; then
13936
13937         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13938         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13939
13940 fi
13941
13942 cf_add_libs="$LIBS"
13943 # reverse order
13944 cf_add_0lib=
13945 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13946 # filter duplicates
13947 for cf_add_1lib in $cf_add_0lib; do
13948         for cf_add_2lib in $cf_add_libs; do
13949                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13950                         cf_add_1lib=
13951                         break
13952                 fi
13953         done
13954         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13955 done
13956 LIBS="$cf_add_libs"
13957
13958         :
13959 else
13960         cf_pkgconfig_incs=
13961         cf_pkgconfig_libs=
13962         { echo "$as_me:13962: WARNING: unable to find X11 library" >&5
13963 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13964 fi
13965
13966 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
13967         test -n "$verbose" && echo "    found package ice" 1>&6
13968
13969 echo "${as_me:-configure}:13969: testing found package ice ..." 1>&5
13970
13971         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
13972         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
13973         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13974
13975 echo "${as_me:-configure}:13975: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13976
13977         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13978
13979 echo "${as_me:-configure}:13979: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13980
13981 cf_fix_cppflags=no
13982 cf_new_cflags=
13983 cf_new_cppflags=
13984 cf_new_extra_cppflags=
13985
13986 for cf_add_cflags in $cf_pkgconfig_incs
13987 do
13988 case "$cf_fix_cppflags" in
13989 (no)
13990         case "$cf_add_cflags" in
13991         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13992                 case "$cf_add_cflags" in
13993                 (-D*)
13994                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13995
13996                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13997                                 && test -z "${cf_tst_cflags}" \
13998                                 && cf_fix_cppflags=yes
13999
14000                         if test "$cf_fix_cppflags" = yes ; then
14001
14002         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14003         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14004
14005                                 continue
14006                         elif test "${cf_tst_cflags}" = "\"'" ; then
14007
14008         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14009         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14010
14011                                 continue
14012                         fi
14013                         ;;
14014                 esac
14015                 case "$CPPFLAGS" in
14016                 (*$cf_add_cflags)
14017                         ;;
14018                 (*)
14019                         case "$cf_add_cflags" in
14020                         (-D*)
14021                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14022
14023 CPPFLAGS=`echo "$CPPFLAGS" | \
14024         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14025                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14026
14027                                 ;;
14028                         esac
14029
14030         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14031         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14032
14033                         ;;
14034                 esac
14035                 ;;
14036         (*)
14037
14038         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14039         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14040
14041                 ;;
14042         esac
14043         ;;
14044 (yes)
14045
14046         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14047         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14048
14049         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14050
14051         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14052                 && test -z "${cf_tst_cflags}" \
14053                 && cf_fix_cppflags=no
14054         ;;
14055 esac
14056 done
14057
14058 if test -n "$cf_new_cflags" ; then
14059
14060         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14061         CFLAGS="${CFLAGS}$cf_new_cflags"
14062
14063 fi
14064
14065 if test -n "$cf_new_cppflags" ; then
14066
14067         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14068         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14069
14070 fi
14071
14072 if test -n "$cf_new_extra_cppflags" ; then
14073
14074         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14075         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14076
14077 fi
14078
14079 cf_add_libs="$LIBS"
14080 # reverse order
14081 cf_add_0lib=
14082 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14083 # filter duplicates
14084 for cf_add_1lib in $cf_add_0lib; do
14085         for cf_add_2lib in $cf_add_libs; do
14086                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14087                         cf_add_1lib=
14088                         break
14089                 fi
14090         done
14091         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14092 done
14093 LIBS="$cf_add_libs"
14094
14095         :
14096 else
14097         cf_pkgconfig_incs=
14098         cf_pkgconfig_libs=
14099         { echo "$as_me:14099: WARNING: unable to find ICE library" >&5
14100 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14101 fi
14102
14103 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14104         test -n "$verbose" && echo "    found package sm" 1>&6
14105
14106 echo "${as_me:-configure}:14106: testing found package sm ..." 1>&5
14107
14108         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14109         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14110         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14111
14112 echo "${as_me:-configure}:14112: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14113
14114         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14115
14116 echo "${as_me:-configure}:14116: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14117
14118 cf_fix_cppflags=no
14119 cf_new_cflags=
14120 cf_new_cppflags=
14121 cf_new_extra_cppflags=
14122
14123 for cf_add_cflags in $cf_pkgconfig_incs
14124 do
14125 case "$cf_fix_cppflags" in
14126 (no)
14127         case "$cf_add_cflags" in
14128         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14129                 case "$cf_add_cflags" in
14130                 (-D*)
14131                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14132
14133                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14134                                 && test -z "${cf_tst_cflags}" \
14135                                 && cf_fix_cppflags=yes
14136
14137                         if test "$cf_fix_cppflags" = yes ; then
14138
14139         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14140         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14141
14142                                 continue
14143                         elif test "${cf_tst_cflags}" = "\"'" ; then
14144
14145         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14146         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14147
14148                                 continue
14149                         fi
14150                         ;;
14151                 esac
14152                 case "$CPPFLAGS" in
14153                 (*$cf_add_cflags)
14154                         ;;
14155                 (*)
14156                         case "$cf_add_cflags" in
14157                         (-D*)
14158                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14159
14160 CPPFLAGS=`echo "$CPPFLAGS" | \
14161         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14162                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14163
14164                                 ;;
14165                         esac
14166
14167         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14168         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14169
14170                         ;;
14171                 esac
14172                 ;;
14173         (*)
14174
14175         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14176         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14177
14178                 ;;
14179         esac
14180         ;;
14181 (yes)
14182
14183         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14184         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14185
14186         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14187
14188         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14189                 && test -z "${cf_tst_cflags}" \
14190                 && cf_fix_cppflags=no
14191         ;;
14192 esac
14193 done
14194
14195 if test -n "$cf_new_cflags" ; then
14196
14197         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14198         CFLAGS="${CFLAGS}$cf_new_cflags"
14199
14200 fi
14201
14202 if test -n "$cf_new_cppflags" ; then
14203
14204         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14205         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14206
14207 fi
14208
14209 if test -n "$cf_new_extra_cppflags" ; then
14210
14211         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14212         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14213
14214 fi
14215
14216 cf_add_libs="$LIBS"
14217 # reverse order
14218 cf_add_0lib=
14219 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14220 # filter duplicates
14221 for cf_add_1lib in $cf_add_0lib; do
14222         for cf_add_2lib in $cf_add_libs; do
14223                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14224                         cf_add_1lib=
14225                         break
14226                 fi
14227         done
14228         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14229 done
14230 LIBS="$cf_add_libs"
14231
14232         :
14233 else
14234         cf_pkgconfig_incs=
14235         cf_pkgconfig_libs=
14236         { echo "$as_me:14236: WARNING: unable to find SM library" >&5
14237 echo "$as_me: WARNING: unable to find SM library" >&2;}
14238 fi
14239
14240 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14241         test -n "$verbose" && echo "    found package xt" 1>&6
14242
14243 echo "${as_me:-configure}:14243: testing found package xt ..." 1>&5
14244
14245         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14246         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14247         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14248
14249 echo "${as_me:-configure}:14249: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14250
14251         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14252
14253 echo "${as_me:-configure}:14253: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14254
14255 cf_fix_cppflags=no
14256 cf_new_cflags=
14257 cf_new_cppflags=
14258 cf_new_extra_cppflags=
14259
14260 for cf_add_cflags in $cf_pkgconfig_incs
14261 do
14262 case "$cf_fix_cppflags" in
14263 (no)
14264         case "$cf_add_cflags" in
14265         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14266                 case "$cf_add_cflags" in
14267                 (-D*)
14268                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14269
14270                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14271                                 && test -z "${cf_tst_cflags}" \
14272                                 && cf_fix_cppflags=yes
14273
14274                         if test "$cf_fix_cppflags" = yes ; then
14275
14276         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14277         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14278
14279                                 continue
14280                         elif test "${cf_tst_cflags}" = "\"'" ; then
14281
14282         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14283         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14284
14285                                 continue
14286                         fi
14287                         ;;
14288                 esac
14289                 case "$CPPFLAGS" in
14290                 (*$cf_add_cflags)
14291                         ;;
14292                 (*)
14293                         case "$cf_add_cflags" in
14294                         (-D*)
14295                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14296
14297 CPPFLAGS=`echo "$CPPFLAGS" | \
14298         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14299                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14300
14301                                 ;;
14302                         esac
14303
14304         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14305         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14306
14307                         ;;
14308                 esac
14309                 ;;
14310         (*)
14311
14312         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14313         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14314
14315                 ;;
14316         esac
14317         ;;
14318 (yes)
14319
14320         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14321         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14322
14323         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14324
14325         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14326                 && test -z "${cf_tst_cflags}" \
14327                 && cf_fix_cppflags=no
14328         ;;
14329 esac
14330 done
14331
14332 if test -n "$cf_new_cflags" ; then
14333
14334         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14335         CFLAGS="${CFLAGS}$cf_new_cflags"
14336
14337 fi
14338
14339 if test -n "$cf_new_cppflags" ; then
14340
14341         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14342         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14343
14344 fi
14345
14346 if test -n "$cf_new_extra_cppflags" ; then
14347
14348         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14349         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14350
14351 fi
14352
14353 cf_add_libs="$LIBS"
14354 # reverse order
14355 cf_add_0lib=
14356 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14357 # filter duplicates
14358 for cf_add_1lib in $cf_add_0lib; do
14359         for cf_add_2lib in $cf_add_libs; do
14360                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14361                         cf_add_1lib=
14362                         break
14363                 fi
14364         done
14365         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14366 done
14367 LIBS="$cf_add_libs"
14368
14369         :
14370 else
14371         cf_pkgconfig_incs=
14372         cf_pkgconfig_libs=
14373         { echo "$as_me:14373: WARNING: unable to find Xt library" >&5
14374 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14375 fi
14376
14377 else
14378         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14379 fi
14380
14381 cf_have_X_LIBS=no
14382
14383 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14384         test -n "$verbose" && echo "    found package xt" 1>&6
14385
14386 echo "${as_me:-configure}:14386: testing found package xt ..." 1>&5
14387
14388         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14389         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14390         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14391
14392 echo "${as_me:-configure}:14392: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14393
14394         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14395
14396 echo "${as_me:-configure}:14396: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14397
14398 cf_fix_cppflags=no
14399 cf_new_cflags=
14400 cf_new_cppflags=
14401 cf_new_extra_cppflags=
14402
14403 for cf_add_cflags in $cf_pkgconfig_incs
14404 do
14405 case "$cf_fix_cppflags" in
14406 (no)
14407         case "$cf_add_cflags" in
14408         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14409                 case "$cf_add_cflags" in
14410                 (-D*)
14411                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14412
14413                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14414                                 && test -z "${cf_tst_cflags}" \
14415                                 && cf_fix_cppflags=yes
14416
14417                         if test "$cf_fix_cppflags" = yes ; then
14418
14419         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14420         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14421
14422                                 continue
14423                         elif test "${cf_tst_cflags}" = "\"'" ; then
14424
14425         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14426         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14427
14428                                 continue
14429                         fi
14430                         ;;
14431                 esac
14432                 case "$CPPFLAGS" in
14433                 (*$cf_add_cflags)
14434                         ;;
14435                 (*)
14436                         case "$cf_add_cflags" in
14437                         (-D*)
14438                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14439
14440 CPPFLAGS=`echo "$CPPFLAGS" | \
14441         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14442                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14443
14444                                 ;;
14445                         esac
14446
14447         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14448         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14449
14450                         ;;
14451                 esac
14452                 ;;
14453         (*)
14454
14455         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14456         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14457
14458                 ;;
14459         esac
14460         ;;
14461 (yes)
14462
14463         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14464         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14465
14466         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14467
14468         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14469                 && test -z "${cf_tst_cflags}" \
14470                 && cf_fix_cppflags=no
14471         ;;
14472 esac
14473 done
14474
14475 if test -n "$cf_new_cflags" ; then
14476
14477         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14478         CFLAGS="${CFLAGS}$cf_new_cflags"
14479
14480 fi
14481
14482 if test -n "$cf_new_cppflags" ; then
14483
14484         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14485         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14486
14487 fi
14488
14489 if test -n "$cf_new_extra_cppflags" ; then
14490
14491         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14492         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14493
14494 fi
14495
14496 cf_add_libs="$LIBS"
14497 # reverse order
14498 cf_add_0lib=
14499 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14500 # filter duplicates
14501 for cf_add_1lib in $cf_add_0lib; do
14502         for cf_add_2lib in $cf_add_libs; do
14503                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14504                         cf_add_1lib=
14505                         break
14506                 fi
14507         done
14508         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14509 done
14510 LIBS="$cf_add_libs"
14511
14512         case "x$LIBS" in
14513         (*-lX11*)
14514                 ;;
14515         (*)
14516 # we have an "xt" package, but it may omit Xt's dependency on X11
14517 echo "$as_me:14517: checking for usable X dependency" >&5
14518 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14519 if test "${cf_cv_xt_x11_compat+set}" = set; then
14520   echo $ECHO_N "(cached) $ECHO_C" >&6
14521 else
14522
14523 cat >"conftest.$ac_ext" <<_ACEOF
14524 #line 14524 "configure"
14525 #include "confdefs.h"
14526
14527 #include <X11/Xlib.h>
14528
14529 int
14530 main (void)
14531 {
14532
14533         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14534         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14535         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14536         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14537
14538   ;
14539   return 0;
14540 }
14541 _ACEOF
14542 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14543 if { (eval echo "$as_me:14543: \"$ac_link\"") >&5
14544   (eval $ac_link) 2>&5
14545   ac_status=$?
14546   echo "$as_me:14546: \$? = $ac_status" >&5
14547   (exit "$ac_status"); } &&
14548          { ac_try='test -s "conftest$ac_exeext"'
14549   { (eval echo "$as_me:14549: \"$ac_try\"") >&5
14550   (eval $ac_try) 2>&5
14551   ac_status=$?
14552   echo "$as_me:14552: \$? = $ac_status" >&5
14553   (exit "$ac_status"); }; }; then
14554   cf_cv_xt_x11_compat=yes
14555 else
14556   echo "$as_me: failed program was:" >&5
14557 cat "conftest.$ac_ext" >&5
14558 cf_cv_xt_x11_compat=no
14559 fi
14560 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14561 fi
14562 echo "$as_me:14562: result: $cf_cv_xt_x11_compat" >&5
14563 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14564                 if test "$cf_cv_xt_x11_compat" = no
14565                 then
14566                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14567
14568 echo "${as_me:-configure}:14568: testing work around broken X11 dependency ..." 1>&5
14569
14570                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14571
14572 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14573         test -n "$verbose" && echo "    found package x11" 1>&6
14574
14575 echo "${as_me:-configure}:14575: testing found package x11 ..." 1>&5
14576
14577         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14578         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14579         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14580
14581 echo "${as_me:-configure}:14581: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14582
14583         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14584
14585 echo "${as_me:-configure}:14585: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14586
14587 cf_fix_cppflags=no
14588 cf_new_cflags=
14589 cf_new_cppflags=
14590 cf_new_extra_cppflags=
14591
14592 for cf_add_cflags in $cf_pkgconfig_incs
14593 do
14594 case "$cf_fix_cppflags" in
14595 (no)
14596         case "$cf_add_cflags" in
14597         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14598                 case "$cf_add_cflags" in
14599                 (-D*)
14600                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14601
14602                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14603                                 && test -z "${cf_tst_cflags}" \
14604                                 && cf_fix_cppflags=yes
14605
14606                         if test "$cf_fix_cppflags" = yes ; then
14607
14608         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14609         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14610
14611                                 continue
14612                         elif test "${cf_tst_cflags}" = "\"'" ; then
14613
14614         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14615         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14616
14617                                 continue
14618                         fi
14619                         ;;
14620                 esac
14621                 case "$CPPFLAGS" in
14622                 (*$cf_add_cflags)
14623                         ;;
14624                 (*)
14625                         case "$cf_add_cflags" in
14626                         (-D*)
14627                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14628
14629 CPPFLAGS=`echo "$CPPFLAGS" | \
14630         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14631                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14632
14633                                 ;;
14634                         esac
14635
14636         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14637         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14638
14639                         ;;
14640                 esac
14641                 ;;
14642         (*)
14643
14644         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14645         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14646
14647                 ;;
14648         esac
14649         ;;
14650 (yes)
14651
14652         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14653         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14654
14655         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14656
14657         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14658                 && test -z "${cf_tst_cflags}" \
14659                 && cf_fix_cppflags=no
14660         ;;
14661 esac
14662 done
14663
14664 if test -n "$cf_new_cflags" ; then
14665
14666         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14667         CFLAGS="${CFLAGS}$cf_new_cflags"
14668
14669 fi
14670
14671 if test -n "$cf_new_cppflags" ; then
14672
14673         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14674         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14675
14676 fi
14677
14678 if test -n "$cf_new_extra_cppflags" ; then
14679
14680         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14681         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14682
14683 fi
14684
14685 cf_add_libs="$LIBS"
14686 # reverse order
14687 cf_add_0lib=
14688 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14689 # filter duplicates
14690 for cf_add_1lib in $cf_add_0lib; do
14691         for cf_add_2lib in $cf_add_libs; do
14692                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14693                         cf_add_1lib=
14694                         break
14695                 fi
14696         done
14697         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14698 done
14699 LIBS="$cf_add_libs"
14700
14701         :
14702 else
14703         cf_pkgconfig_incs=
14704         cf_pkgconfig_libs=
14705
14706 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14707
14708 echo "${as_me:-configure}:14708: testing ...before $LIBS ..." 1>&5
14709
14710 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14711 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14712
14713 echo "${as_me:-configure}:14713: testing ...after  $LIBS ..." 1>&5
14714
14715 fi
14716
14717                 fi
14718                 ;;
14719         esac
14720
14721 echo "$as_me:14721: checking for usable X Toolkit package" >&5
14722 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14723 if test "${cf_cv_xt_ice_compat+set}" = set; then
14724   echo $ECHO_N "(cached) $ECHO_C" >&6
14725 else
14726
14727 cat >"conftest.$ac_ext" <<_ACEOF
14728 #line 14728 "configure"
14729 #include "confdefs.h"
14730
14731 #include <X11/Shell.h>
14732
14733 int
14734 main (void)
14735 {
14736 int num = IceConnectionNumber(0); (void) num
14737
14738   ;
14739   return 0;
14740 }
14741 _ACEOF
14742 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14743 if { (eval echo "$as_me:14743: \"$ac_link\"") >&5
14744   (eval $ac_link) 2>&5
14745   ac_status=$?
14746   echo "$as_me:14746: \$? = $ac_status" >&5
14747   (exit "$ac_status"); } &&
14748          { ac_try='test -s "conftest$ac_exeext"'
14749   { (eval echo "$as_me:14749: \"$ac_try\"") >&5
14750   (eval $ac_try) 2>&5
14751   ac_status=$?
14752   echo "$as_me:14752: \$? = $ac_status" >&5
14753   (exit "$ac_status"); }; }; then
14754   cf_cv_xt_ice_compat=yes
14755 else
14756   echo "$as_me: failed program was:" >&5
14757 cat "conftest.$ac_ext" >&5
14758 cf_cv_xt_ice_compat=no
14759 fi
14760 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14761 fi
14762 echo "$as_me:14762: result: $cf_cv_xt_ice_compat" >&5
14763 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14764
14765         if test "$cf_cv_xt_ice_compat" = no
14766         then
14767                 # workaround for broken ".pc" files used for X Toolkit.
14768                 case "x$X_PRE_LIBS" in
14769                 (*-lICE*)
14770                         case "x$LIBS" in
14771                         (*-lICE*)
14772                                 ;;
14773                         (*)
14774                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14775
14776 echo "${as_me:-configure}:14776: testing work around broken ICE dependency ..." 1>&5
14777
14778 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14779         test -n "$verbose" && echo "    found package ice" 1>&6
14780
14781 echo "${as_me:-configure}:14781: testing found package ice ..." 1>&5
14782
14783         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14784         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14785         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14786
14787 echo "${as_me:-configure}:14787: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14788
14789         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14790
14791 echo "${as_me:-configure}:14791: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14792
14793 cf_fix_cppflags=no
14794 cf_new_cflags=
14795 cf_new_cppflags=
14796 cf_new_extra_cppflags=
14797
14798 for cf_add_cflags in $cf_pkgconfig_incs
14799 do
14800 case "$cf_fix_cppflags" in
14801 (no)
14802         case "$cf_add_cflags" in
14803         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14804                 case "$cf_add_cflags" in
14805                 (-D*)
14806                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14807
14808                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14809                                 && test -z "${cf_tst_cflags}" \
14810                                 && cf_fix_cppflags=yes
14811
14812                         if test "$cf_fix_cppflags" = yes ; then
14813
14814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14816
14817                                 continue
14818                         elif test "${cf_tst_cflags}" = "\"'" ; then
14819
14820         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14821         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14822
14823                                 continue
14824                         fi
14825                         ;;
14826                 esac
14827                 case "$CPPFLAGS" in
14828                 (*$cf_add_cflags)
14829                         ;;
14830                 (*)
14831                         case "$cf_add_cflags" in
14832                         (-D*)
14833                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14834
14835 CPPFLAGS=`echo "$CPPFLAGS" | \
14836         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14837                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14838
14839                                 ;;
14840                         esac
14841
14842         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14843         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14844
14845                         ;;
14846                 esac
14847                 ;;
14848         (*)
14849
14850         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14851         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14852
14853                 ;;
14854         esac
14855         ;;
14856 (yes)
14857
14858         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14859         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14860
14861         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14862
14863         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14864                 && test -z "${cf_tst_cflags}" \
14865                 && cf_fix_cppflags=no
14866         ;;
14867 esac
14868 done
14869
14870 if test -n "$cf_new_cflags" ; then
14871
14872         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14873         CFLAGS="${CFLAGS}$cf_new_cflags"
14874
14875 fi
14876
14877 if test -n "$cf_new_cppflags" ; then
14878
14879         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14880         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14881
14882 fi
14883
14884 if test -n "$cf_new_extra_cppflags" ; then
14885
14886         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14887         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14888
14889 fi
14890
14891 cf_add_libs="$LIBS"
14892 # reverse order
14893 cf_add_0lib=
14894 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14895 # filter duplicates
14896 for cf_add_1lib in $cf_add_0lib; do
14897         for cf_add_2lib in $cf_add_libs; do
14898                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14899                         cf_add_1lib=
14900                         break
14901                 fi
14902         done
14903         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14904 done
14905 LIBS="$cf_add_libs"
14906
14907 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14908         test -n "$verbose" && echo "    found package sm" 1>&6
14909
14910 echo "${as_me:-configure}:14910: testing found package sm ..." 1>&5
14911
14912         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14913         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14914         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14915
14916 echo "${as_me:-configure}:14916: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14917
14918         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14919
14920 echo "${as_me:-configure}:14920: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14921
14922 cf_fix_cppflags=no
14923 cf_new_cflags=
14924 cf_new_cppflags=
14925 cf_new_extra_cppflags=
14926
14927 for cf_add_cflags in $cf_pkgconfig_incs
14928 do
14929 case "$cf_fix_cppflags" in
14930 (no)
14931         case "$cf_add_cflags" in
14932         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14933                 case "$cf_add_cflags" in
14934                 (-D*)
14935                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14936
14937                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14938                                 && test -z "${cf_tst_cflags}" \
14939                                 && cf_fix_cppflags=yes
14940
14941                         if test "$cf_fix_cppflags" = yes ; then
14942
14943         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14944         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14945
14946                                 continue
14947                         elif test "${cf_tst_cflags}" = "\"'" ; then
14948
14949         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14950         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14951
14952                                 continue
14953                         fi
14954                         ;;
14955                 esac
14956                 case "$CPPFLAGS" in
14957                 (*$cf_add_cflags)
14958                         ;;
14959                 (*)
14960                         case "$cf_add_cflags" in
14961                         (-D*)
14962                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14963
14964 CPPFLAGS=`echo "$CPPFLAGS" | \
14965         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14966                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14967
14968                                 ;;
14969                         esac
14970
14971         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14972         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14973
14974                         ;;
14975                 esac
14976                 ;;
14977         (*)
14978
14979         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14980         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14981
14982                 ;;
14983         esac
14984         ;;
14985 (yes)
14986
14987         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14988         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14989
14990         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14991
14992         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14993                 && test -z "${cf_tst_cflags}" \
14994                 && cf_fix_cppflags=no
14995         ;;
14996 esac
14997 done
14998
14999 if test -n "$cf_new_cflags" ; then
15000
15001         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15002         CFLAGS="${CFLAGS}$cf_new_cflags"
15003
15004 fi
15005
15006 if test -n "$cf_new_cppflags" ; then
15007
15008         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15009         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15010
15011 fi
15012
15013 if test -n "$cf_new_extra_cppflags" ; then
15014
15015         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15016         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15017
15018 fi
15019
15020 cf_add_libs="$LIBS"
15021 # reverse order
15022 cf_add_0lib=
15023 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15024 # filter duplicates
15025 for cf_add_1lib in $cf_add_0lib; do
15026         for cf_add_2lib in $cf_add_libs; do
15027                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15028                         cf_add_1lib=
15029                         break
15030                 fi
15031         done
15032         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15033 done
15034 LIBS="$cf_add_libs"
15035
15036         :
15037 else
15038         cf_pkgconfig_incs=
15039         cf_pkgconfig_libs=
15040         :
15041 fi
15042
15043 else
15044         cf_pkgconfig_incs=
15045         cf_pkgconfig_libs=
15046
15047 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15048
15049 echo "${as_me:-configure}:15049: testing ...before $LIBS ..." 1>&5
15050
15051 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
15052 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15053
15054 echo "${as_me:-configure}:15054: testing ...after  $LIBS ..." 1>&5
15055
15056 fi
15057
15058                                 ;;
15059                         esac
15060                         ;;
15061                 esac
15062         fi
15063
15064         cf_have_X_LIBS=yes
15065
15066 else
15067         cf_pkgconfig_incs=
15068         cf_pkgconfig_libs=
15069
15070         LDFLAGS="$X_LIBS $LDFLAGS"
15071
15072 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15073
15074 echo "${as_me:-configure}:15074: testing checking additions to CFLAGS ..." 1>&5
15075
15076 cf_check_cflags="$CFLAGS"
15077 cf_check_cppflags="$CPPFLAGS"
15078
15079 cf_fix_cppflags=no
15080 cf_new_cflags=
15081 cf_new_cppflags=
15082 cf_new_extra_cppflags=
15083
15084 for cf_add_cflags in $X_CFLAGS
15085 do
15086 case "$cf_fix_cppflags" in
15087 (no)
15088         case "$cf_add_cflags" in
15089         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15090                 case "$cf_add_cflags" in
15091                 (-D*)
15092                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15093
15094                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15095                                 && test -z "${cf_tst_cflags}" \
15096                                 && cf_fix_cppflags=yes
15097
15098                         if test "$cf_fix_cppflags" = yes ; then
15099
15100         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15101         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15102
15103                                 continue
15104                         elif test "${cf_tst_cflags}" = "\"'" ; then
15105
15106         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15107         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15108
15109                                 continue
15110                         fi
15111                         ;;
15112                 esac
15113                 case "$CPPFLAGS" in
15114                 (*$cf_add_cflags)
15115                         ;;
15116                 (*)
15117                         case "$cf_add_cflags" in
15118                         (-D*)
15119                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15120
15121 CPPFLAGS=`echo "$CPPFLAGS" | \
15122         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15123                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15124
15125                                 ;;
15126                         esac
15127
15128         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15129         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15130
15131                         ;;
15132                 esac
15133                 ;;
15134         (*)
15135
15136         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15137         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15138
15139                 ;;
15140         esac
15141         ;;
15142 (yes)
15143
15144         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15145         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15146
15147         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15148
15149         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15150                 && test -z "${cf_tst_cflags}" \
15151                 && cf_fix_cppflags=no
15152         ;;
15153 esac
15154 done
15155
15156 if test -n "$cf_new_cflags" ; then
15157         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15158
15159 echo "${as_me:-configure}:15159: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15160
15161         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15162         CFLAGS="${CFLAGS}$cf_new_cflags"
15163
15164 fi
15165
15166 if test -n "$cf_new_cppflags" ; then
15167         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15168
15169 echo "${as_me:-configure}:15169: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15170
15171         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15172         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15173
15174 fi
15175
15176 if test -n "$cf_new_extra_cppflags" ; then
15177         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15178
15179 echo "${as_me:-configure}:15179: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15180
15181         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15182         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15183
15184 fi
15185
15186 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15187 cat >"conftest.$ac_ext" <<_ACEOF
15188 #line 15188 "configure"
15189 #include "confdefs.h"
15190 #include <stdio.h>
15191 int
15192 main (void)
15193 {
15194 printf("Hello world");
15195   ;
15196   return 0;
15197 }
15198 _ACEOF
15199 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15200 if { (eval echo "$as_me:15200: \"$ac_link\"") >&5
15201   (eval $ac_link) 2>&5
15202   ac_status=$?
15203   echo "$as_me:15203: \$? = $ac_status" >&5
15204   (exit "$ac_status"); } &&
15205          { ac_try='test -s "conftest$ac_exeext"'
15206   { (eval echo "$as_me:15206: \"$ac_try\"") >&5
15207   (eval $ac_try) 2>&5
15208   ac_status=$?
15209   echo "$as_me:15209: \$? = $ac_status" >&5
15210   (exit "$ac_status"); }; }; then
15211   :
15212 else
15213   echo "$as_me: failed program was:" >&5
15214 cat "conftest.$ac_ext" >&5
15215 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15216
15217 echo "${as_me:-configure}:15217: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15218
15219          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15220                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15221
15222 echo "${as_me:-configure}:15222: testing but keeping change to \$CPPFLAGS ..." 1>&5
15223
15224          fi
15225          CFLAGS="$cf_check_cflags"
15226 fi
15227 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15228 fi
15229
15230         echo "$as_me:15230: checking for XOpenDisplay" >&5
15231 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15232 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15233   echo $ECHO_N "(cached) $ECHO_C" >&6
15234 else
15235   cat >"conftest.$ac_ext" <<_ACEOF
15236 #line 15236 "configure"
15237 #include "confdefs.h"
15238 #define XOpenDisplay autoconf_temporary
15239 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15240 #undef XOpenDisplay
15241
15242 #ifdef __cplusplus
15243 extern "C"
15244 #endif
15245
15246 /* We use char because int might match the return type of a gcc2
15247    builtin and then its argument prototype would still apply.  */
15248 char XOpenDisplay (void);
15249
15250 int
15251 main (void)
15252 {
15253
15254 /* The GNU C library defines stubs for functions which it implements
15255     to always fail with ENOSYS.  Some functions are actually named
15256     something starting with __ and the normal name is an alias.  */
15257 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15258 #error found stub for XOpenDisplay
15259 #endif
15260
15261         return XOpenDisplay ();
15262   ;
15263   return 0;
15264 }
15265 _ACEOF
15266 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15267 if { (eval echo "$as_me:15267: \"$ac_link\"") >&5
15268   (eval $ac_link) 2>&5
15269   ac_status=$?
15270   echo "$as_me:15270: \$? = $ac_status" >&5
15271   (exit "$ac_status"); } &&
15272          { ac_try='test -s "conftest$ac_exeext"'
15273   { (eval echo "$as_me:15273: \"$ac_try\"") >&5
15274   (eval $ac_try) 2>&5
15275   ac_status=$?
15276   echo "$as_me:15276: \$? = $ac_status" >&5
15277   (exit "$ac_status"); }; }; then
15278   ac_cv_func_XOpenDisplay=yes
15279 else
15280   echo "$as_me: failed program was:" >&5
15281 cat "conftest.$ac_ext" >&5
15282 ac_cv_func_XOpenDisplay=no
15283 fi
15284 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15285 fi
15286 echo "$as_me:15286: result: $ac_cv_func_XOpenDisplay" >&5
15287 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15288 if test "$ac_cv_func_XOpenDisplay" = yes; then
15289   :
15290 else
15291
15292         echo "$as_me:15292: checking for XOpenDisplay in -lX11" >&5
15293 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15294 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15295   echo $ECHO_N "(cached) $ECHO_C" >&6
15296 else
15297   ac_check_lib_save_LIBS=$LIBS
15298 LIBS="-lX11  $LIBS"
15299 cat >"conftest.$ac_ext" <<_ACEOF
15300 #line 15300 "configure"
15301 #include "confdefs.h"
15302
15303 /* Override any gcc2 internal prototype to avoid an error.  */
15304 #ifdef __cplusplus
15305 extern "C"
15306 #endif
15307 /* We use char because int might match the return type of a gcc2
15308    builtin and then its argument prototype would still apply.  */
15309 char XOpenDisplay ();
15310 int
15311 main (void)
15312 {
15313 XOpenDisplay ();
15314   ;
15315   return 0;
15316 }
15317 _ACEOF
15318 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15319 if { (eval echo "$as_me:15319: \"$ac_link\"") >&5
15320   (eval $ac_link) 2>&5
15321   ac_status=$?
15322   echo "$as_me:15322: \$? = $ac_status" >&5
15323   (exit "$ac_status"); } &&
15324          { ac_try='test -s "conftest$ac_exeext"'
15325   { (eval echo "$as_me:15325: \"$ac_try\"") >&5
15326   (eval $ac_try) 2>&5
15327   ac_status=$?
15328   echo "$as_me:15328: \$? = $ac_status" >&5
15329   (exit "$ac_status"); }; }; then
15330   ac_cv_lib_X11_XOpenDisplay=yes
15331 else
15332   echo "$as_me: failed program was:" >&5
15333 cat "conftest.$ac_ext" >&5
15334 ac_cv_lib_X11_XOpenDisplay=no
15335 fi
15336 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15337 LIBS=$ac_check_lib_save_LIBS
15338 fi
15339 echo "$as_me:15339: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15340 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15341 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15342
15343 cf_add_libs="$LIBS"
15344 # reverse order
15345 cf_add_0lib=
15346 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15347 # filter duplicates
15348 for cf_add_1lib in $cf_add_0lib; do
15349         for cf_add_2lib in $cf_add_libs; do
15350                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15351                         cf_add_1lib=
15352                         break
15353                 fi
15354         done
15355         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15356 done
15357 LIBS="$cf_add_libs"
15358
15359 fi
15360
15361 fi
15362
15363         echo "$as_me:15363: checking for XtAppInitialize" >&5
15364 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15365 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15366   echo $ECHO_N "(cached) $ECHO_C" >&6
15367 else
15368   cat >"conftest.$ac_ext" <<_ACEOF
15369 #line 15369 "configure"
15370 #include "confdefs.h"
15371 #define XtAppInitialize autoconf_temporary
15372 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15373 #undef XtAppInitialize
15374
15375 #ifdef __cplusplus
15376 extern "C"
15377 #endif
15378
15379 /* We use char because int might match the return type of a gcc2
15380    builtin and then its argument prototype would still apply.  */
15381 char XtAppInitialize (void);
15382
15383 int
15384 main (void)
15385 {
15386
15387 /* The GNU C library defines stubs for functions which it implements
15388     to always fail with ENOSYS.  Some functions are actually named
15389     something starting with __ and the normal name is an alias.  */
15390 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15391 #error found stub for XtAppInitialize
15392 #endif
15393
15394         return XtAppInitialize ();
15395   ;
15396   return 0;
15397 }
15398 _ACEOF
15399 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15400 if { (eval echo "$as_me:15400: \"$ac_link\"") >&5
15401   (eval $ac_link) 2>&5
15402   ac_status=$?
15403   echo "$as_me:15403: \$? = $ac_status" >&5
15404   (exit "$ac_status"); } &&
15405          { ac_try='test -s "conftest$ac_exeext"'
15406   { (eval echo "$as_me:15406: \"$ac_try\"") >&5
15407   (eval $ac_try) 2>&5
15408   ac_status=$?
15409   echo "$as_me:15409: \$? = $ac_status" >&5
15410   (exit "$ac_status"); }; }; then
15411   ac_cv_func_XtAppInitialize=yes
15412 else
15413   echo "$as_me: failed program was:" >&5
15414 cat "conftest.$ac_ext" >&5
15415 ac_cv_func_XtAppInitialize=no
15416 fi
15417 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15418 fi
15419 echo "$as_me:15419: result: $ac_cv_func_XtAppInitialize" >&5
15420 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15421 if test "$ac_cv_func_XtAppInitialize" = yes; then
15422   :
15423 else
15424
15425         echo "$as_me:15425: checking for XtAppInitialize in -lXt" >&5
15426 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15427 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15428   echo $ECHO_N "(cached) $ECHO_C" >&6
15429 else
15430   ac_check_lib_save_LIBS=$LIBS
15431 LIBS="-lXt  $LIBS"
15432 cat >"conftest.$ac_ext" <<_ACEOF
15433 #line 15433 "configure"
15434 #include "confdefs.h"
15435
15436 /* Override any gcc2 internal prototype to avoid an error.  */
15437 #ifdef __cplusplus
15438 extern "C"
15439 #endif
15440 /* We use char because int might match the return type of a gcc2
15441    builtin and then its argument prototype would still apply.  */
15442 char XtAppInitialize ();
15443 int
15444 main (void)
15445 {
15446 XtAppInitialize ();
15447   ;
15448   return 0;
15449 }
15450 _ACEOF
15451 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15452 if { (eval echo "$as_me:15452: \"$ac_link\"") >&5
15453   (eval $ac_link) 2>&5
15454   ac_status=$?
15455   echo "$as_me:15455: \$? = $ac_status" >&5
15456   (exit "$ac_status"); } &&
15457          { ac_try='test -s "conftest$ac_exeext"'
15458   { (eval echo "$as_me:15458: \"$ac_try\"") >&5
15459   (eval $ac_try) 2>&5
15460   ac_status=$?
15461   echo "$as_me:15461: \$? = $ac_status" >&5
15462   (exit "$ac_status"); }; }; then
15463   ac_cv_lib_Xt_XtAppInitialize=yes
15464 else
15465   echo "$as_me: failed program was:" >&5
15466 cat "conftest.$ac_ext" >&5
15467 ac_cv_lib_Xt_XtAppInitialize=no
15468 fi
15469 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15470 LIBS=$ac_check_lib_save_LIBS
15471 fi
15472 echo "$as_me:15472: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15473 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15474 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15475
15476 cat >>confdefs.h <<\EOF
15477 #define HAVE_LIBXT 1
15478 EOF
15479
15480                  cf_have_X_LIBS=Xt
15481                  LIBS="-lXt $LIBS"
15482 fi
15483
15484 fi
15485
15486 fi
15487
15488 if test "$cf_have_X_LIBS" = no ; then
15489         { echo "$as_me:15489: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15490 test program.  You will have to check and add the proper libraries by hand
15491 to makefile." >&5
15492 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15493 test program.  You will have to check and add the proper libraries by hand
15494 to makefile." >&2;}
15495 fi
15496
15497 cf_x_athena_root=$cf_x_athena
15498 cf_x_athena_inc=""
15499
15500 for cf_path in default \
15501         /usr/contrib/X11R6 \
15502         /usr/contrib/X11R5 \
15503         /usr/lib/X11R5 \
15504         /usr/local
15505 do
15506         if test -z "$cf_x_athena_inc" ; then
15507
15508 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15509 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15510 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15511 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15512 for cf_X_CFLAGS in $X_CFLAGS
15513 do
15514         case "x$cf_X_CFLAGS" in
15515         x-[IUD]*)
15516                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15517                 ;;
15518         *)
15519                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15520                 ;;
15521         esac
15522 done
15523
15524                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15525                 if test "$cf_path" != default ; then
15526
15527         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15528         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15529
15530                         echo "$as_me:15530: checking for $cf_test in $cf_path" >&5
15531 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15532                 else
15533                         echo "$as_me:15533: checking for $cf_test" >&5
15534 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15535                 fi
15536                 cat >"conftest.$ac_ext" <<_ACEOF
15537 #line 15537 "configure"
15538 #include "confdefs.h"
15539
15540 #include <X11/Intrinsic.h>
15541 #include <$cf_test>
15542 int
15543 main (void)
15544 {
15545
15546   ;
15547   return 0;
15548 }
15549 _ACEOF
15550 rm -f "conftest.$ac_objext"
15551 if { (eval echo "$as_me:15551: \"$ac_compile\"") >&5
15552   (eval $ac_compile) 2>&5
15553   ac_status=$?
15554   echo "$as_me:15554: \$? = $ac_status" >&5
15555   (exit "$ac_status"); } &&
15556          { ac_try='test -s "conftest.$ac_objext"'
15557   { (eval echo "$as_me:15557: \"$ac_try\"") >&5
15558   (eval $ac_try) 2>&5
15559   ac_status=$?
15560   echo "$as_me:15560: \$? = $ac_status" >&5
15561   (exit "$ac_status"); }; }; then
15562   cf_result=yes
15563 else
15564   echo "$as_me: failed program was:" >&5
15565 cat "conftest.$ac_ext" >&5
15566 cf_result=no
15567 fi
15568 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15569                 echo "$as_me:15569: result: $cf_result" >&5
15570 echo "${ECHO_T}$cf_result" >&6
15571
15572 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15573 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15574 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15575
15576                 if test "$cf_result" = yes ; then
15577                         test "$cf_path"  = default && cf_x_athena_inc=default
15578                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15579                         break
15580                 fi
15581         fi
15582 done
15583
15584 if test -z "$cf_x_athena_inc" ; then
15585         { echo "$as_me:15585: WARNING: Unable to find Athena header files" >&5
15586 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15587 elif test "$cf_x_athena_inc" != default ; then
15588
15589         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15590         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15591
15592 fi
15593
15594 cf_x_athena_root=$cf_x_athena
15595 cf_x_athena_lib=""
15596
15597 for cf_path in default \
15598         /usr/contrib/X11R6 \
15599         /usr/contrib/X11R5 \
15600         /usr/lib/X11R5 \
15601         /usr/local
15602 do
15603         for cf_lib in \
15604                 ${cf_x_athena_root} \
15605                 ${cf_x_athena_root}7 \
15606                 ${cf_x_athena_root}6
15607         do
15608         for cf_libs in \
15609                 "-l$cf_lib -lXmu" \
15610                 "-l$cf_lib -lXpm -lXmu" \
15611                 "-l${cf_lib}_s -lXmu_s"
15612         do
15613                 test -n "$cf_x_athena_lib" && break
15614
15615 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15616 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15617 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15618 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15619 for cf_X_CFLAGS in $X_CFLAGS
15620 do
15621         case "x$cf_X_CFLAGS" in
15622         x-[IUD]*)
15623                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15624                 ;;
15625         *)
15626                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15627                 ;;
15628         esac
15629 done
15630
15631                 cf_test=XawSimpleMenuAddGlobalActions
15632                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15633
15634 cf_add_libs="$LIBS"
15635 # reverse order
15636 cf_add_0lib=
15637 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15638 # filter duplicates
15639 for cf_add_1lib in $cf_add_0lib; do
15640         for cf_add_2lib in $cf_add_libs; do
15641                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15642                         cf_add_1lib=
15643                         break
15644                 fi
15645         done
15646         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15647 done
15648 LIBS="$cf_add_libs"
15649
15650                 echo "$as_me:15650: checking for $cf_test in $cf_libs" >&5
15651 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15652                 cat >"conftest.$ac_ext" <<_ACEOF
15653 #line 15653 "configure"
15654 #include "confdefs.h"
15655
15656 #include <X11/Intrinsic.h>
15657 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15658
15659 int
15660 main (void)
15661 {
15662
15663 $cf_test((XtAppContext) 0)
15664   ;
15665   return 0;
15666 }
15667 _ACEOF
15668 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15669 if { (eval echo "$as_me:15669: \"$ac_link\"") >&5
15670   (eval $ac_link) 2>&5
15671   ac_status=$?
15672   echo "$as_me:15672: \$? = $ac_status" >&5
15673   (exit "$ac_status"); } &&
15674          { ac_try='test -s "conftest$ac_exeext"'
15675   { (eval echo "$as_me:15675: \"$ac_try\"") >&5
15676   (eval $ac_try) 2>&5
15677   ac_status=$?
15678   echo "$as_me:15678: \$? = $ac_status" >&5
15679   (exit "$ac_status"); }; }; then
15680   cf_result=yes
15681 else
15682   echo "$as_me: failed program was:" >&5
15683 cat "conftest.$ac_ext" >&5
15684 cf_result=no
15685 fi
15686 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15687                 echo "$as_me:15687: result: $cf_result" >&5
15688 echo "${ECHO_T}$cf_result" >&6
15689
15690 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15691 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15692 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15693
15694                 if test "$cf_result" = yes ; then
15695                         cf_x_athena_lib="$cf_libs"
15696                         break
15697                 fi
15698         done # cf_libs
15699                 test -n "$cf_x_athena_lib" && break
15700         done # cf_lib
15701 done
15702
15703 if test -z "$cf_x_athena_lib" ; then
15704         { { echo "$as_me:15704: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15705 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15706    { (exit 1); exit 1; }; }
15707 fi
15708
15709 cf_add_libs="$LIBS"
15710 # reverse order
15711 cf_add_0lib=
15712 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15713 # filter duplicates
15714 for cf_add_1lib in $cf_add_0lib; do
15715         for cf_add_2lib in $cf_add_libs; do
15716                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15717                         cf_add_1lib=
15718                         break
15719                 fi
15720         done
15721         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15722 done
15723 LIBS="$cf_add_libs"
15724
15725 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15726
15727 cat >>confdefs.h <<EOF
15728 #define $cf_x_athena_LIBS 1
15729 EOF
15730
15731 fi
15732
15733 if test -n "$ac_tool_prefix"; then
15734   for ac_prog in xcurses-config
15735   do
15736     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15737 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15738 echo "$as_me:15738: checking for $ac_word" >&5
15739 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15740 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15741   echo $ECHO_N "(cached) $ECHO_C" >&6
15742 else
15743   if test -n "$XCURSES_CONFIG"; then
15744   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15745 else
15746   ac_save_IFS=$IFS; IFS=$ac_path_separator
15747 ac_dummy="$PATH"
15748 for ac_dir in $ac_dummy; do
15749   IFS=$ac_save_IFS
15750   test -z "$ac_dir" && ac_dir=.
15751   $as_executable_p "$ac_dir/$ac_word" || continue
15752 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15753 echo "$as_me:15753: found $ac_dir/$ac_word" >&5
15754 break
15755 done
15756
15757 fi
15758 fi
15759 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15760 if test -n "$XCURSES_CONFIG"; then
15761   echo "$as_me:15761: result: $XCURSES_CONFIG" >&5
15762 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15763 else
15764   echo "$as_me:15764: result: no" >&5
15765 echo "${ECHO_T}no" >&6
15766 fi
15767
15768     test -n "$XCURSES_CONFIG" && break
15769   done
15770 fi
15771 if test -z "$XCURSES_CONFIG"; then
15772   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15773   for ac_prog in xcurses-config
15774 do
15775   # Extract the first word of "$ac_prog", so it can be a program name with args.
15776 set dummy $ac_prog; ac_word=$2
15777 echo "$as_me:15777: checking for $ac_word" >&5
15778 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15779 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15780   echo $ECHO_N "(cached) $ECHO_C" >&6
15781 else
15782   if test -n "$ac_ct_XCURSES_CONFIG"; then
15783   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15784 else
15785   ac_save_IFS=$IFS; IFS=$ac_path_separator
15786 ac_dummy="$PATH"
15787 for ac_dir in $ac_dummy; do
15788   IFS=$ac_save_IFS
15789   test -z "$ac_dir" && ac_dir=.
15790   $as_executable_p "$ac_dir/$ac_word" || continue
15791 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15792 echo "$as_me:15792: found $ac_dir/$ac_word" >&5
15793 break
15794 done
15795
15796 fi
15797 fi
15798 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15799 if test -n "$ac_ct_XCURSES_CONFIG"; then
15800   echo "$as_me:15800: result: $ac_ct_XCURSES_CONFIG" >&5
15801 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15802 else
15803   echo "$as_me:15803: result: no" >&5
15804 echo "${ECHO_T}no" >&6
15805 fi
15806
15807   test -n "$ac_ct_XCURSES_CONFIG" && break
15808 done
15809 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15810
15811   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15812 fi
15813
15814 if test "$XCURSES_CONFIG" != none ; then
15815
15816 cf_fix_cppflags=no
15817 cf_new_cflags=
15818 cf_new_cppflags=
15819 cf_new_extra_cppflags=
15820
15821 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15822 do
15823 case "$cf_fix_cppflags" in
15824 (no)
15825         case "$cf_add_cflags" in
15826         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15827                 case "$cf_add_cflags" in
15828                 (-D*)
15829                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15830
15831                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15832                                 && test -z "${cf_tst_cflags}" \
15833                                 && cf_fix_cppflags=yes
15834
15835                         if test "$cf_fix_cppflags" = yes ; then
15836
15837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15839
15840                                 continue
15841                         elif test "${cf_tst_cflags}" = "\"'" ; then
15842
15843         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15844         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15845
15846                                 continue
15847                         fi
15848                         ;;
15849                 esac
15850                 case "$CPPFLAGS" in
15851                 (*$cf_add_cflags)
15852                         ;;
15853                 (*)
15854                         case "$cf_add_cflags" in
15855                         (-D*)
15856                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15857
15858 CPPFLAGS=`echo "$CPPFLAGS" | \
15859         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15860                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15861
15862                                 ;;
15863                         esac
15864
15865         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15866         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15867
15868                         ;;
15869                 esac
15870                 ;;
15871         (*)
15872
15873         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15874         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15875
15876                 ;;
15877         esac
15878         ;;
15879 (yes)
15880
15881         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15882         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15883
15884         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15885
15886         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15887                 && test -z "${cf_tst_cflags}" \
15888                 && cf_fix_cppflags=no
15889         ;;
15890 esac
15891 done
15892
15893 if test -n "$cf_new_cflags" ; then
15894
15895         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15896         CFLAGS="${CFLAGS}$cf_new_cflags"
15897
15898 fi
15899
15900 if test -n "$cf_new_cppflags" ; then
15901
15902         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15903         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15904
15905 fi
15906
15907 if test -n "$cf_new_extra_cppflags" ; then
15908
15909         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15910         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15911
15912 fi
15913
15914 cf_add_libs="$LIBS"
15915 # reverse order
15916 cf_add_0lib=
15917 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15918 # filter duplicates
15919 for cf_add_1lib in $cf_add_0lib; do
15920         for cf_add_2lib in $cf_add_libs; do
15921                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15922                         cf_add_1lib=
15923                         break
15924                 fi
15925         done
15926         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15927 done
15928 LIBS="$cf_add_libs"
15929
15930 cf_cv_lib_XCurses=yes
15931
15932 else
15933
15934 LDFLAGS="$LDFLAGS $X_LIBS"
15935
15936 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15937
15938 echo "${as_me:-configure}:15938: testing checking additions to CFLAGS ..." 1>&5
15939
15940 cf_check_cflags="$CFLAGS"
15941 cf_check_cppflags="$CPPFLAGS"
15942
15943 cf_fix_cppflags=no
15944 cf_new_cflags=
15945 cf_new_cppflags=
15946 cf_new_extra_cppflags=
15947
15948 for cf_add_cflags in $X_CFLAGS
15949 do
15950 case "$cf_fix_cppflags" in
15951 (no)
15952         case "$cf_add_cflags" in
15953         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15954                 case "$cf_add_cflags" in
15955                 (-D*)
15956                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15957
15958                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15959                                 && test -z "${cf_tst_cflags}" \
15960                                 && cf_fix_cppflags=yes
15961
15962                         if test "$cf_fix_cppflags" = yes ; then
15963
15964         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15965         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15966
15967                                 continue
15968                         elif test "${cf_tst_cflags}" = "\"'" ; then
15969
15970         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15971         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15972
15973                                 continue
15974                         fi
15975                         ;;
15976                 esac
15977                 case "$CPPFLAGS" in
15978                 (*$cf_add_cflags)
15979                         ;;
15980                 (*)
15981                         case "$cf_add_cflags" in
15982                         (-D*)
15983                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15984
15985 CPPFLAGS=`echo "$CPPFLAGS" | \
15986         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15987                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15988
15989                                 ;;
15990                         esac
15991
15992         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15993         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15994
15995                         ;;
15996                 esac
15997                 ;;
15998         (*)
15999
16000         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16001         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16002
16003                 ;;
16004         esac
16005         ;;
16006 (yes)
16007
16008         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16009         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16010
16011         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16012
16013         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16014                 && test -z "${cf_tst_cflags}" \
16015                 && cf_fix_cppflags=no
16016         ;;
16017 esac
16018 done
16019
16020 if test -n "$cf_new_cflags" ; then
16021         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
16022
16023 echo "${as_me:-configure}:16023: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
16024
16025         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16026         CFLAGS="${CFLAGS}$cf_new_cflags"
16027
16028 fi
16029
16030 if test -n "$cf_new_cppflags" ; then
16031         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16032
16033 echo "${as_me:-configure}:16033: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
16034
16035         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16036         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16037
16038 fi
16039
16040 if test -n "$cf_new_extra_cppflags" ; then
16041         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16042
16043 echo "${as_me:-configure}:16043: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
16044
16045         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16046         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16047
16048 fi
16049
16050 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
16051 cat >"conftest.$ac_ext" <<_ACEOF
16052 #line 16052 "configure"
16053 #include "confdefs.h"
16054 #include <stdio.h>
16055 int
16056 main (void)
16057 {
16058 printf("Hello world");
16059   ;
16060   return 0;
16061 }
16062 _ACEOF
16063 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16064 if { (eval echo "$as_me:16064: \"$ac_link\"") >&5
16065   (eval $ac_link) 2>&5
16066   ac_status=$?
16067   echo "$as_me:16067: \$? = $ac_status" >&5
16068   (exit "$ac_status"); } &&
16069          { ac_try='test -s "conftest$ac_exeext"'
16070   { (eval echo "$as_me:16070: \"$ac_try\"") >&5
16071   (eval $ac_try) 2>&5
16072   ac_status=$?
16073   echo "$as_me:16073: \$? = $ac_status" >&5
16074   (exit "$ac_status"); }; }; then
16075   :
16076 else
16077   echo "$as_me: failed program was:" >&5
16078 cat "conftest.$ac_ext" >&5
16079 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16080
16081 echo "${as_me:-configure}:16081: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16082
16083          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16084                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16085
16086 echo "${as_me:-configure}:16086: testing but keeping change to \$CPPFLAGS ..." 1>&5
16087
16088          fi
16089          CFLAGS="$cf_check_cflags"
16090 fi
16091 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16092 fi
16093
16094 echo "$as_me:16094: checking for XOpenDisplay in -lX11" >&5
16095 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16096 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16097   echo $ECHO_N "(cached) $ECHO_C" >&6
16098 else
16099   ac_check_lib_save_LIBS=$LIBS
16100 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16101 cat >"conftest.$ac_ext" <<_ACEOF
16102 #line 16102 "configure"
16103 #include "confdefs.h"
16104
16105 /* Override any gcc2 internal prototype to avoid an error.  */
16106 #ifdef __cplusplus
16107 extern "C"
16108 #endif
16109 /* We use char because int might match the return type of a gcc2
16110    builtin and then its argument prototype would still apply.  */
16111 char XOpenDisplay ();
16112 int
16113 main (void)
16114 {
16115 XOpenDisplay ();
16116   ;
16117   return 0;
16118 }
16119 _ACEOF
16120 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16121 if { (eval echo "$as_me:16121: \"$ac_link\"") >&5
16122   (eval $ac_link) 2>&5
16123   ac_status=$?
16124   echo "$as_me:16124: \$? = $ac_status" >&5
16125   (exit "$ac_status"); } &&
16126          { ac_try='test -s "conftest$ac_exeext"'
16127   { (eval echo "$as_me:16127: \"$ac_try\"") >&5
16128   (eval $ac_try) 2>&5
16129   ac_status=$?
16130   echo "$as_me:16130: \$? = $ac_status" >&5
16131   (exit "$ac_status"); }; }; then
16132   ac_cv_lib_X11_XOpenDisplay=yes
16133 else
16134   echo "$as_me: failed program was:" >&5
16135 cat "conftest.$ac_ext" >&5
16136 ac_cv_lib_X11_XOpenDisplay=no
16137 fi
16138 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16139 LIBS=$ac_check_lib_save_LIBS
16140 fi
16141 echo "$as_me:16141: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16142 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16143 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16144
16145 cf_add_libs="$LIBS"
16146 # reverse order
16147 cf_add_0lib=
16148 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16149 # filter duplicates
16150 for cf_add_1lib in $cf_add_0lib; do
16151         for cf_add_2lib in $cf_add_libs; do
16152                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16153                         cf_add_1lib=
16154                         break
16155                 fi
16156         done
16157         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16158 done
16159 LIBS="$cf_add_libs"
16160
16161 fi
16162
16163 echo "$as_me:16163: checking for XCurses library" >&5
16164 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16165 if test "${cf_cv_lib_XCurses+set}" = set; then
16166   echo $ECHO_N "(cached) $ECHO_C" >&6
16167 else
16168
16169 cf_add_libs="$LIBS"
16170 # reverse order
16171 cf_add_0lib=
16172 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16173 # filter duplicates
16174 for cf_add_1lib in $cf_add_0lib; do
16175         for cf_add_2lib in $cf_add_libs; do
16176                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16177                         cf_add_1lib=
16178                         break
16179                 fi
16180         done
16181         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16182 done
16183 LIBS="$cf_add_libs"
16184
16185 cat >"conftest.$ac_ext" <<_ACEOF
16186 #line 16186 "configure"
16187 #include "confdefs.h"
16188
16189 #include <xcurses.h>
16190 char *XCursesProgramName = "test";
16191
16192 int
16193 main (void)
16194 {
16195 XCursesExit();
16196   ;
16197   return 0;
16198 }
16199 _ACEOF
16200 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16201 if { (eval echo "$as_me:16201: \"$ac_link\"") >&5
16202   (eval $ac_link) 2>&5
16203   ac_status=$?
16204   echo "$as_me:16204: \$? = $ac_status" >&5
16205   (exit "$ac_status"); } &&
16206          { ac_try='test -s "conftest$ac_exeext"'
16207   { (eval echo "$as_me:16207: \"$ac_try\"") >&5
16208   (eval $ac_try) 2>&5
16209   ac_status=$?
16210   echo "$as_me:16210: \$? = $ac_status" >&5
16211   (exit "$ac_status"); }; }; then
16212   cf_cv_lib_XCurses=yes
16213 else
16214   echo "$as_me: failed program was:" >&5
16215 cat "conftest.$ac_ext" >&5
16216 cf_cv_lib_XCurses=no
16217 fi
16218 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16219
16220 fi
16221 echo "$as_me:16221: result: $cf_cv_lib_XCurses" >&5
16222 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16223
16224 fi
16225
16226 if test "$cf_cv_lib_XCurses" = yes ; then
16227
16228 cat >>confdefs.h <<\EOF
16229 #define UNIX 1
16230 EOF
16231
16232 cat >>confdefs.h <<\EOF
16233 #define XCURSES 1
16234 EOF
16235
16236         echo "$as_me:16236: checking for xcurses.h" >&5
16237 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16238 if test "${ac_cv_header_xcurses_h+set}" = set; then
16239   echo $ECHO_N "(cached) $ECHO_C" >&6
16240 else
16241   cat >"conftest.$ac_ext" <<_ACEOF
16242 #line 16242 "configure"
16243 #include "confdefs.h"
16244 #include <xcurses.h>
16245 _ACEOF
16246 if { (eval echo "$as_me:16246: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16247   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16248   ac_status=$?
16249   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16250   rm -f conftest.er1
16251   cat conftest.err >&5
16252   echo "$as_me:16252: \$? = $ac_status" >&5
16253   (exit "$ac_status"); } >/dev/null; then
16254   if test -s conftest.err; then
16255     ac_cpp_err=$ac_c_preproc_warn_flag
16256   else
16257     ac_cpp_err=
16258   fi
16259 else
16260   ac_cpp_err=yes
16261 fi
16262 if test -z "$ac_cpp_err"; then
16263   ac_cv_header_xcurses_h=yes
16264 else
16265   echo "$as_me: failed program was:" >&5
16266   cat "conftest.$ac_ext" >&5
16267   ac_cv_header_xcurses_h=no
16268 fi
16269 rm -f conftest.err "conftest.$ac_ext"
16270 fi
16271 echo "$as_me:16271: result: $ac_cv_header_xcurses_h" >&5
16272 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16273 if test "$ac_cv_header_xcurses_h" = yes; then
16274
16275 cat >>confdefs.h <<\EOF
16276 #define HAVE_XCURSES 1
16277 EOF
16278
16279 fi
16280
16281 else
16282         { { echo "$as_me:16282: error: Cannot link with XCurses" >&5
16283 echo "$as_me: error: Cannot link with XCurses" >&2;}
16284    { (exit 1); exit 1; }; }
16285 fi
16286
16287         ;;
16288 (*)
16289         { { echo "$as_me:16289: error: unexpected screen-value: $cf_cv_screen" >&5
16290 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16291    { (exit 1); exit 1; }; }
16292         ;;
16293 esac
16294
16295 : ${cf_nculib_root:=$cf_cv_screen}
16296 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16297 echo "$as_me:16297: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16298 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16299 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16300   echo $ECHO_N "(cached) $ECHO_C" >&6
16301 else
16302   ac_check_lib_save_LIBS=$LIBS
16303 LIBS="-l$cf_nculib_root  $LIBS"
16304 cat >"conftest.$ac_ext" <<_ACEOF
16305 #line 16305 "configure"
16306 #include "confdefs.h"
16307
16308 /* Override any gcc2 internal prototype to avoid an error.  */
16309 #ifdef __cplusplus
16310 extern "C"
16311 #endif
16312 /* We use char because int might match the return type of a gcc2
16313    builtin and then its argument prototype would still apply.  */
16314 char _nc_init_pthreads ();
16315 int
16316 main (void)
16317 {
16318 _nc_init_pthreads ();
16319   ;
16320   return 0;
16321 }
16322 _ACEOF
16323 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16324 if { (eval echo "$as_me:16324: \"$ac_link\"") >&5
16325   (eval $ac_link) 2>&5
16326   ac_status=$?
16327   echo "$as_me:16327: \$? = $ac_status" >&5
16328   (exit "$ac_status"); } &&
16329          { ac_try='test -s "conftest$ac_exeext"'
16330   { (eval echo "$as_me:16330: \"$ac_try\"") >&5
16331   (eval $ac_try) 2>&5
16332   ac_status=$?
16333   echo "$as_me:16333: \$? = $ac_status" >&5
16334   (exit "$ac_status"); }; }; then
16335   eval "$as_ac_Lib=yes"
16336 else
16337   echo "$as_me: failed program was:" >&5
16338 cat "conftest.$ac_ext" >&5
16339 eval "$as_ac_Lib=no"
16340 fi
16341 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16342 LIBS=$ac_check_lib_save_LIBS
16343 fi
16344 echo "$as_me:16344: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16345 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16346 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16347   cf_cv_ncurses_pthreads=yes
16348 else
16349   cf_cv_ncurses_pthreads=no
16350 fi
16351
16352 if test "$cf_cv_ncurses_pthreads" = yes
16353 then
16354
16355 cf_add_libs="$LIBS"
16356 # reverse order
16357 cf_add_0lib=
16358 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16359 # filter duplicates
16360 for cf_add_1lib in $cf_add_0lib; do
16361         for cf_add_2lib in $cf_add_libs; do
16362                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16363                         cf_add_1lib=
16364                         break
16365                 fi
16366         done
16367         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16368 done
16369 LIBS="$cf_add_libs"
16370
16371 fi
16372
16373 case $cf_cv_screen in
16374 (ncurses*)
16375         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16376         ;;
16377 esac
16378
16379 echo "$as_me:16379: checking for X11 rgb file" >&5
16380 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16381
16382 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16383 if test "${with_x11_rgb+set}" = set; then
16384   withval="$with_x11_rgb"
16385   RGB_PATH=$withval
16386 else
16387   RGB_PATH=auto
16388 fi;
16389
16390 if test "x$RGB_PATH" = xauto
16391 then
16392         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16393         for cf_path in \
16394                 /opt/local/share/X11/rgb.txt \
16395                 /opt/X11/share/X11/rgb.txt \
16396                 /usr/share/X11/rgb.txt \
16397                 /usr/X11/share/X11/rgb.txt \
16398                 /usr/X11/lib/X11/rgb.txt \
16399                 /usr/lib/X11/rgb.txt \
16400                 /etc/X11/rgb.txt \
16401                 /usr/pkg/lib/X11/rgb.txt \
16402                 /usr/X11R7/lib/X11/rgb.txt \
16403                 /usr/X11R6/lib/X11/rgb.txt \
16404                 /usr/X11R5/lib/X11/rgb.txt \
16405                 /usr/X11R4/lib/X11/rgb.txt \
16406                 /usr/local/lib/X11/rgb.txt \
16407                 /usr/local/share/X11/rgb.txt \
16408                 /usr/lib64/X11/rgb.txt
16409         do
16410                 if test -f "$cf_path" ; then
16411                         RGB_PATH="$cf_path"
16412                         break
16413                 fi
16414         done
16415 else
16416         cf_path=$RGB_PATH
16417
16418 if test "x$prefix" != xNONE; then
16419         cf_path_syntax="$prefix"
16420 else
16421         cf_path_syntax="$ac_default_prefix"
16422 fi
16423
16424 case ".$cf_path" in
16425 (.\$\(*\)*|.\'*\'*)
16426         ;;
16427 (..|./*|.\\*)
16428         ;;
16429 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16430         ;;
16431 (.\$\{*prefix\}*|.\$\{*dir\}*)
16432         eval cf_path="$cf_path"
16433         case ".$cf_path" in
16434         (.NONE/*)
16435                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16436                 ;;
16437         esac
16438         ;;
16439 (.no|.NONE/*)
16440         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16441         ;;
16442 (*)
16443         { { echo "$as_me:16443: error: expected a pathname, not \"$cf_path\"" >&5
16444 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16445    { (exit 1); exit 1; }; }
16446         ;;
16447 esac
16448
16449 fi
16450
16451 echo "$as_me:16451: result: $RGB_PATH" >&5
16452 echo "${ECHO_T}$RGB_PATH" >&6
16453
16454 cat >>confdefs.h <<EOF
16455 #define RGB_PATH "$cf_path"
16456 EOF
16457
16458 no_x11_rgb=
16459 if test "$RGB_PATH" = no
16460 then
16461         no_x11_rgb="#"
16462 fi
16463
16464 cf_curses_headers=
16465
16466 case $cf_cv_screen in
16467 (pdcurses)
16468         cf_default_panel=no
16469         cf_default_form=no
16470         cf_default_menu=no
16471         cf_default_tinfo=no
16472         ;;
16473 (xcurses|bsdcurses)
16474         cf_default_panel=no
16475         cf_default_form=no
16476         cf_default_menu=no
16477         cf_default_tinfo=yes
16478         ;;
16479 (*)
16480         cf_default_panel=yes
16481         cf_default_form=yes
16482         cf_default_menu=yes
16483         cf_default_tinfo=yes
16484         case $cf_cv_screen in
16485         (ncurses*)
16486                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16487                 ;;
16488         esac
16489         ;;
16490 esac
16491
16492 echo "$as_me:16492: checking for desired basename for form library" >&5
16493 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16494
16495 # Check whether --with-form-libname or --without-form-libname was given.
16496 if test "${with_form_libname+set}" = set; then
16497   withval="$with_form_libname"
16498   with_lib_basename=$withval
16499 else
16500   with_lib_basename=form
16501 fi;
16502 FORM_NAME="$with_lib_basename"
16503
16504 case "x$FORM_NAME" in
16505 (x|xno|xnone|xyes)
16506         FORM_NAME=form
16507         ;;
16508 (*)
16509         ;;
16510 esac
16511
16512 echo "$as_me:16512: result: $FORM_NAME" >&5
16513 echo "${ECHO_T}$FORM_NAME" >&6
16514
16515 echo "$as_me:16515: checking for desired basename for menu library" >&5
16516 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16517
16518 # Check whether --with-menu-libname or --without-menu-libname was given.
16519 if test "${with_menu_libname+set}" = set; then
16520   withval="$with_menu_libname"
16521   with_lib_basename=$withval
16522 else
16523   with_lib_basename=menu
16524 fi;
16525 MENU_NAME="$with_lib_basename"
16526
16527 case "x$MENU_NAME" in
16528 (x|xno|xnone|xyes)
16529         MENU_NAME=menu
16530         ;;
16531 (*)
16532         ;;
16533 esac
16534
16535 echo "$as_me:16535: result: $MENU_NAME" >&5
16536 echo "${ECHO_T}$MENU_NAME" >&6
16537
16538 echo "$as_me:16538: checking for desired basename for panel library" >&5
16539 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16540
16541 # Check whether --with-panel-libname or --without-panel-libname was given.
16542 if test "${with_panel_libname+set}" = set; then
16543   withval="$with_panel_libname"
16544   with_lib_basename=$withval
16545 else
16546   with_lib_basename=panel
16547 fi;
16548 PANEL_NAME="$with_lib_basename"
16549
16550 case "x$PANEL_NAME" in
16551 (x|xno|xnone|xyes)
16552         PANEL_NAME=panel
16553         ;;
16554 (*)
16555         ;;
16556 esac
16557
16558 echo "$as_me:16558: result: $PANEL_NAME" >&5
16559 echo "${ECHO_T}$PANEL_NAME" >&6
16560
16561 echo "$as_me:16561: checking if you want to check for panel functions" >&5
16562 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16563
16564 # Check whether --enable-panel or --disable-panel was given.
16565 if test "${enable_panel+set}" = set; then
16566   enableval="$enable_panel"
16567   test "$enableval" != no && enableval=yes
16568         if test "$enableval" != "yes" ; then
16569     cf_enable_panel=no
16570         else
16571                 cf_enable_panel=$cf_default_panel
16572         fi
16573 else
16574   enableval=yes
16575         cf_enable_panel=$cf_default_panel
16576
16577 fi;
16578 echo "$as_me:16578: result: $cf_enable_panel" >&5
16579 echo "${ECHO_T}$cf_enable_panel" >&6
16580 if test $cf_enable_panel = yes
16581 then
16582
16583 cf_have_curses_lib=no
16584
16585 : ${NCURSES_CONFIG_PKG:=none}
16586 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16587         :
16588 elif test "x${PKG_CONFIG:=none}" != xnone; then
16589         echo "$as_me:16589: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16590 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16591         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16592                 echo "$as_me:16592: result: yes" >&5
16593 echo "${ECHO_T}yes" >&6
16594
16595                 echo "$as_me:16595: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16596 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16597
16598                 cf_save_CPPFLAGS="$CPPFLAGS"
16599                 cf_save_LIBS="$LIBS"
16600
16601 cf_fix_cppflags=no
16602 cf_new_cflags=
16603 cf_new_cppflags=
16604 cf_new_extra_cppflags=
16605
16606 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16607 do
16608 case "$cf_fix_cppflags" in
16609 (no)
16610         case "$cf_add_cflags" in
16611         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16612                 case "$cf_add_cflags" in
16613                 (-D*)
16614                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16615
16616                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16617                                 && test -z "${cf_tst_cflags}" \
16618                                 && cf_fix_cppflags=yes
16619
16620                         if test "$cf_fix_cppflags" = yes ; then
16621
16622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16624
16625                                 continue
16626                         elif test "${cf_tst_cflags}" = "\"'" ; then
16627
16628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16630
16631                                 continue
16632                         fi
16633                         ;;
16634                 esac
16635                 case "$CPPFLAGS" in
16636                 (*$cf_add_cflags)
16637                         ;;
16638                 (*)
16639                         case "$cf_add_cflags" in
16640                         (-D*)
16641                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16642
16643 CPPFLAGS=`echo "$CPPFLAGS" | \
16644         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16645                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16646
16647                                 ;;
16648                         esac
16649
16650         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16651         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16652
16653                         ;;
16654                 esac
16655                 ;;
16656         (*)
16657
16658         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16659         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16660
16661                 ;;
16662         esac
16663         ;;
16664 (yes)
16665
16666         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16667         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16668
16669         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16670
16671         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16672                 && test -z "${cf_tst_cflags}" \
16673                 && cf_fix_cppflags=no
16674         ;;
16675 esac
16676 done
16677
16678 if test -n "$cf_new_cflags" ; then
16679
16680         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16681         CFLAGS="${CFLAGS}$cf_new_cflags"
16682
16683 fi
16684
16685 if test -n "$cf_new_cppflags" ; then
16686
16687         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16688         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16689
16690 fi
16691
16692 if test -n "$cf_new_extra_cppflags" ; then
16693
16694         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16695         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16696
16697 fi
16698
16699 cf_add_libs="$LIBS"
16700 # reverse order
16701 cf_add_0lib=
16702 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16703 # filter duplicates
16704 for cf_add_1lib in $cf_add_0lib; do
16705         for cf_add_2lib in $cf_add_libs; do
16706                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16707                         cf_add_1lib=
16708                         break
16709                 fi
16710         done
16711         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16712 done
16713 LIBS="$cf_add_libs"
16714
16715                 cat >"conftest.$ac_ext" <<_ACEOF
16716 #line 16716 "configure"
16717 #include "confdefs.h"
16718 #include <$PANEL_NAME.h>
16719 int
16720 main (void)
16721 {
16722 (void) new_panel ( 0 );
16723   ;
16724   return 0;
16725 }
16726 _ACEOF
16727 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16728 if { (eval echo "$as_me:16728: \"$ac_link\"") >&5
16729   (eval $ac_link) 2>&5
16730   ac_status=$?
16731   echo "$as_me:16731: \$? = $ac_status" >&5
16732   (exit "$ac_status"); } &&
16733          { ac_try='test -s "conftest$ac_exeext"'
16734   { (eval echo "$as_me:16734: \"$ac_try\"") >&5
16735   (eval $ac_try) 2>&5
16736   ac_status=$?
16737   echo "$as_me:16737: \$? = $ac_status" >&5
16738   (exit "$ac_status"); }; }; then
16739   if test "$cross_compiling" = yes; then
16740   cf_have_curses_lib=maybe
16741 else
16742   cat >"conftest.$ac_ext" <<_ACEOF
16743 #line 16743 "configure"
16744 #include "confdefs.h"
16745 #include <$PANEL_NAME.h>
16746                                 int main(void)
16747                                 { (void) new_panel ( 0 ); return 0; }
16748 _ACEOF
16749 rm -f "conftest$ac_exeext"
16750 if { (eval echo "$as_me:16750: \"$ac_link\"") >&5
16751   (eval $ac_link) 2>&5
16752   ac_status=$?
16753   echo "$as_me:16753: \$? = $ac_status" >&5
16754   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16755   { (eval echo "$as_me:16755: \"$ac_try\"") >&5
16756   (eval $ac_try) 2>&5
16757   ac_status=$?
16758   echo "$as_me:16758: \$? = $ac_status" >&5
16759   (exit "$ac_status"); }; }; then
16760   cf_have_curses_lib=yes
16761 else
16762   echo "$as_me: program exited with status $ac_status" >&5
16763 echo "$as_me: failed program was:" >&5
16764 cat "conftest.$ac_ext" >&5
16765 cf_have_curses_lib=no
16766 fi
16767 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16768 fi
16769 else
16770   echo "$as_me: failed program was:" >&5
16771 cat "conftest.$ac_ext" >&5
16772 cf_have_curses_lib=no
16773 fi
16774 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16775                 echo "$as_me:16775: result: $cf_have_curses_lib" >&5
16776 echo "${ECHO_T}$cf_have_curses_lib" >&6
16777                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16778                 if test "$cf_have_curses_lib" != "yes"
16779                 then
16780                         CPPFLAGS="$cf_save_CPPFLAGS"
16781                         LIBS="$cf_save_LIBS"
16782                 else
16783
16784 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16785
16786                         cat >>confdefs.h <<EOF
16787 #define $cf_upper 1
16788 EOF
16789
16790                 fi
16791         fi
16792 fi
16793 if test "$cf_have_curses_lib" = no; then
16794         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16795 echo "$as_me:16795: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16796 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16797 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16798   echo $ECHO_N "(cached) $ECHO_C" >&6
16799 else
16800   ac_check_lib_save_LIBS=$LIBS
16801 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16802 cat >"conftest.$ac_ext" <<_ACEOF
16803 #line 16803 "configure"
16804 #include "confdefs.h"
16805
16806 /* Override any gcc2 internal prototype to avoid an error.  */
16807 #ifdef __cplusplus
16808 extern "C"
16809 #endif
16810 /* We use char because int might match the return type of a gcc2
16811    builtin and then its argument prototype would still apply.  */
16812 char new_panel ();
16813 int
16814 main (void)
16815 {
16816 new_panel ();
16817   ;
16818   return 0;
16819 }
16820 _ACEOF
16821 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16822 if { (eval echo "$as_me:16822: \"$ac_link\"") >&5
16823   (eval $ac_link) 2>&5
16824   ac_status=$?
16825   echo "$as_me:16825: \$? = $ac_status" >&5
16826   (exit "$ac_status"); } &&
16827          { ac_try='test -s "conftest$ac_exeext"'
16828   { (eval echo "$as_me:16828: \"$ac_try\"") >&5
16829   (eval $ac_try) 2>&5
16830   ac_status=$?
16831   echo "$as_me:16831: \$? = $ac_status" >&5
16832   (exit "$ac_status"); }; }; then
16833   eval "$as_ac_Lib=yes"
16834 else
16835   echo "$as_me: failed program was:" >&5
16836 cat "conftest.$ac_ext" >&5
16837 eval "$as_ac_Lib=no"
16838 fi
16839 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16840 LIBS=$ac_check_lib_save_LIBS
16841 fi
16842 echo "$as_me:16842: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16843 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16844 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16845
16846 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16847
16848 cf_add_libs="$LIBS"
16849 # reverse order
16850 cf_add_0lib=
16851 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16852 # filter duplicates
16853 for cf_add_1lib in $cf_add_0lib; do
16854         for cf_add_2lib in $cf_add_libs; do
16855                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16856                         cf_add_1lib=
16857                         break
16858                 fi
16859         done
16860         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16861 done
16862 LIBS="$cf_add_libs"
16863
16864                 cat >>confdefs.h <<EOF
16865 #define $cf_upper 1
16866 EOF
16867
16868 fi
16869
16870 fi
16871
16872         cf_curses_headers="$cf_curses_headers panel.h"
16873 fi
16874
16875 echo "$as_me:16875: checking if you want to check for menu functions" >&5
16876 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16877
16878 # Check whether --enable-menu or --disable-menu was given.
16879 if test "${enable_menu+set}" = set; then
16880   enableval="$enable_menu"
16881   test "$enableval" != no && enableval=yes
16882         if test "$enableval" != "yes" ; then
16883     cf_enable_menu=no
16884         else
16885                 cf_enable_menu=$cf_default_menu
16886         fi
16887 else
16888   enableval=yes
16889         cf_enable_menu=$cf_default_menu
16890
16891 fi;
16892 echo "$as_me:16892: result: $cf_enable_menu" >&5
16893 echo "${ECHO_T}$cf_enable_menu" >&6
16894 if test $cf_enable_menu = yes
16895 then
16896         case $cf_cv_screen in
16897         (ncurses*)
16898                 ;;
16899         (curses*)
16900
16901 echo "$as_me:16901: checking for NetBSD menu.h" >&5
16902 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16903 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16904   echo $ECHO_N "(cached) $ECHO_C" >&6
16905 else
16906
16907 cat >"conftest.$ac_ext" <<_ACEOF
16908 #line 16908 "configure"
16909 #include "confdefs.h"
16910
16911 #include <${cf_cv_ncurses_header:-curses.h}>
16912 #include <menu.h>
16913
16914 int
16915 main (void)
16916 {
16917
16918         MENU *menu;
16919         int y = menu->max_item_width;
16920
16921   ;
16922   return 0;
16923 }
16924 _ACEOF
16925 rm -f "conftest.$ac_objext"
16926 if { (eval echo "$as_me:16926: \"$ac_compile\"") >&5
16927   (eval $ac_compile) 2>&5
16928   ac_status=$?
16929   echo "$as_me:16929: \$? = $ac_status" >&5
16930   (exit "$ac_status"); } &&
16931          { ac_try='test -s "conftest.$ac_objext"'
16932   { (eval echo "$as_me:16932: \"$ac_try\"") >&5
16933   (eval $ac_try) 2>&5
16934   ac_status=$?
16935   echo "$as_me:16935: \$? = $ac_status" >&5
16936   (exit "$ac_status"); }; }; then
16937   cf_cv_netbsd_menu_h=yes
16938
16939 else
16940   echo "$as_me: failed program was:" >&5
16941 cat "conftest.$ac_ext" >&5
16942 cf_cv_netbsd_menu_h=no
16943 fi
16944 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16945
16946 fi
16947 echo "$as_me:16947: result: $cf_cv_netbsd_menu_h" >&5
16948 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16949
16950 test "$cf_cv_netbsd_menu_h" = yes &&
16951 cat >>confdefs.h <<\EOF
16952 #define HAVE_NETBSD_MENU_H 1
16953 EOF
16954
16955                 ;;
16956         esac
16957
16958 cf_have_curses_lib=no
16959
16960 : ${NCURSES_CONFIG_PKG:=none}
16961 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16962         :
16963 elif test "x${PKG_CONFIG:=none}" != xnone; then
16964         echo "$as_me:16964: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16965 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16966         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
16967                 echo "$as_me:16967: result: yes" >&5
16968 echo "${ECHO_T}yes" >&6
16969
16970                 echo "$as_me:16970: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16971 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16972
16973                 cf_save_CPPFLAGS="$CPPFLAGS"
16974                 cf_save_LIBS="$LIBS"
16975
16976 cf_fix_cppflags=no
16977 cf_new_cflags=
16978 cf_new_cppflags=
16979 cf_new_extra_cppflags=
16980
16981 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
16982 do
16983 case "$cf_fix_cppflags" in
16984 (no)
16985         case "$cf_add_cflags" in
16986         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16987                 case "$cf_add_cflags" in
16988                 (-D*)
16989                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16990
16991                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16992                                 && test -z "${cf_tst_cflags}" \
16993                                 && cf_fix_cppflags=yes
16994
16995                         if test "$cf_fix_cppflags" = yes ; then
16996
16997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16999
17000                                 continue
17001                         elif test "${cf_tst_cflags}" = "\"'" ; then
17002
17003         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17004         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17005
17006                                 continue
17007                         fi
17008                         ;;
17009                 esac
17010                 case "$CPPFLAGS" in
17011                 (*$cf_add_cflags)
17012                         ;;
17013                 (*)
17014                         case "$cf_add_cflags" in
17015                         (-D*)
17016                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17017
17018 CPPFLAGS=`echo "$CPPFLAGS" | \
17019         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17020                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17021
17022                                 ;;
17023                         esac
17024
17025         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17026         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17027
17028                         ;;
17029                 esac
17030                 ;;
17031         (*)
17032
17033         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17034         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17035
17036                 ;;
17037         esac
17038         ;;
17039 (yes)
17040
17041         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17042         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17043
17044         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17045
17046         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17047                 && test -z "${cf_tst_cflags}" \
17048                 && cf_fix_cppflags=no
17049         ;;
17050 esac
17051 done
17052
17053 if test -n "$cf_new_cflags" ; then
17054
17055         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17056         CFLAGS="${CFLAGS}$cf_new_cflags"
17057
17058 fi
17059
17060 if test -n "$cf_new_cppflags" ; then
17061
17062         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17063         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17064
17065 fi
17066
17067 if test -n "$cf_new_extra_cppflags" ; then
17068
17069         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17070         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17071
17072 fi
17073
17074 cf_add_libs="$LIBS"
17075 # reverse order
17076 cf_add_0lib=
17077 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17078 # filter duplicates
17079 for cf_add_1lib in $cf_add_0lib; do
17080         for cf_add_2lib in $cf_add_libs; do
17081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17082                         cf_add_1lib=
17083                         break
17084                 fi
17085         done
17086         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17087 done
17088 LIBS="$cf_add_libs"
17089
17090                 cat >"conftest.$ac_ext" <<_ACEOF
17091 #line 17091 "configure"
17092 #include "confdefs.h"
17093 #include <$MENU_NAME.h>
17094 int
17095 main (void)
17096 {
17097 (void) menu_driver ( 0,0 );
17098   ;
17099   return 0;
17100 }
17101 _ACEOF
17102 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17103 if { (eval echo "$as_me:17103: \"$ac_link\"") >&5
17104   (eval $ac_link) 2>&5
17105   ac_status=$?
17106   echo "$as_me:17106: \$? = $ac_status" >&5
17107   (exit "$ac_status"); } &&
17108          { ac_try='test -s "conftest$ac_exeext"'
17109   { (eval echo "$as_me:17109: \"$ac_try\"") >&5
17110   (eval $ac_try) 2>&5
17111   ac_status=$?
17112   echo "$as_me:17112: \$? = $ac_status" >&5
17113   (exit "$ac_status"); }; }; then
17114   if test "$cross_compiling" = yes; then
17115   cf_have_curses_lib=maybe
17116 else
17117   cat >"conftest.$ac_ext" <<_ACEOF
17118 #line 17118 "configure"
17119 #include "confdefs.h"
17120 #include <$MENU_NAME.h>
17121                                 int main(void)
17122                                 { (void) menu_driver ( 0,0 ); return 0; }
17123 _ACEOF
17124 rm -f "conftest$ac_exeext"
17125 if { (eval echo "$as_me:17125: \"$ac_link\"") >&5
17126   (eval $ac_link) 2>&5
17127   ac_status=$?
17128   echo "$as_me:17128: \$? = $ac_status" >&5
17129   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17130   { (eval echo "$as_me:17130: \"$ac_try\"") >&5
17131   (eval $ac_try) 2>&5
17132   ac_status=$?
17133   echo "$as_me:17133: \$? = $ac_status" >&5
17134   (exit "$ac_status"); }; }; then
17135   cf_have_curses_lib=yes
17136 else
17137   echo "$as_me: program exited with status $ac_status" >&5
17138 echo "$as_me: failed program was:" >&5
17139 cat "conftest.$ac_ext" >&5
17140 cf_have_curses_lib=no
17141 fi
17142 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17143 fi
17144 else
17145   echo "$as_me: failed program was:" >&5
17146 cat "conftest.$ac_ext" >&5
17147 cf_have_curses_lib=no
17148 fi
17149 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17150                 echo "$as_me:17150: result: $cf_have_curses_lib" >&5
17151 echo "${ECHO_T}$cf_have_curses_lib" >&6
17152                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17153                 if test "$cf_have_curses_lib" != "yes"
17154                 then
17155                         CPPFLAGS="$cf_save_CPPFLAGS"
17156                         LIBS="$cf_save_LIBS"
17157                 else
17158
17159 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17160
17161                         cat >>confdefs.h <<EOF
17162 #define $cf_upper 1
17163 EOF
17164
17165                 fi
17166         fi
17167 fi
17168 if test "$cf_have_curses_lib" = no; then
17169         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17170 echo "$as_me:17170: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17171 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17172 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17173   echo $ECHO_N "(cached) $ECHO_C" >&6
17174 else
17175   ac_check_lib_save_LIBS=$LIBS
17176 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17177 cat >"conftest.$ac_ext" <<_ACEOF
17178 #line 17178 "configure"
17179 #include "confdefs.h"
17180
17181 /* Override any gcc2 internal prototype to avoid an error.  */
17182 #ifdef __cplusplus
17183 extern "C"
17184 #endif
17185 /* We use char because int might match the return type of a gcc2
17186    builtin and then its argument prototype would still apply.  */
17187 char menu_driver ();
17188 int
17189 main (void)
17190 {
17191 menu_driver ();
17192   ;
17193   return 0;
17194 }
17195 _ACEOF
17196 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17197 if { (eval echo "$as_me:17197: \"$ac_link\"") >&5
17198   (eval $ac_link) 2>&5
17199   ac_status=$?
17200   echo "$as_me:17200: \$? = $ac_status" >&5
17201   (exit "$ac_status"); } &&
17202          { ac_try='test -s "conftest$ac_exeext"'
17203   { (eval echo "$as_me:17203: \"$ac_try\"") >&5
17204   (eval $ac_try) 2>&5
17205   ac_status=$?
17206   echo "$as_me:17206: \$? = $ac_status" >&5
17207   (exit "$ac_status"); }; }; then
17208   eval "$as_ac_Lib=yes"
17209 else
17210   echo "$as_me: failed program was:" >&5
17211 cat "conftest.$ac_ext" >&5
17212 eval "$as_ac_Lib=no"
17213 fi
17214 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17215 LIBS=$ac_check_lib_save_LIBS
17216 fi
17217 echo "$as_me:17217: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17218 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17219 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17220
17221 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17222
17223 cf_add_libs="$LIBS"
17224 # reverse order
17225 cf_add_0lib=
17226 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17227 # filter duplicates
17228 for cf_add_1lib in $cf_add_0lib; do
17229         for cf_add_2lib in $cf_add_libs; do
17230                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17231                         cf_add_1lib=
17232                         break
17233                 fi
17234         done
17235         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17236 done
17237 LIBS="$cf_add_libs"
17238
17239                 cat >>confdefs.h <<EOF
17240 #define $cf_upper 1
17241 EOF
17242
17243 fi
17244
17245 fi
17246
17247         cf_curses_headers="$cf_curses_headers menu.h"
17248 fi
17249
17250 echo "$as_me:17250: checking if you want to check for form functions" >&5
17251 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17252
17253 # Check whether --enable-form or --disable-form was given.
17254 if test "${enable_form+set}" = set; then
17255   enableval="$enable_form"
17256   test "$enableval" != no && enableval=yes
17257         if test "$enableval" != "yes" ; then
17258     cf_enable_form=no
17259         else
17260                 cf_enable_form=$cf_default_form
17261         fi
17262 else
17263   enableval=yes
17264         cf_enable_form=$cf_default_form
17265
17266 fi;
17267 echo "$as_me:17267: result: $cf_enable_form" >&5
17268 echo "${ECHO_T}$cf_enable_form" >&6
17269 if test $cf_enable_form = yes
17270 then
17271         case $cf_cv_screen in
17272         (ncurses*)
17273                 ;;
17274         (curses*)
17275
17276 echo "$as_me:17276: checking for NetBSD form.h" >&5
17277 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17278 if test "${cf_cv_netbsd_form_h+set}" = set; then
17279   echo $ECHO_N "(cached) $ECHO_C" >&6
17280 else
17281
17282 cat >"conftest.$ac_ext" <<_ACEOF
17283 #line 17283 "configure"
17284 #include "confdefs.h"
17285
17286 #include <${cf_cv_ncurses_header:-curses.h}>
17287 #include <form.h>
17288
17289 int
17290 main (void)
17291 {
17292
17293         FORM *form;
17294         int y = current_field(form)->cursor_ypos;
17295         int x = current_field(form)->cursor_xpos;
17296
17297   ;
17298   return 0;
17299 }
17300 _ACEOF
17301 rm -f "conftest.$ac_objext"
17302 if { (eval echo "$as_me:17302: \"$ac_compile\"") >&5
17303   (eval $ac_compile) 2>&5
17304   ac_status=$?
17305   echo "$as_me:17305: \$? = $ac_status" >&5
17306   (exit "$ac_status"); } &&
17307          { ac_try='test -s "conftest.$ac_objext"'
17308   { (eval echo "$as_me:17308: \"$ac_try\"") >&5
17309   (eval $ac_try) 2>&5
17310   ac_status=$?
17311   echo "$as_me:17311: \$? = $ac_status" >&5
17312   (exit "$ac_status"); }; }; then
17313   cf_cv_netbsd_form_h=yes
17314
17315 else
17316   echo "$as_me: failed program was:" >&5
17317 cat "conftest.$ac_ext" >&5
17318 cf_cv_netbsd_form_h=no
17319 fi
17320 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17321
17322 fi
17323 echo "$as_me:17323: result: $cf_cv_netbsd_form_h" >&5
17324 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17325
17326 test "$cf_cv_netbsd_form_h" = yes &&
17327 cat >>confdefs.h <<\EOF
17328 #define HAVE_NETBSD_FORM_H 1
17329 EOF
17330
17331                 ;;
17332         esac
17333
17334 cf_have_curses_lib=no
17335
17336 : ${NCURSES_CONFIG_PKG:=none}
17337 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17338         :
17339 elif test "x${PKG_CONFIG:=none}" != xnone; then
17340         echo "$as_me:17340: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17341 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17342         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17343                 echo "$as_me:17343: result: yes" >&5
17344 echo "${ECHO_T}yes" >&6
17345
17346                 echo "$as_me:17346: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17347 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17348
17349                 cf_save_CPPFLAGS="$CPPFLAGS"
17350                 cf_save_LIBS="$LIBS"
17351
17352 cf_fix_cppflags=no
17353 cf_new_cflags=
17354 cf_new_cppflags=
17355 cf_new_extra_cppflags=
17356
17357 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17358 do
17359 case "$cf_fix_cppflags" in
17360 (no)
17361         case "$cf_add_cflags" in
17362         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17363                 case "$cf_add_cflags" in
17364                 (-D*)
17365                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17366
17367                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17368                                 && test -z "${cf_tst_cflags}" \
17369                                 && cf_fix_cppflags=yes
17370
17371                         if test "$cf_fix_cppflags" = yes ; then
17372
17373         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17374         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17375
17376                                 continue
17377                         elif test "${cf_tst_cflags}" = "\"'" ; then
17378
17379         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17380         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17381
17382                                 continue
17383                         fi
17384                         ;;
17385                 esac
17386                 case "$CPPFLAGS" in
17387                 (*$cf_add_cflags)
17388                         ;;
17389                 (*)
17390                         case "$cf_add_cflags" in
17391                         (-D*)
17392                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17393
17394 CPPFLAGS=`echo "$CPPFLAGS" | \
17395         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17396                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17397
17398                                 ;;
17399                         esac
17400
17401         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17402         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17403
17404                         ;;
17405                 esac
17406                 ;;
17407         (*)
17408
17409         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17410         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17411
17412                 ;;
17413         esac
17414         ;;
17415 (yes)
17416
17417         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17418         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17419
17420         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17421
17422         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17423                 && test -z "${cf_tst_cflags}" \
17424                 && cf_fix_cppflags=no
17425         ;;
17426 esac
17427 done
17428
17429 if test -n "$cf_new_cflags" ; then
17430
17431         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17432         CFLAGS="${CFLAGS}$cf_new_cflags"
17433
17434 fi
17435
17436 if test -n "$cf_new_cppflags" ; then
17437
17438         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17439         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17440
17441 fi
17442
17443 if test -n "$cf_new_extra_cppflags" ; then
17444
17445         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17446         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17447
17448 fi
17449
17450 cf_add_libs="$LIBS"
17451 # reverse order
17452 cf_add_0lib=
17453 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17454 # filter duplicates
17455 for cf_add_1lib in $cf_add_0lib; do
17456         for cf_add_2lib in $cf_add_libs; do
17457                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17458                         cf_add_1lib=
17459                         break
17460                 fi
17461         done
17462         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17463 done
17464 LIBS="$cf_add_libs"
17465
17466                 cat >"conftest.$ac_ext" <<_ACEOF
17467 #line 17467 "configure"
17468 #include "confdefs.h"
17469 #include <$FORM_NAME.h>
17470 int
17471 main (void)
17472 {
17473 (void) form_driver ( 0,0 );
17474   ;
17475   return 0;
17476 }
17477 _ACEOF
17478 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17479 if { (eval echo "$as_me:17479: \"$ac_link\"") >&5
17480   (eval $ac_link) 2>&5
17481   ac_status=$?
17482   echo "$as_me:17482: \$? = $ac_status" >&5
17483   (exit "$ac_status"); } &&
17484          { ac_try='test -s "conftest$ac_exeext"'
17485   { (eval echo "$as_me:17485: \"$ac_try\"") >&5
17486   (eval $ac_try) 2>&5
17487   ac_status=$?
17488   echo "$as_me:17488: \$? = $ac_status" >&5
17489   (exit "$ac_status"); }; }; then
17490   if test "$cross_compiling" = yes; then
17491   cf_have_curses_lib=maybe
17492 else
17493   cat >"conftest.$ac_ext" <<_ACEOF
17494 #line 17494 "configure"
17495 #include "confdefs.h"
17496 #include <$FORM_NAME.h>
17497                                 int main(void)
17498                                 { (void) form_driver ( 0,0 ); return 0; }
17499 _ACEOF
17500 rm -f "conftest$ac_exeext"
17501 if { (eval echo "$as_me:17501: \"$ac_link\"") >&5
17502   (eval $ac_link) 2>&5
17503   ac_status=$?
17504   echo "$as_me:17504: \$? = $ac_status" >&5
17505   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17506   { (eval echo "$as_me:17506: \"$ac_try\"") >&5
17507   (eval $ac_try) 2>&5
17508   ac_status=$?
17509   echo "$as_me:17509: \$? = $ac_status" >&5
17510   (exit "$ac_status"); }; }; then
17511   cf_have_curses_lib=yes
17512 else
17513   echo "$as_me: program exited with status $ac_status" >&5
17514 echo "$as_me: failed program was:" >&5
17515 cat "conftest.$ac_ext" >&5
17516 cf_have_curses_lib=no
17517 fi
17518 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17519 fi
17520 else
17521   echo "$as_me: failed program was:" >&5
17522 cat "conftest.$ac_ext" >&5
17523 cf_have_curses_lib=no
17524 fi
17525 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17526                 echo "$as_me:17526: result: $cf_have_curses_lib" >&5
17527 echo "${ECHO_T}$cf_have_curses_lib" >&6
17528                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17529                 if test "$cf_have_curses_lib" != "yes"
17530                 then
17531                         CPPFLAGS="$cf_save_CPPFLAGS"
17532                         LIBS="$cf_save_LIBS"
17533                 else
17534
17535 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17536
17537                         cat >>confdefs.h <<EOF
17538 #define $cf_upper 1
17539 EOF
17540
17541                 fi
17542         fi
17543 fi
17544 if test "$cf_have_curses_lib" = no; then
17545         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17546 echo "$as_me:17546: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17547 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17548 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17549   echo $ECHO_N "(cached) $ECHO_C" >&6
17550 else
17551   ac_check_lib_save_LIBS=$LIBS
17552 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17553 cat >"conftest.$ac_ext" <<_ACEOF
17554 #line 17554 "configure"
17555 #include "confdefs.h"
17556
17557 /* Override any gcc2 internal prototype to avoid an error.  */
17558 #ifdef __cplusplus
17559 extern "C"
17560 #endif
17561 /* We use char because int might match the return type of a gcc2
17562    builtin and then its argument prototype would still apply.  */
17563 char form_driver ();
17564 int
17565 main (void)
17566 {
17567 form_driver ();
17568   ;
17569   return 0;
17570 }
17571 _ACEOF
17572 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17573 if { (eval echo "$as_me:17573: \"$ac_link\"") >&5
17574   (eval $ac_link) 2>&5
17575   ac_status=$?
17576   echo "$as_me:17576: \$? = $ac_status" >&5
17577   (exit "$ac_status"); } &&
17578          { ac_try='test -s "conftest$ac_exeext"'
17579   { (eval echo "$as_me:17579: \"$ac_try\"") >&5
17580   (eval $ac_try) 2>&5
17581   ac_status=$?
17582   echo "$as_me:17582: \$? = $ac_status" >&5
17583   (exit "$ac_status"); }; }; then
17584   eval "$as_ac_Lib=yes"
17585 else
17586   echo "$as_me: failed program was:" >&5
17587 cat "conftest.$ac_ext" >&5
17588 eval "$as_ac_Lib=no"
17589 fi
17590 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17591 LIBS=$ac_check_lib_save_LIBS
17592 fi
17593 echo "$as_me:17593: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17594 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17595 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17596
17597 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17598
17599 cf_add_libs="$LIBS"
17600 # reverse order
17601 cf_add_0lib=
17602 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17603 # filter duplicates
17604 for cf_add_1lib in $cf_add_0lib; do
17605         for cf_add_2lib in $cf_add_libs; do
17606                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17607                         cf_add_1lib=
17608                         break
17609                 fi
17610         done
17611         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17612 done
17613 LIBS="$cf_add_libs"
17614
17615                 cat >>confdefs.h <<EOF
17616 #define $cf_upper 1
17617 EOF
17618
17619 fi
17620
17621 fi
17622
17623         cf_curses_headers="$cf_curses_headers form.h"
17624 fi
17625
17626 # look for curses-related headers
17627
17628 for ac_header in $cf_curses_headers
17629 do
17630 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17631 echo "$as_me:17631: checking for $ac_header" >&5
17632 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17633 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17634   echo $ECHO_N "(cached) $ECHO_C" >&6
17635 else
17636   cat >"conftest.$ac_ext" <<_ACEOF
17637 #line 17637 "configure"
17638 #include "confdefs.h"
17639 #include <$ac_header>
17640 _ACEOF
17641 if { (eval echo "$as_me:17641: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17642   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17643   ac_status=$?
17644   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17645   rm -f conftest.er1
17646   cat conftest.err >&5
17647   echo "$as_me:17647: \$? = $ac_status" >&5
17648   (exit "$ac_status"); } >/dev/null; then
17649   if test -s conftest.err; then
17650     ac_cpp_err=$ac_c_preproc_warn_flag
17651   else
17652     ac_cpp_err=
17653   fi
17654 else
17655   ac_cpp_err=yes
17656 fi
17657 if test -z "$ac_cpp_err"; then
17658   eval "$as_ac_Header=yes"
17659 else
17660   echo "$as_me: failed program was:" >&5
17661   cat "conftest.$ac_ext" >&5
17662   eval "$as_ac_Header=no"
17663 fi
17664 rm -f conftest.err "conftest.$ac_ext"
17665 fi
17666 echo "$as_me:17666: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17667 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17668 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17669   cat >>confdefs.h <<EOF
17670 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17671 EOF
17672
17673 fi
17674 done
17675
17676 echo "$as_me:17676: checking for ANSI C header files" >&5
17677 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17678 if test "${ac_cv_header_stdc+set}" = set; then
17679   echo $ECHO_N "(cached) $ECHO_C" >&6
17680 else
17681   cat >"conftest.$ac_ext" <<_ACEOF
17682 #line 17682 "configure"
17683 #include "confdefs.h"
17684 #include <stdlib.h>
17685 #include <stdarg.h>
17686 #include <string.h>
17687 #include <float.h>
17688
17689 _ACEOF
17690 if { (eval echo "$as_me:17690: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17691   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17692   ac_status=$?
17693   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17694   rm -f conftest.er1
17695   cat conftest.err >&5
17696   echo "$as_me:17696: \$? = $ac_status" >&5
17697   (exit "$ac_status"); } >/dev/null; then
17698   if test -s conftest.err; then
17699     ac_cpp_err=$ac_c_preproc_warn_flag
17700   else
17701     ac_cpp_err=
17702   fi
17703 else
17704   ac_cpp_err=yes
17705 fi
17706 if test -z "$ac_cpp_err"; then
17707   ac_cv_header_stdc=yes
17708 else
17709   echo "$as_me: failed program was:" >&5
17710   cat "conftest.$ac_ext" >&5
17711   ac_cv_header_stdc=no
17712 fi
17713 rm -f conftest.err "conftest.$ac_ext"
17714
17715 if test $ac_cv_header_stdc = yes; then
17716   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17717   cat >"conftest.$ac_ext" <<_ACEOF
17718 #line 17718 "configure"
17719 #include "confdefs.h"
17720 #include <string.h>
17721
17722 _ACEOF
17723 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17724   $EGREP "memchr" >/dev/null 2>&1; then
17725   :
17726 else
17727   ac_cv_header_stdc=no
17728 fi
17729 rm -rf conftest*
17730
17731 fi
17732
17733 if test $ac_cv_header_stdc = yes; then
17734   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17735   cat >"conftest.$ac_ext" <<_ACEOF
17736 #line 17736 "configure"
17737 #include "confdefs.h"
17738 #include <stdlib.h>
17739
17740 _ACEOF
17741 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17742   $EGREP "free" >/dev/null 2>&1; then
17743   :
17744 else
17745   ac_cv_header_stdc=no
17746 fi
17747 rm -rf conftest*
17748
17749 fi
17750
17751 if test $ac_cv_header_stdc = yes; then
17752   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17753   if test "$cross_compiling" = yes; then
17754   :
17755 else
17756   cat >"conftest.$ac_ext" <<_ACEOF
17757 #line 17757 "configure"
17758 #include "confdefs.h"
17759 #include <ctype.h>
17760 #if ((' ' & 0x0FF) == 0x020)
17761 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17762 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17763 #else
17764 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17765                      || ('j' <= (c) && (c) <= 'r') \
17766                      || ('s' <= (c) && (c) <= 'z'))
17767 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17768 #endif
17769
17770 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17771 int
17772 main (void)
17773 {
17774   int i;
17775   for (i = 0; i < 256; i++)
17776     if (XOR (islower (i), ISLOWER (i))
17777         || toupper (i) != TOUPPER (i))
17778       $ac_main_return(2);
17779   $ac_main_return (0);
17780 }
17781 _ACEOF
17782 rm -f "conftest$ac_exeext"
17783 if { (eval echo "$as_me:17783: \"$ac_link\"") >&5
17784   (eval $ac_link) 2>&5
17785   ac_status=$?
17786   echo "$as_me:17786: \$? = $ac_status" >&5
17787   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17788   { (eval echo "$as_me:17788: \"$ac_try\"") >&5
17789   (eval $ac_try) 2>&5
17790   ac_status=$?
17791   echo "$as_me:17791: \$? = $ac_status" >&5
17792   (exit "$ac_status"); }; }; then
17793   :
17794 else
17795   echo "$as_me: program exited with status $ac_status" >&5
17796 echo "$as_me: failed program was:" >&5
17797 cat "conftest.$ac_ext" >&5
17798 ac_cv_header_stdc=no
17799 fi
17800 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17801 fi
17802 fi
17803 fi
17804 echo "$as_me:17804: result: $ac_cv_header_stdc" >&5
17805 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17806 if test $ac_cv_header_stdc = yes; then
17807
17808 cat >>confdefs.h <<\EOF
17809 #define STDC_HEADERS 1
17810 EOF
17811
17812 fi
17813
17814 echo "$as_me:17814: checking whether time.h and sys/time.h may both be included" >&5
17815 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17816 if test "${ac_cv_header_time+set}" = set; then
17817   echo $ECHO_N "(cached) $ECHO_C" >&6
17818 else
17819   cat >"conftest.$ac_ext" <<_ACEOF
17820 #line 17820 "configure"
17821 #include "confdefs.h"
17822 #include <sys/types.h>
17823 #include <sys/time.h>
17824 #include <time.h>
17825
17826 int
17827 main (void)
17828 {
17829 if ((struct tm *) 0)
17830 return 0;
17831   ;
17832   return 0;
17833 }
17834 _ACEOF
17835 rm -f "conftest.$ac_objext"
17836 if { (eval echo "$as_me:17836: \"$ac_compile\"") >&5
17837   (eval $ac_compile) 2>&5
17838   ac_status=$?
17839   echo "$as_me:17839: \$? = $ac_status" >&5
17840   (exit "$ac_status"); } &&
17841          { ac_try='test -s "conftest.$ac_objext"'
17842   { (eval echo "$as_me:17842: \"$ac_try\"") >&5
17843   (eval $ac_try) 2>&5
17844   ac_status=$?
17845   echo "$as_me:17845: \$? = $ac_status" >&5
17846   (exit "$ac_status"); }; }; then
17847   ac_cv_header_time=yes
17848 else
17849   echo "$as_me: failed program was:" >&5
17850 cat "conftest.$ac_ext" >&5
17851 ac_cv_header_time=no
17852 fi
17853 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17854 fi
17855 echo "$as_me:17855: result: $ac_cv_header_time" >&5
17856 echo "${ECHO_T}$ac_cv_header_time" >&6
17857 if test $ac_cv_header_time = yes; then
17858
17859 cat >>confdefs.h <<\EOF
17860 #define TIME_WITH_SYS_TIME 1
17861 EOF
17862
17863 fi
17864
17865 for ac_header in \
17866 getopt.h \
17867 locale.h \
17868 math.h \
17869 stdarg.h \
17870 stdint.h \
17871 sys/ioctl.h \
17872 sys/select.h \
17873 sys/time.h \
17874 termios.h \
17875 unistd.h \
17876
17877 do
17878 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17879 echo "$as_me:17879: checking for $ac_header" >&5
17880 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17881 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17882   echo $ECHO_N "(cached) $ECHO_C" >&6
17883 else
17884   cat >"conftest.$ac_ext" <<_ACEOF
17885 #line 17885 "configure"
17886 #include "confdefs.h"
17887 #include <$ac_header>
17888 _ACEOF
17889 if { (eval echo "$as_me:17889: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17890   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17891   ac_status=$?
17892   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17893   rm -f conftest.er1
17894   cat conftest.err >&5
17895   echo "$as_me:17895: \$? = $ac_status" >&5
17896   (exit "$ac_status"); } >/dev/null; then
17897   if test -s conftest.err; then
17898     ac_cpp_err=$ac_c_preproc_warn_flag
17899   else
17900     ac_cpp_err=
17901   fi
17902 else
17903   ac_cpp_err=yes
17904 fi
17905 if test -z "$ac_cpp_err"; then
17906   eval "$as_ac_Header=yes"
17907 else
17908   echo "$as_me: failed program was:" >&5
17909   cat "conftest.$ac_ext" >&5
17910   eval "$as_ac_Header=no"
17911 fi
17912 rm -f conftest.err "conftest.$ac_ext"
17913 fi
17914 echo "$as_me:17914: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17915 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17916 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17917   cat >>confdefs.h <<EOF
17918 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17919 EOF
17920
17921 fi
17922 done
17923
17924 for ac_header in unistd.h getopt.h
17925 do
17926 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17927 echo "$as_me:17927: checking for $ac_header" >&5
17928 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17929 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17930   echo $ECHO_N "(cached) $ECHO_C" >&6
17931 else
17932   cat >"conftest.$ac_ext" <<_ACEOF
17933 #line 17933 "configure"
17934 #include "confdefs.h"
17935 #include <$ac_header>
17936 _ACEOF
17937 if { (eval echo "$as_me:17937: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17938   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17939   ac_status=$?
17940   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17941   rm -f conftest.er1
17942   cat conftest.err >&5
17943   echo "$as_me:17943: \$? = $ac_status" >&5
17944   (exit "$ac_status"); } >/dev/null; then
17945   if test -s conftest.err; then
17946     ac_cpp_err=$ac_c_preproc_warn_flag
17947   else
17948     ac_cpp_err=
17949   fi
17950 else
17951   ac_cpp_err=yes
17952 fi
17953 if test -z "$ac_cpp_err"; then
17954   eval "$as_ac_Header=yes"
17955 else
17956   echo "$as_me: failed program was:" >&5
17957   cat "conftest.$ac_ext" >&5
17958   eval "$as_ac_Header=no"
17959 fi
17960 rm -f conftest.err "conftest.$ac_ext"
17961 fi
17962 echo "$as_me:17962: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17963 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17964 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17965   cat >>confdefs.h <<EOF
17966 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17967 EOF
17968
17969 fi
17970 done
17971
17972 echo "$as_me:17972: checking for header declaring getopt variables" >&5
17973 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17974 if test "${cf_cv_getopt_header+set}" = set; then
17975   echo $ECHO_N "(cached) $ECHO_C" >&6
17976 else
17977
17978 cf_cv_getopt_header=none
17979 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17980 do
17981 cat >"conftest.$ac_ext" <<_ACEOF
17982 #line 17982 "configure"
17983 #include "confdefs.h"
17984
17985 #include <$cf_header>
17986 int
17987 main (void)
17988 {
17989 int x = optind; char *y = optarg; (void)x; (void)y
17990   ;
17991   return 0;
17992 }
17993 _ACEOF
17994 rm -f "conftest.$ac_objext"
17995 if { (eval echo "$as_me:17995: \"$ac_compile\"") >&5
17996   (eval $ac_compile) 2>&5
17997   ac_status=$?
17998   echo "$as_me:17998: \$? = $ac_status" >&5
17999   (exit "$ac_status"); } &&
18000          { ac_try='test -s "conftest.$ac_objext"'
18001   { (eval echo "$as_me:18001: \"$ac_try\"") >&5
18002   (eval $ac_try) 2>&5
18003   ac_status=$?
18004   echo "$as_me:18004: \$? = $ac_status" >&5
18005   (exit "$ac_status"); }; }; then
18006   cf_cv_getopt_header=$cf_header
18007  break
18008 else
18009   echo "$as_me: failed program was:" >&5
18010 cat "conftest.$ac_ext" >&5
18011 fi
18012 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18013 done
18014
18015 fi
18016 echo "$as_me:18016: result: $cf_cv_getopt_header" >&5
18017 echo "${ECHO_T}$cf_cv_getopt_header" >&6
18018 if test "$cf_cv_getopt_header" != none ; then
18019
18020 cat >>confdefs.h <<\EOF
18021 #define HAVE_GETOPT_HEADER 1
18022 EOF
18023
18024 fi
18025 if test "$cf_cv_getopt_header" = getopt.h ; then
18026
18027 cat >>confdefs.h <<\EOF
18028 #define NEED_GETOPT_H 1
18029 EOF
18030
18031 fi
18032
18033 for ac_func in \
18034 getopt \
18035 gettimeofday \
18036 snprintf \
18037 strdup \
18038 strstr \
18039 tsearch \
18040
18041 do
18042 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18043 echo "$as_me:18043: checking for $ac_func" >&5
18044 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18045 if eval "test \"\${$as_ac_var+set}\" = set"; then
18046   echo $ECHO_N "(cached) $ECHO_C" >&6
18047 else
18048   cat >"conftest.$ac_ext" <<_ACEOF
18049 #line 18049 "configure"
18050 #include "confdefs.h"
18051 #define $ac_func autoconf_temporary
18052 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18053 #undef $ac_func
18054
18055 #ifdef __cplusplus
18056 extern "C"
18057 #endif
18058
18059 /* We use char because int might match the return type of a gcc2
18060    builtin and then its argument prototype would still apply.  */
18061 char $ac_func (void);
18062
18063 int
18064 main (void)
18065 {
18066
18067 /* The GNU C library defines stubs for functions which it implements
18068     to always fail with ENOSYS.  Some functions are actually named
18069     something starting with __ and the normal name is an alias.  */
18070 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18071 #error found stub for $ac_func
18072 #endif
18073
18074         return $ac_func ();
18075   ;
18076   return 0;
18077 }
18078 _ACEOF
18079 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18080 if { (eval echo "$as_me:18080: \"$ac_link\"") >&5
18081   (eval $ac_link) 2>&5
18082   ac_status=$?
18083   echo "$as_me:18083: \$? = $ac_status" >&5
18084   (exit "$ac_status"); } &&
18085          { ac_try='test -s "conftest$ac_exeext"'
18086   { (eval echo "$as_me:18086: \"$ac_try\"") >&5
18087   (eval $ac_try) 2>&5
18088   ac_status=$?
18089   echo "$as_me:18089: \$? = $ac_status" >&5
18090   (exit "$ac_status"); }; }; then
18091   eval "$as_ac_var=yes"
18092 else
18093   echo "$as_me: failed program was:" >&5
18094 cat "conftest.$ac_ext" >&5
18095 eval "$as_ac_var=no"
18096 fi
18097 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18098 fi
18099 echo "$as_me:18099: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18100 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18101 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18102   cat >>confdefs.h <<EOF
18103 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18104 EOF
18105
18106 fi
18107 done
18108
18109 # use a compile-check to work with ncurses*-config and subdirectory includes
18110 echo "$as_me:18110: checking if we can use termcap.h" >&5
18111 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18112 if test "${cf_cv_have_termcap_h+set}" = set; then
18113   echo $ECHO_N "(cached) $ECHO_C" >&6
18114 else
18115
18116         cat >"conftest.$ac_ext" <<_ACEOF
18117 #line 18117 "configure"
18118 #include "confdefs.h"
18119
18120 #include <curses.h>
18121 #ifdef NCURSES_VERSION
18122 #undef NCURSES_VERSION
18123 #endif
18124 #include <termcap.h>
18125 #ifndef NCURSES_VERSION
18126 #error wrong header
18127 #endif
18128
18129 int
18130 main (void)
18131 {
18132 return 0;
18133   ;
18134   return 0;
18135 }
18136 _ACEOF
18137 rm -f "conftest.$ac_objext"
18138 if { (eval echo "$as_me:18138: \"$ac_compile\"") >&5
18139   (eval $ac_compile) 2>&5
18140   ac_status=$?
18141   echo "$as_me:18141: \$? = $ac_status" >&5
18142   (exit "$ac_status"); } &&
18143          { ac_try='test -s "conftest.$ac_objext"'
18144   { (eval echo "$as_me:18144: \"$ac_try\"") >&5
18145   (eval $ac_try) 2>&5
18146   ac_status=$?
18147   echo "$as_me:18147: \$? = $ac_status" >&5
18148   (exit "$ac_status"); }; }; then
18149   cf_cv_have_termcap_h=yes
18150 else
18151   echo "$as_me: failed program was:" >&5
18152 cat "conftest.$ac_ext" >&5
18153 cf_cv_have_termcap_h=no
18154 fi
18155 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18156 fi
18157 echo "$as_me:18157: result: $cf_cv_have_termcap_h" >&5
18158 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18159 if test "x$cf_cv_have_termcap_h" = xyes
18160 then
18161
18162 cat >>confdefs.h <<\EOF
18163 #define HAVE_TERMCAP_H 1
18164 EOF
18165
18166 else
18167 echo "$as_me:18167: checking if we can use ncurses/termcap.h" >&5
18168 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18169 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18170   echo $ECHO_N "(cached) $ECHO_C" >&6
18171 else
18172
18173         cat >"conftest.$ac_ext" <<_ACEOF
18174 #line 18174 "configure"
18175 #include "confdefs.h"
18176
18177 #include <ncurses/curses.h>
18178 #ifdef NCURSES_VERSION
18179 #undef NCURSES_VERSION
18180 #endif
18181 #include <ncurses/termcap.h>
18182 #ifndef NCURSES_VERSION
18183 #error wrong header
18184 #endif
18185
18186 int
18187 main (void)
18188 {
18189 return 0;
18190   ;
18191   return 0;
18192 }
18193 _ACEOF
18194 rm -f "conftest.$ac_objext"
18195 if { (eval echo "$as_me:18195: \"$ac_compile\"") >&5
18196   (eval $ac_compile) 2>&5
18197   ac_status=$?
18198   echo "$as_me:18198: \$? = $ac_status" >&5
18199   (exit "$ac_status"); } &&
18200          { ac_try='test -s "conftest.$ac_objext"'
18201   { (eval echo "$as_me:18201: \"$ac_try\"") >&5
18202   (eval $ac_try) 2>&5
18203   ac_status=$?
18204   echo "$as_me:18204: \$? = $ac_status" >&5
18205   (exit "$ac_status"); }; }; then
18206   cf_cv_have_ncurses_termcap_h=yes
18207 else
18208   echo "$as_me: failed program was:" >&5
18209 cat "conftest.$ac_ext" >&5
18210 cf_cv_have_ncurses_termcap_h=no
18211 fi
18212 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18213 fi
18214 echo "$as_me:18214: result: $cf_cv_have_ncurses_termcap_h" >&5
18215 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18216 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18217 cat >>confdefs.h <<\EOF
18218 #define HAVE_NCURSES_TERMCAP_H 1
18219 EOF
18220
18221 fi
18222
18223 if test "x$ac_cv_func_getopt" = xno; then
18224         { { echo "$as_me:18224: error: getopt is required for building programs" >&5
18225 echo "$as_me: error: getopt is required for building programs" >&2;}
18226    { (exit 1); exit 1; }; }
18227 fi
18228
18229 if test "$cf_enable_widec" = yes; then
18230
18231 for ac_func in \
18232 mblen \
18233 mbrlen \
18234 mbrtowc \
18235 mbsrtowcs \
18236 mbstowcs \
18237 mbtowc \
18238 wcsrtombs \
18239 wcstombs \
18240
18241 do
18242 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18243 echo "$as_me:18243: checking for $ac_func" >&5
18244 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18245 if eval "test \"\${$as_ac_var+set}\" = set"; then
18246   echo $ECHO_N "(cached) $ECHO_C" >&6
18247 else
18248   cat >"conftest.$ac_ext" <<_ACEOF
18249 #line 18249 "configure"
18250 #include "confdefs.h"
18251 #define $ac_func autoconf_temporary
18252 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18253 #undef $ac_func
18254
18255 #ifdef __cplusplus
18256 extern "C"
18257 #endif
18258
18259 /* We use char because int might match the return type of a gcc2
18260    builtin and then its argument prototype would still apply.  */
18261 char $ac_func (void);
18262
18263 int
18264 main (void)
18265 {
18266
18267 /* The GNU C library defines stubs for functions which it implements
18268     to always fail with ENOSYS.  Some functions are actually named
18269     something starting with __ and the normal name is an alias.  */
18270 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18271 #error found stub for $ac_func
18272 #endif
18273
18274         return $ac_func ();
18275   ;
18276   return 0;
18277 }
18278 _ACEOF
18279 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18280 if { (eval echo "$as_me:18280: \"$ac_link\"") >&5
18281   (eval $ac_link) 2>&5
18282   ac_status=$?
18283   echo "$as_me:18283: \$? = $ac_status" >&5
18284   (exit "$ac_status"); } &&
18285          { ac_try='test -s "conftest$ac_exeext"'
18286   { (eval echo "$as_me:18286: \"$ac_try\"") >&5
18287   (eval $ac_try) 2>&5
18288   ac_status=$?
18289   echo "$as_me:18289: \$? = $ac_status" >&5
18290   (exit "$ac_status"); }; }; then
18291   eval "$as_ac_var=yes"
18292 else
18293   echo "$as_me: failed program was:" >&5
18294 cat "conftest.$ac_ext" >&5
18295 eval "$as_ac_var=no"
18296 fi
18297 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18298 fi
18299 echo "$as_me:18299: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18300 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18301 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18302   cat >>confdefs.h <<EOF
18303 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18304 EOF
18305
18306 fi
18307 done
18308
18309 fi
18310
18311 echo "$as_me:18311: checking definition to turn on extended curses functions" >&5
18312 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18313 if test "${cf_cv_need_xopen_extension+set}" = set; then
18314   echo $ECHO_N "(cached) $ECHO_C" >&6
18315 else
18316
18317 cf_cv_need_xopen_extension=unknown
18318 cat >"conftest.$ac_ext" <<_ACEOF
18319 #line 18319 "configure"
18320 #include "confdefs.h"
18321
18322 #include <stdlib.h>
18323 #include <${cf_cv_ncurses_header:-curses.h}>
18324 int
18325 main (void)
18326 {
18327
18328 #if defined(NCURSES_VERSION_PATCH)
18329 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18330         make an error
18331 #endif
18332 #endif
18333 #ifdef NCURSES_WIDECHAR
18334 make an error   /* prefer to fall-through on the second checks */
18335 #endif
18336         cchar_t check;
18337         int check2 = curs_set((int)sizeof(check));
18338         long x = winnstr(stdscr, "", 0);
18339         int x1, y1;
18340         (void)check2;
18341         getbegyx(stdscr, y1, x1);
18342         (void)x;
18343         (void)y1;
18344         (void)x1;
18345
18346   ;
18347   return 0;
18348 }
18349 _ACEOF
18350 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18351 if { (eval echo "$as_me:18351: \"$ac_link\"") >&5
18352   (eval $ac_link) 2>&5
18353   ac_status=$?
18354   echo "$as_me:18354: \$? = $ac_status" >&5
18355   (exit "$ac_status"); } &&
18356          { ac_try='test -s "conftest$ac_exeext"'
18357   { (eval echo "$as_me:18357: \"$ac_try\"") >&5
18358   (eval $ac_try) 2>&5
18359   ac_status=$?
18360   echo "$as_me:18360: \$? = $ac_status" >&5
18361   (exit "$ac_status"); }; }; then
18362   cf_cv_need_xopen_extension=none
18363 else
18364   echo "$as_me: failed program was:" >&5
18365 cat "conftest.$ac_ext" >&5
18366
18367         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18368         do
18369                 cat >"conftest.$ac_ext" <<_ACEOF
18370 #line 18370 "configure"
18371 #include "confdefs.h"
18372
18373 #define $cf_try_xopen_extension 1
18374 #include <stdlib.h>
18375 #include <${cf_cv_ncurses_header:-curses.h}>
18376 int
18377 main (void)
18378 {
18379
18380                 cchar_t check;
18381                 int check2 = curs_set((int)sizeof(check));
18382                 long x = winnstr(stdscr, "", 0);
18383                 int x1, y1;
18384                 getbegyx(stdscr, y1, x1);
18385                 (void)check2;
18386                 (void)x;
18387                 (void)y1;
18388                 (void)x1;
18389
18390   ;
18391   return 0;
18392 }
18393 _ACEOF
18394 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18395 if { (eval echo "$as_me:18395: \"$ac_link\"") >&5
18396   (eval $ac_link) 2>&5
18397   ac_status=$?
18398   echo "$as_me:18398: \$? = $ac_status" >&5
18399   (exit "$ac_status"); } &&
18400          { ac_try='test -s "conftest$ac_exeext"'
18401   { (eval echo "$as_me:18401: \"$ac_try\"") >&5
18402   (eval $ac_try) 2>&5
18403   ac_status=$?
18404   echo "$as_me:18404: \$? = $ac_status" >&5
18405   (exit "$ac_status"); }; }; then
18406   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18407 else
18408   echo "$as_me: failed program was:" >&5
18409 cat "conftest.$ac_ext" >&5
18410 fi
18411 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18412         done
18413
18414 fi
18415 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18416
18417 fi
18418 echo "$as_me:18418: result: $cf_cv_need_xopen_extension" >&5
18419 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18420
18421 case "$cf_cv_need_xopen_extension" in
18422 (*_*)
18423
18424         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18425         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18426
18427         ;;
18428 esac
18429
18430 echo "$as_me:18430: checking for term.h" >&5
18431 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18432 if test "${cf_cv_term_header+set}" = set; then
18433   echo $ECHO_N "(cached) $ECHO_C" >&6
18434 else
18435
18436 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18437 # for <term.h> if we do not find the variant.
18438
18439 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18440
18441 case "${cf_cv_ncurses_header:-curses.h}" in
18442 (*/*)
18443         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18444         cf_header_list="$cf_header_item $cf_header_list"
18445         ;;
18446 esac
18447
18448 for cf_header in $cf_header_list
18449 do
18450         cat >"conftest.$ac_ext" <<_ACEOF
18451 #line 18451 "configure"
18452 #include "confdefs.h"
18453
18454 #include <${cf_cv_ncurses_header:-curses.h}>
18455 #include <${cf_header}>
18456 int
18457 main (void)
18458 {
18459 WINDOW *x; (void)x
18460   ;
18461   return 0;
18462 }
18463 _ACEOF
18464 rm -f "conftest.$ac_objext"
18465 if { (eval echo "$as_me:18465: \"$ac_compile\"") >&5
18466   (eval $ac_compile) 2>&5
18467   ac_status=$?
18468   echo "$as_me:18468: \$? = $ac_status" >&5
18469   (exit "$ac_status"); } &&
18470          { ac_try='test -s "conftest.$ac_objext"'
18471   { (eval echo "$as_me:18471: \"$ac_try\"") >&5
18472   (eval $ac_try) 2>&5
18473   ac_status=$?
18474   echo "$as_me:18474: \$? = $ac_status" >&5
18475   (exit "$ac_status"); }; }; then
18476   cf_cv_term_header=$cf_header
18477          break
18478 else
18479   echo "$as_me: failed program was:" >&5
18480 cat "conftest.$ac_ext" >&5
18481 cf_cv_term_header=no
18482 fi
18483 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18484 done
18485
18486 case "$cf_cv_term_header" in
18487 (no)
18488         # If curses is ncurses, some packagers still mess it up by trying to make
18489         # us use GNU termcap.  This handles the most common case.
18490         for cf_header in ncurses/term.h ncursesw/term.h
18491         do
18492                 cat >"conftest.$ac_ext" <<_ACEOF
18493 #line 18493 "configure"
18494 #include "confdefs.h"
18495
18496 #include <${cf_cv_ncurses_header:-curses.h}>
18497 #ifdef NCURSES_VERSION
18498 #include <${cf_header}>
18499 #else
18500 make an error
18501 #endif
18502 int
18503 main (void)
18504 {
18505 WINDOW *x; (void)x
18506   ;
18507   return 0;
18508 }
18509 _ACEOF
18510 rm -f "conftest.$ac_objext"
18511 if { (eval echo "$as_me:18511: \"$ac_compile\"") >&5
18512   (eval $ac_compile) 2>&5
18513   ac_status=$?
18514   echo "$as_me:18514: \$? = $ac_status" >&5
18515   (exit "$ac_status"); } &&
18516          { ac_try='test -s "conftest.$ac_objext"'
18517   { (eval echo "$as_me:18517: \"$ac_try\"") >&5
18518   (eval $ac_try) 2>&5
18519   ac_status=$?
18520   echo "$as_me:18520: \$? = $ac_status" >&5
18521   (exit "$ac_status"); }; }; then
18522   cf_cv_term_header=$cf_header
18523                          break
18524 else
18525   echo "$as_me: failed program was:" >&5
18526 cat "conftest.$ac_ext" >&5
18527 cf_cv_term_header=no
18528 fi
18529 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18530         done
18531         ;;
18532 esac
18533
18534 fi
18535 echo "$as_me:18535: result: $cf_cv_term_header" >&5
18536 echo "${ECHO_T}$cf_cv_term_header" >&6
18537
18538 case "$cf_cv_term_header" in
18539 (term.h)
18540
18541 cat >>confdefs.h <<\EOF
18542 #define HAVE_TERM_H 1
18543 EOF
18544
18545         ;;
18546 (ncurses/term.h)
18547
18548 cat >>confdefs.h <<\EOF
18549 #define HAVE_NCURSES_TERM_H 1
18550 EOF
18551
18552         ;;
18553 (ncursesw/term.h)
18554
18555 cat >>confdefs.h <<\EOF
18556 #define HAVE_NCURSESW_TERM_H 1
18557 EOF
18558
18559         ;;
18560 esac
18561
18562 echo "$as_me:18562: checking for unctrl.h" >&5
18563 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18564 if test "${cf_cv_unctrl_header+set}" = set; then
18565   echo $ECHO_N "(cached) $ECHO_C" >&6
18566 else
18567
18568 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18569 # for <unctrl.h> if we do not find the variant.
18570
18571 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18572
18573 case "${cf_cv_ncurses_header:-curses.h}" in
18574 (*/*)
18575         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18576         cf_header_list="$cf_header_item $cf_header_list"
18577         ;;
18578 esac
18579
18580 for cf_header in $cf_header_list
18581 do
18582         cat >"conftest.$ac_ext" <<_ACEOF
18583 #line 18583 "configure"
18584 #include "confdefs.h"
18585
18586 #include <${cf_cv_ncurses_header:-curses.h}>
18587 #include <${cf_header}>
18588 int
18589 main (void)
18590 {
18591 WINDOW *x; (void)x
18592   ;
18593   return 0;
18594 }
18595 _ACEOF
18596 rm -f "conftest.$ac_objext"
18597 if { (eval echo "$as_me:18597: \"$ac_compile\"") >&5
18598   (eval $ac_compile) 2>&5
18599   ac_status=$?
18600   echo "$as_me:18600: \$? = $ac_status" >&5
18601   (exit "$ac_status"); } &&
18602          { ac_try='test -s "conftest.$ac_objext"'
18603   { (eval echo "$as_me:18603: \"$ac_try\"") >&5
18604   (eval $ac_try) 2>&5
18605   ac_status=$?
18606   echo "$as_me:18606: \$? = $ac_status" >&5
18607   (exit "$ac_status"); }; }; then
18608   cf_cv_unctrl_header=$cf_header
18609          break
18610 else
18611   echo "$as_me: failed program was:" >&5
18612 cat "conftest.$ac_ext" >&5
18613 cf_cv_unctrl_header=no
18614 fi
18615 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18616 done
18617
18618 fi
18619 echo "$as_me:18619: result: $cf_cv_unctrl_header" >&5
18620 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18621
18622 case "$cf_cv_unctrl_header" in
18623 (no)
18624         { echo "$as_me:18624: WARNING: unctrl.h header not found" >&5
18625 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18626         ;;
18627 esac
18628
18629 case "$cf_cv_unctrl_header" in
18630 (unctrl.h)
18631
18632 cat >>confdefs.h <<\EOF
18633 #define HAVE_UNCTRL_H 1
18634 EOF
18635
18636         ;;
18637 (ncurses/unctrl.h)
18638
18639 cat >>confdefs.h <<\EOF
18640 #define HAVE_NCURSES_UNCTRL_H 1
18641 EOF
18642
18643         ;;
18644 (ncursesw/unctrl.h)
18645
18646 cat >>confdefs.h <<\EOF
18647 #define HAVE_NCURSESW_UNCTRL_H 1
18648 EOF
18649
18650         ;;
18651 esac
18652
18653 for cf_func in \
18654 alloc_pair \
18655 assume_default_colors \
18656 chgat \
18657 color_content \
18658 color_set \
18659 copywin \
18660 delscreen \
18661 dupwin \
18662 exit_curses \
18663 exit_terminfo \
18664 filter \
18665 getbegx \
18666 getcurx \
18667 getmaxx \
18668 getnstr \
18669 getparx \
18670 getwin \
18671 halfdelay \
18672 init_extended_color \
18673 mvderwin \
18674 mvvline \
18675 mvwin \
18676 mvwvline \
18677 napms \
18678 newpad \
18679 putwin \
18680 reset_color_pairs \
18681 resize_term \
18682 resizeterm \
18683 restartterm \
18684 ripoffline \
18685 scr_dump \
18686 setupterm \
18687 slk_color \
18688 slk_init \
18689 termattrs \
18690 termname \
18691 tgetent \
18692 tigetnum \
18693 tigetstr \
18694 tputs_sp \
18695 typeahead \
18696 use_default_colors \
18697 use_env \
18698 use_extended_names \
18699 use_screen \
18700 use_window \
18701 vid_puts \
18702 vidputs \
18703 vsscanf \
18704 vw_printw \
18705 wchgat \
18706 winsdelln \
18707 winsstr \
18708 wresize \
18709 wsyncdown \
18710 _tracef \
18711
18712 do
18713
18714 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18715
18716         echo "$as_me:18716: checking for ${cf_func}" >&5
18717 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18718
18719 echo "${as_me:-configure}:18719: testing ${cf_func} ..." 1>&5
18720
18721         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18722   echo $ECHO_N "(cached) $ECHO_C" >&6
18723 else
18724
18725                 eval cf_result='$ac_cv_func_'$cf_func
18726                 if test ".$cf_result" != ".no"; then
18727                         cat >"conftest.$ac_ext" <<_ACEOF
18728 #line 18728 "configure"
18729 #include "confdefs.h"
18730
18731 #ifdef HAVE_XCURSES
18732 #include <xcurses.h>
18733 char * XCursesProgramName = "test";
18734 #else
18735 #include <${cf_cv_ncurses_header:-curses.h}>
18736 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18737 #include <ncursesw/term.h>
18738 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18739 #include <ncurses/term.h>
18740 #elif defined(HAVE_TERM_H)
18741 #include <term.h>
18742 #endif
18743 #endif
18744
18745 int
18746 main (void)
18747 {
18748
18749 #ifndef ${cf_func}
18750 long foo = (long)(&${cf_func});
18751 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18752 if (foo + 1234L > 5678L)
18753         ${cf_cv_main_return:-return}(foo != 0);
18754 #endif
18755
18756   ;
18757   return 0;
18758 }
18759 _ACEOF
18760 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18761 if { (eval echo "$as_me:18761: \"$ac_link\"") >&5
18762   (eval $ac_link) 2>&5
18763   ac_status=$?
18764   echo "$as_me:18764: \$? = $ac_status" >&5
18765   (exit "$ac_status"); } &&
18766          { ac_try='test -s "conftest$ac_exeext"'
18767   { (eval echo "$as_me:18767: \"$ac_try\"") >&5
18768   (eval $ac_try) 2>&5
18769   ac_status=$?
18770   echo "$as_me:18770: \$? = $ac_status" >&5
18771   (exit "$ac_status"); }; }; then
18772   cf_result=yes
18773 else
18774   echo "$as_me: failed program was:" >&5
18775 cat "conftest.$ac_ext" >&5
18776 cf_result=no
18777 fi
18778 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18779                 fi
18780                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18781
18782 fi
18783
18784         # use the computed/retrieved cache-value:
18785         eval 'cf_result=$cf_cv_func_'$cf_func
18786         echo "$as_me:18786: result: $cf_result" >&5
18787 echo "${ECHO_T}$cf_result" >&6
18788         if test "$cf_result" != no; then
18789                 cat >>confdefs.h <<EOF
18790 #define HAVE_${cf_tr_func} 1
18791 EOF
18792
18793         fi
18794 done
18795
18796 for cf_func in tputs
18797 do
18798
18799 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18800
18801         echo "$as_me:18801: checking for ${cf_func}" >&5
18802 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18803
18804 echo "${as_me:-configure}:18804: testing ${cf_func} ..." 1>&5
18805
18806         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18807   echo $ECHO_N "(cached) $ECHO_C" >&6
18808 else
18809
18810                 eval cf_result='$ac_cv_func_'$cf_func
18811                 if test ".$cf_result" != ".no"; then
18812                         cat >"conftest.$ac_ext" <<_ACEOF
18813 #line 18813 "configure"
18814 #include "confdefs.h"
18815
18816 #ifdef HAVE_XCURSES
18817 #include <xcurses.h>
18818 char * XCursesProgramName = "test";
18819 #else
18820 #include <${cf_cv_ncurses_header:-curses.h}>
18821 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18822 #include <ncursesw/term.h>
18823 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18824 #include <ncurses/term.h>
18825 #elif defined(HAVE_TERM_H)
18826 #include <term.h>
18827 #endif
18828 #endif
18829
18830 int
18831 main (void)
18832 {
18833
18834 #ifndef ${cf_func}
18835 long foo = (long)(&${cf_func});
18836 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18837 if (foo + 1234L > 5678L)
18838         ${cf_cv_main_return:-return}(foo != 0);
18839 #endif
18840
18841   ;
18842   return 0;
18843 }
18844 _ACEOF
18845 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18846 if { (eval echo "$as_me:18846: \"$ac_link\"") >&5
18847   (eval $ac_link) 2>&5
18848   ac_status=$?
18849   echo "$as_me:18849: \$? = $ac_status" >&5
18850   (exit "$ac_status"); } &&
18851          { ac_try='test -s "conftest$ac_exeext"'
18852   { (eval echo "$as_me:18852: \"$ac_try\"") >&5
18853   (eval $ac_try) 2>&5
18854   ac_status=$?
18855   echo "$as_me:18855: \$? = $ac_status" >&5
18856   (exit "$ac_status"); }; }; then
18857   cf_result=yes
18858 else
18859   echo "$as_me: failed program was:" >&5
18860 cat "conftest.$ac_ext" >&5
18861 cf_result=no
18862 fi
18863 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18864                 fi
18865                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18866
18867 fi
18868
18869         # use the computed/retrieved cache-value:
18870         eval 'cf_result=$cf_cv_func_'$cf_func
18871         echo "$as_me:18871: result: $cf_result" >&5
18872 echo "${ECHO_T}$cf_result" >&6
18873         if test "$cf_result" != no; then
18874                 cat >>confdefs.h <<EOF
18875 #define HAVE_${cf_tr_func} 1
18876 EOF
18877
18878         fi
18879 done
18880
18881 if test "x$cf_cv_func_tputs" = xyes
18882 then
18883         cf_done=no
18884         for cf_arg in int char
18885         do
18886                 for cf_ret in int void
18887                 do
18888                         if test "$cf_ret" = void
18889                         then
18890                                 cf_return="/* nothing */"
18891                         else
18892                                 cf_return="return value"
18893                         fi
18894                         cat >"conftest.$ac_ext" <<_ACEOF
18895 #line 18895 "configure"
18896 #include "confdefs.h"
18897
18898 #include <${cf_cv_ncurses_header:-curses.h}>
18899 #include <$cf_cv_term_header>
18900
18901 static $cf_ret outc($cf_arg value) { $cf_return; }
18902
18903 int
18904 main (void)
18905 {
18906
18907         tputs("hello", 0, outc);
18908         ${cf_cv_main_return:-return}(0);
18909
18910   ;
18911   return 0;
18912 }
18913 _ACEOF
18914 rm -f "conftest.$ac_objext"
18915 if { (eval echo "$as_me:18915: \"$ac_compile\"") >&5
18916   (eval $ac_compile) 2>&5
18917   ac_status=$?
18918   echo "$as_me:18918: \$? = $ac_status" >&5
18919   (exit "$ac_status"); } &&
18920          { ac_try='test -s "conftest.$ac_objext"'
18921   { (eval echo "$as_me:18921: \"$ac_try\"") >&5
18922   (eval $ac_try) 2>&5
18923   ac_status=$?
18924   echo "$as_me:18924: \$? = $ac_status" >&5
18925   (exit "$ac_status"); }; }; then
18926
18927                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18928
18929 echo "${as_me:-configure}:18929: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18930
18931                 cat >>confdefs.h <<EOF
18932 #define TPUTS_ARG               $cf_arg
18933 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18934 #define TPUTS_RETURN(value)     $cf_return
18935 EOF
18936                 cf_done=yes
18937                 break
18938
18939 else
18940   echo "$as_me: failed program was:" >&5
18941 cat "conftest.$ac_ext" >&5
18942 fi
18943 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18944                 done
18945                 test "$cf_done" = yes && break
18946         done
18947 fi
18948
18949 echo "$as_me:18949: checking for ncurses extended functions" >&5
18950 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18951 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18952   echo $ECHO_N "(cached) $ECHO_C" >&6
18953 else
18954
18955 cat >"conftest.$ac_ext" <<_ACEOF
18956 #line 18956 "configure"
18957 #include "confdefs.h"
18958
18959 #include <${cf_cv_ncurses_header:-curses.h}>
18960 int
18961 main (void)
18962 {
18963
18964 int x = NCURSES_EXT_FUNCS
18965
18966   ;
18967   return 0;
18968 }
18969 _ACEOF
18970 rm -f "conftest.$ac_objext"
18971 if { (eval echo "$as_me:18971: \"$ac_compile\"") >&5
18972   (eval $ac_compile) 2>&5
18973   ac_status=$?
18974   echo "$as_me:18974: \$? = $ac_status" >&5
18975   (exit "$ac_status"); } &&
18976          { ac_try='test -s "conftest.$ac_objext"'
18977   { (eval echo "$as_me:18977: \"$ac_try\"") >&5
18978   (eval $ac_try) 2>&5
18979   ac_status=$?
18980   echo "$as_me:18980: \$? = $ac_status" >&5
18981   (exit "$ac_status"); }; }; then
18982   cf_cv_ncurses_ext_funcs=defined
18983 else
18984   echo "$as_me: failed program was:" >&5
18985 cat "conftest.$ac_ext" >&5
18986
18987 cat >"conftest.$ac_ext" <<_ACEOF
18988 #line 18988 "configure"
18989 #include "confdefs.h"
18990
18991 #include <${cf_cv_ncurses_header:-curses.h}>
18992 int
18993 main (void)
18994 {
18995
18996         (void) assume_default_colors (0, 0);
18997         (void) curses_version ();
18998         (void) define_key (0, 0);
18999         (void) is_term_resized (0, 0);
19000         (void) key_defined (0);
19001         (void) keybound (0, 0);
19002         (void) keyok (0, 0);
19003         (void) resize_term (0, 0);
19004         (void) resizeterm (0, 0);
19005         (void) use_default_colors ();
19006         (void) use_extended_names (0);
19007         (void) wresize (0, 0, 0);
19008   ;
19009   return 0;
19010 }
19011 _ACEOF
19012 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19013 if { (eval echo "$as_me:19013: \"$ac_link\"") >&5
19014   (eval $ac_link) 2>&5
19015   ac_status=$?
19016   echo "$as_me:19016: \$? = $ac_status" >&5
19017   (exit "$ac_status"); } &&
19018          { ac_try='test -s "conftest$ac_exeext"'
19019   { (eval echo "$as_me:19019: \"$ac_try\"") >&5
19020   (eval $ac_try) 2>&5
19021   ac_status=$?
19022   echo "$as_me:19022: \$? = $ac_status" >&5
19023   (exit "$ac_status"); }; }; then
19024   cf_cv_ncurses_ext_funcs=yes
19025 else
19026   echo "$as_me: failed program was:" >&5
19027 cat "conftest.$ac_ext" >&5
19028 cf_cv_ncurses_ext_funcs=no
19029 fi
19030 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19031
19032 fi
19033 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19034
19035 fi
19036 echo "$as_me:19036: result: $cf_cv_ncurses_ext_funcs" >&5
19037 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19038 test "$cf_cv_ncurses_ext_funcs" = yes &&
19039 cat >>confdefs.h <<\EOF
19040 #define NCURSES_EXT_FUNCS 1
19041 EOF
19042
19043 if test "$cf_enable_widec" = yes
19044 then
19045         # workaround for systems with ncurses before 20111029, due to change of
19046         # feature test macro from _XPG5 to _XOPEN_SOURCE
19047         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19048         then
19049                 cf_define_xpg5=no
19050                 echo "$as_me:19050: checking if _XPG5 should be defined to enable wide-characters" >&5
19051 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19052
19053                 cat >"conftest.$ac_ext" <<_ACEOF
19054 #line 19054 "configure"
19055 #include "confdefs.h"
19056
19057 #include <${cf_cv_ncurses_header:-curses.h}>
19058 int
19059 main (void)
19060 {
19061 int x = _XPG5
19062   ;
19063   return 0;
19064 }
19065 _ACEOF
19066 rm -f "conftest.$ac_objext"
19067 if { (eval echo "$as_me:19067: \"$ac_compile\"") >&5
19068   (eval $ac_compile) 2>&5
19069   ac_status=$?
19070   echo "$as_me:19070: \$? = $ac_status" >&5
19071   (exit "$ac_status"); } &&
19072          { ac_try='test -s "conftest.$ac_objext"'
19073   { (eval echo "$as_me:19073: \"$ac_try\"") >&5
19074   (eval $ac_try) 2>&5
19075   ac_status=$?
19076   echo "$as_me:19076: \$? = $ac_status" >&5
19077   (exit "$ac_status"); }; }; then
19078   :
19079 else
19080   echo "$as_me: failed program was:" >&5
19081 cat "conftest.$ac_ext" >&5
19082 cf_save_cppflags="$CPPFLAGS"
19083                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19084                          cat >"conftest.$ac_ext" <<_ACEOF
19085 #line 19085 "configure"
19086 #include "confdefs.h"
19087
19088 #include <${cf_cv_ncurses_header:-curses.h}>
19089 int
19090 main (void)
19091 {
19092 int x = _XPG5
19093   ;
19094   return 0;
19095 }
19096 _ACEOF
19097 rm -f "conftest.$ac_objext"
19098 if { (eval echo "$as_me:19098: \"$ac_compile\"") >&5
19099   (eval $ac_compile) 2>&5
19100   ac_status=$?
19101   echo "$as_me:19101: \$? = $ac_status" >&5
19102   (exit "$ac_status"); } &&
19103          { ac_try='test -s "conftest.$ac_objext"'
19104   { (eval echo "$as_me:19104: \"$ac_try\"") >&5
19105   (eval $ac_try) 2>&5
19106   ac_status=$?
19107   echo "$as_me:19107: \$? = $ac_status" >&5
19108   (exit "$ac_status"); }; }; then
19109   cf_define_xpg5=yes
19110 else
19111   echo "$as_me: failed program was:" >&5
19112 cat "conftest.$ac_ext" >&5
19113 fi
19114 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19115                          CPPFLAGS="$cf_save_cppflags"
19116 fi
19117 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19118                 echo "$as_me:19118: result: $cf_define_xpg5" >&5
19119 echo "${ECHO_T}$cf_define_xpg5" >&6
19120
19121                 if test "$cf_define_xpg5" = yes
19122                 then
19123                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19124                 fi
19125         fi
19126
19127         echo "$as_me:19127: checking for wide-character functions" >&5
19128 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19129 if test "${cf_cv_widechar_funcs+set}" = set; then
19130   echo $ECHO_N "(cached) $ECHO_C" >&6
19131 else
19132
19133         cat >"conftest.$ac_ext" <<_ACEOF
19134 #line 19134 "configure"
19135 #include "confdefs.h"
19136
19137 #include <${cf_cv_ncurses_header:-curses.h}>
19138 int
19139 main (void)
19140 {
19141
19142                 static wchar_t src_wchar[2];
19143                 static cchar_t dst_cchar;
19144                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19145
19146   ;
19147   return 0;
19148 }
19149 _ACEOF
19150 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19151 if { (eval echo "$as_me:19151: \"$ac_link\"") >&5
19152   (eval $ac_link) 2>&5
19153   ac_status=$?
19154   echo "$as_me:19154: \$? = $ac_status" >&5
19155   (exit "$ac_status"); } &&
19156          { ac_try='test -s "conftest$ac_exeext"'
19157   { (eval echo "$as_me:19157: \"$ac_try\"") >&5
19158   (eval $ac_try) 2>&5
19159   ac_status=$?
19160   echo "$as_me:19160: \$? = $ac_status" >&5
19161   (exit "$ac_status"); }; }; then
19162   cf_cv_widechar_funcs=yes
19163 else
19164   echo "$as_me: failed program was:" >&5
19165 cat "conftest.$ac_ext" >&5
19166 cf_cv_widechar_funcs=no
19167 fi
19168 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19169
19170 fi
19171 echo "$as_me:19171: result: $cf_cv_widechar_funcs" >&5
19172 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19173         if test "$cf_cv_widechar_funcs" != no ; then
19174
19175 cat >>confdefs.h <<\EOF
19176 #define USE_WIDEC_SUPPORT 1
19177 EOF
19178
19179         else
19180                 cat >>confdefs.h <<\EOF
19181 #define USE_WIDEC_SUPPORT 0
19182 EOF
19183
19184         fi
19185 else
19186         cat >>confdefs.h <<\EOF
19187 #define USE_WIDEC_SUPPORT 0
19188 EOF
19189
19190 fi
19191
19192 echo "$as_me:19192: checking if $cf_cv_screen library uses pthreads" >&5
19193 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19194 if test "${cf_cv_use_pthreads+set}" = set; then
19195   echo $ECHO_N "(cached) $ECHO_C" >&6
19196 else
19197
19198 cat >"conftest.$ac_ext" <<_ACEOF
19199 #line 19199 "configure"
19200 #include "confdefs.h"
19201
19202 #include <${cf_cv_ncurses_header:-curses.h}>
19203 extern void _nc_init_pthreads(void);
19204
19205 int
19206 main (void)
19207 {
19208
19209         initscr();
19210         _nc_init_pthreads();
19211
19212   ;
19213   return 0;
19214 }
19215 _ACEOF
19216 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19217 if { (eval echo "$as_me:19217: \"$ac_link\"") >&5
19218   (eval $ac_link) 2>&5
19219   ac_status=$?
19220   echo "$as_me:19220: \$? = $ac_status" >&5
19221   (exit "$ac_status"); } &&
19222          { ac_try='test -s "conftest$ac_exeext"'
19223   { (eval echo "$as_me:19223: \"$ac_try\"") >&5
19224   (eval $ac_try) 2>&5
19225   ac_status=$?
19226   echo "$as_me:19226: \$? = $ac_status" >&5
19227   (exit "$ac_status"); }; }; then
19228   cf_cv_use_pthreads=yes
19229 else
19230   echo "$as_me: failed program was:" >&5
19231 cat "conftest.$ac_ext" >&5
19232 cf_cv_use_pthreads=no
19233 fi
19234 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19235
19236 fi
19237 echo "$as_me:19237: result: $cf_cv_use_pthreads" >&5
19238 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19239 test $cf_cv_use_pthreads = yes &&
19240 cat >>confdefs.h <<\EOF
19241 #define USE_PTHREADS 1
19242 EOF
19243
19244 echo "$as_me:19244: checking if sys/time.h works with sys/select.h" >&5
19245 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19246 if test "${cf_cv_sys_time_select+set}" = set; then
19247   echo $ECHO_N "(cached) $ECHO_C" >&6
19248 else
19249
19250 cat >"conftest.$ac_ext" <<_ACEOF
19251 #line 19251 "configure"
19252 #include "confdefs.h"
19253
19254 #include <sys/types.h>
19255 #ifdef HAVE_SYS_TIME_H
19256 #include <sys/time.h>
19257 #endif
19258 #ifdef HAVE_SYS_SELECT_H
19259 #include <sys/select.h>
19260 #endif
19261
19262 int
19263 main (void)
19264 {
19265
19266   ;
19267   return 0;
19268 }
19269 _ACEOF
19270 rm -f "conftest.$ac_objext"
19271 if { (eval echo "$as_me:19271: \"$ac_compile\"") >&5
19272   (eval $ac_compile) 2>&5
19273   ac_status=$?
19274   echo "$as_me:19274: \$? = $ac_status" >&5
19275   (exit "$ac_status"); } &&
19276          { ac_try='test -s "conftest.$ac_objext"'
19277   { (eval echo "$as_me:19277: \"$ac_try\"") >&5
19278   (eval $ac_try) 2>&5
19279   ac_status=$?
19280   echo "$as_me:19280: \$? = $ac_status" >&5
19281   (exit "$ac_status"); }; }; then
19282   cf_cv_sys_time_select=yes
19283 else
19284   echo "$as_me: failed program was:" >&5
19285 cat "conftest.$ac_ext" >&5
19286 cf_cv_sys_time_select=no
19287 fi
19288 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19289
19290 fi
19291
19292 echo "$as_me:19292: result: $cf_cv_sys_time_select" >&5
19293 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19294 test "$cf_cv_sys_time_select" = yes &&
19295 cat >>confdefs.h <<\EOF
19296 #define HAVE_SYS_TIME_SELECT 1
19297 EOF
19298
19299 # special check for test/ditto.c
19300
19301 echo "$as_me:19301: checking for openpty in -lutil" >&5
19302 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19303 if test "${ac_cv_lib_util_openpty+set}" = set; then
19304   echo $ECHO_N "(cached) $ECHO_C" >&6
19305 else
19306   ac_check_lib_save_LIBS=$LIBS
19307 LIBS="-lutil  $LIBS"
19308 cat >"conftest.$ac_ext" <<_ACEOF
19309 #line 19309 "configure"
19310 #include "confdefs.h"
19311
19312 /* Override any gcc2 internal prototype to avoid an error.  */
19313 #ifdef __cplusplus
19314 extern "C"
19315 #endif
19316 /* We use char because int might match the return type of a gcc2
19317    builtin and then its argument prototype would still apply.  */
19318 char openpty ();
19319 int
19320 main (void)
19321 {
19322 openpty ();
19323   ;
19324   return 0;
19325 }
19326 _ACEOF
19327 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19328 if { (eval echo "$as_me:19328: \"$ac_link\"") >&5
19329   (eval $ac_link) 2>&5
19330   ac_status=$?
19331   echo "$as_me:19331: \$? = $ac_status" >&5
19332   (exit "$ac_status"); } &&
19333          { ac_try='test -s "conftest$ac_exeext"'
19334   { (eval echo "$as_me:19334: \"$ac_try\"") >&5
19335   (eval $ac_try) 2>&5
19336   ac_status=$?
19337   echo "$as_me:19337: \$? = $ac_status" >&5
19338   (exit "$ac_status"); }; }; then
19339   ac_cv_lib_util_openpty=yes
19340 else
19341   echo "$as_me: failed program was:" >&5
19342 cat "conftest.$ac_ext" >&5
19343 ac_cv_lib_util_openpty=no
19344 fi
19345 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19346 LIBS=$ac_check_lib_save_LIBS
19347 fi
19348 echo "$as_me:19348: result: $ac_cv_lib_util_openpty" >&5
19349 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19350 if test "$ac_cv_lib_util_openpty" = yes; then
19351   cf_cv_lib_util=yes
19352 else
19353   cf_cv_lib_util=no
19354 fi
19355
19356 echo "$as_me:19356: checking for openpty header" >&5
19357 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19358 if test "${cf_cv_func_openpty+set}" = set; then
19359   echo $ECHO_N "(cached) $ECHO_C" >&6
19360 else
19361
19362         cf_save_LIBS="$LIBS"
19363         test "$cf_cv_lib_util" = yes && {
19364 cf_add_libs="$LIBS"
19365 # reverse order
19366 cf_add_0lib=
19367 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19368 # filter duplicates
19369 for cf_add_1lib in $cf_add_0lib; do
19370         for cf_add_2lib in $cf_add_libs; do
19371                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19372                         cf_add_1lib=
19373                         break
19374                 fi
19375         done
19376         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19377 done
19378 LIBS="$cf_add_libs"
19379  }
19380         for cf_header in pty.h libutil.h util.h
19381         do
19382         cat >"conftest.$ac_ext" <<_ACEOF
19383 #line 19383 "configure"
19384 #include "confdefs.h"
19385
19386 #include <$cf_header>
19387
19388 int
19389 main (void)
19390 {
19391
19392         int x = openpty((int *)0, (int *)0, (char *)0,
19393                                    (struct termios *)0, (struct winsize *)0);
19394
19395   ;
19396   return 0;
19397 }
19398 _ACEOF
19399 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19400 if { (eval echo "$as_me:19400: \"$ac_link\"") >&5
19401   (eval $ac_link) 2>&5
19402   ac_status=$?
19403   echo "$as_me:19403: \$? = $ac_status" >&5
19404   (exit "$ac_status"); } &&
19405          { ac_try='test -s "conftest$ac_exeext"'
19406   { (eval echo "$as_me:19406: \"$ac_try\"") >&5
19407   (eval $ac_try) 2>&5
19408   ac_status=$?
19409   echo "$as_me:19409: \$? = $ac_status" >&5
19410   (exit "$ac_status"); }; }; then
19411
19412                 cf_cv_func_openpty=$cf_header
19413                 break
19414
19415 else
19416   echo "$as_me: failed program was:" >&5
19417 cat "conftest.$ac_ext" >&5
19418
19419                 cf_cv_func_openpty=no
19420
19421 fi
19422 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19423         done
19424         LIBS="$cf_save_LIBS"
19425
19426 fi
19427 echo "$as_me:19427: result: $cf_cv_func_openpty" >&5
19428 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19429
19430 if test "$cf_cv_func_openpty" != no ; then
19431
19432 cat >>confdefs.h <<EOF
19433 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19434 EOF
19435
19436 cat >>confdefs.h <<\EOF
19437 #define USE_XTERM_PTY 1
19438 EOF
19439
19440         if test "x$cf_cv_lib_util" = xyes ; then
19441
19442 cf_add_libs="$TEST_LIBS"
19443 # reverse order
19444 cf_add_0lib=
19445 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19446 # filter duplicates
19447 for cf_add_1lib in $cf_add_0lib; do
19448         for cf_add_2lib in $cf_add_libs; do
19449                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19450                         cf_add_1lib=
19451                         break
19452                 fi
19453         done
19454         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19455 done
19456 TEST_LIBS="$cf_add_libs"
19457
19458         fi
19459 fi
19460
19461 echo "$as_me:19461: checking for function curses_version" >&5
19462 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19463 if test "${cf_cv_func_curses_version+set}" = set; then
19464   echo $ECHO_N "(cached) $ECHO_C" >&6
19465 else
19466
19467 if test "$cross_compiling" = yes; then
19468   cf_cv_func_curses_version=unknown
19469 else
19470   cat >"conftest.$ac_ext" <<_ACEOF
19471 #line 19471 "configure"
19472 #include "confdefs.h"
19473
19474 #include <${cf_cv_ncurses_header:-curses.h}>
19475 int main(void)
19476 {
19477         char temp[1024];
19478         sprintf(temp, "%s\\n", curses_version());
19479         ${cf_cv_main_return:-return}(0);
19480 }
19481
19482 _ACEOF
19483 rm -f "conftest$ac_exeext"
19484 if { (eval echo "$as_me:19484: \"$ac_link\"") >&5
19485   (eval $ac_link) 2>&5
19486   ac_status=$?
19487   echo "$as_me:19487: \$? = $ac_status" >&5
19488   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19489   { (eval echo "$as_me:19489: \"$ac_try\"") >&5
19490   (eval $ac_try) 2>&5
19491   ac_status=$?
19492   echo "$as_me:19492: \$? = $ac_status" >&5
19493   (exit "$ac_status"); }; }; then
19494   cf_cv_func_curses_version=yes
19495
19496 else
19497   echo "$as_me: program exited with status $ac_status" >&5
19498 echo "$as_me: failed program was:" >&5
19499 cat "conftest.$ac_ext" >&5
19500 cf_cv_func_curses_version=no
19501
19502 fi
19503 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19504 fi
19505 rm -f core
19506 fi
19507 echo "$as_me:19507: result: $cf_cv_func_curses_version" >&5
19508 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19509 test "$cf_cv_func_curses_version" = yes &&
19510 cat >>confdefs.h <<\EOF
19511 #define HAVE_CURSES_VERSION 1
19512 EOF
19513
19514 echo "$as_me:19514: checking for alternate character set array" >&5
19515 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19516 if test "${cf_cv_curses_acs_map+set}" = set; then
19517   echo $ECHO_N "(cached) $ECHO_C" >&6
19518 else
19519
19520 cf_cv_curses_acs_map=unknown
19521 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19522 do
19523 cat >"conftest.$ac_ext" <<_ACEOF
19524 #line 19524 "configure"
19525 #include "confdefs.h"
19526
19527 #include <${cf_cv_ncurses_header:-curses.h}>
19528
19529 int
19530 main (void)
19531 {
19532
19533 ${name}['k'] = ACS_PLUS
19534
19535   ;
19536   return 0;
19537 }
19538 _ACEOF
19539 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19540 if { (eval echo "$as_me:19540: \"$ac_link\"") >&5
19541   (eval $ac_link) 2>&5
19542   ac_status=$?
19543   echo "$as_me:19543: \$? = $ac_status" >&5
19544   (exit "$ac_status"); } &&
19545          { ac_try='test -s "conftest$ac_exeext"'
19546   { (eval echo "$as_me:19546: \"$ac_try\"") >&5
19547   (eval $ac_try) 2>&5
19548   ac_status=$?
19549   echo "$as_me:19549: \$? = $ac_status" >&5
19550   (exit "$ac_status"); }; }; then
19551   cf_cv_curses_acs_map=$name; break
19552 else
19553   echo "$as_me: failed program was:" >&5
19554 cat "conftest.$ac_ext" >&5
19555 fi
19556 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19557 done
19558
19559 fi
19560 echo "$as_me:19560: result: $cf_cv_curses_acs_map" >&5
19561 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19562
19563 test "$cf_cv_curses_acs_map" != unknown &&
19564 cat >>confdefs.h <<EOF
19565 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19566 EOF
19567
19568 if test "$cf_enable_widec" = yes; then
19569
19570 echo "$as_me:19570: checking for wide alternate character set array" >&5
19571 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19572 if test "${cf_cv_curses_wacs_map+set}" = set; then
19573   echo $ECHO_N "(cached) $ECHO_C" >&6
19574 else
19575
19576         cf_cv_curses_wacs_map=unknown
19577         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19578         do
19579         cat >"conftest.$ac_ext" <<_ACEOF
19580 #line 19580 "configure"
19581 #include "confdefs.h"
19582
19583 #ifndef _XOPEN_SOURCE_EXTENDED
19584 #define _XOPEN_SOURCE_EXTENDED
19585 #endif
19586 #include <${cf_cv_ncurses_header:-curses.h}>
19587 int
19588 main (void)
19589 {
19590 void *foo = &(${name}['k']); (void)foo
19591   ;
19592   return 0;
19593 }
19594 _ACEOF
19595 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19596 if { (eval echo "$as_me:19596: \"$ac_link\"") >&5
19597   (eval $ac_link) 2>&5
19598   ac_status=$?
19599   echo "$as_me:19599: \$? = $ac_status" >&5
19600   (exit "$ac_status"); } &&
19601          { ac_try='test -s "conftest$ac_exeext"'
19602   { (eval echo "$as_me:19602: \"$ac_try\"") >&5
19603   (eval $ac_try) 2>&5
19604   ac_status=$?
19605   echo "$as_me:19605: \$? = $ac_status" >&5
19606   (exit "$ac_status"); }; }; then
19607   cf_cv_curses_wacs_map=$name
19608          break
19609 else
19610   echo "$as_me: failed program was:" >&5
19611 cat "conftest.$ac_ext" >&5
19612 fi
19613 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19614         done
19615 fi
19616 echo "$as_me:19616: result: $cf_cv_curses_wacs_map" >&5
19617 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19618
19619 test "$cf_cv_curses_wacs_map" != unknown &&
19620 cat >>confdefs.h <<EOF
19621 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19622 EOF
19623
19624 echo "$as_me:19624: checking for wide alternate character constants" >&5
19625 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19626 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19627   echo $ECHO_N "(cached) $ECHO_C" >&6
19628 else
19629
19630 cf_cv_curses_wacs_symbols=no
19631 if test "$cf_cv_curses_wacs_map" != unknown
19632 then
19633         cat >"conftest.$ac_ext" <<_ACEOF
19634 #line 19634 "configure"
19635 #include "confdefs.h"
19636
19637 #ifndef _XOPEN_SOURCE_EXTENDED
19638 #define _XOPEN_SOURCE_EXTENDED
19639 #endif
19640 #include <${cf_cv_ncurses_header:-curses.h}>
19641 int
19642 main (void)
19643 {
19644 cchar_t *foo = WACS_PLUS;
19645          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
19646   ;
19647   return 0;
19648 }
19649 _ACEOF
19650 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19651 if { (eval echo "$as_me:19651: \"$ac_link\"") >&5
19652   (eval $ac_link) 2>&5
19653   ac_status=$?
19654   echo "$as_me:19654: \$? = $ac_status" >&5
19655   (exit "$ac_status"); } &&
19656          { ac_try='test -s "conftest$ac_exeext"'
19657   { (eval echo "$as_me:19657: \"$ac_try\"") >&5
19658   (eval $ac_try) 2>&5
19659   ac_status=$?
19660   echo "$as_me:19660: \$? = $ac_status" >&5
19661   (exit "$ac_status"); }; }; then
19662   cf_cv_curses_wacs_symbols=yes
19663 else
19664   echo "$as_me: failed program was:" >&5
19665 cat "conftest.$ac_ext" >&5
19666 fi
19667 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19668 else
19669         cat >"conftest.$ac_ext" <<_ACEOF
19670 #line 19670 "configure"
19671 #include "confdefs.h"
19672
19673 #ifndef _XOPEN_SOURCE_EXTENDED
19674 #define _XOPEN_SOURCE_EXTENDED
19675 #endif
19676 #include <${cf_cv_ncurses_header:-curses.h}>
19677 int
19678 main (void)
19679 {
19680 cchar_t *foo = WACS_PLUS; (void)foo
19681   ;
19682   return 0;
19683 }
19684 _ACEOF
19685 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19686 if { (eval echo "$as_me:19686: \"$ac_link\"") >&5
19687   (eval $ac_link) 2>&5
19688   ac_status=$?
19689   echo "$as_me:19689: \$? = $ac_status" >&5
19690   (exit "$ac_status"); } &&
19691          { ac_try='test -s "conftest$ac_exeext"'
19692   { (eval echo "$as_me:19692: \"$ac_try\"") >&5
19693   (eval $ac_try) 2>&5
19694   ac_status=$?
19695   echo "$as_me:19695: \$? = $ac_status" >&5
19696   (exit "$ac_status"); }; }; then
19697   cf_cv_curses_wacs_symbols=yes
19698 else
19699   echo "$as_me: failed program was:" >&5
19700 cat "conftest.$ac_ext" >&5
19701 fi
19702 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19703 fi
19704
19705 fi
19706 echo "$as_me:19706: result: $cf_cv_curses_wacs_symbols" >&5
19707 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19708
19709 test "$cf_cv_curses_wacs_symbols" != no &&
19710 cat >>confdefs.h <<\EOF
19711 #define CURSES_WACS_SYMBOLS 1
19712 EOF
19713
19714 fi
19715
19716 echo "$as_me:19716: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19717 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19718 cat >"conftest.$ac_ext" <<_ACEOF
19719 #line 19719 "configure"
19720 #include "confdefs.h"
19721
19722 #ifndef _XOPEN_SOURCE_EXTENDED
19723 #define _XOPEN_SOURCE_EXTENDED
19724 #endif
19725 #include <${cf_cv_ncurses_header:-curses.h}>
19726 int
19727 main (void)
19728 {
19729
19730 attr_t foo
19731
19732   ;
19733   return 0;
19734 }
19735 _ACEOF
19736 rm -f "conftest.$ac_objext"
19737 if { (eval echo "$as_me:19737: \"$ac_compile\"") >&5
19738   (eval $ac_compile) 2>&5
19739   ac_status=$?
19740   echo "$as_me:19740: \$? = $ac_status" >&5
19741   (exit "$ac_status"); } &&
19742          { ac_try='test -s "conftest.$ac_objext"'
19743   { (eval echo "$as_me:19743: \"$ac_try\"") >&5
19744   (eval $ac_try) 2>&5
19745   ac_status=$?
19746   echo "$as_me:19746: \$? = $ac_status" >&5
19747   (exit "$ac_status"); }; }; then
19748   cf_result=yes
19749 else
19750   echo "$as_me: failed program was:" >&5
19751 cat "conftest.$ac_ext" >&5
19752 cf_result=no
19753 fi
19754 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19755 echo "$as_me:19755: result: $cf_result" >&5
19756 echo "${ECHO_T}$cf_result" >&6
19757 if test "$cf_result" = yes ; then
19758
19759 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19760
19761 cat >>confdefs.h <<EOF
19762 #define $cf_result 1
19763 EOF
19764
19765 else
19766
19767 cat >>confdefs.h <<EOF
19768 #define attr_t long
19769 EOF
19770
19771 fi
19772
19773 if test "$cf_enable_widec" = yes; then
19774
19775 # This is needed on Tru64 5.0 to declare mbstate_t
19776 echo "$as_me:19776: checking if we must include wchar.h to declare mbstate_t" >&5
19777 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19778 if test "${cf_cv_mbstate_t+set}" = set; then
19779   echo $ECHO_N "(cached) $ECHO_C" >&6
19780 else
19781
19782 cat >"conftest.$ac_ext" <<_ACEOF
19783 #line 19783 "configure"
19784 #include "confdefs.h"
19785
19786 #include <stdlib.h>
19787 #include <stdarg.h>
19788 #include <stdio.h>
19789 #ifdef HAVE_LIBUTF8_H
19790 #include <libutf8.h>
19791 #endif
19792 int
19793 main (void)
19794 {
19795 mbstate_t state
19796   ;
19797   return 0;
19798 }
19799 _ACEOF
19800 rm -f "conftest.$ac_objext"
19801 if { (eval echo "$as_me:19801: \"$ac_compile\"") >&5
19802   (eval $ac_compile) 2>&5
19803   ac_status=$?
19804   echo "$as_me:19804: \$? = $ac_status" >&5
19805   (exit "$ac_status"); } &&
19806          { ac_try='test -s "conftest.$ac_objext"'
19807   { (eval echo "$as_me:19807: \"$ac_try\"") >&5
19808   (eval $ac_try) 2>&5
19809   ac_status=$?
19810   echo "$as_me:19810: \$? = $ac_status" >&5
19811   (exit "$ac_status"); }; }; then
19812   cf_cv_mbstate_t=no
19813 else
19814   echo "$as_me: failed program was:" >&5
19815 cat "conftest.$ac_ext" >&5
19816 cat >"conftest.$ac_ext" <<_ACEOF
19817 #line 19817 "configure"
19818 #include "confdefs.h"
19819
19820 #include <stdlib.h>
19821 #include <stdarg.h>
19822 #include <stdio.h>
19823 #include <wchar.h>
19824 #ifdef HAVE_LIBUTF8_H
19825 #include <libutf8.h>
19826 #endif
19827 int
19828 main (void)
19829 {
19830 mbstate_t value
19831   ;
19832   return 0;
19833 }
19834 _ACEOF
19835 rm -f "conftest.$ac_objext"
19836 if { (eval echo "$as_me:19836: \"$ac_compile\"") >&5
19837   (eval $ac_compile) 2>&5
19838   ac_status=$?
19839   echo "$as_me:19839: \$? = $ac_status" >&5
19840   (exit "$ac_status"); } &&
19841          { ac_try='test -s "conftest.$ac_objext"'
19842   { (eval echo "$as_me:19842: \"$ac_try\"") >&5
19843   (eval $ac_try) 2>&5
19844   ac_status=$?
19845   echo "$as_me:19845: \$? = $ac_status" >&5
19846   (exit "$ac_status"); }; }; then
19847   cf_cv_mbstate_t=yes
19848 else
19849   echo "$as_me: failed program was:" >&5
19850 cat "conftest.$ac_ext" >&5
19851 cf_cv_mbstate_t=unknown
19852 fi
19853 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19854 fi
19855 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19856 fi
19857 echo "$as_me:19857: result: $cf_cv_mbstate_t" >&5
19858 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19859
19860 if test "$cf_cv_mbstate_t" = yes ; then
19861
19862 cat >>confdefs.h <<\EOF
19863 #define NEED_WCHAR_H 1
19864 EOF
19865
19866         NEED_WCHAR_H=1
19867 fi
19868
19869 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19870 if test "$cf_cv_mbstate_t" = unknown ; then
19871         NCURSES_MBSTATE_T=1
19872 fi
19873
19874 # if we find mbstate_t in either place, use substitution to provide a fallback.
19875 if test "$cf_cv_mbstate_t" != unknown ; then
19876         NCURSES_OK_MBSTATE_T=1
19877 fi
19878
19879 # This is needed on Tru64 5.0 to declare wchar_t
19880 echo "$as_me:19880: checking if we must include wchar.h to declare wchar_t" >&5
19881 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19882 if test "${cf_cv_wchar_t+set}" = set; then
19883   echo $ECHO_N "(cached) $ECHO_C" >&6
19884 else
19885
19886 cat >"conftest.$ac_ext" <<_ACEOF
19887 #line 19887 "configure"
19888 #include "confdefs.h"
19889
19890 #include <stdlib.h>
19891 #include <stdarg.h>
19892 #include <stdio.h>
19893 #ifdef HAVE_LIBUTF8_H
19894 #include <libutf8.h>
19895 #endif
19896 int
19897 main (void)
19898 {
19899 wchar_t state
19900   ;
19901   return 0;
19902 }
19903 _ACEOF
19904 rm -f "conftest.$ac_objext"
19905 if { (eval echo "$as_me:19905: \"$ac_compile\"") >&5
19906   (eval $ac_compile) 2>&5
19907   ac_status=$?
19908   echo "$as_me:19908: \$? = $ac_status" >&5
19909   (exit "$ac_status"); } &&
19910          { ac_try='test -s "conftest.$ac_objext"'
19911   { (eval echo "$as_me:19911: \"$ac_try\"") >&5
19912   (eval $ac_try) 2>&5
19913   ac_status=$?
19914   echo "$as_me:19914: \$? = $ac_status" >&5
19915   (exit "$ac_status"); }; }; then
19916   cf_cv_wchar_t=no
19917 else
19918   echo "$as_me: failed program was:" >&5
19919 cat "conftest.$ac_ext" >&5
19920 cat >"conftest.$ac_ext" <<_ACEOF
19921 #line 19921 "configure"
19922 #include "confdefs.h"
19923
19924 #include <stdlib.h>
19925 #include <stdarg.h>
19926 #include <stdio.h>
19927 #include <wchar.h>
19928 #ifdef HAVE_LIBUTF8_H
19929 #include <libutf8.h>
19930 #endif
19931 int
19932 main (void)
19933 {
19934 wchar_t value
19935   ;
19936   return 0;
19937 }
19938 _ACEOF
19939 rm -f "conftest.$ac_objext"
19940 if { (eval echo "$as_me:19940: \"$ac_compile\"") >&5
19941   (eval $ac_compile) 2>&5
19942   ac_status=$?
19943   echo "$as_me:19943: \$? = $ac_status" >&5
19944   (exit "$ac_status"); } &&
19945          { ac_try='test -s "conftest.$ac_objext"'
19946   { (eval echo "$as_me:19946: \"$ac_try\"") >&5
19947   (eval $ac_try) 2>&5
19948   ac_status=$?
19949   echo "$as_me:19949: \$? = $ac_status" >&5
19950   (exit "$ac_status"); }; }; then
19951   cf_cv_wchar_t=yes
19952 else
19953   echo "$as_me: failed program was:" >&5
19954 cat "conftest.$ac_ext" >&5
19955 cf_cv_wchar_t=unknown
19956 fi
19957 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19958 fi
19959 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19960 fi
19961 echo "$as_me:19961: result: $cf_cv_wchar_t" >&5
19962 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19963
19964 if test "$cf_cv_wchar_t" = yes ; then
19965
19966 cat >>confdefs.h <<\EOF
19967 #define NEED_WCHAR_H 1
19968 EOF
19969
19970         NEED_WCHAR_H=1
19971 fi
19972
19973 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19974 if test "$cf_cv_wchar_t" = unknown ; then
19975         NCURSES_WCHAR_T=1
19976 fi
19977
19978 # if we find wchar_t in either place, use substitution to provide a fallback.
19979 if test "$cf_cv_wchar_t" != unknown ; then
19980         NCURSES_OK_WCHAR_T=1
19981 fi
19982
19983 # This is needed on Tru64 5.0 to declare wint_t
19984 echo "$as_me:19984: checking if we must include wchar.h to declare wint_t" >&5
19985 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19986 if test "${cf_cv_wint_t+set}" = set; then
19987   echo $ECHO_N "(cached) $ECHO_C" >&6
19988 else
19989
19990 cat >"conftest.$ac_ext" <<_ACEOF
19991 #line 19991 "configure"
19992 #include "confdefs.h"
19993
19994 #include <stdlib.h>
19995 #include <stdarg.h>
19996 #include <stdio.h>
19997 #ifdef HAVE_LIBUTF8_H
19998 #include <libutf8.h>
19999 #endif
20000 int
20001 main (void)
20002 {
20003 wint_t state
20004   ;
20005   return 0;
20006 }
20007 _ACEOF
20008 rm -f "conftest.$ac_objext"
20009 if { (eval echo "$as_me:20009: \"$ac_compile\"") >&5
20010   (eval $ac_compile) 2>&5
20011   ac_status=$?
20012   echo "$as_me:20012: \$? = $ac_status" >&5
20013   (exit "$ac_status"); } &&
20014          { ac_try='test -s "conftest.$ac_objext"'
20015   { (eval echo "$as_me:20015: \"$ac_try\"") >&5
20016   (eval $ac_try) 2>&5
20017   ac_status=$?
20018   echo "$as_me:20018: \$? = $ac_status" >&5
20019   (exit "$ac_status"); }; }; then
20020   cf_cv_wint_t=no
20021 else
20022   echo "$as_me: failed program was:" >&5
20023 cat "conftest.$ac_ext" >&5
20024 cat >"conftest.$ac_ext" <<_ACEOF
20025 #line 20025 "configure"
20026 #include "confdefs.h"
20027
20028 #include <stdlib.h>
20029 #include <stdarg.h>
20030 #include <stdio.h>
20031 #include <wchar.h>
20032 #ifdef HAVE_LIBUTF8_H
20033 #include <libutf8.h>
20034 #endif
20035 int
20036 main (void)
20037 {
20038 wint_t value
20039   ;
20040   return 0;
20041 }
20042 _ACEOF
20043 rm -f "conftest.$ac_objext"
20044 if { (eval echo "$as_me:20044: \"$ac_compile\"") >&5
20045   (eval $ac_compile) 2>&5
20046   ac_status=$?
20047   echo "$as_me:20047: \$? = $ac_status" >&5
20048   (exit "$ac_status"); } &&
20049          { ac_try='test -s "conftest.$ac_objext"'
20050   { (eval echo "$as_me:20050: \"$ac_try\"") >&5
20051   (eval $ac_try) 2>&5
20052   ac_status=$?
20053   echo "$as_me:20053: \$? = $ac_status" >&5
20054   (exit "$ac_status"); }; }; then
20055   cf_cv_wint_t=yes
20056 else
20057   echo "$as_me: failed program was:" >&5
20058 cat "conftest.$ac_ext" >&5
20059 cf_cv_wint_t=unknown
20060 fi
20061 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20062 fi
20063 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20064 fi
20065 echo "$as_me:20065: result: $cf_cv_wint_t" >&5
20066 echo "${ECHO_T}$cf_cv_wint_t" >&6
20067
20068 if test "$cf_cv_wint_t" = yes ; then
20069
20070 cat >>confdefs.h <<\EOF
20071 #define NEED_WCHAR_H 1
20072 EOF
20073
20074         NEED_WCHAR_H=1
20075 fi
20076
20077 # if we do not find wint_t in either place, use substitution to provide a fallback.
20078 if test "$cf_cv_wint_t" = unknown ; then
20079         NCURSES_WINT_T=1
20080 fi
20081
20082 # if we find wint_t in either place, use substitution to provide a fallback.
20083 if test "$cf_cv_wint_t" != unknown ; then
20084         NCURSES_OK_WINT_T=1
20085 fi
20086
20087         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20088
20089 echo "$as_me:20089: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20090 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20091 cat >"conftest.$ac_ext" <<_ACEOF
20092 #line 20092 "configure"
20093 #include "confdefs.h"
20094
20095 #ifndef _XOPEN_SOURCE_EXTENDED
20096 #define _XOPEN_SOURCE_EXTENDED
20097 #endif
20098 #include <${cf_cv_ncurses_header:-curses.h}>
20099 int
20100 main (void)
20101 {
20102
20103 mbstate_t foo
20104
20105   ;
20106   return 0;
20107 }
20108 _ACEOF
20109 rm -f "conftest.$ac_objext"
20110 if { (eval echo "$as_me:20110: \"$ac_compile\"") >&5
20111   (eval $ac_compile) 2>&5
20112   ac_status=$?
20113   echo "$as_me:20113: \$? = $ac_status" >&5
20114   (exit "$ac_status"); } &&
20115          { ac_try='test -s "conftest.$ac_objext"'
20116   { (eval echo "$as_me:20116: \"$ac_try\"") >&5
20117   (eval $ac_try) 2>&5
20118   ac_status=$?
20119   echo "$as_me:20119: \$? = $ac_status" >&5
20120   (exit "$ac_status"); }; }; then
20121   cf_result=yes
20122 else
20123   echo "$as_me: failed program was:" >&5
20124 cat "conftest.$ac_ext" >&5
20125 cf_result=no
20126 fi
20127 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20128 echo "$as_me:20128: result: $cf_result" >&5
20129 echo "${ECHO_T}$cf_result" >&6
20130 if test "$cf_result" = yes ; then
20131
20132 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20133
20134 cat >>confdefs.h <<EOF
20135 #define $cf_result 1
20136 EOF
20137
20138 else
20139
20140 cat >>confdefs.h <<EOF
20141 #define mbstate_t long
20142 EOF
20143
20144 fi
20145
20146         fi
20147
20148         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20149
20150 echo "$as_me:20150: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20151 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20152 cat >"conftest.$ac_ext" <<_ACEOF
20153 #line 20153 "configure"
20154 #include "confdefs.h"
20155
20156 #ifndef _XOPEN_SOURCE_EXTENDED
20157 #define _XOPEN_SOURCE_EXTENDED
20158 #endif
20159 #include <${cf_cv_ncurses_header:-curses.h}>
20160 int
20161 main (void)
20162 {
20163
20164 wchar_t foo
20165
20166   ;
20167   return 0;
20168 }
20169 _ACEOF
20170 rm -f "conftest.$ac_objext"
20171 if { (eval echo "$as_me:20171: \"$ac_compile\"") >&5
20172   (eval $ac_compile) 2>&5
20173   ac_status=$?
20174   echo "$as_me:20174: \$? = $ac_status" >&5
20175   (exit "$ac_status"); } &&
20176          { ac_try='test -s "conftest.$ac_objext"'
20177   { (eval echo "$as_me:20177: \"$ac_try\"") >&5
20178   (eval $ac_try) 2>&5
20179   ac_status=$?
20180   echo "$as_me:20180: \$? = $ac_status" >&5
20181   (exit "$ac_status"); }; }; then
20182   cf_result=yes
20183 else
20184   echo "$as_me: failed program was:" >&5
20185 cat "conftest.$ac_ext" >&5
20186 cf_result=no
20187 fi
20188 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20189 echo "$as_me:20189: result: $cf_result" >&5
20190 echo "${ECHO_T}$cf_result" >&6
20191 if test "$cf_result" = yes ; then
20192
20193 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20194
20195 cat >>confdefs.h <<EOF
20196 #define $cf_result 1
20197 EOF
20198
20199 else
20200
20201 cat >>confdefs.h <<EOF
20202 #define wchar_t long
20203 EOF
20204
20205 fi
20206
20207         fi
20208
20209         if test "$NCURSES_OK_WINT_T" = 0 ; then
20210
20211 echo "$as_me:20211: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20212 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20213 cat >"conftest.$ac_ext" <<_ACEOF
20214 #line 20214 "configure"
20215 #include "confdefs.h"
20216
20217 #ifndef _XOPEN_SOURCE_EXTENDED
20218 #define _XOPEN_SOURCE_EXTENDED
20219 #endif
20220 #include <${cf_cv_ncurses_header:-curses.h}>
20221 int
20222 main (void)
20223 {
20224
20225 wint_t foo
20226
20227   ;
20228   return 0;
20229 }
20230 _ACEOF
20231 rm -f "conftest.$ac_objext"
20232 if { (eval echo "$as_me:20232: \"$ac_compile\"") >&5
20233   (eval $ac_compile) 2>&5
20234   ac_status=$?
20235   echo "$as_me:20235: \$? = $ac_status" >&5
20236   (exit "$ac_status"); } &&
20237          { ac_try='test -s "conftest.$ac_objext"'
20238   { (eval echo "$as_me:20238: \"$ac_try\"") >&5
20239   (eval $ac_try) 2>&5
20240   ac_status=$?
20241   echo "$as_me:20241: \$? = $ac_status" >&5
20242   (exit "$ac_status"); }; }; then
20243   cf_result=yes
20244 else
20245   echo "$as_me: failed program was:" >&5
20246 cat "conftest.$ac_ext" >&5
20247 cf_result=no
20248 fi
20249 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20250 echo "$as_me:20250: result: $cf_result" >&5
20251 echo "${ECHO_T}$cf_result" >&6
20252 if test "$cf_result" = yes ; then
20253
20254 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20255
20256 cat >>confdefs.h <<EOF
20257 #define $cf_result 1
20258 EOF
20259
20260 else
20261
20262 cat >>confdefs.h <<EOF
20263 #define wint_t long
20264 EOF
20265
20266 fi
20267
20268         fi
20269 fi
20270
20271 for cf_data in \
20272 TABSIZE \
20273 curscr \
20274 ospeed \
20275 boolnames \
20276 boolfnames \
20277 ttytype
20278 do
20279 echo "$as_me:20279: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20280 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20281
20282 cat >"conftest.$ac_ext" <<_ACEOF
20283 #line 20283 "configure"
20284 #include "confdefs.h"
20285
20286 #ifdef HAVE_XCURSES
20287 #include <xcurses.h>
20288 char * XCursesProgramName = "test";
20289 #else
20290 #include <${cf_cv_ncurses_header:-curses.h}>
20291 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20292 #include <ncursesw/term.h>
20293 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20294 #include <ncurses/term.h>
20295 #elif defined(HAVE_TERM_H)
20296 #include <term.h>
20297 #endif
20298 #endif
20299
20300 int
20301 main (void)
20302 {
20303
20304 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20305         const void *foo = (const void *)($cf_data);
20306 #else
20307         const void *foo = &($cf_data);
20308 #endif
20309         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20310
20311   ;
20312   return 0;
20313 }
20314 _ACEOF
20315 rm -f "conftest.$ac_objext"
20316 if { (eval echo "$as_me:20316: \"$ac_compile\"") >&5
20317   (eval $ac_compile) 2>&5
20318   ac_status=$?
20319   echo "$as_me:20319: \$? = $ac_status" >&5
20320   (exit "$ac_status"); } &&
20321          { ac_try='test -s "conftest.$ac_objext"'
20322   { (eval echo "$as_me:20322: \"$ac_try\"") >&5
20323   (eval $ac_try) 2>&5
20324   ac_status=$?
20325   echo "$as_me:20325: \$? = $ac_status" >&5
20326   (exit "$ac_status"); }; }; then
20327   cf_result=yes
20328
20329 else
20330   echo "$as_me: failed program was:" >&5
20331 cat "conftest.$ac_ext" >&5
20332 cf_result=no
20333 fi
20334 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20335 echo "$as_me:20335: result: $cf_result" >&5
20336 echo "${ECHO_T}$cf_result" >&6
20337
20338 if test "$cf_result" = yes ; then
20339
20340 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20341
20342         cat >>confdefs.h <<EOF
20343 #define $cf_result 1
20344 EOF
20345
20346 else
20347         echo "$as_me:20347: checking for data $cf_data in library" >&5
20348 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20349         # BSD linkers insist on making weak linkage, but resolve at runtime.
20350         if test "$cross_compiling" = yes; then
20351
20352         # cross-compiling
20353         cat >"conftest.$ac_ext" <<_ACEOF
20354 #line 20354 "configure"
20355 #include "confdefs.h"
20356
20357 #ifdef HAVE_XCURSES
20358 #include <xcurses.h>
20359 char * XCursesProgramName = "test";
20360 #else
20361 #include <${cf_cv_ncurses_header:-curses.h}>
20362 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20363 #include <ncursesw/term.h>
20364 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20365 #include <ncurses/term.h>
20366 #elif defined(HAVE_TERM_H)
20367 #include <term.h>
20368 #endif
20369 #endif
20370
20371 extern char $cf_data;
20372 int
20373 main (void)
20374 {
20375
20376         do {
20377
20378 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20379         const void *foo = (const void *)($cf_data);
20380 #else
20381         const void *foo = &($cf_data);
20382 #endif
20383         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20384
20385                 ${cf_cv_main_return:-return}(foo == 0);
20386         } while (0)
20387
20388   ;
20389   return 0;
20390 }
20391 _ACEOF
20392 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20393 if { (eval echo "$as_me:20393: \"$ac_link\"") >&5
20394   (eval $ac_link) 2>&5
20395   ac_status=$?
20396   echo "$as_me:20396: \$? = $ac_status" >&5
20397   (exit "$ac_status"); } &&
20398          { ac_try='test -s "conftest$ac_exeext"'
20399   { (eval echo "$as_me:20399: \"$ac_try\"") >&5
20400   (eval $ac_try) 2>&5
20401   ac_status=$?
20402   echo "$as_me:20402: \$? = $ac_status" >&5
20403   (exit "$ac_status"); }; }; then
20404   cf_result=yes
20405 else
20406   echo "$as_me: failed program was:" >&5
20407 cat "conftest.$ac_ext" >&5
20408 cf_result=no
20409 fi
20410 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20411
20412 else
20413   cat >"conftest.$ac_ext" <<_ACEOF
20414 #line 20414 "configure"
20415 #include "confdefs.h"
20416
20417 #ifdef HAVE_XCURSES
20418 #include <xcurses.h>
20419 char * XCursesProgramName = "test";
20420 #else
20421 #include <${cf_cv_ncurses_header:-curses.h}>
20422 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20423 #include <ncursesw/term.h>
20424 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20425 #include <ncurses/term.h>
20426 #elif defined(HAVE_TERM_H)
20427 #include <term.h>
20428 #endif
20429 #endif
20430
20431 extern char $cf_data;
20432 int main(void)
20433 {
20434
20435 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20436         const void *foo = (const void *)($cf_data);
20437 #else
20438         const void *foo = &($cf_data);
20439 #endif
20440         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20441
20442         ${cf_cv_main_return:-return}(foo == 0);
20443 }
20444 _ACEOF
20445 rm -f "conftest$ac_exeext"
20446 if { (eval echo "$as_me:20446: \"$ac_link\"") >&5
20447   (eval $ac_link) 2>&5
20448   ac_status=$?
20449   echo "$as_me:20449: \$? = $ac_status" >&5
20450   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20451   { (eval echo "$as_me:20451: \"$ac_try\"") >&5
20452   (eval $ac_try) 2>&5
20453   ac_status=$?
20454   echo "$as_me:20454: \$? = $ac_status" >&5
20455   (exit "$ac_status"); }; }; then
20456   cf_result=yes
20457
20458 else
20459   echo "$as_me: program exited with status $ac_status" >&5
20460 echo "$as_me: failed program was:" >&5
20461 cat "conftest.$ac_ext" >&5
20462 cf_result=no
20463 fi
20464 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20465 fi
20466         echo "$as_me:20466: result: $cf_result" >&5
20467 echo "${ECHO_T}$cf_result" >&6
20468         if test "$cf_result" = yes ; then
20469
20470 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20471
20472                 cat >>confdefs.h <<EOF
20473 #define $cf_result 1
20474 EOF
20475
20476                 # do not exit loop here, since we prefer system's declarations
20477         fi
20478 fi
20479 done
20480
20481 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20482 then
20483         echo "$as_me:20483: checking for X" >&5
20484 echo $ECHO_N "checking for X... $ECHO_C" >&6
20485
20486 # Check whether --with-x or --without-x was given.
20487 if test "${with_x+set}" = set; then
20488   withval="$with_x"
20489
20490 fi;
20491 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20492 if test "x$with_x" = xno; then
20493   # The user explicitly disabled X.
20494   have_x=disabled
20495 else
20496   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20497     # Both variables are already set.
20498     have_x=yes
20499   else
20500     if test "${ac_cv_have_x+set}" = set; then
20501   echo $ECHO_N "(cached) $ECHO_C" >&6
20502 else
20503   # One or both of the vars are not set, and there is no cached value.
20504 ac_x_includes=no ac_x_libraries=no
20505 rm -fr conftest.dir
20506 if mkdir conftest.dir; then
20507   cd conftest.dir
20508   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20509   cat >Imakefile <<'EOF'
20510 acfindx:
20511         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20512 EOF
20513   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20514     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20515     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20516     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20517     for ac_extension in a so sl dylib dll; do
20518       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20519          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20520         ac_im_usrlibdir=$ac_im_libdir; break
20521       fi
20522     done
20523     # Screen out bogus values from the imake configuration.  They are
20524     # bogus both because they are the default anyway, and because
20525     # using them would break gcc on systems where it needs fixed includes.
20526     case $ac_im_incroot in
20527         /usr/include) ;;
20528         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20529     esac
20530     case $ac_im_usrlibdir in
20531         /usr/lib | /lib) ;;
20532         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20533     esac
20534   fi
20535   cd ..
20536   rm -fr conftest.dir
20537 fi
20538
20539 # Standard set of common directories for X headers.
20540 # Check X11 before X11Rn because it is often a symlink to the current release.
20541 ac_x_header_dirs='
20542 /usr/X11/include
20543 /usr/X11R7/include
20544 /usr/X11R6/include
20545 /usr/X11R5/include
20546 /usr/X11R4/include
20547
20548 /opt/local/include
20549 /opt/X11/include
20550
20551 /usr/include/X11
20552 /usr/include/X11R7
20553 /usr/include/X11R6
20554 /usr/include/X11R5
20555 /usr/include/X11R4
20556
20557 /usr/local/X11/include
20558 /usr/local/X11R7/include
20559 /usr/local/X11R6/include
20560 /usr/local/X11R5/include
20561 /usr/local/X11R4/include
20562
20563 /usr/local/include/X11
20564 /usr/local/include/X11R7
20565 /usr/local/include/X11R6
20566 /usr/local/include/X11R5
20567 /usr/local/include/X11R4
20568
20569 /usr/X386/include
20570 /usr/x386/include
20571 /usr/XFree86/include/X11
20572
20573 /usr/include
20574 /usr/local/include
20575 /usr/unsupported/include
20576 /usr/athena/include
20577 /usr/local/x11r5/include
20578 /usr/lpp/Xamples/include
20579
20580 /usr/openwin/include
20581 /usr/openwin/share/include'
20582
20583 if test "$ac_x_includes" = no; then
20584   # Guess where to find include files, by looking for Intrinsic.h.
20585   # First, try using that file with no special directory specified.
20586   cat >"conftest.$ac_ext" <<_ACEOF
20587 #line 20587 "configure"
20588 #include "confdefs.h"
20589 #include <X11/Intrinsic.h>
20590 _ACEOF
20591 if { (eval echo "$as_me:20591: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20592   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20593   ac_status=$?
20594   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20595   rm -f conftest.er1
20596   cat conftest.err >&5
20597   echo "$as_me:20597: \$? = $ac_status" >&5
20598   (exit "$ac_status"); } >/dev/null; then
20599   if test -s conftest.err; then
20600     ac_cpp_err=$ac_c_preproc_warn_flag
20601   else
20602     ac_cpp_err=
20603   fi
20604 else
20605   ac_cpp_err=yes
20606 fi
20607 if test -z "$ac_cpp_err"; then
20608   # We can compile using X headers with no special include directory.
20609 ac_x_includes=
20610 else
20611   echo "$as_me: failed program was:" >&5
20612   cat "conftest.$ac_ext" >&5
20613   for ac_dir in $ac_x_header_dirs; do
20614   if test -r "$ac_dir/X11/Intrinsic.h"; then
20615     ac_x_includes=$ac_dir
20616     break
20617   fi
20618 done
20619 fi
20620 rm -f conftest.err "conftest.$ac_ext"
20621 fi # $ac_x_includes = no
20622
20623 if test "$ac_x_libraries" = no; then
20624   # Check for the libraries.
20625   # See if we find them without any special options.
20626   # Don't add to $LIBS permanently.
20627   ac_save_LIBS=$LIBS
20628   LIBS="-lXt $LIBS"
20629   cat >"conftest.$ac_ext" <<_ACEOF
20630 #line 20630 "configure"
20631 #include "confdefs.h"
20632 #include <X11/Intrinsic.h>
20633 int
20634 main (void)
20635 {
20636 XtMalloc (0)
20637   ;
20638   return 0;
20639 }
20640 _ACEOF
20641 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20642 if { (eval echo "$as_me:20642: \"$ac_link\"") >&5
20643   (eval $ac_link) 2>&5
20644   ac_status=$?
20645   echo "$as_me:20645: \$? = $ac_status" >&5
20646   (exit "$ac_status"); } &&
20647          { ac_try='test -s "conftest$ac_exeext"'
20648   { (eval echo "$as_me:20648: \"$ac_try\"") >&5
20649   (eval $ac_try) 2>&5
20650   ac_status=$?
20651   echo "$as_me:20651: \$? = $ac_status" >&5
20652   (exit "$ac_status"); }; }; then
20653   LIBS=$ac_save_LIBS
20654 # We can link X programs with no special library path.
20655 ac_x_libraries=
20656 else
20657   echo "$as_me: failed program was:" >&5
20658 cat "conftest.$ac_ext" >&5
20659 LIBS=$ac_save_LIBS
20660 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20661 do
20662   # Don't even attempt the hair of trying to link an X program!
20663   for ac_extension in a so sl dylib dll; do
20664     if test -r "$ac_dir/libXt.$ac_extension"; then
20665       ac_x_libraries=$ac_dir
20666       break 2
20667     fi
20668   done
20669 done
20670 fi
20671 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20672 fi # $ac_x_libraries = no
20673
20674 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20675   # Didn't find X anywhere.  Cache the known absence of X.
20676   ac_cv_have_x="have_x=no"
20677 else
20678   # Record where we found X for the cache.
20679   ac_cv_have_x="have_x=yes \
20680                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20681 fi
20682 fi
20683
20684   fi
20685   eval "$ac_cv_have_x"
20686 fi # $with_x != no
20687
20688 if test "$have_x" != yes; then
20689   echo "$as_me:20689: result: $have_x" >&5
20690 echo "${ECHO_T}$have_x" >&6
20691   no_x=yes
20692 else
20693   # If each of the values was on the command line, it overrides each guess.
20694   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20695   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20696   # Update the cache value to reflect the command line values.
20697   ac_cv_have_x="have_x=yes \
20698                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20699   echo "$as_me:20699: result: libraries $x_libraries, headers $x_includes" >&5
20700 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20701 fi
20702
20703         if test "$no_x" = yes; then
20704   # Not all programs may use this symbol, but it does not hurt to define it.
20705
20706 cat >>confdefs.h <<\EOF
20707 #define X_DISPLAY_MISSING 1
20708 EOF
20709
20710   X_CFLAGS=
20711   X_PRE_LIBS=
20712   X_LIBS=
20713   X_EXTRA_LIBS=
20714 else
20715   if test -n "$x_includes"; then
20716     X_CFLAGS="$X_CFLAGS -I$x_includes"
20717   fi
20718
20719   # It would also be nice to do this for all -L options, not just this one.
20720   if test -n "$x_libraries"; then
20721     X_LIBS="$X_LIBS -L$x_libraries"
20722     # For Solaris; some versions of Sun CC require a space after -R and
20723     # others require no space.  Words are not sufficient . . . .
20724     case `(uname -sr) 2>/dev/null` in
20725     "SunOS 5"*)
20726       echo "$as_me:20726: checking whether -R must be followed by a space" >&5
20727 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20728       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20729       cat >"conftest.$ac_ext" <<_ACEOF
20730 #line 20730 "configure"
20731 #include "confdefs.h"
20732
20733 int
20734 main (void)
20735 {
20736
20737   ;
20738   return 0;
20739 }
20740 _ACEOF
20741 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20742 if { (eval echo "$as_me:20742: \"$ac_link\"") >&5
20743   (eval $ac_link) 2>&5
20744   ac_status=$?
20745   echo "$as_me:20745: \$? = $ac_status" >&5
20746   (exit "$ac_status"); } &&
20747          { ac_try='test -s "conftest$ac_exeext"'
20748   { (eval echo "$as_me:20748: \"$ac_try\"") >&5
20749   (eval $ac_try) 2>&5
20750   ac_status=$?
20751   echo "$as_me:20751: \$? = $ac_status" >&5
20752   (exit "$ac_status"); }; }; then
20753   ac_R_nospace=yes
20754 else
20755   echo "$as_me: failed program was:" >&5
20756 cat "conftest.$ac_ext" >&5
20757 ac_R_nospace=no
20758 fi
20759 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20760       if test $ac_R_nospace = yes; then
20761         echo "$as_me:20761: result: no" >&5
20762 echo "${ECHO_T}no" >&6
20763         X_LIBS="$X_LIBS -R$x_libraries"
20764       else
20765         LIBS="$ac_xsave_LIBS -R $x_libraries"
20766         cat >"conftest.$ac_ext" <<_ACEOF
20767 #line 20767 "configure"
20768 #include "confdefs.h"
20769
20770 int
20771 main (void)
20772 {
20773
20774   ;
20775   return 0;
20776 }
20777 _ACEOF
20778 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20779 if { (eval echo "$as_me:20779: \"$ac_link\"") >&5
20780   (eval $ac_link) 2>&5
20781   ac_status=$?
20782   echo "$as_me:20782: \$? = $ac_status" >&5
20783   (exit "$ac_status"); } &&
20784          { ac_try='test -s "conftest$ac_exeext"'
20785   { (eval echo "$as_me:20785: \"$ac_try\"") >&5
20786   (eval $ac_try) 2>&5
20787   ac_status=$?
20788   echo "$as_me:20788: \$? = $ac_status" >&5
20789   (exit "$ac_status"); }; }; then
20790   ac_R_space=yes
20791 else
20792   echo "$as_me: failed program was:" >&5
20793 cat "conftest.$ac_ext" >&5
20794 ac_R_space=no
20795 fi
20796 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20797         if test $ac_R_space = yes; then
20798           echo "$as_me:20798: result: yes" >&5
20799 echo "${ECHO_T}yes" >&6
20800           X_LIBS="$X_LIBS -R $x_libraries"
20801         else
20802           echo "$as_me:20802: result: neither works" >&5
20803 echo "${ECHO_T}neither works" >&6
20804         fi
20805       fi
20806       LIBS=$ac_xsave_LIBS
20807     esac
20808   fi
20809
20810   # Check for system-dependent libraries X programs must link with.
20811   # Do this before checking for the system-independent R6 libraries
20812   # (-lICE), since we may need -lsocket or whatever for X linking.
20813
20814   if test "$ISC" = yes; then
20815     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20816   else
20817     # Martyn Johnson says this is needed for Ultrix, if the X
20818     # libraries were built with DECnet support.  And Karl Berry says
20819     # the Alpha needs dnet_stub (dnet does not exist).
20820     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20821     cat >"conftest.$ac_ext" <<_ACEOF
20822 #line 20822 "configure"
20823 #include "confdefs.h"
20824
20825 /* Override any gcc2 internal prototype to avoid an error.  */
20826 #ifdef __cplusplus
20827 extern "C"
20828 #endif
20829 /* We use char because int might match the return type of a gcc2
20830    builtin and then its argument prototype would still apply.  */
20831 char XOpenDisplay ();
20832 int
20833 main (void)
20834 {
20835 XOpenDisplay ();
20836   ;
20837   return 0;
20838 }
20839 _ACEOF
20840 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20841 if { (eval echo "$as_me:20841: \"$ac_link\"") >&5
20842   (eval $ac_link) 2>&5
20843   ac_status=$?
20844   echo "$as_me:20844: \$? = $ac_status" >&5
20845   (exit "$ac_status"); } &&
20846          { ac_try='test -s "conftest$ac_exeext"'
20847   { (eval echo "$as_me:20847: \"$ac_try\"") >&5
20848   (eval $ac_try) 2>&5
20849   ac_status=$?
20850   echo "$as_me:20850: \$? = $ac_status" >&5
20851   (exit "$ac_status"); }; }; then
20852   :
20853 else
20854   echo "$as_me: failed program was:" >&5
20855 cat "conftest.$ac_ext" >&5
20856 echo "$as_me:20856: checking for dnet_ntoa in -ldnet" >&5
20857 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20858 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20859   echo $ECHO_N "(cached) $ECHO_C" >&6
20860 else
20861   ac_check_lib_save_LIBS=$LIBS
20862 LIBS="-ldnet  $LIBS"
20863 cat >"conftest.$ac_ext" <<_ACEOF
20864 #line 20864 "configure"
20865 #include "confdefs.h"
20866
20867 /* Override any gcc2 internal prototype to avoid an error.  */
20868 #ifdef __cplusplus
20869 extern "C"
20870 #endif
20871 /* We use char because int might match the return type of a gcc2
20872    builtin and then its argument prototype would still apply.  */
20873 char dnet_ntoa ();
20874 int
20875 main (void)
20876 {
20877 dnet_ntoa ();
20878   ;
20879   return 0;
20880 }
20881 _ACEOF
20882 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20883 if { (eval echo "$as_me:20883: \"$ac_link\"") >&5
20884   (eval $ac_link) 2>&5
20885   ac_status=$?
20886   echo "$as_me:20886: \$? = $ac_status" >&5
20887   (exit "$ac_status"); } &&
20888          { ac_try='test -s "conftest$ac_exeext"'
20889   { (eval echo "$as_me:20889: \"$ac_try\"") >&5
20890   (eval $ac_try) 2>&5
20891   ac_status=$?
20892   echo "$as_me:20892: \$? = $ac_status" >&5
20893   (exit "$ac_status"); }; }; then
20894   ac_cv_lib_dnet_dnet_ntoa=yes
20895 else
20896   echo "$as_me: failed program was:" >&5
20897 cat "conftest.$ac_ext" >&5
20898 ac_cv_lib_dnet_dnet_ntoa=no
20899 fi
20900 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20901 LIBS=$ac_check_lib_save_LIBS
20902 fi
20903 echo "$as_me:20903: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20904 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20905 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
20906   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20907 fi
20908
20909     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20910       echo "$as_me:20910: checking for dnet_ntoa in -ldnet_stub" >&5
20911 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20912 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20913   echo $ECHO_N "(cached) $ECHO_C" >&6
20914 else
20915   ac_check_lib_save_LIBS=$LIBS
20916 LIBS="-ldnet_stub  $LIBS"
20917 cat >"conftest.$ac_ext" <<_ACEOF
20918 #line 20918 "configure"
20919 #include "confdefs.h"
20920
20921 /* Override any gcc2 internal prototype to avoid an error.  */
20922 #ifdef __cplusplus
20923 extern "C"
20924 #endif
20925 /* We use char because int might match the return type of a gcc2
20926    builtin and then its argument prototype would still apply.  */
20927 char dnet_ntoa ();
20928 int
20929 main (void)
20930 {
20931 dnet_ntoa ();
20932   ;
20933   return 0;
20934 }
20935 _ACEOF
20936 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20937 if { (eval echo "$as_me:20937: \"$ac_link\"") >&5
20938   (eval $ac_link) 2>&5
20939   ac_status=$?
20940   echo "$as_me:20940: \$? = $ac_status" >&5
20941   (exit "$ac_status"); } &&
20942          { ac_try='test -s "conftest$ac_exeext"'
20943   { (eval echo "$as_me:20943: \"$ac_try\"") >&5
20944   (eval $ac_try) 2>&5
20945   ac_status=$?
20946   echo "$as_me:20946: \$? = $ac_status" >&5
20947   (exit "$ac_status"); }; }; then
20948   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20949 else
20950   echo "$as_me: failed program was:" >&5
20951 cat "conftest.$ac_ext" >&5
20952 ac_cv_lib_dnet_stub_dnet_ntoa=no
20953 fi
20954 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20955 LIBS=$ac_check_lib_save_LIBS
20956 fi
20957 echo "$as_me:20957: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20958 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20959 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
20960   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20961 fi
20962
20963     fi
20964 fi
20965 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20966     LIBS="$ac_xsave_LIBS"
20967
20968     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20969     # to get the SysV transport functions.
20970     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20971     # needs -lnsl.
20972     # The nsl library prevents programs from opening the X display
20973     # on Irix 5.2, according to T.E. Dickey.
20974     # The functions gethostbyname, getservbyname, and inet_addr are
20975     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20976     echo "$as_me:20976: checking for gethostbyname" >&5
20977 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20978 if test "${ac_cv_func_gethostbyname+set}" = set; then
20979   echo $ECHO_N "(cached) $ECHO_C" >&6
20980 else
20981   cat >"conftest.$ac_ext" <<_ACEOF
20982 #line 20982 "configure"
20983 #include "confdefs.h"
20984 #define gethostbyname autoconf_temporary
20985 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20986 #undef gethostbyname
20987
20988 #ifdef __cplusplus
20989 extern "C"
20990 #endif
20991
20992 /* We use char because int might match the return type of a gcc2
20993    builtin and then its argument prototype would still apply.  */
20994 char gethostbyname (void);
20995
20996 int
20997 main (void)
20998 {
20999
21000 /* The GNU C library defines stubs for functions which it implements
21001     to always fail with ENOSYS.  Some functions are actually named
21002     something starting with __ and the normal name is an alias.  */
21003 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21004 #error found stub for gethostbyname
21005 #endif
21006
21007         return gethostbyname ();
21008   ;
21009   return 0;
21010 }
21011 _ACEOF
21012 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21013 if { (eval echo "$as_me:21013: \"$ac_link\"") >&5
21014   (eval $ac_link) 2>&5
21015   ac_status=$?
21016   echo "$as_me:21016: \$? = $ac_status" >&5
21017   (exit "$ac_status"); } &&
21018          { ac_try='test -s "conftest$ac_exeext"'
21019   { (eval echo "$as_me:21019: \"$ac_try\"") >&5
21020   (eval $ac_try) 2>&5
21021   ac_status=$?
21022   echo "$as_me:21022: \$? = $ac_status" >&5
21023   (exit "$ac_status"); }; }; then
21024   ac_cv_func_gethostbyname=yes
21025 else
21026   echo "$as_me: failed program was:" >&5
21027 cat "conftest.$ac_ext" >&5
21028 ac_cv_func_gethostbyname=no
21029 fi
21030 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21031 fi
21032 echo "$as_me:21032: result: $ac_cv_func_gethostbyname" >&5
21033 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21034
21035     if test $ac_cv_func_gethostbyname = no; then
21036       echo "$as_me:21036: checking for gethostbyname in -lnsl" >&5
21037 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21038 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21039   echo $ECHO_N "(cached) $ECHO_C" >&6
21040 else
21041   ac_check_lib_save_LIBS=$LIBS
21042 LIBS="-lnsl  $LIBS"
21043 cat >"conftest.$ac_ext" <<_ACEOF
21044 #line 21044 "configure"
21045 #include "confdefs.h"
21046
21047 /* Override any gcc2 internal prototype to avoid an error.  */
21048 #ifdef __cplusplus
21049 extern "C"
21050 #endif
21051 /* We use char because int might match the return type of a gcc2
21052    builtin and then its argument prototype would still apply.  */
21053 char gethostbyname ();
21054 int
21055 main (void)
21056 {
21057 gethostbyname ();
21058   ;
21059   return 0;
21060 }
21061 _ACEOF
21062 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21063 if { (eval echo "$as_me:21063: \"$ac_link\"") >&5
21064   (eval $ac_link) 2>&5
21065   ac_status=$?
21066   echo "$as_me:21066: \$? = $ac_status" >&5
21067   (exit "$ac_status"); } &&
21068          { ac_try='test -s "conftest$ac_exeext"'
21069   { (eval echo "$as_me:21069: \"$ac_try\"") >&5
21070   (eval $ac_try) 2>&5
21071   ac_status=$?
21072   echo "$as_me:21072: \$? = $ac_status" >&5
21073   (exit "$ac_status"); }; }; then
21074   ac_cv_lib_nsl_gethostbyname=yes
21075 else
21076   echo "$as_me: failed program was:" >&5
21077 cat "conftest.$ac_ext" >&5
21078 ac_cv_lib_nsl_gethostbyname=no
21079 fi
21080 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21081 LIBS=$ac_check_lib_save_LIBS
21082 fi
21083 echo "$as_me:21083: result: $ac_cv_lib_nsl_gethostbyname" >&5
21084 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21085 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21086   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21087 fi
21088
21089       if test $ac_cv_lib_nsl_gethostbyname = no; then
21090         echo "$as_me:21090: checking for gethostbyname in -lbsd" >&5
21091 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21092 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21093   echo $ECHO_N "(cached) $ECHO_C" >&6
21094 else
21095   ac_check_lib_save_LIBS=$LIBS
21096 LIBS="-lbsd  $LIBS"
21097 cat >"conftest.$ac_ext" <<_ACEOF
21098 #line 21098 "configure"
21099 #include "confdefs.h"
21100
21101 /* Override any gcc2 internal prototype to avoid an error.  */
21102 #ifdef __cplusplus
21103 extern "C"
21104 #endif
21105 /* We use char because int might match the return type of a gcc2
21106    builtin and then its argument prototype would still apply.  */
21107 char gethostbyname ();
21108 int
21109 main (void)
21110 {
21111 gethostbyname ();
21112   ;
21113   return 0;
21114 }
21115 _ACEOF
21116 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21117 if { (eval echo "$as_me:21117: \"$ac_link\"") >&5
21118   (eval $ac_link) 2>&5
21119   ac_status=$?
21120   echo "$as_me:21120: \$? = $ac_status" >&5
21121   (exit "$ac_status"); } &&
21122          { ac_try='test -s "conftest$ac_exeext"'
21123   { (eval echo "$as_me:21123: \"$ac_try\"") >&5
21124   (eval $ac_try) 2>&5
21125   ac_status=$?
21126   echo "$as_me:21126: \$? = $ac_status" >&5
21127   (exit "$ac_status"); }; }; then
21128   ac_cv_lib_bsd_gethostbyname=yes
21129 else
21130   echo "$as_me: failed program was:" >&5
21131 cat "conftest.$ac_ext" >&5
21132 ac_cv_lib_bsd_gethostbyname=no
21133 fi
21134 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21135 LIBS=$ac_check_lib_save_LIBS
21136 fi
21137 echo "$as_me:21137: result: $ac_cv_lib_bsd_gethostbyname" >&5
21138 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21139 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21140   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21141 fi
21142
21143       fi
21144     fi
21145
21146     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21147     # socket/setsockopt and other routines are undefined under SCO ODT
21148     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21149     # on later versions), says Simon Leinen: it contains gethostby*
21150     # variants that don't use the nameserver (or something).  -lsocket
21151     # must be given before -lnsl if both are needed.  We assume that
21152     # if connect needs -lnsl, so does gethostbyname.
21153     echo "$as_me:21153: checking for connect" >&5
21154 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21155 if test "${ac_cv_func_connect+set}" = set; then
21156   echo $ECHO_N "(cached) $ECHO_C" >&6
21157 else
21158   cat >"conftest.$ac_ext" <<_ACEOF
21159 #line 21159 "configure"
21160 #include "confdefs.h"
21161 #define connect autoconf_temporary
21162 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21163 #undef connect
21164
21165 #ifdef __cplusplus
21166 extern "C"
21167 #endif
21168
21169 /* We use char because int might match the return type of a gcc2
21170    builtin and then its argument prototype would still apply.  */
21171 char connect (void);
21172
21173 int
21174 main (void)
21175 {
21176
21177 /* The GNU C library defines stubs for functions which it implements
21178     to always fail with ENOSYS.  Some functions are actually named
21179     something starting with __ and the normal name is an alias.  */
21180 #if defined (__stub_connect) || defined (__stub___connect)
21181 #error found stub for connect
21182 #endif
21183
21184         return connect ();
21185   ;
21186   return 0;
21187 }
21188 _ACEOF
21189 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21190 if { (eval echo "$as_me:21190: \"$ac_link\"") >&5
21191   (eval $ac_link) 2>&5
21192   ac_status=$?
21193   echo "$as_me:21193: \$? = $ac_status" >&5
21194   (exit "$ac_status"); } &&
21195          { ac_try='test -s "conftest$ac_exeext"'
21196   { (eval echo "$as_me:21196: \"$ac_try\"") >&5
21197   (eval $ac_try) 2>&5
21198   ac_status=$?
21199   echo "$as_me:21199: \$? = $ac_status" >&5
21200   (exit "$ac_status"); }; }; then
21201   ac_cv_func_connect=yes
21202 else
21203   echo "$as_me: failed program was:" >&5
21204 cat "conftest.$ac_ext" >&5
21205 ac_cv_func_connect=no
21206 fi
21207 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21208 fi
21209 echo "$as_me:21209: result: $ac_cv_func_connect" >&5
21210 echo "${ECHO_T}$ac_cv_func_connect" >&6
21211
21212     if test $ac_cv_func_connect = no; then
21213       echo "$as_me:21213: checking for connect in -lsocket" >&5
21214 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21215 if test "${ac_cv_lib_socket_connect+set}" = set; then
21216   echo $ECHO_N "(cached) $ECHO_C" >&6
21217 else
21218   ac_check_lib_save_LIBS=$LIBS
21219 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21220 cat >"conftest.$ac_ext" <<_ACEOF
21221 #line 21221 "configure"
21222 #include "confdefs.h"
21223
21224 /* Override any gcc2 internal prototype to avoid an error.  */
21225 #ifdef __cplusplus
21226 extern "C"
21227 #endif
21228 /* We use char because int might match the return type of a gcc2
21229    builtin and then its argument prototype would still apply.  */
21230 char connect ();
21231 int
21232 main (void)
21233 {
21234 connect ();
21235   ;
21236   return 0;
21237 }
21238 _ACEOF
21239 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21240 if { (eval echo "$as_me:21240: \"$ac_link\"") >&5
21241   (eval $ac_link) 2>&5
21242   ac_status=$?
21243   echo "$as_me:21243: \$? = $ac_status" >&5
21244   (exit "$ac_status"); } &&
21245          { ac_try='test -s "conftest$ac_exeext"'
21246   { (eval echo "$as_me:21246: \"$ac_try\"") >&5
21247   (eval $ac_try) 2>&5
21248   ac_status=$?
21249   echo "$as_me:21249: \$? = $ac_status" >&5
21250   (exit "$ac_status"); }; }; then
21251   ac_cv_lib_socket_connect=yes
21252 else
21253   echo "$as_me: failed program was:" >&5
21254 cat "conftest.$ac_ext" >&5
21255 ac_cv_lib_socket_connect=no
21256 fi
21257 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21258 LIBS=$ac_check_lib_save_LIBS
21259 fi
21260 echo "$as_me:21260: result: $ac_cv_lib_socket_connect" >&5
21261 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21262 if test "$ac_cv_lib_socket_connect" = yes; then
21263   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21264 fi
21265
21266     fi
21267
21268     # Guillermo Gomez says -lposix is necessary on A/UX.
21269     echo "$as_me:21269: checking for remove" >&5
21270 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21271 if test "${ac_cv_func_remove+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 remove autoconf_temporary
21278 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21279 #undef remove
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 remove (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_remove) || defined (__stub___remove)
21297 #error found stub for remove
21298 #endif
21299
21300         return remove ();
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_remove=yes
21318 else
21319   echo "$as_me: failed program was:" >&5
21320 cat "conftest.$ac_ext" >&5
21321 ac_cv_func_remove=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_remove" >&5
21326 echo "${ECHO_T}$ac_cv_func_remove" >&6
21327
21328     if test $ac_cv_func_remove = no; then
21329       echo "$as_me:21329: checking for remove in -lposix" >&5
21330 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21331 if test "${ac_cv_lib_posix_remove+set}" = set; then
21332   echo $ECHO_N "(cached) $ECHO_C" >&6
21333 else
21334   ac_check_lib_save_LIBS=$LIBS
21335 LIBS="-lposix  $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 remove ();
21347 int
21348 main (void)
21349 {
21350 remove ();
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_posix_remove=yes
21368 else
21369   echo "$as_me: failed program was:" >&5
21370 cat "conftest.$ac_ext" >&5
21371 ac_cv_lib_posix_remove=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_posix_remove" >&5
21377 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21378 if test "$ac_cv_lib_posix_remove" = yes; then
21379   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21380 fi
21381
21382     fi
21383
21384     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21385     echo "$as_me:21385: checking for shmat" >&5
21386 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21387 if test "${ac_cv_func_shmat+set}" = set; then
21388   echo $ECHO_N "(cached) $ECHO_C" >&6
21389 else
21390   cat >"conftest.$ac_ext" <<_ACEOF
21391 #line 21391 "configure"
21392 #include "confdefs.h"
21393 #define shmat autoconf_temporary
21394 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21395 #undef shmat
21396
21397 #ifdef __cplusplus
21398 extern "C"
21399 #endif
21400
21401 /* We use char because int might match the return type of a gcc2
21402    builtin and then its argument prototype would still apply.  */
21403 char shmat (void);
21404
21405 int
21406 main (void)
21407 {
21408
21409 /* The GNU C library defines stubs for functions which it implements
21410     to always fail with ENOSYS.  Some functions are actually named
21411     something starting with __ and the normal name is an alias.  */
21412 #if defined (__stub_shmat) || defined (__stub___shmat)
21413 #error found stub for shmat
21414 #endif
21415
21416         return shmat ();
21417   ;
21418   return 0;
21419 }
21420 _ACEOF
21421 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21422 if { (eval echo "$as_me:21422: \"$ac_link\"") >&5
21423   (eval $ac_link) 2>&5
21424   ac_status=$?
21425   echo "$as_me:21425: \$? = $ac_status" >&5
21426   (exit "$ac_status"); } &&
21427          { ac_try='test -s "conftest$ac_exeext"'
21428   { (eval echo "$as_me:21428: \"$ac_try\"") >&5
21429   (eval $ac_try) 2>&5
21430   ac_status=$?
21431   echo "$as_me:21431: \$? = $ac_status" >&5
21432   (exit "$ac_status"); }; }; then
21433   ac_cv_func_shmat=yes
21434 else
21435   echo "$as_me: failed program was:" >&5
21436 cat "conftest.$ac_ext" >&5
21437 ac_cv_func_shmat=no
21438 fi
21439 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21440 fi
21441 echo "$as_me:21441: result: $ac_cv_func_shmat" >&5
21442 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21443
21444     if test $ac_cv_func_shmat = no; then
21445       echo "$as_me:21445: checking for shmat in -lipc" >&5
21446 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21447 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21448   echo $ECHO_N "(cached) $ECHO_C" >&6
21449 else
21450   ac_check_lib_save_LIBS=$LIBS
21451 LIBS="-lipc  $LIBS"
21452 cat >"conftest.$ac_ext" <<_ACEOF
21453 #line 21453 "configure"
21454 #include "confdefs.h"
21455
21456 /* Override any gcc2 internal prototype to avoid an error.  */
21457 #ifdef __cplusplus
21458 extern "C"
21459 #endif
21460 /* We use char because int might match the return type of a gcc2
21461    builtin and then its argument prototype would still apply.  */
21462 char shmat ();
21463 int
21464 main (void)
21465 {
21466 shmat ();
21467   ;
21468   return 0;
21469 }
21470 _ACEOF
21471 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21472 if { (eval echo "$as_me:21472: \"$ac_link\"") >&5
21473   (eval $ac_link) 2>&5
21474   ac_status=$?
21475   echo "$as_me:21475: \$? = $ac_status" >&5
21476   (exit "$ac_status"); } &&
21477          { ac_try='test -s "conftest$ac_exeext"'
21478   { (eval echo "$as_me:21478: \"$ac_try\"") >&5
21479   (eval $ac_try) 2>&5
21480   ac_status=$?
21481   echo "$as_me:21481: \$? = $ac_status" >&5
21482   (exit "$ac_status"); }; }; then
21483   ac_cv_lib_ipc_shmat=yes
21484 else
21485   echo "$as_me: failed program was:" >&5
21486 cat "conftest.$ac_ext" >&5
21487 ac_cv_lib_ipc_shmat=no
21488 fi
21489 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21490 LIBS=$ac_check_lib_save_LIBS
21491 fi
21492 echo "$as_me:21492: result: $ac_cv_lib_ipc_shmat" >&5
21493 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21494 if test "$ac_cv_lib_ipc_shmat" = yes; then
21495   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21496 fi
21497
21498     fi
21499   fi
21500
21501   # Check for libraries that X11R6 Xt/Xaw programs need.
21502   ac_save_LDFLAGS=$LDFLAGS
21503   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21504   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21505   # check for ICE first), but we must link in the order -lSM -lICE or
21506   # we get undefined symbols.  So assume we have SM if we have ICE.
21507   # These have to be linked with before -lX11, unlike the other
21508   # libraries we check for below, so use a different variable.
21509   # John Interrante, Karl Berry
21510   echo "$as_me:21510: checking for IceConnectionNumber in -lICE" >&5
21511 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21512 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21513   echo $ECHO_N "(cached) $ECHO_C" >&6
21514 else
21515   ac_check_lib_save_LIBS=$LIBS
21516 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21517 cat >"conftest.$ac_ext" <<_ACEOF
21518 #line 21518 "configure"
21519 #include "confdefs.h"
21520
21521 /* Override any gcc2 internal prototype to avoid an error.  */
21522 #ifdef __cplusplus
21523 extern "C"
21524 #endif
21525 /* We use char because int might match the return type of a gcc2
21526    builtin and then its argument prototype would still apply.  */
21527 char IceConnectionNumber ();
21528 int
21529 main (void)
21530 {
21531 IceConnectionNumber ();
21532   ;
21533   return 0;
21534 }
21535 _ACEOF
21536 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21537 if { (eval echo "$as_me:21537: \"$ac_link\"") >&5
21538   (eval $ac_link) 2>&5
21539   ac_status=$?
21540   echo "$as_me:21540: \$? = $ac_status" >&5
21541   (exit "$ac_status"); } &&
21542          { ac_try='test -s "conftest$ac_exeext"'
21543   { (eval echo "$as_me:21543: \"$ac_try\"") >&5
21544   (eval $ac_try) 2>&5
21545   ac_status=$?
21546   echo "$as_me:21546: \$? = $ac_status" >&5
21547   (exit "$ac_status"); }; }; then
21548   ac_cv_lib_ICE_IceConnectionNumber=yes
21549 else
21550   echo "$as_me: failed program was:" >&5
21551 cat "conftest.$ac_ext" >&5
21552 ac_cv_lib_ICE_IceConnectionNumber=no
21553 fi
21554 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21555 LIBS=$ac_check_lib_save_LIBS
21556 fi
21557 echo "$as_me:21557: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21558 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21559 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21560   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21561 fi
21562
21563   LDFLAGS=$ac_save_LDFLAGS
21564
21565 fi
21566
21567 fi
21568
21569 if test "$GCC" = yes || test "$GXX" = yes
21570 then
21571
21572 if test "$GCC" = yes || test "$GXX" = yes
21573 then
21574         case $CFLAGS in
21575         (*-Werror=*)
21576                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21577
21578 echo "${as_me:-configure}:21578: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21579
21580                 cf_temp_flags=
21581                 for cf_temp_scan in $CFLAGS
21582                 do
21583                         case "x$cf_temp_scan" in
21584                         (x-Werror=*)
21585
21586         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21587         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21588
21589                                 ;;
21590                         (*)
21591
21592         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21593         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21594
21595                                 ;;
21596                         esac
21597                 done
21598                 CFLAGS="$cf_temp_flags"
21599                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21600
21601 echo "${as_me:-configure}:21601: testing ... fixed $CFLAGS ..." 1>&5
21602
21603                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21604
21605 echo "${as_me:-configure}:21605: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21606
21607                 ;;
21608         esac
21609 fi
21610
21611 if test "$GCC" = yes || test "$GXX" = yes
21612 then
21613         case $CPPFLAGS in
21614         (*-Werror=*)
21615                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21616
21617 echo "${as_me:-configure}:21617: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21618
21619                 cf_temp_flags=
21620                 for cf_temp_scan in $CPPFLAGS
21621                 do
21622                         case "x$cf_temp_scan" in
21623                         (x-Werror=*)
21624
21625         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21626         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21627
21628                                 ;;
21629                         (*)
21630
21631         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21632         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21633
21634                                 ;;
21635                         esac
21636                 done
21637                 CPPFLAGS="$cf_temp_flags"
21638                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21639
21640 echo "${as_me:-configure}:21640: testing ... fixed $CPPFLAGS ..." 1>&5
21641
21642                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21643
21644 echo "${as_me:-configure}:21644: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21645
21646                 ;;
21647         esac
21648 fi
21649
21650 if test "$GCC" = yes || test "$GXX" = yes
21651 then
21652         case $LDFLAGS in
21653         (*-Werror=*)
21654                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21655
21656 echo "${as_me:-configure}:21656: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21657
21658                 cf_temp_flags=
21659                 for cf_temp_scan in $LDFLAGS
21660                 do
21661                         case "x$cf_temp_scan" in
21662                         (x-Werror=*)
21663
21664         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21665         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21666
21667                                 ;;
21668                         (*)
21669
21670         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21671         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21672
21673                                 ;;
21674                         esac
21675                 done
21676                 LDFLAGS="$cf_temp_flags"
21677                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21678
21679 echo "${as_me:-configure}:21679: testing ... fixed $LDFLAGS ..." 1>&5
21680
21681                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21682
21683 echo "${as_me:-configure}:21683: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21684
21685                 ;;
21686         esac
21687 fi
21688
21689 echo "$as_me:21689: checking if you want to turn on gcc warnings" >&5
21690 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21691
21692 # Check whether --enable-warnings or --disable-warnings was given.
21693 if test "${enable_warnings+set}" = set; then
21694   enableval="$enable_warnings"
21695   test "$enableval" != yes && enableval=no
21696         if test "$enableval" != "no" ; then
21697     enable_warnings=yes
21698         else
21699                 enable_warnings=no
21700         fi
21701 else
21702   enableval=no
21703         enable_warnings=no
21704
21705 fi;
21706 echo "$as_me:21706: result: $enable_warnings" >&5
21707 echo "${ECHO_T}$enable_warnings" >&6
21708 if test "$enable_warnings" = "yes"
21709 then
21710
21711 if test "$GCC" = yes || test "$GXX" = yes
21712 then
21713 cat > conftest.i <<EOF
21714 #ifndef GCC_PRINTF
21715 #define GCC_PRINTF 0
21716 #endif
21717 #ifndef GCC_SCANF
21718 #define GCC_SCANF 0
21719 #endif
21720 #ifndef GCC_NORETURN
21721 #define GCC_NORETURN /* nothing */
21722 #endif
21723 #ifndef GCC_UNUSED
21724 #define GCC_UNUSED /* nothing */
21725 #endif
21726 EOF
21727 if test "$GCC" = yes
21728 then
21729         { echo "$as_me:21729: checking for $CC __attribute__ directives..." >&5
21730 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21731 cat > "conftest.$ac_ext" <<EOF
21732 #line 21732 "${as_me:-configure}"
21733 #include "confdefs.h"
21734 #include "conftest.h"
21735 #include "conftest.i"
21736 #if     GCC_PRINTF
21737 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21738 #else
21739 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21740 #endif
21741 #if     GCC_SCANF
21742 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21743 #else
21744 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21745 #endif
21746 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21747 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
21748 extern GCC_NORETURN void foo(void);
21749 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21750 EOF
21751         cf_printf_attribute=no
21752         cf_scanf_attribute=no
21753         for cf_attribute in scanf printf unused noreturn
21754         do
21755
21756 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21757
21758                 cf_directive="__attribute__(($cf_attribute))"
21759                 echo "checking for $CC $cf_directive" 1>&5
21760
21761                 case "$cf_attribute" in
21762                 (printf)
21763                         cf_printf_attribute=yes
21764                         cat >conftest.h <<EOF
21765 #define GCC_$cf_ATTRIBUTE 1
21766 EOF
21767                         ;;
21768                 (scanf)
21769                         cf_scanf_attribute=yes
21770                         cat >conftest.h <<EOF
21771 #define GCC_$cf_ATTRIBUTE 1
21772 EOF
21773                         ;;
21774                 (*)
21775                         cat >conftest.h <<EOF
21776 #define GCC_$cf_ATTRIBUTE $cf_directive
21777 EOF
21778                         ;;
21779                 esac
21780
21781                 if { (eval echo "$as_me:21781: \"$ac_compile\"") >&5
21782   (eval $ac_compile) 2>&5
21783   ac_status=$?
21784   echo "$as_me:21784: \$? = $ac_status" >&5
21785   (exit "$ac_status"); }; then
21786                         test -n "$verbose" && echo "$as_me:21786: result: ... $cf_attribute" >&5
21787 echo "${ECHO_T}... $cf_attribute" >&6
21788                         cat conftest.h >>confdefs.h
21789                         case "$cf_attribute" in
21790                         (noreturn)
21791
21792 cat >>confdefs.h <<EOF
21793 #define GCC_NORETURN $cf_directive
21794 EOF
21795
21796                                 ;;
21797                         (printf)
21798                                 cf_value='/* nothing */'
21799                                 if test "$cf_printf_attribute" != no ; then
21800                                         cf_value='__attribute__((format(printf,fmt,var)))'
21801
21802 cat >>confdefs.h <<\EOF
21803 #define GCC_PRINTF 1
21804 EOF
21805
21806                                 fi
21807
21808 cat >>confdefs.h <<EOF
21809 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21810 EOF
21811
21812                                 ;;
21813                         (scanf)
21814                                 cf_value='/* nothing */'
21815                                 if test "$cf_scanf_attribute" != no ; then
21816                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21817
21818 cat >>confdefs.h <<\EOF
21819 #define GCC_SCANF 1
21820 EOF
21821
21822                                 fi
21823
21824 cat >>confdefs.h <<EOF
21825 #define GCC_SCANFLIKE(fmt,var) $cf_value
21826 EOF
21827
21828                                 ;;
21829                         (unused)
21830
21831 cat >>confdefs.h <<EOF
21832 #define GCC_UNUSED $cf_directive
21833 EOF
21834
21835                                 ;;
21836                         esac
21837                 fi
21838         done
21839 else
21840         ${FGREP-fgrep} define conftest.i >>confdefs.h
21841 fi
21842 rm -rf ./conftest*
21843 fi
21844
21845 if test "x$have_x" = xyes; then
21846
21847 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21848 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21849 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21850 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21851 for cf_X_CFLAGS in $X_CFLAGS
21852 do
21853         case "x$cf_X_CFLAGS" in
21854         x-[IUD]*)
21855                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21856                 ;;
21857         *)
21858                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21859                 ;;
21860         esac
21861 done
21862
21863 cat >"conftest.$ac_ext" <<_ACEOF
21864 #line 21864 "configure"
21865 #include "confdefs.h"
21866
21867 #include <stdlib.h>
21868 #include <X11/Intrinsic.h>
21869
21870 int
21871 main (void)
21872 {
21873 String foo = malloc(1); free((void*)foo)
21874   ;
21875   return 0;
21876 }
21877 _ACEOF
21878 rm -f "conftest.$ac_objext"
21879 if { (eval echo "$as_me:21879: \"$ac_compile\"") >&5
21880   (eval $ac_compile) 2>&5
21881   ac_status=$?
21882   echo "$as_me:21882: \$? = $ac_status" >&5
21883   (exit "$ac_status"); } &&
21884          { ac_try='test -s "conftest.$ac_objext"'
21885   { (eval echo "$as_me:21885: \"$ac_try\"") >&5
21886   (eval $ac_try) 2>&5
21887   ac_status=$?
21888   echo "$as_me:21888: \$? = $ac_status" >&5
21889   (exit "$ac_status"); }; }; then
21890
21891 echo "$as_me:21891: checking for X11/Xt const-feature" >&5
21892 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21893 if test "${cf_cv_const_x_string+set}" = set; then
21894   echo $ECHO_N "(cached) $ECHO_C" >&6
21895 else
21896
21897         cat >"conftest.$ac_ext" <<_ACEOF
21898 #line 21898 "configure"
21899 #include "confdefs.h"
21900
21901 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21902 #undef  XTSTRINGDEFINES /* X11R5 and later */
21903 #include <stdlib.h>
21904 #include <X11/Intrinsic.h>
21905
21906 int
21907 main (void)
21908 {
21909 String foo = malloc(1); *foo = 0
21910   ;
21911   return 0;
21912 }
21913 _ACEOF
21914 rm -f "conftest.$ac_objext"
21915 if { (eval echo "$as_me:21915: \"$ac_compile\"") >&5
21916   (eval $ac_compile) 2>&5
21917   ac_status=$?
21918   echo "$as_me:21918: \$? = $ac_status" >&5
21919   (exit "$ac_status"); } &&
21920          { ac_try='test -s "conftest.$ac_objext"'
21921   { (eval echo "$as_me:21921: \"$ac_try\"") >&5
21922   (eval $ac_try) 2>&5
21923   ac_status=$?
21924   echo "$as_me:21924: \$? = $ac_status" >&5
21925   (exit "$ac_status"); }; }; then
21926
21927                         cf_cv_const_x_string=no
21928
21929 else
21930   echo "$as_me: failed program was:" >&5
21931 cat "conftest.$ac_ext" >&5
21932
21933                         cf_cv_const_x_string=yes
21934
21935 fi
21936 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21937
21938 fi
21939 echo "$as_me:21939: result: $cf_cv_const_x_string" >&5
21940 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21941
21942 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21943 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21944 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21945
21946 case "$cf_cv_const_x_string" in
21947 (no)
21948
21949         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21950         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21951
21952         ;;
21953 (*)
21954
21955         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21956         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21957
21958         ;;
21959 esac
21960
21961 else
21962   echo "$as_me: failed program was:" >&5
21963 cat "conftest.$ac_ext" >&5
21964 fi
21965 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21966  fi
21967 cat > "conftest.$ac_ext" <<EOF
21968 #line 21968 "${as_me:-configure}"
21969 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21970 EOF
21971 if test "$INTEL_COMPILER" = yes
21972 then
21973 # The "-wdXXX" options suppress warnings:
21974 # remark #1419: external declaration in primary source file
21975 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21976 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21977 # remark #193: zero used for undefined preprocessing identifier
21978 # remark #593: variable "curs_sb_left_arrow" was set but never used
21979 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21980 # remark #869: parameter "tw" was never referenced
21981 # remark #981: operands are evaluated in unspecified order
21982 # warning #279: controlling expression is constant
21983
21984         { echo "$as_me:21984: checking for $CC warning options..." >&5
21985 echo "$as_me: checking for $CC warning options..." >&6;}
21986         cf_save_CFLAGS="$CFLAGS"
21987         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21988         for cf_opt in \
21989                 wd1419 \
21990                 wd1683 \
21991                 wd1684 \
21992                 wd193 \
21993                 wd593 \
21994                 wd279 \
21995                 wd810 \
21996                 wd869 \
21997                 wd981
21998         do
21999                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22000                 if { (eval echo "$as_me:22000: \"$ac_compile\"") >&5
22001   (eval $ac_compile) 2>&5
22002   ac_status=$?
22003   echo "$as_me:22003: \$? = $ac_status" >&5
22004   (exit "$ac_status"); }; then
22005                         test -n "$verbose" && echo "$as_me:22005: result: ... -$cf_opt" >&5
22006 echo "${ECHO_T}... -$cf_opt" >&6
22007                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22008                 fi
22009         done
22010         CFLAGS="$cf_save_CFLAGS"
22011 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22012 then
22013         { echo "$as_me:22013: checking for $CC warning options..." >&5
22014 echo "$as_me: checking for $CC warning options..." >&6;}
22015         cf_save_CFLAGS="$CFLAGS"
22016         cf_warn_CONST=""
22017         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22018         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22019         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22020         for cf_opt in W Wall \
22021                 Wbad-function-cast \
22022                 Wcast-align \
22023                 Wcast-qual \
22024                 Wdeclaration-after-statement \
22025                 Wextra \
22026                 Winline \
22027                 Wmissing-declarations \
22028                 Wmissing-prototypes \
22029                 Wnested-externs \
22030                 Wpointer-arith \
22031                 Wshadow \
22032                 Wstrict-prototypes \
22033                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22034         do
22035                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22036                 if { (eval echo "$as_me:22036: \"$ac_compile\"") >&5
22037   (eval $ac_compile) 2>&5
22038   ac_status=$?
22039   echo "$as_me:22039: \$? = $ac_status" >&5
22040   (exit "$ac_status"); }; then
22041                         test -n "$verbose" && echo "$as_me:22041: result: ... -$cf_opt" >&5
22042 echo "${ECHO_T}... -$cf_opt" >&6
22043                         case "$cf_opt" in
22044                         (Winline)
22045                                 case "$GCC_VERSION" in
22046                                 ([34].*)
22047                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22048
22049 echo "${as_me:-configure}:22049: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22050
22051                                         continue;;
22052                                 esac
22053                                 ;;
22054                         (Wpointer-arith)
22055                                 case "$GCC_VERSION" in
22056                                 ([12].*)
22057                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22058
22059 echo "${as_me:-configure}:22059: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22060
22061                                         continue;;
22062                                 esac
22063                                 ;;
22064                         esac
22065                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22066                 fi
22067         done
22068         CFLAGS="$cf_save_CFLAGS"
22069 fi
22070 rm -rf ./conftest*
22071
22072 fi
22073
22074 fi
22075
22076 echo "$as_me:22076: checking if you want to use dmalloc for testing" >&5
22077 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22078
22079 # Check whether --with-dmalloc or --without-dmalloc was given.
22080 if test "${with_dmalloc+set}" = set; then
22081   withval="$with_dmalloc"
22082   case "x$withval" in
22083         (x|xno) ;;
22084         (*)
22085                 : "${with_cflags:=-g}"
22086                 : "${enable_leaks:=no}"
22087                 with_dmalloc=yes
22088
22089 cat >>confdefs.h <<EOF
22090 #define USE_DMALLOC 1
22091 EOF
22092
22093                 ;;
22094         esac
22095 else
22096   with_dmalloc=
22097 fi;
22098 echo "$as_me:22098: result: ${with_dmalloc:-no}" >&5
22099 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22100
22101 case ".$with_cflags" in
22102 (.*-g*)
22103         case .$CFLAGS in
22104         (.*-g*)
22105                 ;;
22106         (*)
22107
22108 cf_fix_cppflags=no
22109 cf_new_cflags=
22110 cf_new_cppflags=
22111 cf_new_extra_cppflags=
22112
22113 for cf_add_cflags in -g
22114 do
22115 case "$cf_fix_cppflags" in
22116 (no)
22117         case "$cf_add_cflags" in
22118         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22119                 case "$cf_add_cflags" in
22120                 (-D*)
22121                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22122
22123                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22124                                 && test -z "${cf_tst_cflags}" \
22125                                 && cf_fix_cppflags=yes
22126
22127                         if test "$cf_fix_cppflags" = yes ; then
22128
22129         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22130         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22131
22132                                 continue
22133                         elif test "${cf_tst_cflags}" = "\"'" ; then
22134
22135         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22136         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22137
22138                                 continue
22139                         fi
22140                         ;;
22141                 esac
22142                 case "$CPPFLAGS" in
22143                 (*$cf_add_cflags)
22144                         ;;
22145                 (*)
22146                         case "$cf_add_cflags" in
22147                         (-D*)
22148                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22149
22150 CPPFLAGS=`echo "$CPPFLAGS" | \
22151         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22152                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22153
22154                                 ;;
22155                         esac
22156
22157         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22158         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22159
22160                         ;;
22161                 esac
22162                 ;;
22163         (*)
22164
22165         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22166         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22167
22168                 ;;
22169         esac
22170         ;;
22171 (yes)
22172
22173         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22174         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22175
22176         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22177
22178         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22179                 && test -z "${cf_tst_cflags}" \
22180                 && cf_fix_cppflags=no
22181         ;;
22182 esac
22183 done
22184
22185 if test -n "$cf_new_cflags" ; then
22186
22187         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22188         CFLAGS="${CFLAGS}$cf_new_cflags"
22189
22190 fi
22191
22192 if test -n "$cf_new_cppflags" ; then
22193
22194         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22195         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22196
22197 fi
22198
22199 if test -n "$cf_new_extra_cppflags" ; then
22200
22201         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22202         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22203
22204 fi
22205
22206                 ;;
22207         esac
22208         ;;
22209 esac
22210
22211 if test "$with_dmalloc" = yes ; then
22212         echo "$as_me:22212: checking for dmalloc.h" >&5
22213 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22214 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22215   echo $ECHO_N "(cached) $ECHO_C" >&6
22216 else
22217   cat >"conftest.$ac_ext" <<_ACEOF
22218 #line 22218 "configure"
22219 #include "confdefs.h"
22220 #include <dmalloc.h>
22221 _ACEOF
22222 if { (eval echo "$as_me:22222: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22223   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22224   ac_status=$?
22225   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22226   rm -f conftest.er1
22227   cat conftest.err >&5
22228   echo "$as_me:22228: \$? = $ac_status" >&5
22229   (exit "$ac_status"); } >/dev/null; then
22230   if test -s conftest.err; then
22231     ac_cpp_err=$ac_c_preproc_warn_flag
22232   else
22233     ac_cpp_err=
22234   fi
22235 else
22236   ac_cpp_err=yes
22237 fi
22238 if test -z "$ac_cpp_err"; then
22239   ac_cv_header_dmalloc_h=yes
22240 else
22241   echo "$as_me: failed program was:" >&5
22242   cat "conftest.$ac_ext" >&5
22243   ac_cv_header_dmalloc_h=no
22244 fi
22245 rm -f conftest.err "conftest.$ac_ext"
22246 fi
22247 echo "$as_me:22247: result: $ac_cv_header_dmalloc_h" >&5
22248 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22249 if test "$ac_cv_header_dmalloc_h" = yes; then
22250
22251 echo "$as_me:22251: checking for dmalloc_debug in -ldmalloc" >&5
22252 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22253 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22254   echo $ECHO_N "(cached) $ECHO_C" >&6
22255 else
22256   ac_check_lib_save_LIBS=$LIBS
22257 LIBS="-ldmalloc  $LIBS"
22258 cat >"conftest.$ac_ext" <<_ACEOF
22259 #line 22259 "configure"
22260 #include "confdefs.h"
22261
22262 /* Override any gcc2 internal prototype to avoid an error.  */
22263 #ifdef __cplusplus
22264 extern "C"
22265 #endif
22266 /* We use char because int might match the return type of a gcc2
22267    builtin and then its argument prototype would still apply.  */
22268 char dmalloc_debug ();
22269 int
22270 main (void)
22271 {
22272 dmalloc_debug ();
22273   ;
22274   return 0;
22275 }
22276 _ACEOF
22277 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22278 if { (eval echo "$as_me:22278: \"$ac_link\"") >&5
22279   (eval $ac_link) 2>&5
22280   ac_status=$?
22281   echo "$as_me:22281: \$? = $ac_status" >&5
22282   (exit "$ac_status"); } &&
22283          { ac_try='test -s "conftest$ac_exeext"'
22284   { (eval echo "$as_me:22284: \"$ac_try\"") >&5
22285   (eval $ac_try) 2>&5
22286   ac_status=$?
22287   echo "$as_me:22287: \$? = $ac_status" >&5
22288   (exit "$ac_status"); }; }; then
22289   ac_cv_lib_dmalloc_dmalloc_debug=yes
22290 else
22291   echo "$as_me: failed program was:" >&5
22292 cat "conftest.$ac_ext" >&5
22293 ac_cv_lib_dmalloc_dmalloc_debug=no
22294 fi
22295 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22296 LIBS=$ac_check_lib_save_LIBS
22297 fi
22298 echo "$as_me:22298: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22299 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22300 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22301   cat >>confdefs.h <<EOF
22302 #define HAVE_LIBDMALLOC 1
22303 EOF
22304
22305   LIBS="-ldmalloc $LIBS"
22306
22307 fi
22308
22309 fi
22310
22311 fi
22312
22313 echo "$as_me:22313: checking if you want to use dbmalloc for testing" >&5
22314 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22315
22316 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22317 if test "${with_dbmalloc+set}" = set; then
22318   withval="$with_dbmalloc"
22319   case "x$withval" in
22320         (x|xno) ;;
22321         (*)
22322                 : "${with_cflags:=-g}"
22323                 : "${enable_leaks:=no}"
22324                 with_dbmalloc=yes
22325
22326 cat >>confdefs.h <<EOF
22327 #define USE_DBMALLOC 1
22328 EOF
22329
22330                 ;;
22331         esac
22332 else
22333   with_dbmalloc=
22334 fi;
22335 echo "$as_me:22335: result: ${with_dbmalloc:-no}" >&5
22336 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22337
22338 case ".$with_cflags" in
22339 (.*-g*)
22340         case .$CFLAGS in
22341         (.*-g*)
22342                 ;;
22343         (*)
22344
22345 cf_fix_cppflags=no
22346 cf_new_cflags=
22347 cf_new_cppflags=
22348 cf_new_extra_cppflags=
22349
22350 for cf_add_cflags in -g
22351 do
22352 case "$cf_fix_cppflags" in
22353 (no)
22354         case "$cf_add_cflags" in
22355         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22356                 case "$cf_add_cflags" in
22357                 (-D*)
22358                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22359
22360                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22361                                 && test -z "${cf_tst_cflags}" \
22362                                 && cf_fix_cppflags=yes
22363
22364                         if test "$cf_fix_cppflags" = yes ; then
22365
22366         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22367         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22368
22369                                 continue
22370                         elif test "${cf_tst_cflags}" = "\"'" ; then
22371
22372         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22373         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22374
22375                                 continue
22376                         fi
22377                         ;;
22378                 esac
22379                 case "$CPPFLAGS" in
22380                 (*$cf_add_cflags)
22381                         ;;
22382                 (*)
22383                         case "$cf_add_cflags" in
22384                         (-D*)
22385                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22386
22387 CPPFLAGS=`echo "$CPPFLAGS" | \
22388         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22389                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22390
22391                                 ;;
22392                         esac
22393
22394         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22395         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22396
22397                         ;;
22398                 esac
22399                 ;;
22400         (*)
22401
22402         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22403         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22404
22405                 ;;
22406         esac
22407         ;;
22408 (yes)
22409
22410         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22411         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22412
22413         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22414
22415         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22416                 && test -z "${cf_tst_cflags}" \
22417                 && cf_fix_cppflags=no
22418         ;;
22419 esac
22420 done
22421
22422 if test -n "$cf_new_cflags" ; then
22423
22424         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22425         CFLAGS="${CFLAGS}$cf_new_cflags"
22426
22427 fi
22428
22429 if test -n "$cf_new_cppflags" ; then
22430
22431         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22432         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22433
22434 fi
22435
22436 if test -n "$cf_new_extra_cppflags" ; then
22437
22438         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22439         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22440
22441 fi
22442
22443                 ;;
22444         esac
22445         ;;
22446 esac
22447
22448 if test "$with_dbmalloc" = yes ; then
22449         echo "$as_me:22449: checking for dbmalloc.h" >&5
22450 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22451 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22452   echo $ECHO_N "(cached) $ECHO_C" >&6
22453 else
22454   cat >"conftest.$ac_ext" <<_ACEOF
22455 #line 22455 "configure"
22456 #include "confdefs.h"
22457 #include <dbmalloc.h>
22458 _ACEOF
22459 if { (eval echo "$as_me:22459: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22460   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22461   ac_status=$?
22462   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22463   rm -f conftest.er1
22464   cat conftest.err >&5
22465   echo "$as_me:22465: \$? = $ac_status" >&5
22466   (exit "$ac_status"); } >/dev/null; then
22467   if test -s conftest.err; then
22468     ac_cpp_err=$ac_c_preproc_warn_flag
22469   else
22470     ac_cpp_err=
22471   fi
22472 else
22473   ac_cpp_err=yes
22474 fi
22475 if test -z "$ac_cpp_err"; then
22476   ac_cv_header_dbmalloc_h=yes
22477 else
22478   echo "$as_me: failed program was:" >&5
22479   cat "conftest.$ac_ext" >&5
22480   ac_cv_header_dbmalloc_h=no
22481 fi
22482 rm -f conftest.err "conftest.$ac_ext"
22483 fi
22484 echo "$as_me:22484: result: $ac_cv_header_dbmalloc_h" >&5
22485 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22486 if test "$ac_cv_header_dbmalloc_h" = yes; then
22487
22488 echo "$as_me:22488: checking for debug_malloc in -ldbmalloc" >&5
22489 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22490 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22491   echo $ECHO_N "(cached) $ECHO_C" >&6
22492 else
22493   ac_check_lib_save_LIBS=$LIBS
22494 LIBS="-ldbmalloc  $LIBS"
22495 cat >"conftest.$ac_ext" <<_ACEOF
22496 #line 22496 "configure"
22497 #include "confdefs.h"
22498
22499 /* Override any gcc2 internal prototype to avoid an error.  */
22500 #ifdef __cplusplus
22501 extern "C"
22502 #endif
22503 /* We use char because int might match the return type of a gcc2
22504    builtin and then its argument prototype would still apply.  */
22505 char debug_malloc ();
22506 int
22507 main (void)
22508 {
22509 debug_malloc ();
22510   ;
22511   return 0;
22512 }
22513 _ACEOF
22514 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22515 if { (eval echo "$as_me:22515: \"$ac_link\"") >&5
22516   (eval $ac_link) 2>&5
22517   ac_status=$?
22518   echo "$as_me:22518: \$? = $ac_status" >&5
22519   (exit "$ac_status"); } &&
22520          { ac_try='test -s "conftest$ac_exeext"'
22521   { (eval echo "$as_me:22521: \"$ac_try\"") >&5
22522   (eval $ac_try) 2>&5
22523   ac_status=$?
22524   echo "$as_me:22524: \$? = $ac_status" >&5
22525   (exit "$ac_status"); }; }; then
22526   ac_cv_lib_dbmalloc_debug_malloc=yes
22527 else
22528   echo "$as_me: failed program was:" >&5
22529 cat "conftest.$ac_ext" >&5
22530 ac_cv_lib_dbmalloc_debug_malloc=no
22531 fi
22532 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22533 LIBS=$ac_check_lib_save_LIBS
22534 fi
22535 echo "$as_me:22535: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22536 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22537 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22538   cat >>confdefs.h <<EOF
22539 #define HAVE_LIBDBMALLOC 1
22540 EOF
22541
22542   LIBS="-ldbmalloc $LIBS"
22543
22544 fi
22545
22546 fi
22547
22548 fi
22549
22550 echo "$as_me:22550: checking if you want to use valgrind for testing" >&5
22551 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22552
22553 # Check whether --with-valgrind or --without-valgrind was given.
22554 if test "${with_valgrind+set}" = set; then
22555   withval="$with_valgrind"
22556   case "x$withval" in
22557         (x|xno) ;;
22558         (*)
22559                 : "${with_cflags:=-g}"
22560                 : "${enable_leaks:=no}"
22561                 with_valgrind=yes
22562
22563 cat >>confdefs.h <<EOF
22564 #define USE_VALGRIND 1
22565 EOF
22566
22567                 ;;
22568         esac
22569 else
22570   with_valgrind=
22571 fi;
22572 echo "$as_me:22572: result: ${with_valgrind:-no}" >&5
22573 echo "${ECHO_T}${with_valgrind:-no}" >&6
22574
22575 case ".$with_cflags" in
22576 (.*-g*)
22577         case .$CFLAGS in
22578         (.*-g*)
22579                 ;;
22580         (*)
22581
22582 cf_fix_cppflags=no
22583 cf_new_cflags=
22584 cf_new_cppflags=
22585 cf_new_extra_cppflags=
22586
22587 for cf_add_cflags in -g
22588 do
22589 case "$cf_fix_cppflags" in
22590 (no)
22591         case "$cf_add_cflags" in
22592         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22593                 case "$cf_add_cflags" in
22594                 (-D*)
22595                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22596
22597                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22598                                 && test -z "${cf_tst_cflags}" \
22599                                 && cf_fix_cppflags=yes
22600
22601                         if test "$cf_fix_cppflags" = yes ; then
22602
22603         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22604         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22605
22606                                 continue
22607                         elif test "${cf_tst_cflags}" = "\"'" ; then
22608
22609         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22610         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22611
22612                                 continue
22613                         fi
22614                         ;;
22615                 esac
22616                 case "$CPPFLAGS" in
22617                 (*$cf_add_cflags)
22618                         ;;
22619                 (*)
22620                         case "$cf_add_cflags" in
22621                         (-D*)
22622                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22623
22624 CPPFLAGS=`echo "$CPPFLAGS" | \
22625         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22626                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22627
22628                                 ;;
22629                         esac
22630
22631         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22632         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22633
22634                         ;;
22635                 esac
22636                 ;;
22637         (*)
22638
22639         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22640         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22641
22642                 ;;
22643         esac
22644         ;;
22645 (yes)
22646
22647         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22648         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22649
22650         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22651
22652         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22653                 && test -z "${cf_tst_cflags}" \
22654                 && cf_fix_cppflags=no
22655         ;;
22656 esac
22657 done
22658
22659 if test -n "$cf_new_cflags" ; then
22660
22661         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22662         CFLAGS="${CFLAGS}$cf_new_cflags"
22663
22664 fi
22665
22666 if test -n "$cf_new_cppflags" ; then
22667
22668         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22669         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22670
22671 fi
22672
22673 if test -n "$cf_new_extra_cppflags" ; then
22674
22675         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22676         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22677
22678 fi
22679
22680                 ;;
22681         esac
22682         ;;
22683 esac
22684
22685 echo "$as_me:22685: checking if you want to perform memory-leak testing" >&5
22686 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22687
22688 # Check whether --enable-leaks or --disable-leaks was given.
22689 if test "${enable_leaks+set}" = set; then
22690   enableval="$enable_leaks"
22691   enable_leaks=$enableval
22692 else
22693   enable_leaks=yes
22694 fi;
22695 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22696 echo "$as_me:22696: result: $with_no_leaks" >&5
22697 echo "${ECHO_T}$with_no_leaks" >&6
22698
22699 if test "$enable_leaks" = no ; then
22700
22701 cat >>confdefs.h <<\EOF
22702 #define NO_LEAKS 1
22703 EOF
22704
22705 cat >>confdefs.h <<\EOF
22706 #define YY_NO_LEAKS 1
22707 EOF
22708
22709 fi
22710
22711 LD_RPATH_OPT=
22712 if test "x$cf_cv_enable_rpath" != xno
22713 then
22714         echo "$as_me:22714: checking for an rpath option" >&5
22715 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22716         case "$cf_cv_system_name" in
22717         (irix*)
22718                 if test "$GCC" = yes; then
22719                         LD_RPATH_OPT="-Wl,-rpath,"
22720                 else
22721                         LD_RPATH_OPT="-rpath "
22722                 fi
22723                 ;;
22724         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22725                 LD_RPATH_OPT="-Wl,-rpath,"
22726                 ;;
22727         (openbsd[2-9].*|mirbsd*)
22728                 LD_RPATH_OPT="-Wl,-rpath,"
22729                 ;;
22730         (dragonfly*)
22731                 LD_RPATH_OPT="-rpath "
22732                 ;;
22733         (netbsd*)
22734                 LD_RPATH_OPT="-Wl,-rpath,"
22735                 ;;
22736         (osf*|mls+*)
22737                 LD_RPATH_OPT="-rpath "
22738                 ;;
22739         (solaris2*)
22740                 LD_RPATH_OPT="-R"
22741                 ;;
22742         (*)
22743                 ;;
22744         esac
22745         echo "$as_me:22745: result: $LD_RPATH_OPT" >&5
22746 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22747
22748         case "x$LD_RPATH_OPT" in
22749         (x-R*)
22750                 echo "$as_me:22750: checking if we need a space after rpath option" >&5
22751 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22752                 cf_save_LIBS="$LIBS"
22753
22754 cf_add_libs="$LIBS"
22755 # reverse order
22756 cf_add_0lib=
22757 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22758 # filter duplicates
22759 for cf_add_1lib in $cf_add_0lib; do
22760         for cf_add_2lib in $cf_add_libs; do
22761                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22762                         cf_add_1lib=
22763                         break
22764                 fi
22765         done
22766         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22767 done
22768 LIBS="$cf_add_libs"
22769
22770                 cat >"conftest.$ac_ext" <<_ACEOF
22771 #line 22771 "configure"
22772 #include "confdefs.h"
22773
22774 int
22775 main (void)
22776 {
22777
22778   ;
22779   return 0;
22780 }
22781 _ACEOF
22782 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22783 if { (eval echo "$as_me:22783: \"$ac_link\"") >&5
22784   (eval $ac_link) 2>&5
22785   ac_status=$?
22786   echo "$as_me:22786: \$? = $ac_status" >&5
22787   (exit "$ac_status"); } &&
22788          { ac_try='test -s "conftest$ac_exeext"'
22789   { (eval echo "$as_me:22789: \"$ac_try\"") >&5
22790   (eval $ac_try) 2>&5
22791   ac_status=$?
22792   echo "$as_me:22792: \$? = $ac_status" >&5
22793   (exit "$ac_status"); }; }; then
22794   cf_rpath_space=no
22795 else
22796   echo "$as_me: failed program was:" >&5
22797 cat "conftest.$ac_ext" >&5
22798 cf_rpath_space=yes
22799 fi
22800 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22801                 LIBS="$cf_save_LIBS"
22802                 echo "$as_me:22802: result: $cf_rpath_space" >&5
22803 echo "${ECHO_T}$cf_rpath_space" >&6
22804                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22805                 ;;
22806         esac
22807 fi
22808
22809 echo "$as_me:22809: checking if rpath-hack should be disabled" >&5
22810 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22811
22812 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22813 if test "${enable_rpath_hack+set}" = set; then
22814   enableval="$enable_rpath_hack"
22815   test "$enableval" != no && enableval=yes
22816         if test "$enableval" != "yes" ; then
22817     enable_rpath_hack=no
22818         else
22819                 enable_rpath_hack=yes
22820         fi
22821 else
22822   enableval=yes
22823         enable_rpath_hack=yes
22824
22825 fi;
22826 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
22827 echo "$as_me:22827: result: $cf_disable_rpath_hack" >&5
22828 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22829
22830 if test "$enable_rpath_hack" = yes ; then
22831
22832 echo "$as_me:22832: checking for updated LDFLAGS" >&5
22833 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22834 if test -n "$LD_RPATH_OPT" ; then
22835         echo "$as_me:22835: result: maybe" >&5
22836 echo "${ECHO_T}maybe" >&6
22837
22838         for ac_prog in ldd
22839 do
22840   # Extract the first word of "$ac_prog", so it can be a program name with args.
22841 set dummy $ac_prog; ac_word=$2
22842 echo "$as_me:22842: checking for $ac_word" >&5
22843 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22844 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22845   echo $ECHO_N "(cached) $ECHO_C" >&6
22846 else
22847   if test -n "$cf_ldd_prog"; then
22848   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22849 else
22850   ac_save_IFS=$IFS; IFS=$ac_path_separator
22851 ac_dummy="$PATH"
22852 for ac_dir in $ac_dummy; do
22853   IFS=$ac_save_IFS
22854   test -z "$ac_dir" && ac_dir=.
22855   $as_executable_p "$ac_dir/$ac_word" || continue
22856 ac_cv_prog_cf_ldd_prog="$ac_prog"
22857 echo "$as_me:22857: found $ac_dir/$ac_word" >&5
22858 break
22859 done
22860
22861 fi
22862 fi
22863 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22864 if test -n "$cf_ldd_prog"; then
22865   echo "$as_me:22865: result: $cf_ldd_prog" >&5
22866 echo "${ECHO_T}$cf_ldd_prog" >&6
22867 else
22868   echo "$as_me:22868: result: no" >&5
22869 echo "${ECHO_T}no" >&6
22870 fi
22871
22872   test -n "$cf_ldd_prog" && break
22873 done
22874 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22875
22876         cf_rpath_list="/usr/lib /lib"
22877         if test "$cf_ldd_prog" != no
22878         then
22879                 cf_rpath_oops=
22880
22881 cat >"conftest.$ac_ext" <<_ACEOF
22882 #line 22882 "configure"
22883 #include "confdefs.h"
22884 #include <stdio.h>
22885 int
22886 main (void)
22887 {
22888 printf("Hello");
22889   ;
22890   return 0;
22891 }
22892 _ACEOF
22893 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22894 if { (eval echo "$as_me:22894: \"$ac_link\"") >&5
22895   (eval $ac_link) 2>&5
22896   ac_status=$?
22897   echo "$as_me:22897: \$? = $ac_status" >&5
22898   (exit "$ac_status"); } &&
22899          { ac_try='test -s "conftest$ac_exeext"'
22900   { (eval echo "$as_me:22900: \"$ac_try\"") >&5
22901   (eval $ac_try) 2>&5
22902   ac_status=$?
22903   echo "$as_me:22903: \$? = $ac_status" >&5
22904   (exit "$ac_status"); }; }; then
22905   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22906                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22907 else
22908   echo "$as_me: failed program was:" >&5
22909 cat "conftest.$ac_ext" >&5
22910 fi
22911 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22912
22913                 # If we passed the link-test, but get a "not found" on a given library,
22914                 # this could be due to inept reconfiguration of gcc to make it only
22915                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22916                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22917                 # /usr/local libraries.
22918                 if test -n "$cf_rpath_oops"
22919                 then
22920                         for cf_rpath_src in $cf_rpath_oops
22921                         do
22922                                 for cf_rpath_dir in \
22923                                         /usr/local \
22924                                         /usr/pkg \
22925                                         /opt/sfw
22926                                 do
22927                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
22928                                         then
22929                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22930
22931 echo "${as_me:-configure}:22931: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22932
22933                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22934                                                 break
22935                                         fi
22936                                 done
22937                         done
22938                 fi
22939         fi
22940
22941         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22942
22943 echo "${as_me:-configure}:22943: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22944
22945 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22946
22947 echo "${as_me:-configure}:22947: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22948
22949 cf_rpath_dst=
22950 for cf_rpath_src in $LDFLAGS
22951 do
22952         case "$cf_rpath_src" in
22953         (-L*)
22954
22955                 # check if this refers to a directory which we will ignore
22956                 cf_rpath_skip=no
22957                 if test -n "$cf_rpath_list"
22958                 then
22959                         for cf_rpath_item in $cf_rpath_list
22960                         do
22961                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22962                                 then
22963                                         cf_rpath_skip=yes
22964                                         break
22965                                 fi
22966                         done
22967                 fi
22968
22969                 if test "$cf_rpath_skip" = no
22970                 then
22971                         # transform the option
22972                         if test "$LD_RPATH_OPT" = "-R " ; then
22973                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22974                         else
22975                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22976                         fi
22977
22978                         # if we have not already added this, add it now
22979                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22980                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22981                         then
22982                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22983
22984 echo "${as_me:-configure}:22984: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22985
22986                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22987                         fi
22988                 fi
22989                 ;;
22990         esac
22991         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22992 done
22993 LDFLAGS=$cf_rpath_dst
22994
22995 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22996
22997 echo "${as_me:-configure}:22997: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22998
22999 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23000
23001 echo "${as_me:-configure}:23001: testing ...checking LIBS $LIBS ..." 1>&5
23002
23003 cf_rpath_dst=
23004 for cf_rpath_src in $LIBS
23005 do
23006         case "$cf_rpath_src" in
23007         (-L*)
23008
23009                 # check if this refers to a directory which we will ignore
23010                 cf_rpath_skip=no
23011                 if test -n "$cf_rpath_list"
23012                 then
23013                         for cf_rpath_item in $cf_rpath_list
23014                         do
23015                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23016                                 then
23017                                         cf_rpath_skip=yes
23018                                         break
23019                                 fi
23020                         done
23021                 fi
23022
23023                 if test "$cf_rpath_skip" = no
23024                 then
23025                         # transform the option
23026                         if test "$LD_RPATH_OPT" = "-R " ; then
23027                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23028                         else
23029                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23030                         fi
23031
23032                         # if we have not already added this, add it now
23033                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23034                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23035                         then
23036                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23037
23038 echo "${as_me:-configure}:23038: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23039
23040                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23041                         fi
23042                 fi
23043                 ;;
23044         esac
23045         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23046 done
23047 LIBS=$cf_rpath_dst
23048
23049 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23050
23051 echo "${as_me:-configure}:23051: testing ...checked LIBS $LIBS ..." 1>&5
23052
23053         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23054
23055 echo "${as_me:-configure}:23055: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23056
23057 else
23058         echo "$as_me:23058: result: no" >&5
23059 echo "${ECHO_T}no" >&6
23060 fi
23061
23062 fi
23063
23064 TEST_ARGS="$LIBS"
23065 LIBS=
23066
23067 ac_config_files="$ac_config_files Makefile"
23068 ac_config_commands="$ac_config_commands default"
23069 cat >confcache <<\_ACEOF
23070 # This file is a shell script that caches the results of configure
23071 # tests run on this system so they can be shared between configure
23072 # scripts and configure runs, see configure's option --config-cache.
23073 # It is not useful on other systems.  If it contains results you don't
23074 # want to keep, you may remove or edit it.
23075 #
23076 # config.status only pays attention to the cache file if you give it
23077 # the --recheck option to rerun configure.
23078 #
23079 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23080 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23081 # following values.
23082
23083 _ACEOF
23084
23085 # The following way of writing the cache mishandles newlines in values,
23086 # but we know of no workaround that is simple, portable, and efficient.
23087 # So, don't put newlines in cache variables' values.
23088 # Ultrix sh set writes to stderr and can't be redirected directly,
23089 # and sets the high bit in the cache file unless we assign to the vars.
23090 {
23091   (set) 2>&1 |
23092     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23093     *ac_space=\ *)
23094       # `set' does not quote correctly, so add quotes (double-quote
23095       # substitution turns \\\\ into \\, and sed turns \\ into \).
23096       sed -n \
23097         "s/'/'\\\\''/g;
23098           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23099       ;;
23100     *)
23101       # `set' quotes correctly as required by POSIX, so do not add quotes.
23102       sed -n \
23103         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23104       ;;
23105     esac;
23106 } |
23107   sed '
23108      t clear
23109      : clear
23110      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23111      t end
23112      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23113      : end' >>confcache
23114 if cmp -s $cache_file confcache; then :; else
23115   if test -w $cache_file; then
23116     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23117     cat confcache >$cache_file
23118   else
23119     echo "not updating unwritable cache $cache_file"
23120   fi
23121 fi
23122 rm -f confcache
23123
23124 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23125 # Let make expand exec_prefix.
23126 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23127
23128 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23129 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23130 # trailing colons and then remove the whole line if VPATH becomes empty
23131 # (actually we leave an empty line to preserve line numbers).
23132 if test "x$srcdir" = x.; then
23133   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23134 s/:*\$(srcdir):*/:/;
23135 s/:*\${srcdir}:*/:/;
23136 s/:*@srcdir@:*/:/;
23137 s/^\([^=]*=[    ]*\):*/\1/;
23138 s/:*$//;
23139 s/^[^=]*=[      ]*$//;
23140 }'
23141 fi
23142
23143 DEFS=-DHAVE_CONFIG_H
23144
23145 : "${CONFIG_STATUS=./config.status}"
23146 ac_clean_files_save=$ac_clean_files
23147 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23148 { echo "$as_me:23148: creating $CONFIG_STATUS" >&5
23149 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23150 cat >"$CONFIG_STATUS" <<_ACEOF
23151 #! $SHELL
23152 # Generated automatically by configure.
23153 # Run this file to recreate the current configuration.
23154 # Compiler output produced by configure, useful for debugging
23155 # configure, is in config.log if it exists.
23156
23157 debug=false
23158 SHELL=\${CONFIG_SHELL-$SHELL}
23159 ac_cs_invocation="\$0 \$@"
23160
23161 CLICOLOR_FORCE= GREP_OPTIONS=
23162 unset CLICOLOR_FORCE GREP_OPTIONS
23163 _ACEOF
23164
23165 cat >>"$CONFIG_STATUS" <<\_ACEOF
23166 # Be Bourne compatible
23167 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23168   emulate sh
23169   NULLCMD=:
23170 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23171   set -o posix
23172 fi
23173
23174 # Name of the executable.
23175 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23176
23177 if expr a : '\(a\)' >/dev/null 2>&1; then
23178   as_expr=expr
23179 else
23180   as_expr=false
23181 fi
23182
23183 rm -f conf$$ conf$$.exe conf$$.file
23184 echo >conf$$.file
23185 if ln -s conf$$.file conf$$ 2>/dev/null; then
23186   # We could just check for DJGPP; but this test a) works b) is more generic
23187   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23188   if test -f conf$$.exe; then
23189     # Don't use ln at all; we don't have any links
23190     as_ln_s='cp -p'
23191   else
23192     as_ln_s='ln -s'
23193   fi
23194 elif ln conf$$.file conf$$ 2>/dev/null; then
23195   as_ln_s=ln
23196 else
23197   as_ln_s='cp -p'
23198 fi
23199 rm -f conf$$ conf$$.exe conf$$.file
23200
23201 as_executable_p="test -f"
23202
23203 # Support unset when possible.
23204 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23205   as_unset="unset"
23206 else
23207   as_unset="false"
23208 fi
23209
23210 # NLS nuisances.
23211 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23212 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23213 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23214 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23215 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23216 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23217 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23218 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23219
23220 # IFS
23221 # We need space, tab and new line, in precisely that order.
23222 as_nl='
23223 '
23224 IFS="   $as_nl"
23225
23226 # CDPATH.
23227 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23228
23229 exec 6>&1
23230
23231 _ACEOF
23232
23233 # Files that config.status was made for.
23234 if test -n "$ac_config_files"; then
23235   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23236 fi
23237
23238 if test -n "$ac_config_headers"; then
23239   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23240 fi
23241
23242 if test -n "$ac_config_links"; then
23243   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23244 fi
23245
23246 if test -n "$ac_config_commands"; then
23247   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23248 fi
23249
23250 cat >>"$CONFIG_STATUS" <<\EOF
23251
23252 ac_cs_usage="\
23253 \`$as_me' instantiates files from templates according to the
23254 current configuration.
23255
23256 Usage: $0 [OPTIONS] [FILE]...
23257
23258   -h, --help       print this help, then exit
23259   -V, --version    print version number, then exit
23260   -d, --debug      don't remove temporary files
23261       --recheck    update $as_me by reconfiguring in the same conditions
23262   --file=FILE[:TEMPLATE]
23263                    instantiate the configuration file FILE
23264   --header=FILE[:TEMPLATE]
23265                    instantiate the configuration header FILE
23266
23267 Configuration files:
23268 $config_files
23269
23270 Configuration headers:
23271 $config_headers
23272
23273 Configuration commands:
23274 $config_commands
23275
23276 Report bugs to <dickey@invisible-island.net>."
23277 EOF
23278
23279 cat >>"$CONFIG_STATUS" <<EOF
23280 ac_cs_version="\\
23281 config.status
23282 configured by $0, generated by GNU Autoconf 2.52.20210509,
23283   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23284
23285 Copyright 2003-2020,2021        Thomas E. Dickey
23286 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23287 Free Software Foundation, Inc.
23288 This config.status script is free software; the Free Software Foundation
23289 gives unlimited permission to copy, distribute and modify it."
23290 srcdir="$srcdir"
23291 INSTALL="$INSTALL"
23292 EOF
23293
23294 cat >>"$CONFIG_STATUS" <<\EOF
23295 # If no file are specified by the user, then we need to provide default
23296 # value.  By we need to know if files were specified by the user.
23297 ac_need_defaults=:
23298 while test $# != 0
23299 do
23300   case $1 in
23301   --*=*)
23302     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23303     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23304     shift
23305     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23306     shift
23307     ;;
23308   -*);;
23309   *) # This is not an option, so the user has probably given explicit
23310      # arguments.
23311      ac_need_defaults=false;;
23312   esac
23313
23314   case $1 in
23315   # Handling of the options.
23316 EOF
23317 cat >>"$CONFIG_STATUS" <<EOF
23318   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23319     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23320     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23321 EOF
23322 cat >>"$CONFIG_STATUS" <<\EOF
23323   --version | --vers* | -V )
23324     echo "$ac_cs_version"; exit 0 ;;
23325   --he | --h)
23326     # Conflict between --help and --header
23327     { { echo "$as_me:23327: error: ambiguous option: $1
23328 Try \`$0 --help' for more information." >&5
23329 echo "$as_me: error: ambiguous option: $1
23330 Try \`$0 --help' for more information." >&2;}
23331    { (exit 1); exit 1; }; };;
23332   --help | --hel | -h )
23333     echo "$ac_cs_usage"; exit 0 ;;
23334   --debug | --d* | -d )
23335     debug=: ;;
23336   --file | --fil | --fi | --f )
23337     shift
23338     CONFIG_FILES="$CONFIG_FILES $1"
23339     ac_need_defaults=false;;
23340   --header | --heade | --head | --hea )
23341     shift
23342     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23343     ac_need_defaults=false;;
23344
23345   # This is an error.
23346   -*) { { echo "$as_me:23346: error: unrecognized option: $1
23347 Try \`$0 --help' for more information." >&5
23348 echo "$as_me: error: unrecognized option: $1
23349 Try \`$0 --help' for more information." >&2;}
23350    { (exit 1); exit 1; }; } ;;
23351
23352   *) ac_config_targets="$ac_config_targets $1" ;;
23353
23354   esac
23355   shift
23356 done
23357
23358 exec 5>>config.log
23359 cat >&5 << _ACEOF
23360
23361 ## ----------------------- ##
23362 ## Running config.status.  ##
23363 ## ----------------------- ##
23364
23365 This file was extended by $as_me 2.52.20210509, executed with
23366   CONFIG_FILES    = $CONFIG_FILES
23367   CONFIG_HEADERS  = $CONFIG_HEADERS
23368   CONFIG_LINKS    = $CONFIG_LINKS
23369   CONFIG_COMMANDS = $CONFIG_COMMANDS
23370   > "$ac_cs_invocation"
23371 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23372
23373 _ACEOF
23374 EOF
23375
23376 cat >>"$CONFIG_STATUS" <<EOF
23377 #
23378 # INIT-COMMANDS section.
23379 #
23380
23381 AWK="$AWK"
23382 ECHO_CC="$ECHO_CC"
23383 ECHO_LD="$ECHO_LD"
23384 SHOW_CC="$SHOW_LD"
23385
23386 EOF
23387
23388 cat >>"$CONFIG_STATUS" <<\EOF
23389 for ac_config_target in $ac_config_targets
23390 do
23391   case "$ac_config_target" in
23392   # Handling of arguments.
23393   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23394   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23395   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23396   *) { { echo "$as_me:23396: error: invalid argument: $ac_config_target" >&5
23397 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23398    { (exit 1); exit 1; }; };;
23399   esac
23400 done
23401
23402 # If the user did not use the arguments to specify the items to instantiate,
23403 # then the envvar interface is used.  Set only those that are not.
23404 # We use the long form for the default assignment because of an extremely
23405 # bizarre bug on SunOS 4.1.3.
23406 if "$ac_need_defaults"; then
23407   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23408   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23409   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23410 fi
23411
23412 # Create a temporary directory, and hook for its removal unless debugging.
23413 $debug ||
23414 {
23415   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23416   trap '{ (exit 1); exit 1; }' 1 2 13 15
23417 }
23418
23419 # Create a (secure) tmp directory for tmp files.
23420 : ${TMPDIR=/tmp}
23421 {
23422   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23423   test -n "$tmp" && test -d "$tmp"
23424 }  ||
23425 {
23426   tmp=$TMPDIR/cs$$-$RANDOM
23427   (umask 077 && mkdir $tmp)
23428 } ||
23429 {
23430    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23431    { (exit 1); exit 1; }
23432 }
23433
23434 EOF
23435
23436 cat >>"$CONFIG_STATUS" <<EOF
23437
23438 #
23439 # CONFIG_FILES section.
23440 #
23441
23442 # No need to generate the scripts if there are no CONFIG_FILES.
23443 # This happens for instance when ./config.status config.h
23444 if test -n "\$CONFIG_FILES"; then
23445   # Protect against being on the right side of a sed subst in config.status.
23446   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23447    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23448 s,@SHELL@,$SHELL,;t t
23449 s,@exec_prefix@,$exec_prefix,;t t
23450 s,@prefix@,$prefix,;t t
23451 s,@program_transform_name@,$program_transform_name,;t t
23452 s,@bindir@,$bindir,;t t
23453 s,@sbindir@,$sbindir,;t t
23454 s,@libexecdir@,$libexecdir,;t t
23455 s,@datarootdir@,$datarootdir,;t t
23456 s,@datadir@,$datadir,;t t
23457 s,@sysconfdir@,$sysconfdir,;t t
23458 s,@sharedstatedir@,$sharedstatedir,;t t
23459 s,@localstatedir@,$localstatedir,;t t
23460 s,@runstatedir@,$runstatedir,;t t
23461 s,@libdir@,$libdir,;t t
23462 s,@includedir@,$includedir,;t t
23463 s,@oldincludedir@,$oldincludedir,;t t
23464 s,@infodir@,$infodir,;t t
23465 s,@mandir@,$mandir,;t t
23466 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23467 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23468 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23469 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23470 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23471 s,@build_alias@,$build_alias,;t t
23472 s,@host_alias@,$host_alias,;t t
23473 s,@target_alias@,$target_alias,;t t
23474 s,@ECHO_C@,$ECHO_C,;t t
23475 s,@ECHO_N@,$ECHO_N,;t t
23476 s,@ECHO_T@,$ECHO_T,;t t
23477 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23478 s,@DEFS@,$DEFS,;t t
23479 s,@LIBS@,$LIBS,;t t
23480 s,@build@,$build,;t t
23481 s,@build_cpu@,$build_cpu,;t t
23482 s,@build_vendor@,$build_vendor,;t t
23483 s,@build_os@,$build_os,;t t
23484 s,@host@,$host,;t t
23485 s,@host_cpu@,$host_cpu,;t t
23486 s,@host_vendor@,$host_vendor,;t t
23487 s,@host_os@,$host_os,;t t
23488 s,@SET_MAKE@,$SET_MAKE,;t t
23489 s,@CC@,$CC,;t t
23490 s,@CFLAGS@,$CFLAGS,;t t
23491 s,@LDFLAGS@,$LDFLAGS,;t t
23492 s,@CPPFLAGS@,$CPPFLAGS,;t t
23493 s,@ac_ct_CC@,$ac_ct_CC,;t t
23494 s,@EXEEXT@,$EXEEXT,;t t
23495 s,@OBJEXT@,$OBJEXT,;t t
23496 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23497 s,@CPP@,$CPP,;t t
23498 s,@GREP@,$GREP,;t t
23499 s,@EGREP@,$EGREP,;t t
23500 s,@AWK@,$AWK,;t t
23501 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23502 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23503 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23504 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23505 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23506 s,@LINT@,$LINT,;t t
23507 s,@LINT_OPTS@,$LINT_OPTS,;t t
23508 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
23509 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
23510 s,@CTAGS@,$CTAGS,;t t
23511 s,@ETAGS@,$ETAGS,;t t
23512 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23513 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23514 s,@MATH_LIB@,$MATH_LIB,;t t
23515 s,@top_builddir@,$top_builddir,;t t
23516 s,@CC_G_OPT@,$CC_G_OPT,;t t
23517 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23518 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23519 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23520 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23521 s,@LD@,$LD,;t t
23522 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23523 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23524 s,@LD_MODEL@,$LD_MODEL,;t t
23525 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23526 s,@LIBTOOL@,$LIBTOOL,;t t
23527 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23528 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23529 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23530 s,@LIB_LINK@,$LIB_LINK,;t t
23531 s,@LINK_TESTS@,$LINK_TESTS,;t t
23532 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23533 s,@PACKAGE@,$PACKAGE,;t t
23534 s,@PTHREAD@,$PTHREAD,;t t
23535 s,@TEST_ARGS@,$TEST_ARGS,;t t
23536 s,@TEST_DEPS@,$TEST_DEPS,;t t
23537 s,@TEST_LIBS@,$TEST_LIBS,;t t
23538 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23539 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23540 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23541 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23542 s,@includesubdir@,$includesubdir,;t t
23543 s,@FGREP@,$FGREP,;t t
23544 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23545 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
23546 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23547 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23548 s,@ECHO_LT@,$ECHO_LT,;t t
23549 s,@ECHO_LD@,$ECHO_LD,;t t
23550 s,@RULE_CC@,$RULE_CC,;t t
23551 s,@SHOW_CC@,$SHOW_CC,;t t
23552 s,@ECHO_CC@,$ECHO_CC,;t t
23553 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23554 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23555 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23556 s,@X_CFLAGS@,$X_CFLAGS,;t t
23557 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23558 s,@X_LIBS@,$X_LIBS,;t t
23559 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23560 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23561 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23562 s,@RGB_PATH@,$RGB_PATH,;t t
23563 s,@no_x11_rgb@,$no_x11_rgb,;t t
23564 s,@FORM_NAME@,$FORM_NAME,;t t
23565 s,@MENU_NAME@,$MENU_NAME,;t t
23566 s,@PANEL_NAME@,$PANEL_NAME,;t t
23567 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23568 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23569 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23570 CEOF
23571
23572 EOF
23573
23574   cat >>"$CONFIG_STATUS" <<\EOF
23575   # Split the substitutions into bite-sized pieces for seds with
23576   # small command number limits, like on Digital OSF/1 and HP-UX.
23577   ac_max_sed_lines=48
23578   ac_sed_frag=1 # Number of current file.
23579   ac_beg=1 # First line for current file.
23580   ac_end=$ac_max_sed_lines # Line after last line for current file.
23581   ac_more_lines=:
23582   ac_sed_cmds=
23583   while "$ac_more_lines"; do
23584     if test "$ac_beg" -gt 1; then
23585       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23586     else
23587       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23588     fi
23589     if test ! -s $tmp/subs.frag; then
23590       ac_more_lines=false
23591     else
23592       # The purpose of the label and of the branching condition is to
23593       # speed up the sed processing (if there are no `@' at all, there
23594       # is no need to browse any of the substitutions).
23595       # These are the two extra sed commands mentioned above.
23596       (echo ':t
23597   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23598       # It is possible to make a multiline substitution using escaped newlines.
23599       # Ensure that we do not split the substitution between script fragments.
23600       ac_BEG=$ac_end
23601       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23602       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23603       if test -s $tmp/subs.next; then
23604         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23605         if test ! -s $tmp/subs.edit; then
23606           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23607           if test ! -s $tmp/subs.edit; then
23608             if test "$ac_beg" -gt 1; then
23609               ac_end=`expr "$ac_end" - 1`
23610               continue
23611             fi
23612           fi
23613         fi
23614       fi
23615
23616       if test -z "$ac_sed_cmds"; then
23617         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23618       else
23619         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23620       fi
23621       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23622       ac_beg=$ac_end
23623       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23624     fi
23625   done
23626   if test -z "$ac_sed_cmds"; then
23627     ac_sed_cmds=cat
23628   fi
23629 fi # test -n "$CONFIG_FILES"
23630
23631 EOF
23632 cat >>"$CONFIG_STATUS" <<\EOF
23633 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23634   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23635   case "$ac_file" in
23636   - | *:- | *:-:* ) # input from stdin
23637         cat >$tmp/stdin
23638         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23639         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23640   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23641         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23642   * )   ac_file_in=$ac_file.in ;;
23643   esac
23644
23645   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23646   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23647          X"$ac_file" : 'X\(//\)[^/]' \| \
23648          X"$ac_file" : 'X\(//\)$' \| \
23649          X"$ac_file" : 'X\(/\)' \| \
23650          .     : '\(.\)' 2>/dev/null ||
23651 echo X"$ac_file" |
23652     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23653           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23654           /^X\(\/\/\)$/{ s//\1/; q; }
23655           /^X\(\/\).*/{ s//\1/; q; }
23656           s/.*/./; q'`
23657   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23658     { case "$ac_dir" in
23659   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23660   *)                      as_incr_dir=.;;
23661 esac
23662 as_dummy="$ac_dir"
23663 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23664   case $as_mkdir_dir in
23665     # Skip DOS drivespec
23666     ?:) as_incr_dir=$as_mkdir_dir ;;
23667     *)
23668       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23669       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23670     ;;
23671   esac
23672 done; }
23673
23674     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23675     # A "../" for each directory in $ac_dir_suffix.
23676     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23677   else
23678     ac_dir_suffix= ac_dots=
23679   fi
23680
23681   case "$srcdir" in
23682   .)  ac_srcdir=.
23683       if test -z "$ac_dots"; then
23684          ac_top_srcdir=.
23685       else
23686          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
23687       fi ;;
23688   [\\/]* | ?:[\\/]* )
23689       ac_srcdir="$srcdir$ac_dir_suffix";
23690       ac_top_srcdir="$srcdir" ;;
23691   *) # Relative path.
23692     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
23693     ac_top_srcdir="$ac_dots$srcdir" ;;
23694   esac
23695
23696   case $INSTALL in
23697   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23698   *) ac_INSTALL=$ac_dots$INSTALL ;;
23699   esac
23700
23701   if test x"$ac_file" != x-; then
23702     { echo "$as_me:23702: creating $ac_file" >&5
23703 echo "$as_me: creating $ac_file" >&6;}
23704     rm -f "$ac_file"
23705   fi
23706   # Let's still pretend it is `configure' which instantiates (i.e., don't
23707   # use $as_me), people would be surprised to read:
23708   #    /* config.h.  Generated automatically by config.status.  */
23709   configure_input="Generated automatically from `echo $ac_file_in |
23710                                                  sed 's,.*/,,'` by configure."
23711
23712   # First look for the input files in the build tree, otherwise in the
23713   # src tree.
23714   ac_file_inputs=`IFS=:
23715     for f in $ac_file_in; do
23716       case $f in
23717       -) echo $tmp/stdin ;;
23718       [\\/$]*)
23719          # Absolute (can't be DOS-style, as IFS=:)
23720          test -f "$f" || { { echo "$as_me:23720: error: cannot find input file: $f" >&5
23721 echo "$as_me: error: cannot find input file: $f" >&2;}
23722    { (exit 1); exit 1; }; }
23723          echo $f;;
23724       *) # Relative
23725          if test -f "$f"; then
23726            # Build tree
23727            echo $f
23728          elif test -f "$srcdir/$f"; then
23729            # Source tree
23730            echo "$srcdir/$f"
23731          else
23732            # /dev/null tree
23733            { { echo "$as_me:23733: error: cannot find input file: $f" >&5
23734 echo "$as_me: error: cannot find input file: $f" >&2;}
23735    { (exit 1); exit 1; }; }
23736          fi;;
23737       esac
23738     done` || { (exit 1); exit 1; }
23739 EOF
23740 cat >>"$CONFIG_STATUS" <<\EOF
23741   ac_warn_datarootdir=no
23742   if test x"$ac_file" != x-; then
23743     for ac_item in $ac_file_inputs
23744     do
23745       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
23746       if test -n "$ac_seen"; then
23747         ac_used=`grep '@datarootdir@' "$ac_item"`
23748         if test -z "$ac_used"; then
23749           { echo "$as_me:23749: WARNING: datarootdir was used implicitly but not set:
23750 $ac_seen" >&5
23751 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23752 $ac_seen" >&2;}
23753           ac_warn_datarootdir=yes
23754         fi
23755       fi
23756       ac_seen=`grep '${datarootdir}' "$ac_item"`
23757       if test -n "$ac_seen"; then
23758         { echo "$as_me:23758: WARNING: datarootdir was used explicitly but not set:
23759 $ac_seen" >&5
23760 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23761 $ac_seen" >&2;}
23762         ac_warn_datarootdir=yes
23763       fi
23764     done
23765   fi
23766
23767 if test "x$ac_warn_datarootdir" = xyes; then
23768   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23769 fi
23770
23771 EOF
23772 cat >>"$CONFIG_STATUS" <<EOF
23773   sed "$ac_vpsub
23774 $extrasub
23775 EOF
23776 cat >>"$CONFIG_STATUS" <<\EOF
23777 :t
23778 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23779 s,@configure_input@,$configure_input,;t t
23780 s,@srcdir@,$ac_srcdir,;t t
23781 s,@top_srcdir@,$ac_top_srcdir,;t t
23782 s,@INSTALL@,$ac_INSTALL,;t t
23783 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23784   rm -f $tmp/stdin
23785   if test x"$ac_file" != x-; then
23786     cp "$tmp/out" "$ac_file"
23787
23788     for ac_name in prefix exec_prefix datarootdir
23789     do
23790         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
23791         if test -n "$ac_seen"; then
23792             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
23793             if test -z "$ac_init"; then
23794               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23795               { echo "$as_me:23795: WARNING: Variable $ac_name is used but was not set:
23796 $ac_seen" >&5
23797 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23798 $ac_seen" >&2;}
23799             fi
23800         fi
23801     done
23802     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
23803     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
23804     if test -s $tmp/out; then
23805       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23806       { echo "$as_me:23806: WARNING: Some variables may not be substituted:
23807 $ac_seen" >&5
23808 echo "$as_me: WARNING: Some variables may not be substituted:
23809 $ac_seen" >&2;}
23810     fi
23811   else
23812     cat $tmp/out
23813   fi
23814   rm -f $tmp/out
23815
23816 done
23817 EOF
23818 cat >>"$CONFIG_STATUS" <<\EOF
23819
23820 #
23821 # CONFIG_HEADER section.
23822 #
23823
23824 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23825 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23826 #
23827 # ac_d sets the value in "#define NAME VALUE" lines.
23828 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23829 ac_dB='[        ].*$,\1#\2'
23830 ac_dC=' '
23831 ac_dD=',;t'
23832 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23833 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23834 ac_iB='\([      ]\),\1#\2define\3'
23835 ac_iC=' '
23836 ac_iD='\4,;t'
23837 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23838 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23839 ac_uB='$,\1#\2define\3'
23840 ac_uC=' '
23841 ac_uD=',;t'
23842
23843 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23844   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23845   case "$ac_file" in
23846   - | *:- | *:-:* ) # input from stdin
23847         cat >$tmp/stdin
23848         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23849         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23850   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23851         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23852   * )   ac_file_in=$ac_file.in ;;
23853   esac
23854
23855   test x"$ac_file" != x- && { echo "$as_me:23855: creating $ac_file" >&5
23856 echo "$as_me: creating $ac_file" >&6;}
23857
23858   # First look for the input files in the build tree, otherwise in the
23859   # src tree.
23860   ac_file_inputs=`IFS=:
23861     for f in $ac_file_in; do
23862       case $f in
23863       -) echo $tmp/stdin ;;
23864       [\\/$]*)
23865          # Absolute (can't be DOS-style, as IFS=:)
23866          test -f "$f" || { { echo "$as_me:23866: error: cannot find input file: $f" >&5
23867 echo "$as_me: error: cannot find input file: $f" >&2;}
23868    { (exit 1); exit 1; }; }
23869          echo $f;;
23870       *) # Relative
23871          if test -f "$f"; then
23872            # Build tree
23873            echo $f
23874          elif test -f "$srcdir/$f"; then
23875            # Source tree
23876            echo "$srcdir/$f"
23877          else
23878            # /dev/null tree
23879            { { echo "$as_me:23879: error: cannot find input file: $f" >&5
23880 echo "$as_me: error: cannot find input file: $f" >&2;}
23881    { (exit 1); exit 1; }; }
23882          fi;;
23883       esac
23884     done` || { (exit 1); exit 1; }
23885   # Remove the trailing spaces.
23886   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23887
23888 EOF
23889
23890 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23891 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23892 # be either 'cat' or 'sort'.
23893 cat confdefs.h | uniq >conftest.vals
23894
23895 # Break up conftest.vals because some shells have a limit on
23896 # the size of here documents, and old seds have small limits too.
23897
23898 rm -f conftest.tail
23899 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
23900 while grep . conftest.vals >/dev/null
23901 do
23902   # Write chunks of a limited-size here document to conftest.frag.
23903   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
23904   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
23905   echo 'CEOF' >> "$CONFIG_STATUS"
23906   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
23907   rm -f conftest.vals
23908   mv conftest.tail conftest.vals
23909 done
23910 rm -f conftest.vals
23911
23912 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23913 # marker @DEFS@.
23914 echo '  cat >> conftest.edit <<CEOF
23915 /@DEFS@/r conftest.frag
23916 /@DEFS@/d
23917 CEOF
23918 sed -f conftest.edit $tmp/in > $tmp/out
23919 rm -f $tmp/in
23920 mv $tmp/out $tmp/in
23921 rm -f conftest.edit conftest.frag
23922 ' >> "$CONFIG_STATUS"
23923
23924 cat >>"$CONFIG_STATUS" <<\EOF
23925   # Let's still pretend it is `configure' which instantiates (i.e., don't
23926   # use $as_me), people would be surprised to read:
23927   #    /* config.h.  Generated automatically by config.status.  */
23928   if test x"$ac_file" = x-; then
23929     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23930   else
23931     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23932   fi
23933   cat $tmp/in >>$tmp/config.h
23934   rm -f $tmp/in
23935   if test x"$ac_file" != x-; then
23936     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
23937       { echo "$as_me:23937: $ac_file is unchanged" >&5
23938 echo "$as_me: $ac_file is unchanged" >&6;}
23939     else
23940       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23941          X"$ac_file" : 'X\(//\)[^/]' \| \
23942          X"$ac_file" : 'X\(//\)$' \| \
23943          X"$ac_file" : 'X\(/\)' \| \
23944          .     : '\(.\)' 2>/dev/null ||
23945 echo X"$ac_file" |
23946     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23947           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23948           /^X\(\/\/\)$/{ s//\1/; q; }
23949           /^X\(\/\).*/{ s//\1/; q; }
23950           s/.*/./; q'`
23951       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23952         { case "$ac_dir" in
23953   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23954   *)                      as_incr_dir=.;;
23955 esac
23956 as_dummy="$ac_dir"
23957 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23958   case $as_mkdir_dir in
23959     # Skip DOS drivespec
23960     ?:) as_incr_dir=$as_mkdir_dir ;;
23961     *)
23962       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23963       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23964     ;;
23965   esac
23966 done; }
23967
23968       fi
23969       rm -f "$ac_file"
23970       mv "$tmp/config.h" "$ac_file"
23971     fi
23972   else
23973     cat $tmp/config.h
23974     rm -f $tmp/config.h
23975   fi
23976 done
23977 EOF
23978 cat >>"$CONFIG_STATUS" <<\EOF
23979 #
23980 # CONFIG_COMMANDS section.
23981 #
23982 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23983   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23984   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23985
23986   case "$ac_dest" in
23987     default )
23988
23989 for cf_dir in .
23990 do
23991         if test ! -d "$srcdir/$cf_dir" ; then
23992                 continue
23993         elif test -f "$srcdir/$cf_dir/programs" ; then
23994                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
23995         fi
23996 done
23997
23998         cat >>Makefile <<TEST_EOF
23999
24000 # These rules are generated so we do not rely on suffix rules, which do not
24001 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24002 # some, and the '\$x' confuses others).
24003 TEST_EOF
24004
24005 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24006 for N in $LIST
24007 do
24008         cat >>Makefile <<TEST_EOF
24009
24010 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24011         \$(srcdir)/test.priv.h \\
24012         ncurses_cfg.h
24013         $SHOW_CC
24014         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24015 TEST_EOF
24016 done
24017
24018 if test -f ../config.guess && test -f ../config.sub
24019 then
24020         cat >>Makefile <<TEST_EOF
24021
24022 # if we used CF_INHERIT for getting these files, we can remove them
24023 distclean::
24024         rm -f config.guess config.sub
24025 TEST_EOF
24026 fi
24027  ;;
24028   esac
24029 done
24030 EOF
24031
24032 cat >>"$CONFIG_STATUS" <<\EOF
24033
24034 { (exit 0); exit 0; }
24035 EOF
24036 chmod +x "$CONFIG_STATUS"
24037 ac_clean_files=$ac_clean_files_save
24038
24039 # configure is writing to config.log, and then calls config.status.
24040 # config.status does its own redirection, appending to config.log.
24041 # Unfortunately, on DOS this fails, as config.log is still kept open
24042 # by configure, so config.status won't be able to write to it; its
24043 # output is simply discarded.  So we exec the FD to /dev/null,
24044 # effectively closing config.log, so it can be properly (re)opened and
24045 # appended to by config.status.  When coming back to configure, we
24046 # need to make the FD available again.
24047 if test "$no_create" != yes; then
24048   ac_cs_success=:
24049   exec 5>/dev/null
24050   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24051   exec 5>>config.log
24052   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24053   # would make configure fail if this is the last instruction.
24054   "$ac_cs_success" || { (exit 1); exit 1; }
24055 fi
24056