]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20210703
[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_VERSION
18334         cchar_t check;
18335         int check2 = curs_set((int)sizeof(check));
18336 #endif
18337         long x = winnstr(stdscr, "", 0);
18338         int x1, y1;
18339 #ifdef NCURSES_VERSION
18340         (void)check2;
18341 #endif
18342         getbegyx(stdscr, y1, x1);
18343         (void)x;
18344         (void)y1;
18345         (void)x1;
18346
18347   ;
18348   return 0;
18349 }
18350 _ACEOF
18351 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18352 if { (eval echo "$as_me:18352: \"$ac_link\"") >&5
18353   (eval $ac_link) 2>&5
18354   ac_status=$?
18355   echo "$as_me:18355: \$? = $ac_status" >&5
18356   (exit "$ac_status"); } &&
18357          { ac_try='test -s "conftest$ac_exeext"'
18358   { (eval echo "$as_me:18358: \"$ac_try\"") >&5
18359   (eval $ac_try) 2>&5
18360   ac_status=$?
18361   echo "$as_me:18361: \$? = $ac_status" >&5
18362   (exit "$ac_status"); }; }; then
18363   cf_cv_need_xopen_extension=none
18364 else
18365   echo "$as_me: failed program was:" >&5
18366 cat "conftest.$ac_ext" >&5
18367
18368         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18369         do
18370                 cat >"conftest.$ac_ext" <<_ACEOF
18371 #line 18371 "configure"
18372 #include "confdefs.h"
18373
18374 #define $cf_try_xopen_extension 1
18375 #include <stdlib.h>
18376 #include <${cf_cv_ncurses_header:-curses.h}>
18377 int
18378 main (void)
18379 {
18380
18381 #ifdef NCURSES_VERSION
18382                 cchar_t check;
18383                 int check2 = curs_set((int)sizeof(check));
18384 #endif
18385                 long x = winnstr(stdscr, "", 0);
18386                 int x1, y1;
18387                 getbegyx(stdscr, y1, x1);
18388 #ifdef NCURSES_VERSION
18389                 (void)check2;
18390 #endif
18391                 (void)x;
18392                 (void)y1;
18393                 (void)x1;
18394
18395   ;
18396   return 0;
18397 }
18398 _ACEOF
18399 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18400 if { (eval echo "$as_me:18400: \"$ac_link\"") >&5
18401   (eval $ac_link) 2>&5
18402   ac_status=$?
18403   echo "$as_me:18403: \$? = $ac_status" >&5
18404   (exit "$ac_status"); } &&
18405          { ac_try='test -s "conftest$ac_exeext"'
18406   { (eval echo "$as_me:18406: \"$ac_try\"") >&5
18407   (eval $ac_try) 2>&5
18408   ac_status=$?
18409   echo "$as_me:18409: \$? = $ac_status" >&5
18410   (exit "$ac_status"); }; }; then
18411   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18412 else
18413   echo "$as_me: failed program was:" >&5
18414 cat "conftest.$ac_ext" >&5
18415 fi
18416 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18417         done
18418
18419 fi
18420 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18421
18422 fi
18423 echo "$as_me:18423: result: $cf_cv_need_xopen_extension" >&5
18424 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18425
18426 case "$cf_cv_need_xopen_extension" in
18427 (*_*)
18428
18429         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18430         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18431
18432         ;;
18433 esac
18434
18435 echo "$as_me:18435: checking for term.h" >&5
18436 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18437 if test "${cf_cv_term_header+set}" = set; then
18438   echo $ECHO_N "(cached) $ECHO_C" >&6
18439 else
18440
18441 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18442 # for <term.h> if we do not find the variant.
18443
18444 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18445
18446 case "${cf_cv_ncurses_header:-curses.h}" in
18447 (*/*)
18448         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18449         cf_header_list="$cf_header_item $cf_header_list"
18450         ;;
18451 esac
18452
18453 for cf_header in $cf_header_list
18454 do
18455         cat >"conftest.$ac_ext" <<_ACEOF
18456 #line 18456 "configure"
18457 #include "confdefs.h"
18458
18459 #include <${cf_cv_ncurses_header:-curses.h}>
18460 #include <${cf_header}>
18461 int
18462 main (void)
18463 {
18464 WINDOW *x; (void)x
18465   ;
18466   return 0;
18467 }
18468 _ACEOF
18469 rm -f "conftest.$ac_objext"
18470 if { (eval echo "$as_me:18470: \"$ac_compile\"") >&5
18471   (eval $ac_compile) 2>&5
18472   ac_status=$?
18473   echo "$as_me:18473: \$? = $ac_status" >&5
18474   (exit "$ac_status"); } &&
18475          { ac_try='test -s "conftest.$ac_objext"'
18476   { (eval echo "$as_me:18476: \"$ac_try\"") >&5
18477   (eval $ac_try) 2>&5
18478   ac_status=$?
18479   echo "$as_me:18479: \$? = $ac_status" >&5
18480   (exit "$ac_status"); }; }; then
18481   cf_cv_term_header=$cf_header
18482          break
18483 else
18484   echo "$as_me: failed program was:" >&5
18485 cat "conftest.$ac_ext" >&5
18486 cf_cv_term_header=no
18487 fi
18488 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18489 done
18490
18491 case "$cf_cv_term_header" in
18492 (no)
18493         # If curses is ncurses, some packagers still mess it up by trying to make
18494         # us use GNU termcap.  This handles the most common case.
18495         for cf_header in ncurses/term.h ncursesw/term.h
18496         do
18497                 cat >"conftest.$ac_ext" <<_ACEOF
18498 #line 18498 "configure"
18499 #include "confdefs.h"
18500
18501 #include <${cf_cv_ncurses_header:-curses.h}>
18502 #ifdef NCURSES_VERSION
18503 #include <${cf_header}>
18504 #else
18505 make an error
18506 #endif
18507 int
18508 main (void)
18509 {
18510 WINDOW *x; (void)x
18511   ;
18512   return 0;
18513 }
18514 _ACEOF
18515 rm -f "conftest.$ac_objext"
18516 if { (eval echo "$as_me:18516: \"$ac_compile\"") >&5
18517   (eval $ac_compile) 2>&5
18518   ac_status=$?
18519   echo "$as_me:18519: \$? = $ac_status" >&5
18520   (exit "$ac_status"); } &&
18521          { ac_try='test -s "conftest.$ac_objext"'
18522   { (eval echo "$as_me:18522: \"$ac_try\"") >&5
18523   (eval $ac_try) 2>&5
18524   ac_status=$?
18525   echo "$as_me:18525: \$? = $ac_status" >&5
18526   (exit "$ac_status"); }; }; then
18527   cf_cv_term_header=$cf_header
18528                          break
18529 else
18530   echo "$as_me: failed program was:" >&5
18531 cat "conftest.$ac_ext" >&5
18532 cf_cv_term_header=no
18533 fi
18534 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18535         done
18536         ;;
18537 esac
18538
18539 fi
18540 echo "$as_me:18540: result: $cf_cv_term_header" >&5
18541 echo "${ECHO_T}$cf_cv_term_header" >&6
18542
18543 case "$cf_cv_term_header" in
18544 (term.h)
18545
18546 cat >>confdefs.h <<\EOF
18547 #define HAVE_TERM_H 1
18548 EOF
18549
18550         ;;
18551 (ncurses/term.h)
18552
18553 cat >>confdefs.h <<\EOF
18554 #define HAVE_NCURSES_TERM_H 1
18555 EOF
18556
18557         ;;
18558 (ncursesw/term.h)
18559
18560 cat >>confdefs.h <<\EOF
18561 #define HAVE_NCURSESW_TERM_H 1
18562 EOF
18563
18564         ;;
18565 esac
18566
18567 echo "$as_me:18567: checking for unctrl.h" >&5
18568 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18569 if test "${cf_cv_unctrl_header+set}" = set; then
18570   echo $ECHO_N "(cached) $ECHO_C" >&6
18571 else
18572
18573 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18574 # for <unctrl.h> if we do not find the variant.
18575
18576 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18577
18578 case "${cf_cv_ncurses_header:-curses.h}" in
18579 (*/*)
18580         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18581         cf_header_list="$cf_header_item $cf_header_list"
18582         ;;
18583 esac
18584
18585 for cf_header in $cf_header_list
18586 do
18587         cat >"conftest.$ac_ext" <<_ACEOF
18588 #line 18588 "configure"
18589 #include "confdefs.h"
18590
18591 #include <${cf_cv_ncurses_header:-curses.h}>
18592 #include <${cf_header}>
18593 int
18594 main (void)
18595 {
18596 WINDOW *x; (void)x
18597   ;
18598   return 0;
18599 }
18600 _ACEOF
18601 rm -f "conftest.$ac_objext"
18602 if { (eval echo "$as_me:18602: \"$ac_compile\"") >&5
18603   (eval $ac_compile) 2>&5
18604   ac_status=$?
18605   echo "$as_me:18605: \$? = $ac_status" >&5
18606   (exit "$ac_status"); } &&
18607          { ac_try='test -s "conftest.$ac_objext"'
18608   { (eval echo "$as_me:18608: \"$ac_try\"") >&5
18609   (eval $ac_try) 2>&5
18610   ac_status=$?
18611   echo "$as_me:18611: \$? = $ac_status" >&5
18612   (exit "$ac_status"); }; }; then
18613   cf_cv_unctrl_header=$cf_header
18614          break
18615 else
18616   echo "$as_me: failed program was:" >&5
18617 cat "conftest.$ac_ext" >&5
18618 cf_cv_unctrl_header=no
18619 fi
18620 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18621 done
18622
18623 fi
18624 echo "$as_me:18624: result: $cf_cv_unctrl_header" >&5
18625 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18626
18627 case "$cf_cv_unctrl_header" in
18628 (no)
18629         { echo "$as_me:18629: WARNING: unctrl.h header not found" >&5
18630 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18631         ;;
18632 esac
18633
18634 case "$cf_cv_unctrl_header" in
18635 (unctrl.h)
18636
18637 cat >>confdefs.h <<\EOF
18638 #define HAVE_UNCTRL_H 1
18639 EOF
18640
18641         ;;
18642 (ncurses/unctrl.h)
18643
18644 cat >>confdefs.h <<\EOF
18645 #define HAVE_NCURSES_UNCTRL_H 1
18646 EOF
18647
18648         ;;
18649 (ncursesw/unctrl.h)
18650
18651 cat >>confdefs.h <<\EOF
18652 #define HAVE_NCURSESW_UNCTRL_H 1
18653 EOF
18654
18655         ;;
18656 esac
18657
18658 for cf_func in \
18659 alloc_pair \
18660 assume_default_colors \
18661 chgat \
18662 color_content \
18663 color_set \
18664 copywin \
18665 delscreen \
18666 dupwin \
18667 exit_curses \
18668 exit_terminfo \
18669 filter \
18670 getbegx \
18671 getcurx \
18672 getmaxx \
18673 getnstr \
18674 getparx \
18675 getwin \
18676 halfdelay \
18677 init_extended_color \
18678 mvderwin \
18679 mvvline \
18680 mvwin \
18681 mvwvline \
18682 napms \
18683 newpad \
18684 putwin \
18685 reset_color_pairs \
18686 resize_term \
18687 resizeterm \
18688 restartterm \
18689 ripoffline \
18690 scr_dump \
18691 setupterm \
18692 slk_color \
18693 slk_init \
18694 termattrs \
18695 termname \
18696 tgetent \
18697 tigetnum \
18698 tigetstr \
18699 tputs_sp \
18700 typeahead \
18701 use_default_colors \
18702 use_env \
18703 use_extended_names \
18704 use_screen \
18705 use_window \
18706 vid_puts \
18707 vidputs \
18708 vsscanf \
18709 vw_printw \
18710 wchgat \
18711 winsdelln \
18712 winsstr \
18713 wresize \
18714 wsyncdown \
18715 _tracef \
18716
18717 do
18718
18719 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18720
18721         echo "$as_me:18721: checking for ${cf_func}" >&5
18722 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18723
18724 echo "${as_me:-configure}:18724: testing ${cf_func} ..." 1>&5
18725
18726         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18727   echo $ECHO_N "(cached) $ECHO_C" >&6
18728 else
18729
18730                 eval cf_result='$ac_cv_func_'$cf_func
18731                 if test ".$cf_result" != ".no"; then
18732                         cat >"conftest.$ac_ext" <<_ACEOF
18733 #line 18733 "configure"
18734 #include "confdefs.h"
18735
18736 #ifdef HAVE_XCURSES
18737 #include <xcurses.h>
18738 char * XCursesProgramName = "test";
18739 #else
18740 #include <${cf_cv_ncurses_header:-curses.h}>
18741 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18742 #include <ncursesw/term.h>
18743 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18744 #include <ncurses/term.h>
18745 #elif defined(HAVE_TERM_H)
18746 #include <term.h>
18747 #endif
18748 #endif
18749
18750 int
18751 main (void)
18752 {
18753
18754 #ifndef ${cf_func}
18755 long foo = (long)(&${cf_func});
18756 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18757 if (foo + 1234L > 5678L)
18758         ${cf_cv_main_return:-return}(foo != 0);
18759 #endif
18760
18761   ;
18762   return 0;
18763 }
18764 _ACEOF
18765 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18766 if { (eval echo "$as_me:18766: \"$ac_link\"") >&5
18767   (eval $ac_link) 2>&5
18768   ac_status=$?
18769   echo "$as_me:18769: \$? = $ac_status" >&5
18770   (exit "$ac_status"); } &&
18771          { ac_try='test -s "conftest$ac_exeext"'
18772   { (eval echo "$as_me:18772: \"$ac_try\"") >&5
18773   (eval $ac_try) 2>&5
18774   ac_status=$?
18775   echo "$as_me:18775: \$? = $ac_status" >&5
18776   (exit "$ac_status"); }; }; then
18777   cf_result=yes
18778 else
18779   echo "$as_me: failed program was:" >&5
18780 cat "conftest.$ac_ext" >&5
18781 cf_result=no
18782 fi
18783 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18784                 fi
18785                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18786
18787 fi
18788
18789         # use the computed/retrieved cache-value:
18790         eval 'cf_result=$cf_cv_func_'$cf_func
18791         echo "$as_me:18791: result: $cf_result" >&5
18792 echo "${ECHO_T}$cf_result" >&6
18793         if test "$cf_result" != no; then
18794                 cat >>confdefs.h <<EOF
18795 #define HAVE_${cf_tr_func} 1
18796 EOF
18797
18798         fi
18799 done
18800
18801 for cf_func in tputs
18802 do
18803
18804 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18805
18806         echo "$as_me:18806: checking for ${cf_func}" >&5
18807 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18808
18809 echo "${as_me:-configure}:18809: testing ${cf_func} ..." 1>&5
18810
18811         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18812   echo $ECHO_N "(cached) $ECHO_C" >&6
18813 else
18814
18815                 eval cf_result='$ac_cv_func_'$cf_func
18816                 if test ".$cf_result" != ".no"; then
18817                         cat >"conftest.$ac_ext" <<_ACEOF
18818 #line 18818 "configure"
18819 #include "confdefs.h"
18820
18821 #ifdef HAVE_XCURSES
18822 #include <xcurses.h>
18823 char * XCursesProgramName = "test";
18824 #else
18825 #include <${cf_cv_ncurses_header:-curses.h}>
18826 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18827 #include <ncursesw/term.h>
18828 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18829 #include <ncurses/term.h>
18830 #elif defined(HAVE_TERM_H)
18831 #include <term.h>
18832 #endif
18833 #endif
18834
18835 int
18836 main (void)
18837 {
18838
18839 #ifndef ${cf_func}
18840 long foo = (long)(&${cf_func});
18841 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18842 if (foo + 1234L > 5678L)
18843         ${cf_cv_main_return:-return}(foo != 0);
18844 #endif
18845
18846   ;
18847   return 0;
18848 }
18849 _ACEOF
18850 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18851 if { (eval echo "$as_me:18851: \"$ac_link\"") >&5
18852   (eval $ac_link) 2>&5
18853   ac_status=$?
18854   echo "$as_me:18854: \$? = $ac_status" >&5
18855   (exit "$ac_status"); } &&
18856          { ac_try='test -s "conftest$ac_exeext"'
18857   { (eval echo "$as_me:18857: \"$ac_try\"") >&5
18858   (eval $ac_try) 2>&5
18859   ac_status=$?
18860   echo "$as_me:18860: \$? = $ac_status" >&5
18861   (exit "$ac_status"); }; }; then
18862   cf_result=yes
18863 else
18864   echo "$as_me: failed program was:" >&5
18865 cat "conftest.$ac_ext" >&5
18866 cf_result=no
18867 fi
18868 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18869                 fi
18870                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18871
18872 fi
18873
18874         # use the computed/retrieved cache-value:
18875         eval 'cf_result=$cf_cv_func_'$cf_func
18876         echo "$as_me:18876: result: $cf_result" >&5
18877 echo "${ECHO_T}$cf_result" >&6
18878         if test "$cf_result" != no; then
18879                 cat >>confdefs.h <<EOF
18880 #define HAVE_${cf_tr_func} 1
18881 EOF
18882
18883         fi
18884 done
18885
18886 if test "x$cf_cv_func_tputs" = xyes
18887 then
18888         cf_done=no
18889         for cf_arg in int char
18890         do
18891                 for cf_ret in int void
18892                 do
18893                         if test "$cf_ret" = void
18894                         then
18895                                 cf_return="/* nothing */"
18896                         else
18897                                 cf_return="return value"
18898                         fi
18899                         cat >"conftest.$ac_ext" <<_ACEOF
18900 #line 18900 "configure"
18901 #include "confdefs.h"
18902
18903 #include <${cf_cv_ncurses_header:-curses.h}>
18904 #include <$cf_cv_term_header>
18905
18906 static $cf_ret outc($cf_arg value) { $cf_return; }
18907
18908 int
18909 main (void)
18910 {
18911
18912         tputs("hello", 0, outc);
18913         ${cf_cv_main_return:-return}(0);
18914
18915   ;
18916   return 0;
18917 }
18918 _ACEOF
18919 rm -f "conftest.$ac_objext"
18920 if { (eval echo "$as_me:18920: \"$ac_compile\"") >&5
18921   (eval $ac_compile) 2>&5
18922   ac_status=$?
18923   echo "$as_me:18923: \$? = $ac_status" >&5
18924   (exit "$ac_status"); } &&
18925          { ac_try='test -s "conftest.$ac_objext"'
18926   { (eval echo "$as_me:18926: \"$ac_try\"") >&5
18927   (eval $ac_try) 2>&5
18928   ac_status=$?
18929   echo "$as_me:18929: \$? = $ac_status" >&5
18930   (exit "$ac_status"); }; }; then
18931
18932                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18933
18934 echo "${as_me:-configure}:18934: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18935
18936                 cat >>confdefs.h <<EOF
18937 #define TPUTS_ARG               $cf_arg
18938 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18939 #define TPUTS_RETURN(value)     $cf_return
18940 EOF
18941                 cf_done=yes
18942                 break
18943
18944 else
18945   echo "$as_me: failed program was:" >&5
18946 cat "conftest.$ac_ext" >&5
18947 fi
18948 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18949                 done
18950                 test "$cf_done" = yes && break
18951         done
18952 fi
18953
18954 echo "$as_me:18954: checking for ncurses extended functions" >&5
18955 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18956 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18957   echo $ECHO_N "(cached) $ECHO_C" >&6
18958 else
18959
18960 cat >"conftest.$ac_ext" <<_ACEOF
18961 #line 18961 "configure"
18962 #include "confdefs.h"
18963
18964 #include <${cf_cv_ncurses_header:-curses.h}>
18965 int
18966 main (void)
18967 {
18968
18969 int x = NCURSES_EXT_FUNCS
18970
18971   ;
18972   return 0;
18973 }
18974 _ACEOF
18975 rm -f "conftest.$ac_objext"
18976 if { (eval echo "$as_me:18976: \"$ac_compile\"") >&5
18977   (eval $ac_compile) 2>&5
18978   ac_status=$?
18979   echo "$as_me:18979: \$? = $ac_status" >&5
18980   (exit "$ac_status"); } &&
18981          { ac_try='test -s "conftest.$ac_objext"'
18982   { (eval echo "$as_me:18982: \"$ac_try\"") >&5
18983   (eval $ac_try) 2>&5
18984   ac_status=$?
18985   echo "$as_me:18985: \$? = $ac_status" >&5
18986   (exit "$ac_status"); }; }; then
18987   cf_cv_ncurses_ext_funcs=defined
18988 else
18989   echo "$as_me: failed program was:" >&5
18990 cat "conftest.$ac_ext" >&5
18991
18992 cat >"conftest.$ac_ext" <<_ACEOF
18993 #line 18993 "configure"
18994 #include "confdefs.h"
18995
18996 #include <${cf_cv_ncurses_header:-curses.h}>
18997 int
18998 main (void)
18999 {
19000
19001         (void) assume_default_colors (0, 0);
19002         (void) curses_version ();
19003         (void) define_key (0, 0);
19004         (void) is_term_resized (0, 0);
19005         (void) key_defined (0);
19006         (void) keybound (0, 0);
19007         (void) keyok (0, 0);
19008         (void) resize_term (0, 0);
19009         (void) resizeterm (0, 0);
19010         (void) use_default_colors ();
19011         (void) use_extended_names (0);
19012         (void) wresize (0, 0, 0);
19013   ;
19014   return 0;
19015 }
19016 _ACEOF
19017 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19018 if { (eval echo "$as_me:19018: \"$ac_link\"") >&5
19019   (eval $ac_link) 2>&5
19020   ac_status=$?
19021   echo "$as_me:19021: \$? = $ac_status" >&5
19022   (exit "$ac_status"); } &&
19023          { ac_try='test -s "conftest$ac_exeext"'
19024   { (eval echo "$as_me:19024: \"$ac_try\"") >&5
19025   (eval $ac_try) 2>&5
19026   ac_status=$?
19027   echo "$as_me:19027: \$? = $ac_status" >&5
19028   (exit "$ac_status"); }; }; then
19029   cf_cv_ncurses_ext_funcs=yes
19030 else
19031   echo "$as_me: failed program was:" >&5
19032 cat "conftest.$ac_ext" >&5
19033 cf_cv_ncurses_ext_funcs=no
19034 fi
19035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19036
19037 fi
19038 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19039
19040 fi
19041 echo "$as_me:19041: result: $cf_cv_ncurses_ext_funcs" >&5
19042 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19043 test "$cf_cv_ncurses_ext_funcs" = yes &&
19044 cat >>confdefs.h <<\EOF
19045 #define NCURSES_EXT_FUNCS 1
19046 EOF
19047
19048 if test "$cf_enable_widec" = yes
19049 then
19050         # workaround for systems with ncurses before 20111029, due to change of
19051         # feature test macro from _XPG5 to _XOPEN_SOURCE
19052         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19053         then
19054                 cf_define_xpg5=no
19055                 echo "$as_me:19055: checking if _XPG5 should be defined to enable wide-characters" >&5
19056 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19057
19058                 cat >"conftest.$ac_ext" <<_ACEOF
19059 #line 19059 "configure"
19060 #include "confdefs.h"
19061
19062 #include <${cf_cv_ncurses_header:-curses.h}>
19063 int
19064 main (void)
19065 {
19066 int x = _XPG5
19067   ;
19068   return 0;
19069 }
19070 _ACEOF
19071 rm -f "conftest.$ac_objext"
19072 if { (eval echo "$as_me:19072: \"$ac_compile\"") >&5
19073   (eval $ac_compile) 2>&5
19074   ac_status=$?
19075   echo "$as_me:19075: \$? = $ac_status" >&5
19076   (exit "$ac_status"); } &&
19077          { ac_try='test -s "conftest.$ac_objext"'
19078   { (eval echo "$as_me:19078: \"$ac_try\"") >&5
19079   (eval $ac_try) 2>&5
19080   ac_status=$?
19081   echo "$as_me:19081: \$? = $ac_status" >&5
19082   (exit "$ac_status"); }; }; then
19083   :
19084 else
19085   echo "$as_me: failed program was:" >&5
19086 cat "conftest.$ac_ext" >&5
19087 cf_save_cppflags="$CPPFLAGS"
19088                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19089                          cat >"conftest.$ac_ext" <<_ACEOF
19090 #line 19090 "configure"
19091 #include "confdefs.h"
19092
19093 #include <${cf_cv_ncurses_header:-curses.h}>
19094 int
19095 main (void)
19096 {
19097 int x = _XPG5
19098   ;
19099   return 0;
19100 }
19101 _ACEOF
19102 rm -f "conftest.$ac_objext"
19103 if { (eval echo "$as_me:19103: \"$ac_compile\"") >&5
19104   (eval $ac_compile) 2>&5
19105   ac_status=$?
19106   echo "$as_me:19106: \$? = $ac_status" >&5
19107   (exit "$ac_status"); } &&
19108          { ac_try='test -s "conftest.$ac_objext"'
19109   { (eval echo "$as_me:19109: \"$ac_try\"") >&5
19110   (eval $ac_try) 2>&5
19111   ac_status=$?
19112   echo "$as_me:19112: \$? = $ac_status" >&5
19113   (exit "$ac_status"); }; }; then
19114   cf_define_xpg5=yes
19115 else
19116   echo "$as_me: failed program was:" >&5
19117 cat "conftest.$ac_ext" >&5
19118 fi
19119 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19120                          CPPFLAGS="$cf_save_cppflags"
19121 fi
19122 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19123                 echo "$as_me:19123: result: $cf_define_xpg5" >&5
19124 echo "${ECHO_T}$cf_define_xpg5" >&6
19125
19126                 if test "$cf_define_xpg5" = yes
19127                 then
19128                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19129                 fi
19130         fi
19131
19132         echo "$as_me:19132: checking for wide-character functions" >&5
19133 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19134 if test "${cf_cv_widechar_funcs+set}" = set; then
19135   echo $ECHO_N "(cached) $ECHO_C" >&6
19136 else
19137
19138         cat >"conftest.$ac_ext" <<_ACEOF
19139 #line 19139 "configure"
19140 #include "confdefs.h"
19141
19142 #include <${cf_cv_ncurses_header:-curses.h}>
19143 int
19144 main (void)
19145 {
19146
19147                 static wchar_t src_wchar[2];
19148                 static cchar_t dst_cchar;
19149                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19150
19151   ;
19152   return 0;
19153 }
19154 _ACEOF
19155 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19156 if { (eval echo "$as_me:19156: \"$ac_link\"") >&5
19157   (eval $ac_link) 2>&5
19158   ac_status=$?
19159   echo "$as_me:19159: \$? = $ac_status" >&5
19160   (exit "$ac_status"); } &&
19161          { ac_try='test -s "conftest$ac_exeext"'
19162   { (eval echo "$as_me:19162: \"$ac_try\"") >&5
19163   (eval $ac_try) 2>&5
19164   ac_status=$?
19165   echo "$as_me:19165: \$? = $ac_status" >&5
19166   (exit "$ac_status"); }; }; then
19167   cf_cv_widechar_funcs=yes
19168 else
19169   echo "$as_me: failed program was:" >&5
19170 cat "conftest.$ac_ext" >&5
19171 cf_cv_widechar_funcs=no
19172 fi
19173 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19174
19175 fi
19176 echo "$as_me:19176: result: $cf_cv_widechar_funcs" >&5
19177 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19178         if test "$cf_cv_widechar_funcs" != no ; then
19179
19180 cat >>confdefs.h <<\EOF
19181 #define USE_WIDEC_SUPPORT 1
19182 EOF
19183
19184         else
19185                 cat >>confdefs.h <<\EOF
19186 #define USE_WIDEC_SUPPORT 0
19187 EOF
19188
19189         fi
19190 else
19191         cat >>confdefs.h <<\EOF
19192 #define USE_WIDEC_SUPPORT 0
19193 EOF
19194
19195 fi
19196
19197 echo "$as_me:19197: checking if $cf_cv_screen library uses pthreads" >&5
19198 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19199 if test "${cf_cv_use_pthreads+set}" = set; then
19200   echo $ECHO_N "(cached) $ECHO_C" >&6
19201 else
19202
19203 cat >"conftest.$ac_ext" <<_ACEOF
19204 #line 19204 "configure"
19205 #include "confdefs.h"
19206
19207 #include <${cf_cv_ncurses_header:-curses.h}>
19208 extern void _nc_init_pthreads(void);
19209
19210 int
19211 main (void)
19212 {
19213
19214         initscr();
19215         _nc_init_pthreads();
19216
19217   ;
19218   return 0;
19219 }
19220 _ACEOF
19221 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19222 if { (eval echo "$as_me:19222: \"$ac_link\"") >&5
19223   (eval $ac_link) 2>&5
19224   ac_status=$?
19225   echo "$as_me:19225: \$? = $ac_status" >&5
19226   (exit "$ac_status"); } &&
19227          { ac_try='test -s "conftest$ac_exeext"'
19228   { (eval echo "$as_me:19228: \"$ac_try\"") >&5
19229   (eval $ac_try) 2>&5
19230   ac_status=$?
19231   echo "$as_me:19231: \$? = $ac_status" >&5
19232   (exit "$ac_status"); }; }; then
19233   cf_cv_use_pthreads=yes
19234 else
19235   echo "$as_me: failed program was:" >&5
19236 cat "conftest.$ac_ext" >&5
19237 cf_cv_use_pthreads=no
19238 fi
19239 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19240
19241 fi
19242 echo "$as_me:19242: result: $cf_cv_use_pthreads" >&5
19243 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19244 test $cf_cv_use_pthreads = yes &&
19245 cat >>confdefs.h <<\EOF
19246 #define USE_PTHREADS 1
19247 EOF
19248
19249 echo "$as_me:19249: checking if sys/time.h works with sys/select.h" >&5
19250 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19251 if test "${cf_cv_sys_time_select+set}" = set; then
19252   echo $ECHO_N "(cached) $ECHO_C" >&6
19253 else
19254
19255 cat >"conftest.$ac_ext" <<_ACEOF
19256 #line 19256 "configure"
19257 #include "confdefs.h"
19258
19259 #include <sys/types.h>
19260 #ifdef HAVE_SYS_TIME_H
19261 #include <sys/time.h>
19262 #endif
19263 #ifdef HAVE_SYS_SELECT_H
19264 #include <sys/select.h>
19265 #endif
19266
19267 int
19268 main (void)
19269 {
19270
19271   ;
19272   return 0;
19273 }
19274 _ACEOF
19275 rm -f "conftest.$ac_objext"
19276 if { (eval echo "$as_me:19276: \"$ac_compile\"") >&5
19277   (eval $ac_compile) 2>&5
19278   ac_status=$?
19279   echo "$as_me:19279: \$? = $ac_status" >&5
19280   (exit "$ac_status"); } &&
19281          { ac_try='test -s "conftest.$ac_objext"'
19282   { (eval echo "$as_me:19282: \"$ac_try\"") >&5
19283   (eval $ac_try) 2>&5
19284   ac_status=$?
19285   echo "$as_me:19285: \$? = $ac_status" >&5
19286   (exit "$ac_status"); }; }; then
19287   cf_cv_sys_time_select=yes
19288 else
19289   echo "$as_me: failed program was:" >&5
19290 cat "conftest.$ac_ext" >&5
19291 cf_cv_sys_time_select=no
19292 fi
19293 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19294
19295 fi
19296
19297 echo "$as_me:19297: result: $cf_cv_sys_time_select" >&5
19298 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19299 test "$cf_cv_sys_time_select" = yes &&
19300 cat >>confdefs.h <<\EOF
19301 #define HAVE_SYS_TIME_SELECT 1
19302 EOF
19303
19304 # special check for test/ditto.c
19305
19306 echo "$as_me:19306: checking for openpty in -lutil" >&5
19307 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19308 if test "${ac_cv_lib_util_openpty+set}" = set; then
19309   echo $ECHO_N "(cached) $ECHO_C" >&6
19310 else
19311   ac_check_lib_save_LIBS=$LIBS
19312 LIBS="-lutil  $LIBS"
19313 cat >"conftest.$ac_ext" <<_ACEOF
19314 #line 19314 "configure"
19315 #include "confdefs.h"
19316
19317 /* Override any gcc2 internal prototype to avoid an error.  */
19318 #ifdef __cplusplus
19319 extern "C"
19320 #endif
19321 /* We use char because int might match the return type of a gcc2
19322    builtin and then its argument prototype would still apply.  */
19323 char openpty ();
19324 int
19325 main (void)
19326 {
19327 openpty ();
19328   ;
19329   return 0;
19330 }
19331 _ACEOF
19332 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19333 if { (eval echo "$as_me:19333: \"$ac_link\"") >&5
19334   (eval $ac_link) 2>&5
19335   ac_status=$?
19336   echo "$as_me:19336: \$? = $ac_status" >&5
19337   (exit "$ac_status"); } &&
19338          { ac_try='test -s "conftest$ac_exeext"'
19339   { (eval echo "$as_me:19339: \"$ac_try\"") >&5
19340   (eval $ac_try) 2>&5
19341   ac_status=$?
19342   echo "$as_me:19342: \$? = $ac_status" >&5
19343   (exit "$ac_status"); }; }; then
19344   ac_cv_lib_util_openpty=yes
19345 else
19346   echo "$as_me: failed program was:" >&5
19347 cat "conftest.$ac_ext" >&5
19348 ac_cv_lib_util_openpty=no
19349 fi
19350 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19351 LIBS=$ac_check_lib_save_LIBS
19352 fi
19353 echo "$as_me:19353: result: $ac_cv_lib_util_openpty" >&5
19354 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19355 if test "$ac_cv_lib_util_openpty" = yes; then
19356   cf_cv_lib_util=yes
19357 else
19358   cf_cv_lib_util=no
19359 fi
19360
19361 echo "$as_me:19361: checking for openpty header" >&5
19362 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19363 if test "${cf_cv_func_openpty+set}" = set; then
19364   echo $ECHO_N "(cached) $ECHO_C" >&6
19365 else
19366
19367         cf_save_LIBS="$LIBS"
19368         test "$cf_cv_lib_util" = yes && {
19369 cf_add_libs="$LIBS"
19370 # reverse order
19371 cf_add_0lib=
19372 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19373 # filter duplicates
19374 for cf_add_1lib in $cf_add_0lib; do
19375         for cf_add_2lib in $cf_add_libs; do
19376                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19377                         cf_add_1lib=
19378                         break
19379                 fi
19380         done
19381         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19382 done
19383 LIBS="$cf_add_libs"
19384  }
19385         for cf_header in pty.h libutil.h util.h
19386         do
19387         cat >"conftest.$ac_ext" <<_ACEOF
19388 #line 19388 "configure"
19389 #include "confdefs.h"
19390
19391 #include <$cf_header>
19392
19393 int
19394 main (void)
19395 {
19396
19397         int x = openpty((int *)0, (int *)0, (char *)0,
19398                                    (struct termios *)0, (struct winsize *)0);
19399
19400   ;
19401   return 0;
19402 }
19403 _ACEOF
19404 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19405 if { (eval echo "$as_me:19405: \"$ac_link\"") >&5
19406   (eval $ac_link) 2>&5
19407   ac_status=$?
19408   echo "$as_me:19408: \$? = $ac_status" >&5
19409   (exit "$ac_status"); } &&
19410          { ac_try='test -s "conftest$ac_exeext"'
19411   { (eval echo "$as_me:19411: \"$ac_try\"") >&5
19412   (eval $ac_try) 2>&5
19413   ac_status=$?
19414   echo "$as_me:19414: \$? = $ac_status" >&5
19415   (exit "$ac_status"); }; }; then
19416
19417                 cf_cv_func_openpty=$cf_header
19418                 break
19419
19420 else
19421   echo "$as_me: failed program was:" >&5
19422 cat "conftest.$ac_ext" >&5
19423
19424                 cf_cv_func_openpty=no
19425
19426 fi
19427 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19428         done
19429         LIBS="$cf_save_LIBS"
19430
19431 fi
19432 echo "$as_me:19432: result: $cf_cv_func_openpty" >&5
19433 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19434
19435 if test "$cf_cv_func_openpty" != no ; then
19436
19437 cat >>confdefs.h <<EOF
19438 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19439 EOF
19440
19441 cat >>confdefs.h <<\EOF
19442 #define USE_XTERM_PTY 1
19443 EOF
19444
19445         if test "x$cf_cv_lib_util" = xyes ; then
19446
19447 cf_add_libs="$TEST_LIBS"
19448 # reverse order
19449 cf_add_0lib=
19450 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19451 # filter duplicates
19452 for cf_add_1lib in $cf_add_0lib; do
19453         for cf_add_2lib in $cf_add_libs; do
19454                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19455                         cf_add_1lib=
19456                         break
19457                 fi
19458         done
19459         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19460 done
19461 TEST_LIBS="$cf_add_libs"
19462
19463         fi
19464 fi
19465
19466 echo "$as_me:19466: checking for function curses_version" >&5
19467 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19468 if test "${cf_cv_func_curses_version+set}" = set; then
19469   echo $ECHO_N "(cached) $ECHO_C" >&6
19470 else
19471
19472 if test "$cross_compiling" = yes; then
19473   cf_cv_func_curses_version=unknown
19474 else
19475   cat >"conftest.$ac_ext" <<_ACEOF
19476 #line 19476 "configure"
19477 #include "confdefs.h"
19478
19479 #include <${cf_cv_ncurses_header:-curses.h}>
19480 int main(void)
19481 {
19482         char temp[1024];
19483         sprintf(temp, "%s\\n", curses_version());
19484         ${cf_cv_main_return:-return}(0);
19485 }
19486
19487 _ACEOF
19488 rm -f "conftest$ac_exeext"
19489 if { (eval echo "$as_me:19489: \"$ac_link\"") >&5
19490   (eval $ac_link) 2>&5
19491   ac_status=$?
19492   echo "$as_me:19492: \$? = $ac_status" >&5
19493   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19494   { (eval echo "$as_me:19494: \"$ac_try\"") >&5
19495   (eval $ac_try) 2>&5
19496   ac_status=$?
19497   echo "$as_me:19497: \$? = $ac_status" >&5
19498   (exit "$ac_status"); }; }; then
19499   cf_cv_func_curses_version=yes
19500
19501 else
19502   echo "$as_me: program exited with status $ac_status" >&5
19503 echo "$as_me: failed program was:" >&5
19504 cat "conftest.$ac_ext" >&5
19505 cf_cv_func_curses_version=no
19506
19507 fi
19508 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19509 fi
19510 rm -f core
19511 fi
19512 echo "$as_me:19512: result: $cf_cv_func_curses_version" >&5
19513 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19514 test "$cf_cv_func_curses_version" = yes &&
19515 cat >>confdefs.h <<\EOF
19516 #define HAVE_CURSES_VERSION 1
19517 EOF
19518
19519 echo "$as_me:19519: checking for alternate character set array" >&5
19520 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19521 if test "${cf_cv_curses_acs_map+set}" = set; then
19522   echo $ECHO_N "(cached) $ECHO_C" >&6
19523 else
19524
19525 cf_cv_curses_acs_map=unknown
19526 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19527 do
19528 cat >"conftest.$ac_ext" <<_ACEOF
19529 #line 19529 "configure"
19530 #include "confdefs.h"
19531
19532 #include <${cf_cv_ncurses_header:-curses.h}>
19533
19534 int
19535 main (void)
19536 {
19537
19538 ${name}['k'] = ACS_PLUS
19539
19540   ;
19541   return 0;
19542 }
19543 _ACEOF
19544 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19545 if { (eval echo "$as_me:19545: \"$ac_link\"") >&5
19546   (eval $ac_link) 2>&5
19547   ac_status=$?
19548   echo "$as_me:19548: \$? = $ac_status" >&5
19549   (exit "$ac_status"); } &&
19550          { ac_try='test -s "conftest$ac_exeext"'
19551   { (eval echo "$as_me:19551: \"$ac_try\"") >&5
19552   (eval $ac_try) 2>&5
19553   ac_status=$?
19554   echo "$as_me:19554: \$? = $ac_status" >&5
19555   (exit "$ac_status"); }; }; then
19556   cf_cv_curses_acs_map=$name; break
19557 else
19558   echo "$as_me: failed program was:" >&5
19559 cat "conftest.$ac_ext" >&5
19560 fi
19561 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19562 done
19563
19564 fi
19565 echo "$as_me:19565: result: $cf_cv_curses_acs_map" >&5
19566 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19567
19568 test "$cf_cv_curses_acs_map" != unknown &&
19569 cat >>confdefs.h <<EOF
19570 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19571 EOF
19572
19573 if test "$cf_enable_widec" = yes; then
19574
19575 echo "$as_me:19575: checking for wide alternate character set array" >&5
19576 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19577 if test "${cf_cv_curses_wacs_map+set}" = set; then
19578   echo $ECHO_N "(cached) $ECHO_C" >&6
19579 else
19580
19581         cf_cv_curses_wacs_map=unknown
19582         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19583         do
19584         cat >"conftest.$ac_ext" <<_ACEOF
19585 #line 19585 "configure"
19586 #include "confdefs.h"
19587
19588 #ifndef _XOPEN_SOURCE_EXTENDED
19589 #define _XOPEN_SOURCE_EXTENDED
19590 #endif
19591 #include <${cf_cv_ncurses_header:-curses.h}>
19592 int
19593 main (void)
19594 {
19595 void *foo = &(${name}['k']); (void)foo
19596   ;
19597   return 0;
19598 }
19599 _ACEOF
19600 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19601 if { (eval echo "$as_me:19601: \"$ac_link\"") >&5
19602   (eval $ac_link) 2>&5
19603   ac_status=$?
19604   echo "$as_me:19604: \$? = $ac_status" >&5
19605   (exit "$ac_status"); } &&
19606          { ac_try='test -s "conftest$ac_exeext"'
19607   { (eval echo "$as_me:19607: \"$ac_try\"") >&5
19608   (eval $ac_try) 2>&5
19609   ac_status=$?
19610   echo "$as_me:19610: \$? = $ac_status" >&5
19611   (exit "$ac_status"); }; }; then
19612   cf_cv_curses_wacs_map=$name
19613          break
19614 else
19615   echo "$as_me: failed program was:" >&5
19616 cat "conftest.$ac_ext" >&5
19617 fi
19618 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19619         done
19620 fi
19621 echo "$as_me:19621: result: $cf_cv_curses_wacs_map" >&5
19622 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19623
19624 test "$cf_cv_curses_wacs_map" != unknown &&
19625 cat >>confdefs.h <<EOF
19626 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19627 EOF
19628
19629 echo "$as_me:19629: checking for wide alternate character constants" >&5
19630 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19631 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19632   echo $ECHO_N "(cached) $ECHO_C" >&6
19633 else
19634
19635 cf_cv_curses_wacs_symbols=no
19636 if test "$cf_cv_curses_wacs_map" != unknown
19637 then
19638         cat >"conftest.$ac_ext" <<_ACEOF
19639 #line 19639 "configure"
19640 #include "confdefs.h"
19641
19642 #ifndef _XOPEN_SOURCE_EXTENDED
19643 #define _XOPEN_SOURCE_EXTENDED
19644 #endif
19645 #include <${cf_cv_ncurses_header:-curses.h}>
19646 int
19647 main (void)
19648 {
19649 cchar_t *foo = WACS_PLUS;
19650          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
19651   ;
19652   return 0;
19653 }
19654 _ACEOF
19655 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19656 if { (eval echo "$as_me:19656: \"$ac_link\"") >&5
19657   (eval $ac_link) 2>&5
19658   ac_status=$?
19659   echo "$as_me:19659: \$? = $ac_status" >&5
19660   (exit "$ac_status"); } &&
19661          { ac_try='test -s "conftest$ac_exeext"'
19662   { (eval echo "$as_me:19662: \"$ac_try\"") >&5
19663   (eval $ac_try) 2>&5
19664   ac_status=$?
19665   echo "$as_me:19665: \$? = $ac_status" >&5
19666   (exit "$ac_status"); }; }; then
19667   cf_cv_curses_wacs_symbols=yes
19668 else
19669   echo "$as_me: failed program was:" >&5
19670 cat "conftest.$ac_ext" >&5
19671 fi
19672 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19673 else
19674         cat >"conftest.$ac_ext" <<_ACEOF
19675 #line 19675 "configure"
19676 #include "confdefs.h"
19677
19678 #ifndef _XOPEN_SOURCE_EXTENDED
19679 #define _XOPEN_SOURCE_EXTENDED
19680 #endif
19681 #include <${cf_cv_ncurses_header:-curses.h}>
19682 int
19683 main (void)
19684 {
19685 cchar_t *foo = WACS_PLUS; (void)foo
19686   ;
19687   return 0;
19688 }
19689 _ACEOF
19690 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19691 if { (eval echo "$as_me:19691: \"$ac_link\"") >&5
19692   (eval $ac_link) 2>&5
19693   ac_status=$?
19694   echo "$as_me:19694: \$? = $ac_status" >&5
19695   (exit "$ac_status"); } &&
19696          { ac_try='test -s "conftest$ac_exeext"'
19697   { (eval echo "$as_me:19697: \"$ac_try\"") >&5
19698   (eval $ac_try) 2>&5
19699   ac_status=$?
19700   echo "$as_me:19700: \$? = $ac_status" >&5
19701   (exit "$ac_status"); }; }; then
19702   cf_cv_curses_wacs_symbols=yes
19703 else
19704   echo "$as_me: failed program was:" >&5
19705 cat "conftest.$ac_ext" >&5
19706 fi
19707 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19708 fi
19709
19710 fi
19711 echo "$as_me:19711: result: $cf_cv_curses_wacs_symbols" >&5
19712 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19713
19714 test "$cf_cv_curses_wacs_symbols" != no &&
19715 cat >>confdefs.h <<\EOF
19716 #define CURSES_WACS_SYMBOLS 1
19717 EOF
19718
19719 fi
19720
19721 echo "$as_me:19721: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19722 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19723 cat >"conftest.$ac_ext" <<_ACEOF
19724 #line 19724 "configure"
19725 #include "confdefs.h"
19726
19727 #ifndef _XOPEN_SOURCE_EXTENDED
19728 #define _XOPEN_SOURCE_EXTENDED
19729 #endif
19730 #include <${cf_cv_ncurses_header:-curses.h}>
19731 int
19732 main (void)
19733 {
19734
19735 attr_t foo
19736
19737   ;
19738   return 0;
19739 }
19740 _ACEOF
19741 rm -f "conftest.$ac_objext"
19742 if { (eval echo "$as_me:19742: \"$ac_compile\"") >&5
19743   (eval $ac_compile) 2>&5
19744   ac_status=$?
19745   echo "$as_me:19745: \$? = $ac_status" >&5
19746   (exit "$ac_status"); } &&
19747          { ac_try='test -s "conftest.$ac_objext"'
19748   { (eval echo "$as_me:19748: \"$ac_try\"") >&5
19749   (eval $ac_try) 2>&5
19750   ac_status=$?
19751   echo "$as_me:19751: \$? = $ac_status" >&5
19752   (exit "$ac_status"); }; }; then
19753   cf_result=yes
19754 else
19755   echo "$as_me: failed program was:" >&5
19756 cat "conftest.$ac_ext" >&5
19757 cf_result=no
19758 fi
19759 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19760 echo "$as_me:19760: result: $cf_result" >&5
19761 echo "${ECHO_T}$cf_result" >&6
19762 if test "$cf_result" = yes ; then
19763
19764 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19765
19766 cat >>confdefs.h <<EOF
19767 #define $cf_result 1
19768 EOF
19769
19770 else
19771
19772 cat >>confdefs.h <<EOF
19773 #define attr_t long
19774 EOF
19775
19776 fi
19777
19778 if test "$cf_enable_widec" = yes; then
19779
19780 # This is needed on Tru64 5.0 to declare mbstate_t
19781 echo "$as_me:19781: checking if we must include wchar.h to declare mbstate_t" >&5
19782 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19783 if test "${cf_cv_mbstate_t+set}" = set; then
19784   echo $ECHO_N "(cached) $ECHO_C" >&6
19785 else
19786
19787 cat >"conftest.$ac_ext" <<_ACEOF
19788 #line 19788 "configure"
19789 #include "confdefs.h"
19790
19791 #include <stdlib.h>
19792 #include <stdarg.h>
19793 #include <stdio.h>
19794 #ifdef HAVE_LIBUTF8_H
19795 #include <libutf8.h>
19796 #endif
19797 int
19798 main (void)
19799 {
19800 mbstate_t state
19801   ;
19802   return 0;
19803 }
19804 _ACEOF
19805 rm -f "conftest.$ac_objext"
19806 if { (eval echo "$as_me:19806: \"$ac_compile\"") >&5
19807   (eval $ac_compile) 2>&5
19808   ac_status=$?
19809   echo "$as_me:19809: \$? = $ac_status" >&5
19810   (exit "$ac_status"); } &&
19811          { ac_try='test -s "conftest.$ac_objext"'
19812   { (eval echo "$as_me:19812: \"$ac_try\"") >&5
19813   (eval $ac_try) 2>&5
19814   ac_status=$?
19815   echo "$as_me:19815: \$? = $ac_status" >&5
19816   (exit "$ac_status"); }; }; then
19817   cf_cv_mbstate_t=no
19818 else
19819   echo "$as_me: failed program was:" >&5
19820 cat "conftest.$ac_ext" >&5
19821 cat >"conftest.$ac_ext" <<_ACEOF
19822 #line 19822 "configure"
19823 #include "confdefs.h"
19824
19825 #include <stdlib.h>
19826 #include <stdarg.h>
19827 #include <stdio.h>
19828 #include <wchar.h>
19829 #ifdef HAVE_LIBUTF8_H
19830 #include <libutf8.h>
19831 #endif
19832 int
19833 main (void)
19834 {
19835 mbstate_t value
19836   ;
19837   return 0;
19838 }
19839 _ACEOF
19840 rm -f "conftest.$ac_objext"
19841 if { (eval echo "$as_me:19841: \"$ac_compile\"") >&5
19842   (eval $ac_compile) 2>&5
19843   ac_status=$?
19844   echo "$as_me:19844: \$? = $ac_status" >&5
19845   (exit "$ac_status"); } &&
19846          { ac_try='test -s "conftest.$ac_objext"'
19847   { (eval echo "$as_me:19847: \"$ac_try\"") >&5
19848   (eval $ac_try) 2>&5
19849   ac_status=$?
19850   echo "$as_me:19850: \$? = $ac_status" >&5
19851   (exit "$ac_status"); }; }; then
19852   cf_cv_mbstate_t=yes
19853 else
19854   echo "$as_me: failed program was:" >&5
19855 cat "conftest.$ac_ext" >&5
19856 cf_cv_mbstate_t=unknown
19857 fi
19858 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19859 fi
19860 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19861 fi
19862 echo "$as_me:19862: result: $cf_cv_mbstate_t" >&5
19863 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19864
19865 if test "$cf_cv_mbstate_t" = yes ; then
19866
19867 cat >>confdefs.h <<\EOF
19868 #define NEED_WCHAR_H 1
19869 EOF
19870
19871         NEED_WCHAR_H=1
19872 fi
19873
19874 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19875 if test "$cf_cv_mbstate_t" = unknown ; then
19876         NCURSES_MBSTATE_T=1
19877 fi
19878
19879 # if we find mbstate_t in either place, use substitution to provide a fallback.
19880 if test "$cf_cv_mbstate_t" != unknown ; then
19881         NCURSES_OK_MBSTATE_T=1
19882 fi
19883
19884 # This is needed on Tru64 5.0 to declare wchar_t
19885 echo "$as_me:19885: checking if we must include wchar.h to declare wchar_t" >&5
19886 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19887 if test "${cf_cv_wchar_t+set}" = set; then
19888   echo $ECHO_N "(cached) $ECHO_C" >&6
19889 else
19890
19891 cat >"conftest.$ac_ext" <<_ACEOF
19892 #line 19892 "configure"
19893 #include "confdefs.h"
19894
19895 #include <stdlib.h>
19896 #include <stdarg.h>
19897 #include <stdio.h>
19898 #ifdef HAVE_LIBUTF8_H
19899 #include <libutf8.h>
19900 #endif
19901 int
19902 main (void)
19903 {
19904 wchar_t state
19905   ;
19906   return 0;
19907 }
19908 _ACEOF
19909 rm -f "conftest.$ac_objext"
19910 if { (eval echo "$as_me:19910: \"$ac_compile\"") >&5
19911   (eval $ac_compile) 2>&5
19912   ac_status=$?
19913   echo "$as_me:19913: \$? = $ac_status" >&5
19914   (exit "$ac_status"); } &&
19915          { ac_try='test -s "conftest.$ac_objext"'
19916   { (eval echo "$as_me:19916: \"$ac_try\"") >&5
19917   (eval $ac_try) 2>&5
19918   ac_status=$?
19919   echo "$as_me:19919: \$? = $ac_status" >&5
19920   (exit "$ac_status"); }; }; then
19921   cf_cv_wchar_t=no
19922 else
19923   echo "$as_me: failed program was:" >&5
19924 cat "conftest.$ac_ext" >&5
19925 cat >"conftest.$ac_ext" <<_ACEOF
19926 #line 19926 "configure"
19927 #include "confdefs.h"
19928
19929 #include <stdlib.h>
19930 #include <stdarg.h>
19931 #include <stdio.h>
19932 #include <wchar.h>
19933 #ifdef HAVE_LIBUTF8_H
19934 #include <libutf8.h>
19935 #endif
19936 int
19937 main (void)
19938 {
19939 wchar_t value
19940   ;
19941   return 0;
19942 }
19943 _ACEOF
19944 rm -f "conftest.$ac_objext"
19945 if { (eval echo "$as_me:19945: \"$ac_compile\"") >&5
19946   (eval $ac_compile) 2>&5
19947   ac_status=$?
19948   echo "$as_me:19948: \$? = $ac_status" >&5
19949   (exit "$ac_status"); } &&
19950          { ac_try='test -s "conftest.$ac_objext"'
19951   { (eval echo "$as_me:19951: \"$ac_try\"") >&5
19952   (eval $ac_try) 2>&5
19953   ac_status=$?
19954   echo "$as_me:19954: \$? = $ac_status" >&5
19955   (exit "$ac_status"); }; }; then
19956   cf_cv_wchar_t=yes
19957 else
19958   echo "$as_me: failed program was:" >&5
19959 cat "conftest.$ac_ext" >&5
19960 cf_cv_wchar_t=unknown
19961 fi
19962 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19963 fi
19964 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19965 fi
19966 echo "$as_me:19966: result: $cf_cv_wchar_t" >&5
19967 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19968
19969 if test "$cf_cv_wchar_t" = yes ; then
19970
19971 cat >>confdefs.h <<\EOF
19972 #define NEED_WCHAR_H 1
19973 EOF
19974
19975         NEED_WCHAR_H=1
19976 fi
19977
19978 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19979 if test "$cf_cv_wchar_t" = unknown ; then
19980         NCURSES_WCHAR_T=1
19981 fi
19982
19983 # if we find wchar_t in either place, use substitution to provide a fallback.
19984 if test "$cf_cv_wchar_t" != unknown ; then
19985         NCURSES_OK_WCHAR_T=1
19986 fi
19987
19988 # This is needed on Tru64 5.0 to declare wint_t
19989 echo "$as_me:19989: checking if we must include wchar.h to declare wint_t" >&5
19990 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19991 if test "${cf_cv_wint_t+set}" = set; then
19992   echo $ECHO_N "(cached) $ECHO_C" >&6
19993 else
19994
19995 cat >"conftest.$ac_ext" <<_ACEOF
19996 #line 19996 "configure"
19997 #include "confdefs.h"
19998
19999 #include <stdlib.h>
20000 #include <stdarg.h>
20001 #include <stdio.h>
20002 #ifdef HAVE_LIBUTF8_H
20003 #include <libutf8.h>
20004 #endif
20005 int
20006 main (void)
20007 {
20008 wint_t state
20009   ;
20010   return 0;
20011 }
20012 _ACEOF
20013 rm -f "conftest.$ac_objext"
20014 if { (eval echo "$as_me:20014: \"$ac_compile\"") >&5
20015   (eval $ac_compile) 2>&5
20016   ac_status=$?
20017   echo "$as_me:20017: \$? = $ac_status" >&5
20018   (exit "$ac_status"); } &&
20019          { ac_try='test -s "conftest.$ac_objext"'
20020   { (eval echo "$as_me:20020: \"$ac_try\"") >&5
20021   (eval $ac_try) 2>&5
20022   ac_status=$?
20023   echo "$as_me:20023: \$? = $ac_status" >&5
20024   (exit "$ac_status"); }; }; then
20025   cf_cv_wint_t=no
20026 else
20027   echo "$as_me: failed program was:" >&5
20028 cat "conftest.$ac_ext" >&5
20029 cat >"conftest.$ac_ext" <<_ACEOF
20030 #line 20030 "configure"
20031 #include "confdefs.h"
20032
20033 #include <stdlib.h>
20034 #include <stdarg.h>
20035 #include <stdio.h>
20036 #include <wchar.h>
20037 #ifdef HAVE_LIBUTF8_H
20038 #include <libutf8.h>
20039 #endif
20040 int
20041 main (void)
20042 {
20043 wint_t value
20044   ;
20045   return 0;
20046 }
20047 _ACEOF
20048 rm -f "conftest.$ac_objext"
20049 if { (eval echo "$as_me:20049: \"$ac_compile\"") >&5
20050   (eval $ac_compile) 2>&5
20051   ac_status=$?
20052   echo "$as_me:20052: \$? = $ac_status" >&5
20053   (exit "$ac_status"); } &&
20054          { ac_try='test -s "conftest.$ac_objext"'
20055   { (eval echo "$as_me:20055: \"$ac_try\"") >&5
20056   (eval $ac_try) 2>&5
20057   ac_status=$?
20058   echo "$as_me:20058: \$? = $ac_status" >&5
20059   (exit "$ac_status"); }; }; then
20060   cf_cv_wint_t=yes
20061 else
20062   echo "$as_me: failed program was:" >&5
20063 cat "conftest.$ac_ext" >&5
20064 cf_cv_wint_t=unknown
20065 fi
20066 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20067 fi
20068 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20069 fi
20070 echo "$as_me:20070: result: $cf_cv_wint_t" >&5
20071 echo "${ECHO_T}$cf_cv_wint_t" >&6
20072
20073 if test "$cf_cv_wint_t" = yes ; then
20074
20075 cat >>confdefs.h <<\EOF
20076 #define NEED_WCHAR_H 1
20077 EOF
20078
20079         NEED_WCHAR_H=1
20080 fi
20081
20082 # if we do not find wint_t in either place, use substitution to provide a fallback.
20083 if test "$cf_cv_wint_t" = unknown ; then
20084         NCURSES_WINT_T=1
20085 fi
20086
20087 # if we find wint_t in either place, use substitution to provide a fallback.
20088 if test "$cf_cv_wint_t" != unknown ; then
20089         NCURSES_OK_WINT_T=1
20090 fi
20091
20092         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20093
20094 echo "$as_me:20094: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20095 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20096 cat >"conftest.$ac_ext" <<_ACEOF
20097 #line 20097 "configure"
20098 #include "confdefs.h"
20099
20100 #ifndef _XOPEN_SOURCE_EXTENDED
20101 #define _XOPEN_SOURCE_EXTENDED
20102 #endif
20103 #include <${cf_cv_ncurses_header:-curses.h}>
20104 int
20105 main (void)
20106 {
20107
20108 mbstate_t foo
20109
20110   ;
20111   return 0;
20112 }
20113 _ACEOF
20114 rm -f "conftest.$ac_objext"
20115 if { (eval echo "$as_me:20115: \"$ac_compile\"") >&5
20116   (eval $ac_compile) 2>&5
20117   ac_status=$?
20118   echo "$as_me:20118: \$? = $ac_status" >&5
20119   (exit "$ac_status"); } &&
20120          { ac_try='test -s "conftest.$ac_objext"'
20121   { (eval echo "$as_me:20121: \"$ac_try\"") >&5
20122   (eval $ac_try) 2>&5
20123   ac_status=$?
20124   echo "$as_me:20124: \$? = $ac_status" >&5
20125   (exit "$ac_status"); }; }; then
20126   cf_result=yes
20127 else
20128   echo "$as_me: failed program was:" >&5
20129 cat "conftest.$ac_ext" >&5
20130 cf_result=no
20131 fi
20132 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20133 echo "$as_me:20133: result: $cf_result" >&5
20134 echo "${ECHO_T}$cf_result" >&6
20135 if test "$cf_result" = yes ; then
20136
20137 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20138
20139 cat >>confdefs.h <<EOF
20140 #define $cf_result 1
20141 EOF
20142
20143 else
20144
20145 cat >>confdefs.h <<EOF
20146 #define mbstate_t long
20147 EOF
20148
20149 fi
20150
20151         fi
20152
20153         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20154
20155 echo "$as_me:20155: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20156 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20157 cat >"conftest.$ac_ext" <<_ACEOF
20158 #line 20158 "configure"
20159 #include "confdefs.h"
20160
20161 #ifndef _XOPEN_SOURCE_EXTENDED
20162 #define _XOPEN_SOURCE_EXTENDED
20163 #endif
20164 #include <${cf_cv_ncurses_header:-curses.h}>
20165 int
20166 main (void)
20167 {
20168
20169 wchar_t foo
20170
20171   ;
20172   return 0;
20173 }
20174 _ACEOF
20175 rm -f "conftest.$ac_objext"
20176 if { (eval echo "$as_me:20176: \"$ac_compile\"") >&5
20177   (eval $ac_compile) 2>&5
20178   ac_status=$?
20179   echo "$as_me:20179: \$? = $ac_status" >&5
20180   (exit "$ac_status"); } &&
20181          { ac_try='test -s "conftest.$ac_objext"'
20182   { (eval echo "$as_me:20182: \"$ac_try\"") >&5
20183   (eval $ac_try) 2>&5
20184   ac_status=$?
20185   echo "$as_me:20185: \$? = $ac_status" >&5
20186   (exit "$ac_status"); }; }; then
20187   cf_result=yes
20188 else
20189   echo "$as_me: failed program was:" >&5
20190 cat "conftest.$ac_ext" >&5
20191 cf_result=no
20192 fi
20193 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20194 echo "$as_me:20194: result: $cf_result" >&5
20195 echo "${ECHO_T}$cf_result" >&6
20196 if test "$cf_result" = yes ; then
20197
20198 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20199
20200 cat >>confdefs.h <<EOF
20201 #define $cf_result 1
20202 EOF
20203
20204 else
20205
20206 cat >>confdefs.h <<EOF
20207 #define wchar_t long
20208 EOF
20209
20210 fi
20211
20212         fi
20213
20214         if test "$NCURSES_OK_WINT_T" = 0 ; then
20215
20216 echo "$as_me:20216: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20217 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20218 cat >"conftest.$ac_ext" <<_ACEOF
20219 #line 20219 "configure"
20220 #include "confdefs.h"
20221
20222 #ifndef _XOPEN_SOURCE_EXTENDED
20223 #define _XOPEN_SOURCE_EXTENDED
20224 #endif
20225 #include <${cf_cv_ncurses_header:-curses.h}>
20226 int
20227 main (void)
20228 {
20229
20230 wint_t foo
20231
20232   ;
20233   return 0;
20234 }
20235 _ACEOF
20236 rm -f "conftest.$ac_objext"
20237 if { (eval echo "$as_me:20237: \"$ac_compile\"") >&5
20238   (eval $ac_compile) 2>&5
20239   ac_status=$?
20240   echo "$as_me:20240: \$? = $ac_status" >&5
20241   (exit "$ac_status"); } &&
20242          { ac_try='test -s "conftest.$ac_objext"'
20243   { (eval echo "$as_me:20243: \"$ac_try\"") >&5
20244   (eval $ac_try) 2>&5
20245   ac_status=$?
20246   echo "$as_me:20246: \$? = $ac_status" >&5
20247   (exit "$ac_status"); }; }; then
20248   cf_result=yes
20249 else
20250   echo "$as_me: failed program was:" >&5
20251 cat "conftest.$ac_ext" >&5
20252 cf_result=no
20253 fi
20254 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20255 echo "$as_me:20255: result: $cf_result" >&5
20256 echo "${ECHO_T}$cf_result" >&6
20257 if test "$cf_result" = yes ; then
20258
20259 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20260
20261 cat >>confdefs.h <<EOF
20262 #define $cf_result 1
20263 EOF
20264
20265 else
20266
20267 cat >>confdefs.h <<EOF
20268 #define wint_t long
20269 EOF
20270
20271 fi
20272
20273         fi
20274 fi
20275
20276 for cf_data in \
20277 TABSIZE \
20278 curscr \
20279 ospeed \
20280 boolnames \
20281 boolfnames \
20282 ttytype
20283 do
20284 echo "$as_me:20284: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20285 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20286
20287 cat >"conftest.$ac_ext" <<_ACEOF
20288 #line 20288 "configure"
20289 #include "confdefs.h"
20290
20291 #ifdef HAVE_XCURSES
20292 #include <xcurses.h>
20293 char * XCursesProgramName = "test";
20294 #else
20295 #include <${cf_cv_ncurses_header:-curses.h}>
20296 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20297 #include <ncursesw/term.h>
20298 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20299 #include <ncurses/term.h>
20300 #elif defined(HAVE_TERM_H)
20301 #include <term.h>
20302 #endif
20303 #endif
20304
20305 int
20306 main (void)
20307 {
20308
20309 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20310         const void *foo = (const void *)($cf_data);
20311 #else
20312         const void *foo = &($cf_data);
20313 #endif
20314         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20315
20316   ;
20317   return 0;
20318 }
20319 _ACEOF
20320 rm -f "conftest.$ac_objext"
20321 if { (eval echo "$as_me:20321: \"$ac_compile\"") >&5
20322   (eval $ac_compile) 2>&5
20323   ac_status=$?
20324   echo "$as_me:20324: \$? = $ac_status" >&5
20325   (exit "$ac_status"); } &&
20326          { ac_try='test -s "conftest.$ac_objext"'
20327   { (eval echo "$as_me:20327: \"$ac_try\"") >&5
20328   (eval $ac_try) 2>&5
20329   ac_status=$?
20330   echo "$as_me:20330: \$? = $ac_status" >&5
20331   (exit "$ac_status"); }; }; then
20332   cf_result=yes
20333
20334 else
20335   echo "$as_me: failed program was:" >&5
20336 cat "conftest.$ac_ext" >&5
20337 cf_result=no
20338 fi
20339 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20340 echo "$as_me:20340: result: $cf_result" >&5
20341 echo "${ECHO_T}$cf_result" >&6
20342
20343 if test "$cf_result" = yes ; then
20344
20345 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20346
20347         cat >>confdefs.h <<EOF
20348 #define $cf_result 1
20349 EOF
20350
20351 else
20352         echo "$as_me:20352: checking for data $cf_data in library" >&5
20353 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20354         # BSD linkers insist on making weak linkage, but resolve at runtime.
20355         if test "$cross_compiling" = yes; then
20356
20357         # cross-compiling
20358         cat >"conftest.$ac_ext" <<_ACEOF
20359 #line 20359 "configure"
20360 #include "confdefs.h"
20361
20362 #ifdef HAVE_XCURSES
20363 #include <xcurses.h>
20364 char * XCursesProgramName = "test";
20365 #else
20366 #include <${cf_cv_ncurses_header:-curses.h}>
20367 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20368 #include <ncursesw/term.h>
20369 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20370 #include <ncurses/term.h>
20371 #elif defined(HAVE_TERM_H)
20372 #include <term.h>
20373 #endif
20374 #endif
20375
20376 extern char $cf_data;
20377 int
20378 main (void)
20379 {
20380
20381         do {
20382
20383 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20384         const void *foo = (const void *)($cf_data);
20385 #else
20386         const void *foo = &($cf_data);
20387 #endif
20388         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20389
20390                 ${cf_cv_main_return:-return}(foo == 0);
20391         } while (0)
20392
20393   ;
20394   return 0;
20395 }
20396 _ACEOF
20397 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20398 if { (eval echo "$as_me:20398: \"$ac_link\"") >&5
20399   (eval $ac_link) 2>&5
20400   ac_status=$?
20401   echo "$as_me:20401: \$? = $ac_status" >&5
20402   (exit "$ac_status"); } &&
20403          { ac_try='test -s "conftest$ac_exeext"'
20404   { (eval echo "$as_me:20404: \"$ac_try\"") >&5
20405   (eval $ac_try) 2>&5
20406   ac_status=$?
20407   echo "$as_me:20407: \$? = $ac_status" >&5
20408   (exit "$ac_status"); }; }; then
20409   cf_result=yes
20410 else
20411   echo "$as_me: failed program was:" >&5
20412 cat "conftest.$ac_ext" >&5
20413 cf_result=no
20414 fi
20415 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20416
20417 else
20418   cat >"conftest.$ac_ext" <<_ACEOF
20419 #line 20419 "configure"
20420 #include "confdefs.h"
20421
20422 #ifdef HAVE_XCURSES
20423 #include <xcurses.h>
20424 char * XCursesProgramName = "test";
20425 #else
20426 #include <${cf_cv_ncurses_header:-curses.h}>
20427 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20428 #include <ncursesw/term.h>
20429 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20430 #include <ncurses/term.h>
20431 #elif defined(HAVE_TERM_H)
20432 #include <term.h>
20433 #endif
20434 #endif
20435
20436 extern char $cf_data;
20437 int main(void)
20438 {
20439
20440 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20441         const void *foo = (const void *)($cf_data);
20442 #else
20443         const void *foo = &($cf_data);
20444 #endif
20445         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20446
20447         ${cf_cv_main_return:-return}(foo == 0);
20448 }
20449 _ACEOF
20450 rm -f "conftest$ac_exeext"
20451 if { (eval echo "$as_me:20451: \"$ac_link\"") >&5
20452   (eval $ac_link) 2>&5
20453   ac_status=$?
20454   echo "$as_me:20454: \$? = $ac_status" >&5
20455   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20456   { (eval echo "$as_me:20456: \"$ac_try\"") >&5
20457   (eval $ac_try) 2>&5
20458   ac_status=$?
20459   echo "$as_me:20459: \$? = $ac_status" >&5
20460   (exit "$ac_status"); }; }; then
20461   cf_result=yes
20462
20463 else
20464   echo "$as_me: program exited with status $ac_status" >&5
20465 echo "$as_me: failed program was:" >&5
20466 cat "conftest.$ac_ext" >&5
20467 cf_result=no
20468 fi
20469 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20470 fi
20471         echo "$as_me:20471: result: $cf_result" >&5
20472 echo "${ECHO_T}$cf_result" >&6
20473         if test "$cf_result" = yes ; then
20474
20475 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20476
20477                 cat >>confdefs.h <<EOF
20478 #define $cf_result 1
20479 EOF
20480
20481                 # do not exit loop here, since we prefer system's declarations
20482         fi
20483 fi
20484 done
20485
20486 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20487 then
20488         echo "$as_me:20488: checking for X" >&5
20489 echo $ECHO_N "checking for X... $ECHO_C" >&6
20490
20491 # Check whether --with-x or --without-x was given.
20492 if test "${with_x+set}" = set; then
20493   withval="$with_x"
20494
20495 fi;
20496 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20497 if test "x$with_x" = xno; then
20498   # The user explicitly disabled X.
20499   have_x=disabled
20500 else
20501   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20502     # Both variables are already set.
20503     have_x=yes
20504   else
20505     if test "${ac_cv_have_x+set}" = set; then
20506   echo $ECHO_N "(cached) $ECHO_C" >&6
20507 else
20508   # One or both of the vars are not set, and there is no cached value.
20509 ac_x_includes=no ac_x_libraries=no
20510 rm -fr conftest.dir
20511 if mkdir conftest.dir; then
20512   cd conftest.dir
20513   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20514   cat >Imakefile <<'EOF'
20515 acfindx:
20516         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20517 EOF
20518   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20519     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20520     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20521     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20522     for ac_extension in a so sl dylib dll; do
20523       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20524          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20525         ac_im_usrlibdir=$ac_im_libdir; break
20526       fi
20527     done
20528     # Screen out bogus values from the imake configuration.  They are
20529     # bogus both because they are the default anyway, and because
20530     # using them would break gcc on systems where it needs fixed includes.
20531     case $ac_im_incroot in
20532         /usr/include) ;;
20533         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20534     esac
20535     case $ac_im_usrlibdir in
20536         /usr/lib | /lib) ;;
20537         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20538     esac
20539   fi
20540   cd ..
20541   rm -fr conftest.dir
20542 fi
20543
20544 # Standard set of common directories for X headers.
20545 # Check X11 before X11Rn because it is often a symlink to the current release.
20546 ac_x_header_dirs='
20547 /usr/X11/include
20548 /usr/X11R7/include
20549 /usr/X11R6/include
20550 /usr/X11R5/include
20551 /usr/X11R4/include
20552
20553 /opt/local/include
20554 /opt/X11/include
20555
20556 /usr/include/X11
20557 /usr/include/X11R7
20558 /usr/include/X11R6
20559 /usr/include/X11R5
20560 /usr/include/X11R4
20561
20562 /usr/local/X11/include
20563 /usr/local/X11R7/include
20564 /usr/local/X11R6/include
20565 /usr/local/X11R5/include
20566 /usr/local/X11R4/include
20567
20568 /usr/local/include/X11
20569 /usr/local/include/X11R7
20570 /usr/local/include/X11R6
20571 /usr/local/include/X11R5
20572 /usr/local/include/X11R4
20573
20574 /usr/X386/include
20575 /usr/x386/include
20576 /usr/XFree86/include/X11
20577
20578 /usr/include
20579 /usr/local/include
20580 /usr/unsupported/include
20581 /usr/athena/include
20582 /usr/local/x11r5/include
20583 /usr/lpp/Xamples/include
20584
20585 /usr/openwin/include
20586 /usr/openwin/share/include'
20587
20588 if test "$ac_x_includes" = no; then
20589   # Guess where to find include files, by looking for Intrinsic.h.
20590   # First, try using that file with no special directory specified.
20591   cat >"conftest.$ac_ext" <<_ACEOF
20592 #line 20592 "configure"
20593 #include "confdefs.h"
20594 #include <X11/Intrinsic.h>
20595 _ACEOF
20596 if { (eval echo "$as_me:20596: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20597   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20598   ac_status=$?
20599   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20600   rm -f conftest.er1
20601   cat conftest.err >&5
20602   echo "$as_me:20602: \$? = $ac_status" >&5
20603   (exit "$ac_status"); } >/dev/null; then
20604   if test -s conftest.err; then
20605     ac_cpp_err=$ac_c_preproc_warn_flag
20606   else
20607     ac_cpp_err=
20608   fi
20609 else
20610   ac_cpp_err=yes
20611 fi
20612 if test -z "$ac_cpp_err"; then
20613   # We can compile using X headers with no special include directory.
20614 ac_x_includes=
20615 else
20616   echo "$as_me: failed program was:" >&5
20617   cat "conftest.$ac_ext" >&5
20618   for ac_dir in $ac_x_header_dirs; do
20619   if test -r "$ac_dir/X11/Intrinsic.h"; then
20620     ac_x_includes=$ac_dir
20621     break
20622   fi
20623 done
20624 fi
20625 rm -f conftest.err "conftest.$ac_ext"
20626 fi # $ac_x_includes = no
20627
20628 if test "$ac_x_libraries" = no; then
20629   # Check for the libraries.
20630   # See if we find them without any special options.
20631   # Don't add to $LIBS permanently.
20632   ac_save_LIBS=$LIBS
20633   LIBS="-lXt $LIBS"
20634   cat >"conftest.$ac_ext" <<_ACEOF
20635 #line 20635 "configure"
20636 #include "confdefs.h"
20637 #include <X11/Intrinsic.h>
20638 int
20639 main (void)
20640 {
20641 XtMalloc (0)
20642   ;
20643   return 0;
20644 }
20645 _ACEOF
20646 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20647 if { (eval echo "$as_me:20647: \"$ac_link\"") >&5
20648   (eval $ac_link) 2>&5
20649   ac_status=$?
20650   echo "$as_me:20650: \$? = $ac_status" >&5
20651   (exit "$ac_status"); } &&
20652          { ac_try='test -s "conftest$ac_exeext"'
20653   { (eval echo "$as_me:20653: \"$ac_try\"") >&5
20654   (eval $ac_try) 2>&5
20655   ac_status=$?
20656   echo "$as_me:20656: \$? = $ac_status" >&5
20657   (exit "$ac_status"); }; }; then
20658   LIBS=$ac_save_LIBS
20659 # We can link X programs with no special library path.
20660 ac_x_libraries=
20661 else
20662   echo "$as_me: failed program was:" >&5
20663 cat "conftest.$ac_ext" >&5
20664 LIBS=$ac_save_LIBS
20665 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20666 do
20667   # Don't even attempt the hair of trying to link an X program!
20668   for ac_extension in a so sl dylib dll; do
20669     if test -r "$ac_dir/libXt.$ac_extension"; then
20670       ac_x_libraries=$ac_dir
20671       break 2
20672     fi
20673   done
20674 done
20675 fi
20676 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20677 fi # $ac_x_libraries = no
20678
20679 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20680   # Didn't find X anywhere.  Cache the known absence of X.
20681   ac_cv_have_x="have_x=no"
20682 else
20683   # Record where we found X for the cache.
20684   ac_cv_have_x="have_x=yes \
20685                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20686 fi
20687 fi
20688
20689   fi
20690   eval "$ac_cv_have_x"
20691 fi # $with_x != no
20692
20693 if test "$have_x" != yes; then
20694   echo "$as_me:20694: result: $have_x" >&5
20695 echo "${ECHO_T}$have_x" >&6
20696   no_x=yes
20697 else
20698   # If each of the values was on the command line, it overrides each guess.
20699   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20700   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20701   # Update the cache value to reflect the command line values.
20702   ac_cv_have_x="have_x=yes \
20703                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20704   echo "$as_me:20704: result: libraries $x_libraries, headers $x_includes" >&5
20705 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20706 fi
20707
20708         if test "$no_x" = yes; then
20709   # Not all programs may use this symbol, but it does not hurt to define it.
20710
20711 cat >>confdefs.h <<\EOF
20712 #define X_DISPLAY_MISSING 1
20713 EOF
20714
20715   X_CFLAGS=
20716   X_PRE_LIBS=
20717   X_LIBS=
20718   X_EXTRA_LIBS=
20719 else
20720   if test -n "$x_includes"; then
20721     X_CFLAGS="$X_CFLAGS -I$x_includes"
20722   fi
20723
20724   # It would also be nice to do this for all -L options, not just this one.
20725   if test -n "$x_libraries"; then
20726     X_LIBS="$X_LIBS -L$x_libraries"
20727     # For Solaris; some versions of Sun CC require a space after -R and
20728     # others require no space.  Words are not sufficient . . . .
20729     case `(uname -sr) 2>/dev/null` in
20730     "SunOS 5"*)
20731       echo "$as_me:20731: checking whether -R must be followed by a space" >&5
20732 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20733       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20734       cat >"conftest.$ac_ext" <<_ACEOF
20735 #line 20735 "configure"
20736 #include "confdefs.h"
20737
20738 int
20739 main (void)
20740 {
20741
20742   ;
20743   return 0;
20744 }
20745 _ACEOF
20746 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20747 if { (eval echo "$as_me:20747: \"$ac_link\"") >&5
20748   (eval $ac_link) 2>&5
20749   ac_status=$?
20750   echo "$as_me:20750: \$? = $ac_status" >&5
20751   (exit "$ac_status"); } &&
20752          { ac_try='test -s "conftest$ac_exeext"'
20753   { (eval echo "$as_me:20753: \"$ac_try\"") >&5
20754   (eval $ac_try) 2>&5
20755   ac_status=$?
20756   echo "$as_me:20756: \$? = $ac_status" >&5
20757   (exit "$ac_status"); }; }; then
20758   ac_R_nospace=yes
20759 else
20760   echo "$as_me: failed program was:" >&5
20761 cat "conftest.$ac_ext" >&5
20762 ac_R_nospace=no
20763 fi
20764 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20765       if test $ac_R_nospace = yes; then
20766         echo "$as_me:20766: result: no" >&5
20767 echo "${ECHO_T}no" >&6
20768         X_LIBS="$X_LIBS -R$x_libraries"
20769       else
20770         LIBS="$ac_xsave_LIBS -R $x_libraries"
20771         cat >"conftest.$ac_ext" <<_ACEOF
20772 #line 20772 "configure"
20773 #include "confdefs.h"
20774
20775 int
20776 main (void)
20777 {
20778
20779   ;
20780   return 0;
20781 }
20782 _ACEOF
20783 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20784 if { (eval echo "$as_me:20784: \"$ac_link\"") >&5
20785   (eval $ac_link) 2>&5
20786   ac_status=$?
20787   echo "$as_me:20787: \$? = $ac_status" >&5
20788   (exit "$ac_status"); } &&
20789          { ac_try='test -s "conftest$ac_exeext"'
20790   { (eval echo "$as_me:20790: \"$ac_try\"") >&5
20791   (eval $ac_try) 2>&5
20792   ac_status=$?
20793   echo "$as_me:20793: \$? = $ac_status" >&5
20794   (exit "$ac_status"); }; }; then
20795   ac_R_space=yes
20796 else
20797   echo "$as_me: failed program was:" >&5
20798 cat "conftest.$ac_ext" >&5
20799 ac_R_space=no
20800 fi
20801 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20802         if test $ac_R_space = yes; then
20803           echo "$as_me:20803: result: yes" >&5
20804 echo "${ECHO_T}yes" >&6
20805           X_LIBS="$X_LIBS -R $x_libraries"
20806         else
20807           echo "$as_me:20807: result: neither works" >&5
20808 echo "${ECHO_T}neither works" >&6
20809         fi
20810       fi
20811       LIBS=$ac_xsave_LIBS
20812     esac
20813   fi
20814
20815   # Check for system-dependent libraries X programs must link with.
20816   # Do this before checking for the system-independent R6 libraries
20817   # (-lICE), since we may need -lsocket or whatever for X linking.
20818
20819   if test "$ISC" = yes; then
20820     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20821   else
20822     # Martyn Johnson says this is needed for Ultrix, if the X
20823     # libraries were built with DECnet support.  And Karl Berry says
20824     # the Alpha needs dnet_stub (dnet does not exist).
20825     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20826     cat >"conftest.$ac_ext" <<_ACEOF
20827 #line 20827 "configure"
20828 #include "confdefs.h"
20829
20830 /* Override any gcc2 internal prototype to avoid an error.  */
20831 #ifdef __cplusplus
20832 extern "C"
20833 #endif
20834 /* We use char because int might match the return type of a gcc2
20835    builtin and then its argument prototype would still apply.  */
20836 char XOpenDisplay ();
20837 int
20838 main (void)
20839 {
20840 XOpenDisplay ();
20841   ;
20842   return 0;
20843 }
20844 _ACEOF
20845 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20846 if { (eval echo "$as_me:20846: \"$ac_link\"") >&5
20847   (eval $ac_link) 2>&5
20848   ac_status=$?
20849   echo "$as_me:20849: \$? = $ac_status" >&5
20850   (exit "$ac_status"); } &&
20851          { ac_try='test -s "conftest$ac_exeext"'
20852   { (eval echo "$as_me:20852: \"$ac_try\"") >&5
20853   (eval $ac_try) 2>&5
20854   ac_status=$?
20855   echo "$as_me:20855: \$? = $ac_status" >&5
20856   (exit "$ac_status"); }; }; then
20857   :
20858 else
20859   echo "$as_me: failed program was:" >&5
20860 cat "conftest.$ac_ext" >&5
20861 echo "$as_me:20861: checking for dnet_ntoa in -ldnet" >&5
20862 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20863 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20864   echo $ECHO_N "(cached) $ECHO_C" >&6
20865 else
20866   ac_check_lib_save_LIBS=$LIBS
20867 LIBS="-ldnet  $LIBS"
20868 cat >"conftest.$ac_ext" <<_ACEOF
20869 #line 20869 "configure"
20870 #include "confdefs.h"
20871
20872 /* Override any gcc2 internal prototype to avoid an error.  */
20873 #ifdef __cplusplus
20874 extern "C"
20875 #endif
20876 /* We use char because int might match the return type of a gcc2
20877    builtin and then its argument prototype would still apply.  */
20878 char dnet_ntoa ();
20879 int
20880 main (void)
20881 {
20882 dnet_ntoa ();
20883   ;
20884   return 0;
20885 }
20886 _ACEOF
20887 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20888 if { (eval echo "$as_me:20888: \"$ac_link\"") >&5
20889   (eval $ac_link) 2>&5
20890   ac_status=$?
20891   echo "$as_me:20891: \$? = $ac_status" >&5
20892   (exit "$ac_status"); } &&
20893          { ac_try='test -s "conftest$ac_exeext"'
20894   { (eval echo "$as_me:20894: \"$ac_try\"") >&5
20895   (eval $ac_try) 2>&5
20896   ac_status=$?
20897   echo "$as_me:20897: \$? = $ac_status" >&5
20898   (exit "$ac_status"); }; }; then
20899   ac_cv_lib_dnet_dnet_ntoa=yes
20900 else
20901   echo "$as_me: failed program was:" >&5
20902 cat "conftest.$ac_ext" >&5
20903 ac_cv_lib_dnet_dnet_ntoa=no
20904 fi
20905 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20906 LIBS=$ac_check_lib_save_LIBS
20907 fi
20908 echo "$as_me:20908: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20909 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20910 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
20911   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20912 fi
20913
20914     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20915       echo "$as_me:20915: checking for dnet_ntoa in -ldnet_stub" >&5
20916 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20917 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20918   echo $ECHO_N "(cached) $ECHO_C" >&6
20919 else
20920   ac_check_lib_save_LIBS=$LIBS
20921 LIBS="-ldnet_stub  $LIBS"
20922 cat >"conftest.$ac_ext" <<_ACEOF
20923 #line 20923 "configure"
20924 #include "confdefs.h"
20925
20926 /* Override any gcc2 internal prototype to avoid an error.  */
20927 #ifdef __cplusplus
20928 extern "C"
20929 #endif
20930 /* We use char because int might match the return type of a gcc2
20931    builtin and then its argument prototype would still apply.  */
20932 char dnet_ntoa ();
20933 int
20934 main (void)
20935 {
20936 dnet_ntoa ();
20937   ;
20938   return 0;
20939 }
20940 _ACEOF
20941 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20942 if { (eval echo "$as_me:20942: \"$ac_link\"") >&5
20943   (eval $ac_link) 2>&5
20944   ac_status=$?
20945   echo "$as_me:20945: \$? = $ac_status" >&5
20946   (exit "$ac_status"); } &&
20947          { ac_try='test -s "conftest$ac_exeext"'
20948   { (eval echo "$as_me:20948: \"$ac_try\"") >&5
20949   (eval $ac_try) 2>&5
20950   ac_status=$?
20951   echo "$as_me:20951: \$? = $ac_status" >&5
20952   (exit "$ac_status"); }; }; then
20953   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20954 else
20955   echo "$as_me: failed program was:" >&5
20956 cat "conftest.$ac_ext" >&5
20957 ac_cv_lib_dnet_stub_dnet_ntoa=no
20958 fi
20959 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20960 LIBS=$ac_check_lib_save_LIBS
20961 fi
20962 echo "$as_me:20962: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20963 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20964 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
20965   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20966 fi
20967
20968     fi
20969 fi
20970 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20971     LIBS="$ac_xsave_LIBS"
20972
20973     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20974     # to get the SysV transport functions.
20975     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20976     # needs -lnsl.
20977     # The nsl library prevents programs from opening the X display
20978     # on Irix 5.2, according to T.E. Dickey.
20979     # The functions gethostbyname, getservbyname, and inet_addr are
20980     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20981     echo "$as_me:20981: checking for gethostbyname" >&5
20982 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20983 if test "${ac_cv_func_gethostbyname+set}" = set; then
20984   echo $ECHO_N "(cached) $ECHO_C" >&6
20985 else
20986   cat >"conftest.$ac_ext" <<_ACEOF
20987 #line 20987 "configure"
20988 #include "confdefs.h"
20989 #define gethostbyname autoconf_temporary
20990 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20991 #undef gethostbyname
20992
20993 #ifdef __cplusplus
20994 extern "C"
20995 #endif
20996
20997 /* We use char because int might match the return type of a gcc2
20998    builtin and then its argument prototype would still apply.  */
20999 char gethostbyname (void);
21000
21001 int
21002 main (void)
21003 {
21004
21005 /* The GNU C library defines stubs for functions which it implements
21006     to always fail with ENOSYS.  Some functions are actually named
21007     something starting with __ and the normal name is an alias.  */
21008 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21009 #error found stub for gethostbyname
21010 #endif
21011
21012         return gethostbyname ();
21013   ;
21014   return 0;
21015 }
21016 _ACEOF
21017 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21018 if { (eval echo "$as_me:21018: \"$ac_link\"") >&5
21019   (eval $ac_link) 2>&5
21020   ac_status=$?
21021   echo "$as_me:21021: \$? = $ac_status" >&5
21022   (exit "$ac_status"); } &&
21023          { ac_try='test -s "conftest$ac_exeext"'
21024   { (eval echo "$as_me:21024: \"$ac_try\"") >&5
21025   (eval $ac_try) 2>&5
21026   ac_status=$?
21027   echo "$as_me:21027: \$? = $ac_status" >&5
21028   (exit "$ac_status"); }; }; then
21029   ac_cv_func_gethostbyname=yes
21030 else
21031   echo "$as_me: failed program was:" >&5
21032 cat "conftest.$ac_ext" >&5
21033 ac_cv_func_gethostbyname=no
21034 fi
21035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21036 fi
21037 echo "$as_me:21037: result: $ac_cv_func_gethostbyname" >&5
21038 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21039
21040     if test $ac_cv_func_gethostbyname = no; then
21041       echo "$as_me:21041: checking for gethostbyname in -lnsl" >&5
21042 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21043 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21044   echo $ECHO_N "(cached) $ECHO_C" >&6
21045 else
21046   ac_check_lib_save_LIBS=$LIBS
21047 LIBS="-lnsl  $LIBS"
21048 cat >"conftest.$ac_ext" <<_ACEOF
21049 #line 21049 "configure"
21050 #include "confdefs.h"
21051
21052 /* Override any gcc2 internal prototype to avoid an error.  */
21053 #ifdef __cplusplus
21054 extern "C"
21055 #endif
21056 /* We use char because int might match the return type of a gcc2
21057    builtin and then its argument prototype would still apply.  */
21058 char gethostbyname ();
21059 int
21060 main (void)
21061 {
21062 gethostbyname ();
21063   ;
21064   return 0;
21065 }
21066 _ACEOF
21067 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21068 if { (eval echo "$as_me:21068: \"$ac_link\"") >&5
21069   (eval $ac_link) 2>&5
21070   ac_status=$?
21071   echo "$as_me:21071: \$? = $ac_status" >&5
21072   (exit "$ac_status"); } &&
21073          { ac_try='test -s "conftest$ac_exeext"'
21074   { (eval echo "$as_me:21074: \"$ac_try\"") >&5
21075   (eval $ac_try) 2>&5
21076   ac_status=$?
21077   echo "$as_me:21077: \$? = $ac_status" >&5
21078   (exit "$ac_status"); }; }; then
21079   ac_cv_lib_nsl_gethostbyname=yes
21080 else
21081   echo "$as_me: failed program was:" >&5
21082 cat "conftest.$ac_ext" >&5
21083 ac_cv_lib_nsl_gethostbyname=no
21084 fi
21085 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21086 LIBS=$ac_check_lib_save_LIBS
21087 fi
21088 echo "$as_me:21088: result: $ac_cv_lib_nsl_gethostbyname" >&5
21089 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21090 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21091   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21092 fi
21093
21094       if test $ac_cv_lib_nsl_gethostbyname = no; then
21095         echo "$as_me:21095: checking for gethostbyname in -lbsd" >&5
21096 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21097 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21098   echo $ECHO_N "(cached) $ECHO_C" >&6
21099 else
21100   ac_check_lib_save_LIBS=$LIBS
21101 LIBS="-lbsd  $LIBS"
21102 cat >"conftest.$ac_ext" <<_ACEOF
21103 #line 21103 "configure"
21104 #include "confdefs.h"
21105
21106 /* Override any gcc2 internal prototype to avoid an error.  */
21107 #ifdef __cplusplus
21108 extern "C"
21109 #endif
21110 /* We use char because int might match the return type of a gcc2
21111    builtin and then its argument prototype would still apply.  */
21112 char gethostbyname ();
21113 int
21114 main (void)
21115 {
21116 gethostbyname ();
21117   ;
21118   return 0;
21119 }
21120 _ACEOF
21121 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21122 if { (eval echo "$as_me:21122: \"$ac_link\"") >&5
21123   (eval $ac_link) 2>&5
21124   ac_status=$?
21125   echo "$as_me:21125: \$? = $ac_status" >&5
21126   (exit "$ac_status"); } &&
21127          { ac_try='test -s "conftest$ac_exeext"'
21128   { (eval echo "$as_me:21128: \"$ac_try\"") >&5
21129   (eval $ac_try) 2>&5
21130   ac_status=$?
21131   echo "$as_me:21131: \$? = $ac_status" >&5
21132   (exit "$ac_status"); }; }; then
21133   ac_cv_lib_bsd_gethostbyname=yes
21134 else
21135   echo "$as_me: failed program was:" >&5
21136 cat "conftest.$ac_ext" >&5
21137 ac_cv_lib_bsd_gethostbyname=no
21138 fi
21139 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21140 LIBS=$ac_check_lib_save_LIBS
21141 fi
21142 echo "$as_me:21142: result: $ac_cv_lib_bsd_gethostbyname" >&5
21143 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21144 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21145   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21146 fi
21147
21148       fi
21149     fi
21150
21151     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21152     # socket/setsockopt and other routines are undefined under SCO ODT
21153     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21154     # on later versions), says Simon Leinen: it contains gethostby*
21155     # variants that don't use the nameserver (or something).  -lsocket
21156     # must be given before -lnsl if both are needed.  We assume that
21157     # if connect needs -lnsl, so does gethostbyname.
21158     echo "$as_me:21158: checking for connect" >&5
21159 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21160 if test "${ac_cv_func_connect+set}" = set; then
21161   echo $ECHO_N "(cached) $ECHO_C" >&6
21162 else
21163   cat >"conftest.$ac_ext" <<_ACEOF
21164 #line 21164 "configure"
21165 #include "confdefs.h"
21166 #define connect autoconf_temporary
21167 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21168 #undef connect
21169
21170 #ifdef __cplusplus
21171 extern "C"
21172 #endif
21173
21174 /* We use char because int might match the return type of a gcc2
21175    builtin and then its argument prototype would still apply.  */
21176 char connect (void);
21177
21178 int
21179 main (void)
21180 {
21181
21182 /* The GNU C library defines stubs for functions which it implements
21183     to always fail with ENOSYS.  Some functions are actually named
21184     something starting with __ and the normal name is an alias.  */
21185 #if defined (__stub_connect) || defined (__stub___connect)
21186 #error found stub for connect
21187 #endif
21188
21189         return connect ();
21190   ;
21191   return 0;
21192 }
21193 _ACEOF
21194 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21195 if { (eval echo "$as_me:21195: \"$ac_link\"") >&5
21196   (eval $ac_link) 2>&5
21197   ac_status=$?
21198   echo "$as_me:21198: \$? = $ac_status" >&5
21199   (exit "$ac_status"); } &&
21200          { ac_try='test -s "conftest$ac_exeext"'
21201   { (eval echo "$as_me:21201: \"$ac_try\"") >&5
21202   (eval $ac_try) 2>&5
21203   ac_status=$?
21204   echo "$as_me:21204: \$? = $ac_status" >&5
21205   (exit "$ac_status"); }; }; then
21206   ac_cv_func_connect=yes
21207 else
21208   echo "$as_me: failed program was:" >&5
21209 cat "conftest.$ac_ext" >&5
21210 ac_cv_func_connect=no
21211 fi
21212 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21213 fi
21214 echo "$as_me:21214: result: $ac_cv_func_connect" >&5
21215 echo "${ECHO_T}$ac_cv_func_connect" >&6
21216
21217     if test $ac_cv_func_connect = no; then
21218       echo "$as_me:21218: checking for connect in -lsocket" >&5
21219 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21220 if test "${ac_cv_lib_socket_connect+set}" = set; then
21221   echo $ECHO_N "(cached) $ECHO_C" >&6
21222 else
21223   ac_check_lib_save_LIBS=$LIBS
21224 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21225 cat >"conftest.$ac_ext" <<_ACEOF
21226 #line 21226 "configure"
21227 #include "confdefs.h"
21228
21229 /* Override any gcc2 internal prototype to avoid an error.  */
21230 #ifdef __cplusplus
21231 extern "C"
21232 #endif
21233 /* We use char because int might match the return type of a gcc2
21234    builtin and then its argument prototype would still apply.  */
21235 char connect ();
21236 int
21237 main (void)
21238 {
21239 connect ();
21240   ;
21241   return 0;
21242 }
21243 _ACEOF
21244 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21245 if { (eval echo "$as_me:21245: \"$ac_link\"") >&5
21246   (eval $ac_link) 2>&5
21247   ac_status=$?
21248   echo "$as_me:21248: \$? = $ac_status" >&5
21249   (exit "$ac_status"); } &&
21250          { ac_try='test -s "conftest$ac_exeext"'
21251   { (eval echo "$as_me:21251: \"$ac_try\"") >&5
21252   (eval $ac_try) 2>&5
21253   ac_status=$?
21254   echo "$as_me:21254: \$? = $ac_status" >&5
21255   (exit "$ac_status"); }; }; then
21256   ac_cv_lib_socket_connect=yes
21257 else
21258   echo "$as_me: failed program was:" >&5
21259 cat "conftest.$ac_ext" >&5
21260 ac_cv_lib_socket_connect=no
21261 fi
21262 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21263 LIBS=$ac_check_lib_save_LIBS
21264 fi
21265 echo "$as_me:21265: result: $ac_cv_lib_socket_connect" >&5
21266 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21267 if test "$ac_cv_lib_socket_connect" = yes; then
21268   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21269 fi
21270
21271     fi
21272
21273     # Guillermo Gomez says -lposix is necessary on A/UX.
21274     echo "$as_me:21274: checking for remove" >&5
21275 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21276 if test "${ac_cv_func_remove+set}" = set; then
21277   echo $ECHO_N "(cached) $ECHO_C" >&6
21278 else
21279   cat >"conftest.$ac_ext" <<_ACEOF
21280 #line 21280 "configure"
21281 #include "confdefs.h"
21282 #define remove autoconf_temporary
21283 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21284 #undef remove
21285
21286 #ifdef __cplusplus
21287 extern "C"
21288 #endif
21289
21290 /* We use char because int might match the return type of a gcc2
21291    builtin and then its argument prototype would still apply.  */
21292 char remove (void);
21293
21294 int
21295 main (void)
21296 {
21297
21298 /* The GNU C library defines stubs for functions which it implements
21299     to always fail with ENOSYS.  Some functions are actually named
21300     something starting with __ and the normal name is an alias.  */
21301 #if defined (__stub_remove) || defined (__stub___remove)
21302 #error found stub for remove
21303 #endif
21304
21305         return remove ();
21306   ;
21307   return 0;
21308 }
21309 _ACEOF
21310 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21311 if { (eval echo "$as_me:21311: \"$ac_link\"") >&5
21312   (eval $ac_link) 2>&5
21313   ac_status=$?
21314   echo "$as_me:21314: \$? = $ac_status" >&5
21315   (exit "$ac_status"); } &&
21316          { ac_try='test -s "conftest$ac_exeext"'
21317   { (eval echo "$as_me:21317: \"$ac_try\"") >&5
21318   (eval $ac_try) 2>&5
21319   ac_status=$?
21320   echo "$as_me:21320: \$? = $ac_status" >&5
21321   (exit "$ac_status"); }; }; then
21322   ac_cv_func_remove=yes
21323 else
21324   echo "$as_me: failed program was:" >&5
21325 cat "conftest.$ac_ext" >&5
21326 ac_cv_func_remove=no
21327 fi
21328 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21329 fi
21330 echo "$as_me:21330: result: $ac_cv_func_remove" >&5
21331 echo "${ECHO_T}$ac_cv_func_remove" >&6
21332
21333     if test $ac_cv_func_remove = no; then
21334       echo "$as_me:21334: checking for remove in -lposix" >&5
21335 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21336 if test "${ac_cv_lib_posix_remove+set}" = set; then
21337   echo $ECHO_N "(cached) $ECHO_C" >&6
21338 else
21339   ac_check_lib_save_LIBS=$LIBS
21340 LIBS="-lposix  $LIBS"
21341 cat >"conftest.$ac_ext" <<_ACEOF
21342 #line 21342 "configure"
21343 #include "confdefs.h"
21344
21345 /* Override any gcc2 internal prototype to avoid an error.  */
21346 #ifdef __cplusplus
21347 extern "C"
21348 #endif
21349 /* We use char because int might match the return type of a gcc2
21350    builtin and then its argument prototype would still apply.  */
21351 char remove ();
21352 int
21353 main (void)
21354 {
21355 remove ();
21356   ;
21357   return 0;
21358 }
21359 _ACEOF
21360 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21361 if { (eval echo "$as_me:21361: \"$ac_link\"") >&5
21362   (eval $ac_link) 2>&5
21363   ac_status=$?
21364   echo "$as_me:21364: \$? = $ac_status" >&5
21365   (exit "$ac_status"); } &&
21366          { ac_try='test -s "conftest$ac_exeext"'
21367   { (eval echo "$as_me:21367: \"$ac_try\"") >&5
21368   (eval $ac_try) 2>&5
21369   ac_status=$?
21370   echo "$as_me:21370: \$? = $ac_status" >&5
21371   (exit "$ac_status"); }; }; then
21372   ac_cv_lib_posix_remove=yes
21373 else
21374   echo "$as_me: failed program was:" >&5
21375 cat "conftest.$ac_ext" >&5
21376 ac_cv_lib_posix_remove=no
21377 fi
21378 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21379 LIBS=$ac_check_lib_save_LIBS
21380 fi
21381 echo "$as_me:21381: result: $ac_cv_lib_posix_remove" >&5
21382 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21383 if test "$ac_cv_lib_posix_remove" = yes; then
21384   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21385 fi
21386
21387     fi
21388
21389     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21390     echo "$as_me:21390: checking for shmat" >&5
21391 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21392 if test "${ac_cv_func_shmat+set}" = set; then
21393   echo $ECHO_N "(cached) $ECHO_C" >&6
21394 else
21395   cat >"conftest.$ac_ext" <<_ACEOF
21396 #line 21396 "configure"
21397 #include "confdefs.h"
21398 #define shmat autoconf_temporary
21399 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21400 #undef shmat
21401
21402 #ifdef __cplusplus
21403 extern "C"
21404 #endif
21405
21406 /* We use char because int might match the return type of a gcc2
21407    builtin and then its argument prototype would still apply.  */
21408 char shmat (void);
21409
21410 int
21411 main (void)
21412 {
21413
21414 /* The GNU C library defines stubs for functions which it implements
21415     to always fail with ENOSYS.  Some functions are actually named
21416     something starting with __ and the normal name is an alias.  */
21417 #if defined (__stub_shmat) || defined (__stub___shmat)
21418 #error found stub for shmat
21419 #endif
21420
21421         return shmat ();
21422   ;
21423   return 0;
21424 }
21425 _ACEOF
21426 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21427 if { (eval echo "$as_me:21427: \"$ac_link\"") >&5
21428   (eval $ac_link) 2>&5
21429   ac_status=$?
21430   echo "$as_me:21430: \$? = $ac_status" >&5
21431   (exit "$ac_status"); } &&
21432          { ac_try='test -s "conftest$ac_exeext"'
21433   { (eval echo "$as_me:21433: \"$ac_try\"") >&5
21434   (eval $ac_try) 2>&5
21435   ac_status=$?
21436   echo "$as_me:21436: \$? = $ac_status" >&5
21437   (exit "$ac_status"); }; }; then
21438   ac_cv_func_shmat=yes
21439 else
21440   echo "$as_me: failed program was:" >&5
21441 cat "conftest.$ac_ext" >&5
21442 ac_cv_func_shmat=no
21443 fi
21444 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21445 fi
21446 echo "$as_me:21446: result: $ac_cv_func_shmat" >&5
21447 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21448
21449     if test $ac_cv_func_shmat = no; then
21450       echo "$as_me:21450: checking for shmat in -lipc" >&5
21451 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21452 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21453   echo $ECHO_N "(cached) $ECHO_C" >&6
21454 else
21455   ac_check_lib_save_LIBS=$LIBS
21456 LIBS="-lipc  $LIBS"
21457 cat >"conftest.$ac_ext" <<_ACEOF
21458 #line 21458 "configure"
21459 #include "confdefs.h"
21460
21461 /* Override any gcc2 internal prototype to avoid an error.  */
21462 #ifdef __cplusplus
21463 extern "C"
21464 #endif
21465 /* We use char because int might match the return type of a gcc2
21466    builtin and then its argument prototype would still apply.  */
21467 char shmat ();
21468 int
21469 main (void)
21470 {
21471 shmat ();
21472   ;
21473   return 0;
21474 }
21475 _ACEOF
21476 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21477 if { (eval echo "$as_me:21477: \"$ac_link\"") >&5
21478   (eval $ac_link) 2>&5
21479   ac_status=$?
21480   echo "$as_me:21480: \$? = $ac_status" >&5
21481   (exit "$ac_status"); } &&
21482          { ac_try='test -s "conftest$ac_exeext"'
21483   { (eval echo "$as_me:21483: \"$ac_try\"") >&5
21484   (eval $ac_try) 2>&5
21485   ac_status=$?
21486   echo "$as_me:21486: \$? = $ac_status" >&5
21487   (exit "$ac_status"); }; }; then
21488   ac_cv_lib_ipc_shmat=yes
21489 else
21490   echo "$as_me: failed program was:" >&5
21491 cat "conftest.$ac_ext" >&5
21492 ac_cv_lib_ipc_shmat=no
21493 fi
21494 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21495 LIBS=$ac_check_lib_save_LIBS
21496 fi
21497 echo "$as_me:21497: result: $ac_cv_lib_ipc_shmat" >&5
21498 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21499 if test "$ac_cv_lib_ipc_shmat" = yes; then
21500   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21501 fi
21502
21503     fi
21504   fi
21505
21506   # Check for libraries that X11R6 Xt/Xaw programs need.
21507   ac_save_LDFLAGS=$LDFLAGS
21508   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21509   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21510   # check for ICE first), but we must link in the order -lSM -lICE or
21511   # we get undefined symbols.  So assume we have SM if we have ICE.
21512   # These have to be linked with before -lX11, unlike the other
21513   # libraries we check for below, so use a different variable.
21514   # John Interrante, Karl Berry
21515   echo "$as_me:21515: checking for IceConnectionNumber in -lICE" >&5
21516 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21517 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21518   echo $ECHO_N "(cached) $ECHO_C" >&6
21519 else
21520   ac_check_lib_save_LIBS=$LIBS
21521 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21522 cat >"conftest.$ac_ext" <<_ACEOF
21523 #line 21523 "configure"
21524 #include "confdefs.h"
21525
21526 /* Override any gcc2 internal prototype to avoid an error.  */
21527 #ifdef __cplusplus
21528 extern "C"
21529 #endif
21530 /* We use char because int might match the return type of a gcc2
21531    builtin and then its argument prototype would still apply.  */
21532 char IceConnectionNumber ();
21533 int
21534 main (void)
21535 {
21536 IceConnectionNumber ();
21537   ;
21538   return 0;
21539 }
21540 _ACEOF
21541 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21542 if { (eval echo "$as_me:21542: \"$ac_link\"") >&5
21543   (eval $ac_link) 2>&5
21544   ac_status=$?
21545   echo "$as_me:21545: \$? = $ac_status" >&5
21546   (exit "$ac_status"); } &&
21547          { ac_try='test -s "conftest$ac_exeext"'
21548   { (eval echo "$as_me:21548: \"$ac_try\"") >&5
21549   (eval $ac_try) 2>&5
21550   ac_status=$?
21551   echo "$as_me:21551: \$? = $ac_status" >&5
21552   (exit "$ac_status"); }; }; then
21553   ac_cv_lib_ICE_IceConnectionNumber=yes
21554 else
21555   echo "$as_me: failed program was:" >&5
21556 cat "conftest.$ac_ext" >&5
21557 ac_cv_lib_ICE_IceConnectionNumber=no
21558 fi
21559 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21560 LIBS=$ac_check_lib_save_LIBS
21561 fi
21562 echo "$as_me:21562: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21563 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21564 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21565   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21566 fi
21567
21568   LDFLAGS=$ac_save_LDFLAGS
21569
21570 fi
21571
21572 fi
21573
21574 if test "$GCC" = yes || test "$GXX" = yes
21575 then
21576
21577 if test "$GCC" = yes || test "$GXX" = yes
21578 then
21579         case $CFLAGS in
21580         (*-Werror=*)
21581                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21582
21583 echo "${as_me:-configure}:21583: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21584
21585                 cf_temp_flags=
21586                 for cf_temp_scan in $CFLAGS
21587                 do
21588                         case "x$cf_temp_scan" in
21589                         (x-Werror=*)
21590
21591         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21592         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21593
21594                                 ;;
21595                         (*)
21596
21597         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21598         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21599
21600                                 ;;
21601                         esac
21602                 done
21603                 CFLAGS="$cf_temp_flags"
21604                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21605
21606 echo "${as_me:-configure}:21606: testing ... fixed $CFLAGS ..." 1>&5
21607
21608                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21609
21610 echo "${as_me:-configure}:21610: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21611
21612                 ;;
21613         esac
21614 fi
21615
21616 if test "$GCC" = yes || test "$GXX" = yes
21617 then
21618         case $CPPFLAGS in
21619         (*-Werror=*)
21620                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21621
21622 echo "${as_me:-configure}:21622: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21623
21624                 cf_temp_flags=
21625                 for cf_temp_scan in $CPPFLAGS
21626                 do
21627                         case "x$cf_temp_scan" in
21628                         (x-Werror=*)
21629
21630         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21631         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21632
21633                                 ;;
21634                         (*)
21635
21636         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21637         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21638
21639                                 ;;
21640                         esac
21641                 done
21642                 CPPFLAGS="$cf_temp_flags"
21643                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21644
21645 echo "${as_me:-configure}:21645: testing ... fixed $CPPFLAGS ..." 1>&5
21646
21647                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21648
21649 echo "${as_me:-configure}:21649: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21650
21651                 ;;
21652         esac
21653 fi
21654
21655 if test "$GCC" = yes || test "$GXX" = yes
21656 then
21657         case $LDFLAGS in
21658         (*-Werror=*)
21659                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21660
21661 echo "${as_me:-configure}:21661: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21662
21663                 cf_temp_flags=
21664                 for cf_temp_scan in $LDFLAGS
21665                 do
21666                         case "x$cf_temp_scan" in
21667                         (x-Werror=*)
21668
21669         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21670         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21671
21672                                 ;;
21673                         (*)
21674
21675         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21676         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21677
21678                                 ;;
21679                         esac
21680                 done
21681                 LDFLAGS="$cf_temp_flags"
21682                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21683
21684 echo "${as_me:-configure}:21684: testing ... fixed $LDFLAGS ..." 1>&5
21685
21686                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21687
21688 echo "${as_me:-configure}:21688: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21689
21690                 ;;
21691         esac
21692 fi
21693
21694 echo "$as_me:21694: checking if you want to turn on gcc warnings" >&5
21695 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21696
21697 # Check whether --enable-warnings or --disable-warnings was given.
21698 if test "${enable_warnings+set}" = set; then
21699   enableval="$enable_warnings"
21700   test "$enableval" != yes && enableval=no
21701         if test "$enableval" != "no" ; then
21702     enable_warnings=yes
21703         else
21704                 enable_warnings=no
21705         fi
21706 else
21707   enableval=no
21708         enable_warnings=no
21709
21710 fi;
21711 echo "$as_me:21711: result: $enable_warnings" >&5
21712 echo "${ECHO_T}$enable_warnings" >&6
21713 if test "$enable_warnings" = "yes"
21714 then
21715
21716 if test "$GCC" = yes || test "$GXX" = yes
21717 then
21718 cat > conftest.i <<EOF
21719 #ifndef GCC_PRINTF
21720 #define GCC_PRINTF 0
21721 #endif
21722 #ifndef GCC_SCANF
21723 #define GCC_SCANF 0
21724 #endif
21725 #ifndef GCC_NORETURN
21726 #define GCC_NORETURN /* nothing */
21727 #endif
21728 #ifndef GCC_UNUSED
21729 #define GCC_UNUSED /* nothing */
21730 #endif
21731 EOF
21732 if test "$GCC" = yes
21733 then
21734         { echo "$as_me:21734: checking for $CC __attribute__ directives..." >&5
21735 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21736 cat > "conftest.$ac_ext" <<EOF
21737 #line 21737 "${as_me:-configure}"
21738 #include "confdefs.h"
21739 #include "conftest.h"
21740 #include "conftest.i"
21741 #if     GCC_PRINTF
21742 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21743 #else
21744 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21745 #endif
21746 #if     GCC_SCANF
21747 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21748 #else
21749 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21750 #endif
21751 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21752 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
21753 extern GCC_NORETURN void foo(void);
21754 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21755 EOF
21756         cf_printf_attribute=no
21757         cf_scanf_attribute=no
21758         for cf_attribute in scanf printf unused noreturn
21759         do
21760
21761 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21762
21763                 cf_directive="__attribute__(($cf_attribute))"
21764                 echo "checking for $CC $cf_directive" 1>&5
21765
21766                 case "$cf_attribute" in
21767                 (printf)
21768                         cf_printf_attribute=yes
21769                         cat >conftest.h <<EOF
21770 #define GCC_$cf_ATTRIBUTE 1
21771 EOF
21772                         ;;
21773                 (scanf)
21774                         cf_scanf_attribute=yes
21775                         cat >conftest.h <<EOF
21776 #define GCC_$cf_ATTRIBUTE 1
21777 EOF
21778                         ;;
21779                 (*)
21780                         cat >conftest.h <<EOF
21781 #define GCC_$cf_ATTRIBUTE $cf_directive
21782 EOF
21783                         ;;
21784                 esac
21785
21786                 if { (eval echo "$as_me:21786: \"$ac_compile\"") >&5
21787   (eval $ac_compile) 2>&5
21788   ac_status=$?
21789   echo "$as_me:21789: \$? = $ac_status" >&5
21790   (exit "$ac_status"); }; then
21791                         test -n "$verbose" && echo "$as_me:21791: result: ... $cf_attribute" >&5
21792 echo "${ECHO_T}... $cf_attribute" >&6
21793                         cat conftest.h >>confdefs.h
21794                         case "$cf_attribute" in
21795                         (noreturn)
21796
21797 cat >>confdefs.h <<EOF
21798 #define GCC_NORETURN $cf_directive
21799 EOF
21800
21801                                 ;;
21802                         (printf)
21803                                 cf_value='/* nothing */'
21804                                 if test "$cf_printf_attribute" != no ; then
21805                                         cf_value='__attribute__((format(printf,fmt,var)))'
21806
21807 cat >>confdefs.h <<\EOF
21808 #define GCC_PRINTF 1
21809 EOF
21810
21811                                 fi
21812
21813 cat >>confdefs.h <<EOF
21814 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21815 EOF
21816
21817                                 ;;
21818                         (scanf)
21819                                 cf_value='/* nothing */'
21820                                 if test "$cf_scanf_attribute" != no ; then
21821                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21822
21823 cat >>confdefs.h <<\EOF
21824 #define GCC_SCANF 1
21825 EOF
21826
21827                                 fi
21828
21829 cat >>confdefs.h <<EOF
21830 #define GCC_SCANFLIKE(fmt,var) $cf_value
21831 EOF
21832
21833                                 ;;
21834                         (unused)
21835
21836 cat >>confdefs.h <<EOF
21837 #define GCC_UNUSED $cf_directive
21838 EOF
21839
21840                                 ;;
21841                         esac
21842                 fi
21843         done
21844 else
21845         ${FGREP-fgrep} define conftest.i >>confdefs.h
21846 fi
21847 rm -rf ./conftest*
21848 fi
21849
21850 if test "x$have_x" = xyes; then
21851
21852 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21853 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21854 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21855 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21856 for cf_X_CFLAGS in $X_CFLAGS
21857 do
21858         case "x$cf_X_CFLAGS" in
21859         x-[IUD]*)
21860                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21861                 ;;
21862         *)
21863                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21864                 ;;
21865         esac
21866 done
21867
21868 cat >"conftest.$ac_ext" <<_ACEOF
21869 #line 21869 "configure"
21870 #include "confdefs.h"
21871
21872 #include <stdlib.h>
21873 #include <X11/Intrinsic.h>
21874
21875 int
21876 main (void)
21877 {
21878 String foo = malloc(1); free((void*)foo)
21879   ;
21880   return 0;
21881 }
21882 _ACEOF
21883 rm -f "conftest.$ac_objext"
21884 if { (eval echo "$as_me:21884: \"$ac_compile\"") >&5
21885   (eval $ac_compile) 2>&5
21886   ac_status=$?
21887   echo "$as_me:21887: \$? = $ac_status" >&5
21888   (exit "$ac_status"); } &&
21889          { ac_try='test -s "conftest.$ac_objext"'
21890   { (eval echo "$as_me:21890: \"$ac_try\"") >&5
21891   (eval $ac_try) 2>&5
21892   ac_status=$?
21893   echo "$as_me:21893: \$? = $ac_status" >&5
21894   (exit "$ac_status"); }; }; then
21895
21896 echo "$as_me:21896: checking for X11/Xt const-feature" >&5
21897 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21898 if test "${cf_cv_const_x_string+set}" = set; then
21899   echo $ECHO_N "(cached) $ECHO_C" >&6
21900 else
21901
21902         cat >"conftest.$ac_ext" <<_ACEOF
21903 #line 21903 "configure"
21904 #include "confdefs.h"
21905
21906 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21907 #undef  XTSTRINGDEFINES /* X11R5 and later */
21908 #include <stdlib.h>
21909 #include <X11/Intrinsic.h>
21910
21911 int
21912 main (void)
21913 {
21914 String foo = malloc(1); *foo = 0
21915   ;
21916   return 0;
21917 }
21918 _ACEOF
21919 rm -f "conftest.$ac_objext"
21920 if { (eval echo "$as_me:21920: \"$ac_compile\"") >&5
21921   (eval $ac_compile) 2>&5
21922   ac_status=$?
21923   echo "$as_me:21923: \$? = $ac_status" >&5
21924   (exit "$ac_status"); } &&
21925          { ac_try='test -s "conftest.$ac_objext"'
21926   { (eval echo "$as_me:21926: \"$ac_try\"") >&5
21927   (eval $ac_try) 2>&5
21928   ac_status=$?
21929   echo "$as_me:21929: \$? = $ac_status" >&5
21930   (exit "$ac_status"); }; }; then
21931
21932                         cf_cv_const_x_string=no
21933
21934 else
21935   echo "$as_me: failed program was:" >&5
21936 cat "conftest.$ac_ext" >&5
21937
21938                         cf_cv_const_x_string=yes
21939
21940 fi
21941 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21942
21943 fi
21944 echo "$as_me:21944: result: $cf_cv_const_x_string" >&5
21945 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21946
21947 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21948 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21949 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21950
21951 case "$cf_cv_const_x_string" in
21952 (no)
21953
21954         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21955         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21956
21957         ;;
21958 (*)
21959
21960         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21961         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21962
21963         ;;
21964 esac
21965
21966 else
21967   echo "$as_me: failed program was:" >&5
21968 cat "conftest.$ac_ext" >&5
21969 fi
21970 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21971  fi
21972 cat > "conftest.$ac_ext" <<EOF
21973 #line 21973 "${as_me:-configure}"
21974 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21975 EOF
21976 if test "$INTEL_COMPILER" = yes
21977 then
21978 # The "-wdXXX" options suppress warnings:
21979 # remark #1419: external declaration in primary source file
21980 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21981 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21982 # remark #193: zero used for undefined preprocessing identifier
21983 # remark #593: variable "curs_sb_left_arrow" was set but never used
21984 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21985 # remark #869: parameter "tw" was never referenced
21986 # remark #981: operands are evaluated in unspecified order
21987 # warning #279: controlling expression is constant
21988
21989         { echo "$as_me:21989: checking for $CC warning options..." >&5
21990 echo "$as_me: checking for $CC warning options..." >&6;}
21991         cf_save_CFLAGS="$CFLAGS"
21992         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21993         for cf_opt in \
21994                 wd1419 \
21995                 wd1683 \
21996                 wd1684 \
21997                 wd193 \
21998                 wd593 \
21999                 wd279 \
22000                 wd810 \
22001                 wd869 \
22002                 wd981
22003         do
22004                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22005                 if { (eval echo "$as_me:22005: \"$ac_compile\"") >&5
22006   (eval $ac_compile) 2>&5
22007   ac_status=$?
22008   echo "$as_me:22008: \$? = $ac_status" >&5
22009   (exit "$ac_status"); }; then
22010                         test -n "$verbose" && echo "$as_me:22010: result: ... -$cf_opt" >&5
22011 echo "${ECHO_T}... -$cf_opt" >&6
22012                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22013                 fi
22014         done
22015         CFLAGS="$cf_save_CFLAGS"
22016 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22017 then
22018         { echo "$as_me:22018: checking for $CC warning options..." >&5
22019 echo "$as_me: checking for $CC warning options..." >&6;}
22020         cf_save_CFLAGS="$CFLAGS"
22021         cf_warn_CONST=""
22022         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22023         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22024         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22025         for cf_opt in W Wall \
22026                 Wbad-function-cast \
22027                 Wcast-align \
22028                 Wcast-qual \
22029                 Wdeclaration-after-statement \
22030                 Wextra \
22031                 Winline \
22032                 Wmissing-declarations \
22033                 Wmissing-prototypes \
22034                 Wnested-externs \
22035                 Wpointer-arith \
22036                 Wshadow \
22037                 Wstrict-prototypes \
22038                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22039         do
22040                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22041                 if { (eval echo "$as_me:22041: \"$ac_compile\"") >&5
22042   (eval $ac_compile) 2>&5
22043   ac_status=$?
22044   echo "$as_me:22044: \$? = $ac_status" >&5
22045   (exit "$ac_status"); }; then
22046                         test -n "$verbose" && echo "$as_me:22046: result: ... -$cf_opt" >&5
22047 echo "${ECHO_T}... -$cf_opt" >&6
22048                         case "$cf_opt" in
22049                         (Winline)
22050                                 case "$GCC_VERSION" in
22051                                 ([34].*)
22052                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22053
22054 echo "${as_me:-configure}:22054: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22055
22056                                         continue;;
22057                                 esac
22058                                 ;;
22059                         (Wpointer-arith)
22060                                 case "$GCC_VERSION" in
22061                                 ([12].*)
22062                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22063
22064 echo "${as_me:-configure}:22064: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22065
22066                                         continue;;
22067                                 esac
22068                                 ;;
22069                         esac
22070                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22071                 fi
22072         done
22073         CFLAGS="$cf_save_CFLAGS"
22074 fi
22075 rm -rf ./conftest*
22076
22077 fi
22078
22079 fi
22080
22081 echo "$as_me:22081: checking if you want to use dmalloc for testing" >&5
22082 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22083
22084 # Check whether --with-dmalloc or --without-dmalloc was given.
22085 if test "${with_dmalloc+set}" = set; then
22086   withval="$with_dmalloc"
22087   case "x$withval" in
22088         (x|xno) ;;
22089         (*)
22090                 : "${with_cflags:=-g}"
22091                 : "${enable_leaks:=no}"
22092                 with_dmalloc=yes
22093
22094 cat >>confdefs.h <<EOF
22095 #define USE_DMALLOC 1
22096 EOF
22097
22098                 ;;
22099         esac
22100 else
22101   with_dmalloc=
22102 fi;
22103 echo "$as_me:22103: result: ${with_dmalloc:-no}" >&5
22104 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22105
22106 case ".$with_cflags" in
22107 (.*-g*)
22108         case .$CFLAGS in
22109         (.*-g*)
22110                 ;;
22111         (*)
22112
22113 cf_fix_cppflags=no
22114 cf_new_cflags=
22115 cf_new_cppflags=
22116 cf_new_extra_cppflags=
22117
22118 for cf_add_cflags in -g
22119 do
22120 case "$cf_fix_cppflags" in
22121 (no)
22122         case "$cf_add_cflags" in
22123         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22124                 case "$cf_add_cflags" in
22125                 (-D*)
22126                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22127
22128                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22129                                 && test -z "${cf_tst_cflags}" \
22130                                 && cf_fix_cppflags=yes
22131
22132                         if test "$cf_fix_cppflags" = yes ; then
22133
22134         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22135         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22136
22137                                 continue
22138                         elif test "${cf_tst_cflags}" = "\"'" ; then
22139
22140         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22141         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22142
22143                                 continue
22144                         fi
22145                         ;;
22146                 esac
22147                 case "$CPPFLAGS" in
22148                 (*$cf_add_cflags)
22149                         ;;
22150                 (*)
22151                         case "$cf_add_cflags" in
22152                         (-D*)
22153                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22154
22155 CPPFLAGS=`echo "$CPPFLAGS" | \
22156         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22157                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22158
22159                                 ;;
22160                         esac
22161
22162         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22163         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22164
22165                         ;;
22166                 esac
22167                 ;;
22168         (*)
22169
22170         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22171         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22172
22173                 ;;
22174         esac
22175         ;;
22176 (yes)
22177
22178         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22179         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22180
22181         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22182
22183         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22184                 && test -z "${cf_tst_cflags}" \
22185                 && cf_fix_cppflags=no
22186         ;;
22187 esac
22188 done
22189
22190 if test -n "$cf_new_cflags" ; then
22191
22192         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22193         CFLAGS="${CFLAGS}$cf_new_cflags"
22194
22195 fi
22196
22197 if test -n "$cf_new_cppflags" ; then
22198
22199         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22200         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22201
22202 fi
22203
22204 if test -n "$cf_new_extra_cppflags" ; then
22205
22206         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22207         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22208
22209 fi
22210
22211                 ;;
22212         esac
22213         ;;
22214 esac
22215
22216 if test "$with_dmalloc" = yes ; then
22217         echo "$as_me:22217: checking for dmalloc.h" >&5
22218 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22219 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22220   echo $ECHO_N "(cached) $ECHO_C" >&6
22221 else
22222   cat >"conftest.$ac_ext" <<_ACEOF
22223 #line 22223 "configure"
22224 #include "confdefs.h"
22225 #include <dmalloc.h>
22226 _ACEOF
22227 if { (eval echo "$as_me:22227: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22228   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22229   ac_status=$?
22230   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22231   rm -f conftest.er1
22232   cat conftest.err >&5
22233   echo "$as_me:22233: \$? = $ac_status" >&5
22234   (exit "$ac_status"); } >/dev/null; then
22235   if test -s conftest.err; then
22236     ac_cpp_err=$ac_c_preproc_warn_flag
22237   else
22238     ac_cpp_err=
22239   fi
22240 else
22241   ac_cpp_err=yes
22242 fi
22243 if test -z "$ac_cpp_err"; then
22244   ac_cv_header_dmalloc_h=yes
22245 else
22246   echo "$as_me: failed program was:" >&5
22247   cat "conftest.$ac_ext" >&5
22248   ac_cv_header_dmalloc_h=no
22249 fi
22250 rm -f conftest.err "conftest.$ac_ext"
22251 fi
22252 echo "$as_me:22252: result: $ac_cv_header_dmalloc_h" >&5
22253 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22254 if test "$ac_cv_header_dmalloc_h" = yes; then
22255
22256 echo "$as_me:22256: checking for dmalloc_debug in -ldmalloc" >&5
22257 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22258 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22259   echo $ECHO_N "(cached) $ECHO_C" >&6
22260 else
22261   ac_check_lib_save_LIBS=$LIBS
22262 LIBS="-ldmalloc  $LIBS"
22263 cat >"conftest.$ac_ext" <<_ACEOF
22264 #line 22264 "configure"
22265 #include "confdefs.h"
22266
22267 /* Override any gcc2 internal prototype to avoid an error.  */
22268 #ifdef __cplusplus
22269 extern "C"
22270 #endif
22271 /* We use char because int might match the return type of a gcc2
22272    builtin and then its argument prototype would still apply.  */
22273 char dmalloc_debug ();
22274 int
22275 main (void)
22276 {
22277 dmalloc_debug ();
22278   ;
22279   return 0;
22280 }
22281 _ACEOF
22282 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22283 if { (eval echo "$as_me:22283: \"$ac_link\"") >&5
22284   (eval $ac_link) 2>&5
22285   ac_status=$?
22286   echo "$as_me:22286: \$? = $ac_status" >&5
22287   (exit "$ac_status"); } &&
22288          { ac_try='test -s "conftest$ac_exeext"'
22289   { (eval echo "$as_me:22289: \"$ac_try\"") >&5
22290   (eval $ac_try) 2>&5
22291   ac_status=$?
22292   echo "$as_me:22292: \$? = $ac_status" >&5
22293   (exit "$ac_status"); }; }; then
22294   ac_cv_lib_dmalloc_dmalloc_debug=yes
22295 else
22296   echo "$as_me: failed program was:" >&5
22297 cat "conftest.$ac_ext" >&5
22298 ac_cv_lib_dmalloc_dmalloc_debug=no
22299 fi
22300 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22301 LIBS=$ac_check_lib_save_LIBS
22302 fi
22303 echo "$as_me:22303: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22304 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22305 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22306   cat >>confdefs.h <<EOF
22307 #define HAVE_LIBDMALLOC 1
22308 EOF
22309
22310   LIBS="-ldmalloc $LIBS"
22311
22312 fi
22313
22314 fi
22315
22316 fi
22317
22318 echo "$as_me:22318: checking if you want to use dbmalloc for testing" >&5
22319 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22320
22321 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22322 if test "${with_dbmalloc+set}" = set; then
22323   withval="$with_dbmalloc"
22324   case "x$withval" in
22325         (x|xno) ;;
22326         (*)
22327                 : "${with_cflags:=-g}"
22328                 : "${enable_leaks:=no}"
22329                 with_dbmalloc=yes
22330
22331 cat >>confdefs.h <<EOF
22332 #define USE_DBMALLOC 1
22333 EOF
22334
22335                 ;;
22336         esac
22337 else
22338   with_dbmalloc=
22339 fi;
22340 echo "$as_me:22340: result: ${with_dbmalloc:-no}" >&5
22341 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22342
22343 case ".$with_cflags" in
22344 (.*-g*)
22345         case .$CFLAGS in
22346         (.*-g*)
22347                 ;;
22348         (*)
22349
22350 cf_fix_cppflags=no
22351 cf_new_cflags=
22352 cf_new_cppflags=
22353 cf_new_extra_cppflags=
22354
22355 for cf_add_cflags in -g
22356 do
22357 case "$cf_fix_cppflags" in
22358 (no)
22359         case "$cf_add_cflags" in
22360         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22361                 case "$cf_add_cflags" in
22362                 (-D*)
22363                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22364
22365                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22366                                 && test -z "${cf_tst_cflags}" \
22367                                 && cf_fix_cppflags=yes
22368
22369                         if test "$cf_fix_cppflags" = yes ; then
22370
22371         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22372         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22373
22374                                 continue
22375                         elif test "${cf_tst_cflags}" = "\"'" ; then
22376
22377         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22378         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22379
22380                                 continue
22381                         fi
22382                         ;;
22383                 esac
22384                 case "$CPPFLAGS" in
22385                 (*$cf_add_cflags)
22386                         ;;
22387                 (*)
22388                         case "$cf_add_cflags" in
22389                         (-D*)
22390                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22391
22392 CPPFLAGS=`echo "$CPPFLAGS" | \
22393         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22394                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22395
22396                                 ;;
22397                         esac
22398
22399         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22400         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22401
22402                         ;;
22403                 esac
22404                 ;;
22405         (*)
22406
22407         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22408         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22409
22410                 ;;
22411         esac
22412         ;;
22413 (yes)
22414
22415         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22416         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22417
22418         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22419
22420         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22421                 && test -z "${cf_tst_cflags}" \
22422                 && cf_fix_cppflags=no
22423         ;;
22424 esac
22425 done
22426
22427 if test -n "$cf_new_cflags" ; then
22428
22429         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22430         CFLAGS="${CFLAGS}$cf_new_cflags"
22431
22432 fi
22433
22434 if test -n "$cf_new_cppflags" ; then
22435
22436         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22437         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22438
22439 fi
22440
22441 if test -n "$cf_new_extra_cppflags" ; then
22442
22443         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22444         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22445
22446 fi
22447
22448                 ;;
22449         esac
22450         ;;
22451 esac
22452
22453 if test "$with_dbmalloc" = yes ; then
22454         echo "$as_me:22454: checking for dbmalloc.h" >&5
22455 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22456 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22457   echo $ECHO_N "(cached) $ECHO_C" >&6
22458 else
22459   cat >"conftest.$ac_ext" <<_ACEOF
22460 #line 22460 "configure"
22461 #include "confdefs.h"
22462 #include <dbmalloc.h>
22463 _ACEOF
22464 if { (eval echo "$as_me:22464: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22465   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22466   ac_status=$?
22467   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22468   rm -f conftest.er1
22469   cat conftest.err >&5
22470   echo "$as_me:22470: \$? = $ac_status" >&5
22471   (exit "$ac_status"); } >/dev/null; then
22472   if test -s conftest.err; then
22473     ac_cpp_err=$ac_c_preproc_warn_flag
22474   else
22475     ac_cpp_err=
22476   fi
22477 else
22478   ac_cpp_err=yes
22479 fi
22480 if test -z "$ac_cpp_err"; then
22481   ac_cv_header_dbmalloc_h=yes
22482 else
22483   echo "$as_me: failed program was:" >&5
22484   cat "conftest.$ac_ext" >&5
22485   ac_cv_header_dbmalloc_h=no
22486 fi
22487 rm -f conftest.err "conftest.$ac_ext"
22488 fi
22489 echo "$as_me:22489: result: $ac_cv_header_dbmalloc_h" >&5
22490 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22491 if test "$ac_cv_header_dbmalloc_h" = yes; then
22492
22493 echo "$as_me:22493: checking for debug_malloc in -ldbmalloc" >&5
22494 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22495 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22496   echo $ECHO_N "(cached) $ECHO_C" >&6
22497 else
22498   ac_check_lib_save_LIBS=$LIBS
22499 LIBS="-ldbmalloc  $LIBS"
22500 cat >"conftest.$ac_ext" <<_ACEOF
22501 #line 22501 "configure"
22502 #include "confdefs.h"
22503
22504 /* Override any gcc2 internal prototype to avoid an error.  */
22505 #ifdef __cplusplus
22506 extern "C"
22507 #endif
22508 /* We use char because int might match the return type of a gcc2
22509    builtin and then its argument prototype would still apply.  */
22510 char debug_malloc ();
22511 int
22512 main (void)
22513 {
22514 debug_malloc ();
22515   ;
22516   return 0;
22517 }
22518 _ACEOF
22519 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22520 if { (eval echo "$as_me:22520: \"$ac_link\"") >&5
22521   (eval $ac_link) 2>&5
22522   ac_status=$?
22523   echo "$as_me:22523: \$? = $ac_status" >&5
22524   (exit "$ac_status"); } &&
22525          { ac_try='test -s "conftest$ac_exeext"'
22526   { (eval echo "$as_me:22526: \"$ac_try\"") >&5
22527   (eval $ac_try) 2>&5
22528   ac_status=$?
22529   echo "$as_me:22529: \$? = $ac_status" >&5
22530   (exit "$ac_status"); }; }; then
22531   ac_cv_lib_dbmalloc_debug_malloc=yes
22532 else
22533   echo "$as_me: failed program was:" >&5
22534 cat "conftest.$ac_ext" >&5
22535 ac_cv_lib_dbmalloc_debug_malloc=no
22536 fi
22537 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22538 LIBS=$ac_check_lib_save_LIBS
22539 fi
22540 echo "$as_me:22540: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22541 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22542 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22543   cat >>confdefs.h <<EOF
22544 #define HAVE_LIBDBMALLOC 1
22545 EOF
22546
22547   LIBS="-ldbmalloc $LIBS"
22548
22549 fi
22550
22551 fi
22552
22553 fi
22554
22555 echo "$as_me:22555: checking if you want to use valgrind for testing" >&5
22556 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22557
22558 # Check whether --with-valgrind or --without-valgrind was given.
22559 if test "${with_valgrind+set}" = set; then
22560   withval="$with_valgrind"
22561   case "x$withval" in
22562         (x|xno) ;;
22563         (*)
22564                 : "${with_cflags:=-g}"
22565                 : "${enable_leaks:=no}"
22566                 with_valgrind=yes
22567
22568 cat >>confdefs.h <<EOF
22569 #define USE_VALGRIND 1
22570 EOF
22571
22572                 ;;
22573         esac
22574 else
22575   with_valgrind=
22576 fi;
22577 echo "$as_me:22577: result: ${with_valgrind:-no}" >&5
22578 echo "${ECHO_T}${with_valgrind:-no}" >&6
22579
22580 case ".$with_cflags" in
22581 (.*-g*)
22582         case .$CFLAGS in
22583         (.*-g*)
22584                 ;;
22585         (*)
22586
22587 cf_fix_cppflags=no
22588 cf_new_cflags=
22589 cf_new_cppflags=
22590 cf_new_extra_cppflags=
22591
22592 for cf_add_cflags in -g
22593 do
22594 case "$cf_fix_cppflags" in
22595 (no)
22596         case "$cf_add_cflags" in
22597         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22598                 case "$cf_add_cflags" in
22599                 (-D*)
22600                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22601
22602                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22603                                 && test -z "${cf_tst_cflags}" \
22604                                 && cf_fix_cppflags=yes
22605
22606                         if test "$cf_fix_cppflags" = yes ; then
22607
22608         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22609         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22610
22611                                 continue
22612                         elif test "${cf_tst_cflags}" = "\"'" ; then
22613
22614         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22615         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22616
22617                                 continue
22618                         fi
22619                         ;;
22620                 esac
22621                 case "$CPPFLAGS" in
22622                 (*$cf_add_cflags)
22623                         ;;
22624                 (*)
22625                         case "$cf_add_cflags" in
22626                         (-D*)
22627                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22628
22629 CPPFLAGS=`echo "$CPPFLAGS" | \
22630         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22631                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22632
22633                                 ;;
22634                         esac
22635
22636         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22637         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22638
22639                         ;;
22640                 esac
22641                 ;;
22642         (*)
22643
22644         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22645         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22646
22647                 ;;
22648         esac
22649         ;;
22650 (yes)
22651
22652         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22653         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22654
22655         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22656
22657         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22658                 && test -z "${cf_tst_cflags}" \
22659                 && cf_fix_cppflags=no
22660         ;;
22661 esac
22662 done
22663
22664 if test -n "$cf_new_cflags" ; then
22665
22666         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22667         CFLAGS="${CFLAGS}$cf_new_cflags"
22668
22669 fi
22670
22671 if test -n "$cf_new_cppflags" ; then
22672
22673         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22674         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22675
22676 fi
22677
22678 if test -n "$cf_new_extra_cppflags" ; then
22679
22680         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22681         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22682
22683 fi
22684
22685                 ;;
22686         esac
22687         ;;
22688 esac
22689
22690 echo "$as_me:22690: checking if you want to perform memory-leak testing" >&5
22691 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22692
22693 # Check whether --enable-leaks or --disable-leaks was given.
22694 if test "${enable_leaks+set}" = set; then
22695   enableval="$enable_leaks"
22696   enable_leaks=$enableval
22697 else
22698   enable_leaks=yes
22699 fi;
22700 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22701 echo "$as_me:22701: result: $with_no_leaks" >&5
22702 echo "${ECHO_T}$with_no_leaks" >&6
22703
22704 if test "$enable_leaks" = no ; then
22705
22706 cat >>confdefs.h <<\EOF
22707 #define NO_LEAKS 1
22708 EOF
22709
22710 cat >>confdefs.h <<\EOF
22711 #define YY_NO_LEAKS 1
22712 EOF
22713
22714 fi
22715
22716 LD_RPATH_OPT=
22717 if test "x$cf_cv_enable_rpath" != xno
22718 then
22719         echo "$as_me:22719: checking for an rpath option" >&5
22720 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22721         case "$cf_cv_system_name" in
22722         (irix*)
22723                 if test "$GCC" = yes; then
22724                         LD_RPATH_OPT="-Wl,-rpath,"
22725                 else
22726                         LD_RPATH_OPT="-rpath "
22727                 fi
22728                 ;;
22729         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22730                 LD_RPATH_OPT="-Wl,-rpath,"
22731                 ;;
22732         (openbsd[2-9].*|mirbsd*)
22733                 LD_RPATH_OPT="-Wl,-rpath,"
22734                 ;;
22735         (dragonfly*)
22736                 LD_RPATH_OPT="-rpath "
22737                 ;;
22738         (netbsd*)
22739                 LD_RPATH_OPT="-Wl,-rpath,"
22740                 ;;
22741         (osf*|mls+*)
22742                 LD_RPATH_OPT="-rpath "
22743                 ;;
22744         (solaris2*)
22745                 LD_RPATH_OPT="-R"
22746                 ;;
22747         (*)
22748                 ;;
22749         esac
22750         echo "$as_me:22750: result: $LD_RPATH_OPT" >&5
22751 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22752
22753         case "x$LD_RPATH_OPT" in
22754         (x-R*)
22755                 echo "$as_me:22755: checking if we need a space after rpath option" >&5
22756 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22757                 cf_save_LIBS="$LIBS"
22758
22759 cf_add_libs="$LIBS"
22760 # reverse order
22761 cf_add_0lib=
22762 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22763 # filter duplicates
22764 for cf_add_1lib in $cf_add_0lib; do
22765         for cf_add_2lib in $cf_add_libs; do
22766                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22767                         cf_add_1lib=
22768                         break
22769                 fi
22770         done
22771         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22772 done
22773 LIBS="$cf_add_libs"
22774
22775                 cat >"conftest.$ac_ext" <<_ACEOF
22776 #line 22776 "configure"
22777 #include "confdefs.h"
22778
22779 int
22780 main (void)
22781 {
22782
22783   ;
22784   return 0;
22785 }
22786 _ACEOF
22787 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22788 if { (eval echo "$as_me:22788: \"$ac_link\"") >&5
22789   (eval $ac_link) 2>&5
22790   ac_status=$?
22791   echo "$as_me:22791: \$? = $ac_status" >&5
22792   (exit "$ac_status"); } &&
22793          { ac_try='test -s "conftest$ac_exeext"'
22794   { (eval echo "$as_me:22794: \"$ac_try\"") >&5
22795   (eval $ac_try) 2>&5
22796   ac_status=$?
22797   echo "$as_me:22797: \$? = $ac_status" >&5
22798   (exit "$ac_status"); }; }; then
22799   cf_rpath_space=no
22800 else
22801   echo "$as_me: failed program was:" >&5
22802 cat "conftest.$ac_ext" >&5
22803 cf_rpath_space=yes
22804 fi
22805 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22806                 LIBS="$cf_save_LIBS"
22807                 echo "$as_me:22807: result: $cf_rpath_space" >&5
22808 echo "${ECHO_T}$cf_rpath_space" >&6
22809                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22810                 ;;
22811         esac
22812 fi
22813
22814 echo "$as_me:22814: checking if rpath-hack should be disabled" >&5
22815 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22816
22817 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22818 if test "${enable_rpath_hack+set}" = set; then
22819   enableval="$enable_rpath_hack"
22820   test "$enableval" != no && enableval=yes
22821         if test "$enableval" != "yes" ; then
22822     enable_rpath_hack=no
22823         else
22824                 enable_rpath_hack=yes
22825         fi
22826 else
22827   enableval=yes
22828         enable_rpath_hack=yes
22829
22830 fi;
22831 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
22832 echo "$as_me:22832: result: $cf_disable_rpath_hack" >&5
22833 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22834
22835 if test "$enable_rpath_hack" = yes ; then
22836
22837 echo "$as_me:22837: checking for updated LDFLAGS" >&5
22838 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22839 if test -n "$LD_RPATH_OPT" ; then
22840         echo "$as_me:22840: result: maybe" >&5
22841 echo "${ECHO_T}maybe" >&6
22842
22843         for ac_prog in ldd
22844 do
22845   # Extract the first word of "$ac_prog", so it can be a program name with args.
22846 set dummy $ac_prog; ac_word=$2
22847 echo "$as_me:22847: checking for $ac_word" >&5
22848 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22849 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22850   echo $ECHO_N "(cached) $ECHO_C" >&6
22851 else
22852   if test -n "$cf_ldd_prog"; then
22853   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22854 else
22855   ac_save_IFS=$IFS; IFS=$ac_path_separator
22856 ac_dummy="$PATH"
22857 for ac_dir in $ac_dummy; do
22858   IFS=$ac_save_IFS
22859   test -z "$ac_dir" && ac_dir=.
22860   $as_executable_p "$ac_dir/$ac_word" || continue
22861 ac_cv_prog_cf_ldd_prog="$ac_prog"
22862 echo "$as_me:22862: found $ac_dir/$ac_word" >&5
22863 break
22864 done
22865
22866 fi
22867 fi
22868 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22869 if test -n "$cf_ldd_prog"; then
22870   echo "$as_me:22870: result: $cf_ldd_prog" >&5
22871 echo "${ECHO_T}$cf_ldd_prog" >&6
22872 else
22873   echo "$as_me:22873: result: no" >&5
22874 echo "${ECHO_T}no" >&6
22875 fi
22876
22877   test -n "$cf_ldd_prog" && break
22878 done
22879 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22880
22881         cf_rpath_list="/usr/lib /lib"
22882         if test "$cf_ldd_prog" != no
22883         then
22884                 cf_rpath_oops=
22885
22886 cat >"conftest.$ac_ext" <<_ACEOF
22887 #line 22887 "configure"
22888 #include "confdefs.h"
22889 #include <stdio.h>
22890 int
22891 main (void)
22892 {
22893 printf("Hello");
22894   ;
22895   return 0;
22896 }
22897 _ACEOF
22898 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22899 if { (eval echo "$as_me:22899: \"$ac_link\"") >&5
22900   (eval $ac_link) 2>&5
22901   ac_status=$?
22902   echo "$as_me:22902: \$? = $ac_status" >&5
22903   (exit "$ac_status"); } &&
22904          { ac_try='test -s "conftest$ac_exeext"'
22905   { (eval echo "$as_me:22905: \"$ac_try\"") >&5
22906   (eval $ac_try) 2>&5
22907   ac_status=$?
22908   echo "$as_me:22908: \$? = $ac_status" >&5
22909   (exit "$ac_status"); }; }; then
22910   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22911                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22912 else
22913   echo "$as_me: failed program was:" >&5
22914 cat "conftest.$ac_ext" >&5
22915 fi
22916 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22917
22918                 # If we passed the link-test, but get a "not found" on a given library,
22919                 # this could be due to inept reconfiguration of gcc to make it only
22920                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22921                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22922                 # /usr/local libraries.
22923                 if test -n "$cf_rpath_oops"
22924                 then
22925                         for cf_rpath_src in $cf_rpath_oops
22926                         do
22927                                 for cf_rpath_dir in \
22928                                         /usr/local \
22929                                         /usr/pkg \
22930                                         /opt/sfw
22931                                 do
22932                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
22933                                         then
22934                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22935
22936 echo "${as_me:-configure}:22936: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22937
22938                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22939                                                 break
22940                                         fi
22941                                 done
22942                         done
22943                 fi
22944         fi
22945
22946         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22947
22948 echo "${as_me:-configure}:22948: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22949
22950 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22951
22952 echo "${as_me:-configure}:22952: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22953
22954 cf_rpath_dst=
22955 for cf_rpath_src in $LDFLAGS
22956 do
22957         case "$cf_rpath_src" in
22958         (-L*)
22959
22960                 # check if this refers to a directory which we will ignore
22961                 cf_rpath_skip=no
22962                 if test -n "$cf_rpath_list"
22963                 then
22964                         for cf_rpath_item in $cf_rpath_list
22965                         do
22966                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22967                                 then
22968                                         cf_rpath_skip=yes
22969                                         break
22970                                 fi
22971                         done
22972                 fi
22973
22974                 if test "$cf_rpath_skip" = no
22975                 then
22976                         # transform the option
22977                         if test "$LD_RPATH_OPT" = "-R " ; then
22978                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22979                         else
22980                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22981                         fi
22982
22983                         # if we have not already added this, add it now
22984                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22985                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22986                         then
22987                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22988
22989 echo "${as_me:-configure}:22989: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22990
22991                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22992                         fi
22993                 fi
22994                 ;;
22995         esac
22996         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22997 done
22998 LDFLAGS=$cf_rpath_dst
22999
23000 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
23001
23002 echo "${as_me:-configure}:23002: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
23003
23004 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23005
23006 echo "${as_me:-configure}:23006: testing ...checking LIBS $LIBS ..." 1>&5
23007
23008 cf_rpath_dst=
23009 for cf_rpath_src in $LIBS
23010 do
23011         case "$cf_rpath_src" in
23012         (-L*)
23013
23014                 # check if this refers to a directory which we will ignore
23015                 cf_rpath_skip=no
23016                 if test -n "$cf_rpath_list"
23017                 then
23018                         for cf_rpath_item in $cf_rpath_list
23019                         do
23020                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23021                                 then
23022                                         cf_rpath_skip=yes
23023                                         break
23024                                 fi
23025                         done
23026                 fi
23027
23028                 if test "$cf_rpath_skip" = no
23029                 then
23030                         # transform the option
23031                         if test "$LD_RPATH_OPT" = "-R " ; then
23032                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23033                         else
23034                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23035                         fi
23036
23037                         # if we have not already added this, add it now
23038                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23039                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23040                         then
23041                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23042
23043 echo "${as_me:-configure}:23043: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23044
23045                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23046                         fi
23047                 fi
23048                 ;;
23049         esac
23050         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23051 done
23052 LIBS=$cf_rpath_dst
23053
23054 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23055
23056 echo "${as_me:-configure}:23056: testing ...checked LIBS $LIBS ..." 1>&5
23057
23058         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23059
23060 echo "${as_me:-configure}:23060: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23061
23062 else
23063         echo "$as_me:23063: result: no" >&5
23064 echo "${ECHO_T}no" >&6
23065 fi
23066
23067 fi
23068
23069 TEST_ARGS="$LIBS"
23070 LIBS=
23071
23072 ac_config_files="$ac_config_files Makefile"
23073 ac_config_commands="$ac_config_commands default"
23074 cat >confcache <<\_ACEOF
23075 # This file is a shell script that caches the results of configure
23076 # tests run on this system so they can be shared between configure
23077 # scripts and configure runs, see configure's option --config-cache.
23078 # It is not useful on other systems.  If it contains results you don't
23079 # want to keep, you may remove or edit it.
23080 #
23081 # config.status only pays attention to the cache file if you give it
23082 # the --recheck option to rerun configure.
23083 #
23084 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23085 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23086 # following values.
23087
23088 _ACEOF
23089
23090 # The following way of writing the cache mishandles newlines in values,
23091 # but we know of no workaround that is simple, portable, and efficient.
23092 # So, don't put newlines in cache variables' values.
23093 # Ultrix sh set writes to stderr and can't be redirected directly,
23094 # and sets the high bit in the cache file unless we assign to the vars.
23095 {
23096   (set) 2>&1 |
23097     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23098     *ac_space=\ *)
23099       # `set' does not quote correctly, so add quotes (double-quote
23100       # substitution turns \\\\ into \\, and sed turns \\ into \).
23101       sed -n \
23102         "s/'/'\\\\''/g;
23103           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23104       ;;
23105     *)
23106       # `set' quotes correctly as required by POSIX, so do not add quotes.
23107       sed -n \
23108         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23109       ;;
23110     esac;
23111 } |
23112   sed '
23113      t clear
23114      : clear
23115      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23116      t end
23117      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23118      : end' >>confcache
23119 if cmp -s $cache_file confcache; then :; else
23120   if test -w $cache_file; then
23121     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23122     cat confcache >$cache_file
23123   else
23124     echo "not updating unwritable cache $cache_file"
23125   fi
23126 fi
23127 rm -f confcache
23128
23129 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23130 # Let make expand exec_prefix.
23131 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23132
23133 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23134 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23135 # trailing colons and then remove the whole line if VPATH becomes empty
23136 # (actually we leave an empty line to preserve line numbers).
23137 if test "x$srcdir" = x.; then
23138   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23139 s/:*\$(srcdir):*/:/;
23140 s/:*\${srcdir}:*/:/;
23141 s/:*@srcdir@:*/:/;
23142 s/^\([^=]*=[    ]*\):*/\1/;
23143 s/:*$//;
23144 s/^[^=]*=[      ]*$//;
23145 }'
23146 fi
23147
23148 DEFS=-DHAVE_CONFIG_H
23149
23150 : "${CONFIG_STATUS=./config.status}"
23151 ac_clean_files_save=$ac_clean_files
23152 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23153 { echo "$as_me:23153: creating $CONFIG_STATUS" >&5
23154 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23155 cat >"$CONFIG_STATUS" <<_ACEOF
23156 #! $SHELL
23157 # Generated automatically by configure.
23158 # Run this file to recreate the current configuration.
23159 # Compiler output produced by configure, useful for debugging
23160 # configure, is in config.log if it exists.
23161
23162 debug=false
23163 SHELL=\${CONFIG_SHELL-$SHELL}
23164 ac_cs_invocation="\$0 \$@"
23165
23166 CLICOLOR_FORCE= GREP_OPTIONS=
23167 unset CLICOLOR_FORCE GREP_OPTIONS
23168 _ACEOF
23169
23170 cat >>"$CONFIG_STATUS" <<\_ACEOF
23171 # Be Bourne compatible
23172 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23173   emulate sh
23174   NULLCMD=:
23175 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23176   set -o posix
23177 fi
23178
23179 # Name of the executable.
23180 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23181
23182 if expr a : '\(a\)' >/dev/null 2>&1; then
23183   as_expr=expr
23184 else
23185   as_expr=false
23186 fi
23187
23188 rm -f conf$$ conf$$.exe conf$$.file
23189 echo >conf$$.file
23190 if ln -s conf$$.file conf$$ 2>/dev/null; then
23191   # We could just check for DJGPP; but this test a) works b) is more generic
23192   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23193   if test -f conf$$.exe; then
23194     # Don't use ln at all; we don't have any links
23195     as_ln_s='cp -p'
23196   else
23197     as_ln_s='ln -s'
23198   fi
23199 elif ln conf$$.file conf$$ 2>/dev/null; then
23200   as_ln_s=ln
23201 else
23202   as_ln_s='cp -p'
23203 fi
23204 rm -f conf$$ conf$$.exe conf$$.file
23205
23206 as_executable_p="test -f"
23207
23208 # Support unset when possible.
23209 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23210   as_unset="unset"
23211 else
23212   as_unset="false"
23213 fi
23214
23215 # NLS nuisances.
23216 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23217 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23218 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23219 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23220 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23221 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23222 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23223 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23224
23225 # IFS
23226 # We need space, tab and new line, in precisely that order.
23227 as_nl='
23228 '
23229 IFS="   $as_nl"
23230
23231 # CDPATH.
23232 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23233
23234 exec 6>&1
23235
23236 _ACEOF
23237
23238 # Files that config.status was made for.
23239 if test -n "$ac_config_files"; then
23240   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23241 fi
23242
23243 if test -n "$ac_config_headers"; then
23244   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23245 fi
23246
23247 if test -n "$ac_config_links"; then
23248   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23249 fi
23250
23251 if test -n "$ac_config_commands"; then
23252   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23253 fi
23254
23255 cat >>"$CONFIG_STATUS" <<\EOF
23256
23257 ac_cs_usage="\
23258 \`$as_me' instantiates files from templates according to the
23259 current configuration.
23260
23261 Usage: $0 [OPTIONS] [FILE]...
23262
23263   -h, --help       print this help, then exit
23264   -V, --version    print version number, then exit
23265   -d, --debug      don't remove temporary files
23266       --recheck    update $as_me by reconfiguring in the same conditions
23267   --file=FILE[:TEMPLATE]
23268                    instantiate the configuration file FILE
23269   --header=FILE[:TEMPLATE]
23270                    instantiate the configuration header FILE
23271
23272 Configuration files:
23273 $config_files
23274
23275 Configuration headers:
23276 $config_headers
23277
23278 Configuration commands:
23279 $config_commands
23280
23281 Report bugs to <dickey@invisible-island.net>."
23282 EOF
23283
23284 cat >>"$CONFIG_STATUS" <<EOF
23285 ac_cs_version="\\
23286 config.status
23287 configured by $0, generated by GNU Autoconf 2.52.20210509,
23288   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23289
23290 Copyright 2003-2020,2021        Thomas E. Dickey
23291 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23292 Free Software Foundation, Inc.
23293 This config.status script is free software; the Free Software Foundation
23294 gives unlimited permission to copy, distribute and modify it."
23295 srcdir="$srcdir"
23296 INSTALL="$INSTALL"
23297 EOF
23298
23299 cat >>"$CONFIG_STATUS" <<\EOF
23300 # If no file are specified by the user, then we need to provide default
23301 # value.  By we need to know if files were specified by the user.
23302 ac_need_defaults=:
23303 while test $# != 0
23304 do
23305   case $1 in
23306   --*=*)
23307     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23308     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23309     shift
23310     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23311     shift
23312     ;;
23313   -*);;
23314   *) # This is not an option, so the user has probably given explicit
23315      # arguments.
23316      ac_need_defaults=false;;
23317   esac
23318
23319   case $1 in
23320   # Handling of the options.
23321 EOF
23322 cat >>"$CONFIG_STATUS" <<EOF
23323   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23324     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23325     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23326 EOF
23327 cat >>"$CONFIG_STATUS" <<\EOF
23328   --version | --vers* | -V )
23329     echo "$ac_cs_version"; exit 0 ;;
23330   --he | --h)
23331     # Conflict between --help and --header
23332     { { echo "$as_me:23332: error: ambiguous option: $1
23333 Try \`$0 --help' for more information." >&5
23334 echo "$as_me: error: ambiguous option: $1
23335 Try \`$0 --help' for more information." >&2;}
23336    { (exit 1); exit 1; }; };;
23337   --help | --hel | -h )
23338     echo "$ac_cs_usage"; exit 0 ;;
23339   --debug | --d* | -d )
23340     debug=: ;;
23341   --file | --fil | --fi | --f )
23342     shift
23343     CONFIG_FILES="$CONFIG_FILES $1"
23344     ac_need_defaults=false;;
23345   --header | --heade | --head | --hea )
23346     shift
23347     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23348     ac_need_defaults=false;;
23349
23350   # This is an error.
23351   -*) { { echo "$as_me:23351: error: unrecognized option: $1
23352 Try \`$0 --help' for more information." >&5
23353 echo "$as_me: error: unrecognized option: $1
23354 Try \`$0 --help' for more information." >&2;}
23355    { (exit 1); exit 1; }; } ;;
23356
23357   *) ac_config_targets="$ac_config_targets $1" ;;
23358
23359   esac
23360   shift
23361 done
23362
23363 exec 5>>config.log
23364 cat >&5 << _ACEOF
23365
23366 ## ----------------------- ##
23367 ## Running config.status.  ##
23368 ## ----------------------- ##
23369
23370 This file was extended by $as_me 2.52.20210509, executed with
23371   CONFIG_FILES    = $CONFIG_FILES
23372   CONFIG_HEADERS  = $CONFIG_HEADERS
23373   CONFIG_LINKS    = $CONFIG_LINKS
23374   CONFIG_COMMANDS = $CONFIG_COMMANDS
23375   > "$ac_cs_invocation"
23376 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23377
23378 _ACEOF
23379 EOF
23380
23381 cat >>"$CONFIG_STATUS" <<EOF
23382 #
23383 # INIT-COMMANDS section.
23384 #
23385
23386 AWK="$AWK"
23387 ECHO_CC="$ECHO_CC"
23388 ECHO_LD="$ECHO_LD"
23389 SHOW_CC="$SHOW_LD"
23390
23391 EOF
23392
23393 cat >>"$CONFIG_STATUS" <<\EOF
23394 for ac_config_target in $ac_config_targets
23395 do
23396   case "$ac_config_target" in
23397   # Handling of arguments.
23398   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23399   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23400   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23401   *) { { echo "$as_me:23401: error: invalid argument: $ac_config_target" >&5
23402 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23403    { (exit 1); exit 1; }; };;
23404   esac
23405 done
23406
23407 # If the user did not use the arguments to specify the items to instantiate,
23408 # then the envvar interface is used.  Set only those that are not.
23409 # We use the long form for the default assignment because of an extremely
23410 # bizarre bug on SunOS 4.1.3.
23411 if "$ac_need_defaults"; then
23412   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23413   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23414   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23415 fi
23416
23417 # Create a temporary directory, and hook for its removal unless debugging.
23418 $debug ||
23419 {
23420   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23421   trap '{ (exit 1); exit 1; }' 1 2 13 15
23422 }
23423
23424 # Create a (secure) tmp directory for tmp files.
23425 : ${TMPDIR=/tmp}
23426 {
23427   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23428   test -n "$tmp" && test -d "$tmp"
23429 }  ||
23430 {
23431   tmp=$TMPDIR/cs$$-$RANDOM
23432   (umask 077 && mkdir $tmp)
23433 } ||
23434 {
23435    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23436    { (exit 1); exit 1; }
23437 }
23438
23439 EOF
23440
23441 cat >>"$CONFIG_STATUS" <<EOF
23442
23443 #
23444 # CONFIG_FILES section.
23445 #
23446
23447 # No need to generate the scripts if there are no CONFIG_FILES.
23448 # This happens for instance when ./config.status config.h
23449 if test -n "\$CONFIG_FILES"; then
23450   # Protect against being on the right side of a sed subst in config.status.
23451   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23452    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23453 s,@SHELL@,$SHELL,;t t
23454 s,@exec_prefix@,$exec_prefix,;t t
23455 s,@prefix@,$prefix,;t t
23456 s,@program_transform_name@,$program_transform_name,;t t
23457 s,@bindir@,$bindir,;t t
23458 s,@sbindir@,$sbindir,;t t
23459 s,@libexecdir@,$libexecdir,;t t
23460 s,@datarootdir@,$datarootdir,;t t
23461 s,@datadir@,$datadir,;t t
23462 s,@sysconfdir@,$sysconfdir,;t t
23463 s,@sharedstatedir@,$sharedstatedir,;t t
23464 s,@localstatedir@,$localstatedir,;t t
23465 s,@runstatedir@,$runstatedir,;t t
23466 s,@libdir@,$libdir,;t t
23467 s,@includedir@,$includedir,;t t
23468 s,@oldincludedir@,$oldincludedir,;t t
23469 s,@infodir@,$infodir,;t t
23470 s,@mandir@,$mandir,;t t
23471 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23472 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23473 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23474 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23475 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23476 s,@build_alias@,$build_alias,;t t
23477 s,@host_alias@,$host_alias,;t t
23478 s,@target_alias@,$target_alias,;t t
23479 s,@ECHO_C@,$ECHO_C,;t t
23480 s,@ECHO_N@,$ECHO_N,;t t
23481 s,@ECHO_T@,$ECHO_T,;t t
23482 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23483 s,@DEFS@,$DEFS,;t t
23484 s,@LIBS@,$LIBS,;t t
23485 s,@build@,$build,;t t
23486 s,@build_cpu@,$build_cpu,;t t
23487 s,@build_vendor@,$build_vendor,;t t
23488 s,@build_os@,$build_os,;t t
23489 s,@host@,$host,;t t
23490 s,@host_cpu@,$host_cpu,;t t
23491 s,@host_vendor@,$host_vendor,;t t
23492 s,@host_os@,$host_os,;t t
23493 s,@SET_MAKE@,$SET_MAKE,;t t
23494 s,@CC@,$CC,;t t
23495 s,@CFLAGS@,$CFLAGS,;t t
23496 s,@LDFLAGS@,$LDFLAGS,;t t
23497 s,@CPPFLAGS@,$CPPFLAGS,;t t
23498 s,@ac_ct_CC@,$ac_ct_CC,;t t
23499 s,@EXEEXT@,$EXEEXT,;t t
23500 s,@OBJEXT@,$OBJEXT,;t t
23501 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23502 s,@CPP@,$CPP,;t t
23503 s,@GREP@,$GREP,;t t
23504 s,@EGREP@,$EGREP,;t t
23505 s,@AWK@,$AWK,;t t
23506 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23507 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23508 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23509 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23510 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23511 s,@LINT@,$LINT,;t t
23512 s,@LINT_OPTS@,$LINT_OPTS,;t t
23513 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
23514 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
23515 s,@CTAGS@,$CTAGS,;t t
23516 s,@ETAGS@,$ETAGS,;t t
23517 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23518 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23519 s,@MATH_LIB@,$MATH_LIB,;t t
23520 s,@top_builddir@,$top_builddir,;t t
23521 s,@CC_G_OPT@,$CC_G_OPT,;t t
23522 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23523 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23524 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23525 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23526 s,@LD@,$LD,;t t
23527 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23528 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23529 s,@LD_MODEL@,$LD_MODEL,;t t
23530 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23531 s,@LIBTOOL@,$LIBTOOL,;t t
23532 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23533 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23534 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23535 s,@LIB_LINK@,$LIB_LINK,;t t
23536 s,@LINK_TESTS@,$LINK_TESTS,;t t
23537 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23538 s,@PACKAGE@,$PACKAGE,;t t
23539 s,@PTHREAD@,$PTHREAD,;t t
23540 s,@TEST_ARGS@,$TEST_ARGS,;t t
23541 s,@TEST_DEPS@,$TEST_DEPS,;t t
23542 s,@TEST_LIBS@,$TEST_LIBS,;t t
23543 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23544 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23545 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23546 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23547 s,@includesubdir@,$includesubdir,;t t
23548 s,@FGREP@,$FGREP,;t t
23549 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23550 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
23551 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23552 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23553 s,@ECHO_LT@,$ECHO_LT,;t t
23554 s,@ECHO_LD@,$ECHO_LD,;t t
23555 s,@RULE_CC@,$RULE_CC,;t t
23556 s,@SHOW_CC@,$SHOW_CC,;t t
23557 s,@ECHO_CC@,$ECHO_CC,;t t
23558 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23559 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23560 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23561 s,@X_CFLAGS@,$X_CFLAGS,;t t
23562 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23563 s,@X_LIBS@,$X_LIBS,;t t
23564 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23565 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23566 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23567 s,@RGB_PATH@,$RGB_PATH,;t t
23568 s,@no_x11_rgb@,$no_x11_rgb,;t t
23569 s,@FORM_NAME@,$FORM_NAME,;t t
23570 s,@MENU_NAME@,$MENU_NAME,;t t
23571 s,@PANEL_NAME@,$PANEL_NAME,;t t
23572 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23573 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23574 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23575 CEOF
23576
23577 EOF
23578
23579   cat >>"$CONFIG_STATUS" <<\EOF
23580   # Split the substitutions into bite-sized pieces for seds with
23581   # small command number limits, like on Digital OSF/1 and HP-UX.
23582   ac_max_sed_lines=48
23583   ac_sed_frag=1 # Number of current file.
23584   ac_beg=1 # First line for current file.
23585   ac_end=$ac_max_sed_lines # Line after last line for current file.
23586   ac_more_lines=:
23587   ac_sed_cmds=
23588   while "$ac_more_lines"; do
23589     if test "$ac_beg" -gt 1; then
23590       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23591     else
23592       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23593     fi
23594     if test ! -s $tmp/subs.frag; then
23595       ac_more_lines=false
23596     else
23597       # The purpose of the label and of the branching condition is to
23598       # speed up the sed processing (if there are no `@' at all, there
23599       # is no need to browse any of the substitutions).
23600       # These are the two extra sed commands mentioned above.
23601       (echo ':t
23602   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23603       # It is possible to make a multiline substitution using escaped newlines.
23604       # Ensure that we do not split the substitution between script fragments.
23605       ac_BEG=$ac_end
23606       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23607       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23608       if test -s $tmp/subs.next; then
23609         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23610         if test ! -s $tmp/subs.edit; then
23611           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23612           if test ! -s $tmp/subs.edit; then
23613             if test "$ac_beg" -gt 1; then
23614               ac_end=`expr "$ac_end" - 1`
23615               continue
23616             fi
23617           fi
23618         fi
23619       fi
23620
23621       if test -z "$ac_sed_cmds"; then
23622         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23623       else
23624         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23625       fi
23626       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23627       ac_beg=$ac_end
23628       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23629     fi
23630   done
23631   if test -z "$ac_sed_cmds"; then
23632     ac_sed_cmds=cat
23633   fi
23634 fi # test -n "$CONFIG_FILES"
23635
23636 EOF
23637 cat >>"$CONFIG_STATUS" <<\EOF
23638 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23639   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23640   case "$ac_file" in
23641   - | *:- | *:-:* ) # input from stdin
23642         cat >$tmp/stdin
23643         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23644         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23645   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23646         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23647   * )   ac_file_in=$ac_file.in ;;
23648   esac
23649
23650   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23651   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23652          X"$ac_file" : 'X\(//\)[^/]' \| \
23653          X"$ac_file" : 'X\(//\)$' \| \
23654          X"$ac_file" : 'X\(/\)' \| \
23655          .     : '\(.\)' 2>/dev/null ||
23656 echo X"$ac_file" |
23657     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23658           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23659           /^X\(\/\/\)$/{ s//\1/; q; }
23660           /^X\(\/\).*/{ s//\1/; q; }
23661           s/.*/./; q'`
23662   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23663     { case "$ac_dir" in
23664   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23665   *)                      as_incr_dir=.;;
23666 esac
23667 as_dummy="$ac_dir"
23668 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23669   case $as_mkdir_dir in
23670     # Skip DOS drivespec
23671     ?:) as_incr_dir=$as_mkdir_dir ;;
23672     *)
23673       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23674       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23675     ;;
23676   esac
23677 done; }
23678
23679     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23680     # A "../" for each directory in $ac_dir_suffix.
23681     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23682   else
23683     ac_dir_suffix= ac_dots=
23684   fi
23685
23686   case "$srcdir" in
23687   .)  ac_srcdir=.
23688       if test -z "$ac_dots"; then
23689          ac_top_srcdir=.
23690       else
23691          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
23692       fi ;;
23693   [\\/]* | ?:[\\/]* )
23694       ac_srcdir="$srcdir$ac_dir_suffix";
23695       ac_top_srcdir="$srcdir" ;;
23696   *) # Relative path.
23697     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
23698     ac_top_srcdir="$ac_dots$srcdir" ;;
23699   esac
23700
23701   case $INSTALL in
23702   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23703   *) ac_INSTALL=$ac_dots$INSTALL ;;
23704   esac
23705
23706   if test x"$ac_file" != x-; then
23707     { echo "$as_me:23707: creating $ac_file" >&5
23708 echo "$as_me: creating $ac_file" >&6;}
23709     rm -f "$ac_file"
23710   fi
23711   # Let's still pretend it is `configure' which instantiates (i.e., don't
23712   # use $as_me), people would be surprised to read:
23713   #    /* config.h.  Generated automatically by config.status.  */
23714   configure_input="Generated automatically from `echo $ac_file_in |
23715                                                  sed 's,.*/,,'` by configure."
23716
23717   # First look for the input files in the build tree, otherwise in the
23718   # src tree.
23719   ac_file_inputs=`IFS=:
23720     for f in $ac_file_in; do
23721       case $f in
23722       -) echo $tmp/stdin ;;
23723       [\\/$]*)
23724          # Absolute (can't be DOS-style, as IFS=:)
23725          test -f "$f" || { { echo "$as_me:23725: error: cannot find input file: $f" >&5
23726 echo "$as_me: error: cannot find input file: $f" >&2;}
23727    { (exit 1); exit 1; }; }
23728          echo $f;;
23729       *) # Relative
23730          if test -f "$f"; then
23731            # Build tree
23732            echo $f
23733          elif test -f "$srcdir/$f"; then
23734            # Source tree
23735            echo "$srcdir/$f"
23736          else
23737            # /dev/null tree
23738            { { echo "$as_me:23738: error: cannot find input file: $f" >&5
23739 echo "$as_me: error: cannot find input file: $f" >&2;}
23740    { (exit 1); exit 1; }; }
23741          fi;;
23742       esac
23743     done` || { (exit 1); exit 1; }
23744 EOF
23745 cat >>"$CONFIG_STATUS" <<\EOF
23746   ac_warn_datarootdir=no
23747   if test x"$ac_file" != x-; then
23748     for ac_item in $ac_file_inputs
23749     do
23750       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
23751       if test -n "$ac_seen"; then
23752         ac_used=`grep '@datarootdir@' "$ac_item"`
23753         if test -z "$ac_used"; then
23754           { echo "$as_me:23754: WARNING: datarootdir was used implicitly but not set:
23755 $ac_seen" >&5
23756 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23757 $ac_seen" >&2;}
23758           ac_warn_datarootdir=yes
23759         fi
23760       fi
23761       ac_seen=`grep '${datarootdir}' "$ac_item"`
23762       if test -n "$ac_seen"; then
23763         { echo "$as_me:23763: WARNING: datarootdir was used explicitly but not set:
23764 $ac_seen" >&5
23765 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23766 $ac_seen" >&2;}
23767         ac_warn_datarootdir=yes
23768       fi
23769     done
23770   fi
23771
23772 if test "x$ac_warn_datarootdir" = xyes; then
23773   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23774 fi
23775
23776 EOF
23777 cat >>"$CONFIG_STATUS" <<EOF
23778   sed "$ac_vpsub
23779 $extrasub
23780 EOF
23781 cat >>"$CONFIG_STATUS" <<\EOF
23782 :t
23783 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23784 s,@configure_input@,$configure_input,;t t
23785 s,@srcdir@,$ac_srcdir,;t t
23786 s,@top_srcdir@,$ac_top_srcdir,;t t
23787 s,@INSTALL@,$ac_INSTALL,;t t
23788 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23789   rm -f $tmp/stdin
23790   if test x"$ac_file" != x-; then
23791     cp "$tmp/out" "$ac_file"
23792
23793     for ac_name in prefix exec_prefix datarootdir
23794     do
23795         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
23796         if test -n "$ac_seen"; then
23797             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
23798             if test -z "$ac_init"; then
23799               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23800               { echo "$as_me:23800: WARNING: Variable $ac_name is used but was not set:
23801 $ac_seen" >&5
23802 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23803 $ac_seen" >&2;}
23804             fi
23805         fi
23806     done
23807     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
23808     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
23809     if test -s $tmp/out; then
23810       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23811       { echo "$as_me:23811: WARNING: Some variables may not be substituted:
23812 $ac_seen" >&5
23813 echo "$as_me: WARNING: Some variables may not be substituted:
23814 $ac_seen" >&2;}
23815     fi
23816   else
23817     cat $tmp/out
23818   fi
23819   rm -f $tmp/out
23820
23821 done
23822 EOF
23823 cat >>"$CONFIG_STATUS" <<\EOF
23824
23825 #
23826 # CONFIG_HEADER section.
23827 #
23828
23829 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23830 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23831 #
23832 # ac_d sets the value in "#define NAME VALUE" lines.
23833 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23834 ac_dB='[        ].*$,\1#\2'
23835 ac_dC=' '
23836 ac_dD=',;t'
23837 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23838 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23839 ac_iB='\([      ]\),\1#\2define\3'
23840 ac_iC=' '
23841 ac_iD='\4,;t'
23842 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23843 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23844 ac_uB='$,\1#\2define\3'
23845 ac_uC=' '
23846 ac_uD=',;t'
23847
23848 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23849   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23850   case "$ac_file" in
23851   - | *:- | *:-:* ) # input from stdin
23852         cat >$tmp/stdin
23853         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23854         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23855   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23856         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23857   * )   ac_file_in=$ac_file.in ;;
23858   esac
23859
23860   test x"$ac_file" != x- && { echo "$as_me:23860: creating $ac_file" >&5
23861 echo "$as_me: creating $ac_file" >&6;}
23862
23863   # First look for the input files in the build tree, otherwise in the
23864   # src tree.
23865   ac_file_inputs=`IFS=:
23866     for f in $ac_file_in; do
23867       case $f in
23868       -) echo $tmp/stdin ;;
23869       [\\/$]*)
23870          # Absolute (can't be DOS-style, as IFS=:)
23871          test -f "$f" || { { echo "$as_me:23871: error: cannot find input file: $f" >&5
23872 echo "$as_me: error: cannot find input file: $f" >&2;}
23873    { (exit 1); exit 1; }; }
23874          echo $f;;
23875       *) # Relative
23876          if test -f "$f"; then
23877            # Build tree
23878            echo $f
23879          elif test -f "$srcdir/$f"; then
23880            # Source tree
23881            echo "$srcdir/$f"
23882          else
23883            # /dev/null tree
23884            { { echo "$as_me:23884: error: cannot find input file: $f" >&5
23885 echo "$as_me: error: cannot find input file: $f" >&2;}
23886    { (exit 1); exit 1; }; }
23887          fi;;
23888       esac
23889     done` || { (exit 1); exit 1; }
23890   # Remove the trailing spaces.
23891   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23892
23893 EOF
23894
23895 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23896 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23897 # be either 'cat' or 'sort'.
23898 cat confdefs.h | uniq >conftest.vals
23899
23900 # Break up conftest.vals because some shells have a limit on
23901 # the size of here documents, and old seds have small limits too.
23902
23903 rm -f conftest.tail
23904 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
23905 while grep . conftest.vals >/dev/null
23906 do
23907   # Write chunks of a limited-size here document to conftest.frag.
23908   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
23909   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
23910   echo 'CEOF' >> "$CONFIG_STATUS"
23911   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
23912   rm -f conftest.vals
23913   mv conftest.tail conftest.vals
23914 done
23915 rm -f conftest.vals
23916
23917 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23918 # marker @DEFS@.
23919 echo '  cat >> conftest.edit <<CEOF
23920 /@DEFS@/r conftest.frag
23921 /@DEFS@/d
23922 CEOF
23923 sed -f conftest.edit $tmp/in > $tmp/out
23924 rm -f $tmp/in
23925 mv $tmp/out $tmp/in
23926 rm -f conftest.edit conftest.frag
23927 ' >> "$CONFIG_STATUS"
23928
23929 cat >>"$CONFIG_STATUS" <<\EOF
23930   # Let's still pretend it is `configure' which instantiates (i.e., don't
23931   # use $as_me), people would be surprised to read:
23932   #    /* config.h.  Generated automatically by config.status.  */
23933   if test x"$ac_file" = x-; then
23934     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23935   else
23936     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23937   fi
23938   cat $tmp/in >>$tmp/config.h
23939   rm -f $tmp/in
23940   if test x"$ac_file" != x-; then
23941     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
23942       { echo "$as_me:23942: $ac_file is unchanged" >&5
23943 echo "$as_me: $ac_file is unchanged" >&6;}
23944     else
23945       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23946          X"$ac_file" : 'X\(//\)[^/]' \| \
23947          X"$ac_file" : 'X\(//\)$' \| \
23948          X"$ac_file" : 'X\(/\)' \| \
23949          .     : '\(.\)' 2>/dev/null ||
23950 echo X"$ac_file" |
23951     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23952           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23953           /^X\(\/\/\)$/{ s//\1/; q; }
23954           /^X\(\/\).*/{ s//\1/; q; }
23955           s/.*/./; q'`
23956       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23957         { case "$ac_dir" in
23958   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23959   *)                      as_incr_dir=.;;
23960 esac
23961 as_dummy="$ac_dir"
23962 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23963   case $as_mkdir_dir in
23964     # Skip DOS drivespec
23965     ?:) as_incr_dir=$as_mkdir_dir ;;
23966     *)
23967       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23968       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23969     ;;
23970   esac
23971 done; }
23972
23973       fi
23974       rm -f "$ac_file"
23975       mv "$tmp/config.h" "$ac_file"
23976     fi
23977   else
23978     cat $tmp/config.h
23979     rm -f $tmp/config.h
23980   fi
23981 done
23982 EOF
23983 cat >>"$CONFIG_STATUS" <<\EOF
23984 #
23985 # CONFIG_COMMANDS section.
23986 #
23987 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23988   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23989   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23990
23991   case "$ac_dest" in
23992     default )
23993
23994 for cf_dir in .
23995 do
23996         if test ! -d "$srcdir/$cf_dir" ; then
23997                 continue
23998         elif test -f "$srcdir/$cf_dir/programs" ; then
23999                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
24000         fi
24001 done
24002
24003         cat >>Makefile <<TEST_EOF
24004
24005 # These rules are generated so we do not rely on suffix rules, which do not
24006 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24007 # some, and the '\$x' confuses others).
24008 TEST_EOF
24009
24010 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24011 for N in $LIST
24012 do
24013         cat >>Makefile <<TEST_EOF
24014
24015 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24016         \$(srcdir)/test.priv.h \\
24017         ncurses_cfg.h
24018         $SHOW_CC
24019         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24020 TEST_EOF
24021 done
24022
24023 if test -f ../config.guess && test -f ../config.sub
24024 then
24025         cat >>Makefile <<TEST_EOF
24026
24027 # if we used CF_INHERIT for getting these files, we can remove them
24028 distclean::
24029         rm -f config.guess config.sub
24030 TEST_EOF
24031 fi
24032  ;;
24033   esac
24034 done
24035 EOF
24036
24037 cat >>"$CONFIG_STATUS" <<\EOF
24038
24039 { (exit 0); exit 0; }
24040 EOF
24041 chmod +x "$CONFIG_STATUS"
24042 ac_clean_files=$ac_clean_files_save
24043
24044 # configure is writing to config.log, and then calls config.status.
24045 # config.status does its own redirection, appending to config.log.
24046 # Unfortunately, on DOS this fails, as config.log is still kept open
24047 # by configure, so config.status won't be able to write to it; its
24048 # output is simply discarded.  So we exec the FD to /dev/null,
24049 # effectively closing config.log, so it can be properly (re)opened and
24050 # appended to by config.status.  When coming back to configure, we
24051 # need to make the FD available again.
24052 if test "$no_create" != yes; then
24053   ac_cs_success=:
24054   exec 5>/dev/null
24055   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24056   exec 5>>config.log
24057   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24058   # would make configure fail if this is the last instruction.
24059   "$ac_cs_success" || { (exit 1); exit 1; }
24060 fi
24061