]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.4 - patch 20240420
[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
3298 if test "$cf_cv_need_libm" = yes
3299 then
3300
3301         cf_save_LIBS="$LIBS"
3302         LIBS="$LIBS -lm"
3303         echo "$as_me:3303: checking if -lm is available for math functions" >&5
3304 echo $ECHO_N "checking if -lm is available for math functions... $ECHO_C" >&6
3305 if test "${cf_cv_have_libm+set}" = set; then
3306   echo $ECHO_N "(cached) $ECHO_C" >&6
3307 else
3308
3309         cat >"conftest.$ac_ext" <<_ACEOF
3310 #line 3310 "configure"
3311 #include "confdefs.h"
3312
3313                 #include <stdio.h>
3314                 #include <stdlib.h>
3315                 #include <math.h>
3316
3317 int
3318 main (void)
3319 {
3320 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3321   ;
3322   return 0;
3323 }
3324 _ACEOF
3325 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3326 if { (eval echo "$as_me:3326: \"$ac_link\"") >&5
3327   (eval $ac_link) 2>&5
3328   ac_status=$?
3329   echo "$as_me:3329: \$? = $ac_status" >&5
3330   (exit "$ac_status"); } &&
3331          { ac_try='test -s "conftest$ac_exeext"'
3332   { (eval echo "$as_me:3332: \"$ac_try\"") >&5
3333   (eval $ac_try) 2>&5
3334   ac_status=$?
3335   echo "$as_me:3335: \$? = $ac_status" >&5
3336   (exit "$ac_status"); }; }; then
3337   cf_cv_have_libm=yes
3338 else
3339   echo "$as_me: failed program was:" >&5
3340 cat "conftest.$ac_ext" >&5
3341 cf_cv_have_libm=no
3342 fi
3343 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3344 fi
3345 echo "$as_me:3345: result: $cf_cv_have_libm" >&5
3346 echo "${ECHO_T}$cf_cv_have_libm" >&6
3347         LIBS="$cf_save_LIBS"
3348
3349         if test "$cf_cv_have_libm" = yes
3350         then
3351                 MATH_LIB=-lm
3352         fi
3353 else
3354         cf_cv_have_libm=yes
3355 fi
3356
3357 if test "$cf_cv_have_libm" = yes
3358 then
3359
3360 cat >>confdefs.h <<\EOF
3361 #define HAVE_MATH_FUNCS 1
3362 EOF
3363
3364 fi
3365
3366 top_builddir=`pwd`
3367
3368 CC_G_OPT="-g"
3369 CC_SHARED_OPTS=unknown
3370 CPPFLAGS="$CPPFLAGS"
3371 DFT_DEP_SUFFIX=""
3372 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3373 DFT_UPR_MODEL="NORMAL"
3374 LD="ld"
3375 LDFLAGS_SHARED=""
3376 LDFLAGS_STATIC=""
3377 LD_MODEL=""
3378 LD_SHARED_OPTS=""
3379 LIBTOOL=""
3380 LIBTOOL_OPTS=""
3381 LIB_CLEAN=""
3382 LIB_COMPILE=""
3383 LIB_LINK='${CC}'
3384 LINK_TESTS=""
3385 LOCAL_LDFLAGS=""
3386 PACKAGE="ncurses-examples"
3387 PTHREAD="-lm"
3388 TEST_ARGS=""
3389 TEST_DEPS=""
3390 TEST_LIBS=""
3391 TINFO_LDFLAGS=''
3392 TINFO_LIBS='$(LIBS_CURSES)'
3393 cf_cv_abi_version=""
3394 cf_cv_rel_version=""
3395 includesubdir=""
3396
3397 cf_cv_screen=curses
3398 cf_cv_libtype=
3399
3400 echo "$as_me:3400: checking for fgrep" >&5
3401 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3402 if test "${ac_cv_path_FGREP+set}" = set; then
3403   echo $ECHO_N "(cached) $ECHO_C" >&6
3404 else
3405   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3406    then ac_cv_path_FGREP="$GREP -F"
3407    else
3408      for ac_prog in gfgrep fgrep
3409 do
3410   # Extract the first word of "$ac_prog", so it can be a program name with args.
3411 set dummy $ac_prog; ac_word=$2
3412 echo "$as_me:3412: checking for $ac_word" >&5
3413 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3414 if test "${ac_cv_path_FGREP+set}" = set; then
3415   echo $ECHO_N "(cached) $ECHO_C" >&6
3416 else
3417   case $FGREP in
3418   [\\/]* | ?:[\\/]*)
3419   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3420   ;;
3421   *)
3422   ac_save_IFS=$IFS; IFS=$ac_path_separator
3423 ac_dummy="$PATH"
3424 for ac_dir in $ac_dummy; do
3425   IFS=$ac_save_IFS
3426   test -z "$ac_dir" && ac_dir=.
3427   if $as_executable_p "$ac_dir/$ac_word"; then
3428    ac_cv_path_FGREP="$ac_dir/$ac_word"
3429    echo "$as_me:3429: found $ac_dir/$ac_word" >&5
3430    break
3431 fi
3432 done
3433
3434   ;;
3435 esac
3436 fi
3437 FGREP=$ac_cv_path_FGREP
3438
3439 if test -n "$FGREP"; then
3440   echo "$as_me:3440: result: $FGREP" >&5
3441 echo "${ECHO_T}$FGREP" >&6
3442 else
3443   echo "$as_me:3443: result: no" >&5
3444 echo "${ECHO_T}no" >&6
3445 fi
3446
3447   test -n "$FGREP" && break
3448 done
3449 test -n "$FGREP" || FGREP=": "
3450
3451      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3451: error: cannot find workable fgrep" >&5
3452 echo "$as_me: error: cannot find workable fgrep" >&2;}
3453    { (exit 1); exit 1; }; }
3454    fi
3455 fi
3456 echo "$as_me:3456: result: $ac_cv_path_FGREP" >&5
3457 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3458  FGREP="$ac_cv_path_FGREP"
3459
3460 echo "$as_me:3460: checking if you want to use C11 _Noreturn feature" >&5
3461 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3462
3463 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3464 if test "${enable_stdnoreturn+set}" = set; then
3465   enableval="$enable_stdnoreturn"
3466   test "$enableval" != yes && enableval=no
3467         if test "$enableval" != "no" ; then
3468     enable_stdnoreturn=yes
3469         else
3470                 enable_stdnoreturn=no
3471         fi
3472 else
3473   enableval=no
3474         enable_stdnoreturn=no
3475
3476 fi;
3477 echo "$as_me:3477: result: $enable_stdnoreturn" >&5
3478 echo "${ECHO_T}$enable_stdnoreturn" >&6
3479
3480 if test $enable_stdnoreturn = yes; then
3481 echo "$as_me:3481: checking for C11 _Noreturn feature" >&5
3482 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3483 if test "${cf_cv_c11_noreturn+set}" = set; then
3484   echo $ECHO_N "(cached) $ECHO_C" >&6
3485 else
3486   cat >"conftest.$ac_ext" <<_ACEOF
3487 #line 3487 "configure"
3488 #include "confdefs.h"
3489
3490 #include <stdio.h>
3491 #include <stdlib.h>
3492 #include <stdnoreturn.h>
3493 static _Noreturn void giveup(void) { exit(0); }
3494
3495 int
3496 main (void)
3497 {
3498 if (feof(stdin)) giveup()
3499   ;
3500   return 0;
3501 }
3502 _ACEOF
3503 rm -f "conftest.$ac_objext"
3504 if { (eval echo "$as_me:3504: \"$ac_compile\"") >&5
3505   (eval $ac_compile) 2>&5
3506   ac_status=$?
3507   echo "$as_me:3507: \$? = $ac_status" >&5
3508   (exit "$ac_status"); } &&
3509          { ac_try='test -s "conftest.$ac_objext"'
3510   { (eval echo "$as_me:3510: \"$ac_try\"") >&5
3511   (eval $ac_try) 2>&5
3512   ac_status=$?
3513   echo "$as_me:3513: \$? = $ac_status" >&5
3514   (exit "$ac_status"); }; }; then
3515   cf_cv_c11_noreturn=yes
3516 else
3517   echo "$as_me: failed program was:" >&5
3518 cat "conftest.$ac_ext" >&5
3519 cf_cv_c11_noreturn=no
3520 fi
3521 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3522
3523 fi
3524 echo "$as_me:3524: result: $cf_cv_c11_noreturn" >&5
3525 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3526 else
3527         cf_cv_c11_noreturn=no,
3528 fi
3529
3530 if test "$cf_cv_c11_noreturn" = yes; then
3531
3532 cat >>confdefs.h <<\EOF
3533 #define HAVE_STDNORETURN_H 1
3534 EOF
3535
3536 cat >>confdefs.h <<EOF
3537 #define STDC_NORETURN _Noreturn
3538 EOF
3539
3540         HAVE_STDNORETURN_H=1
3541 else
3542         HAVE_STDNORETURN_H=0
3543 fi
3544
3545 if test "$GCC" = yes || test "$GXX" = yes
3546 then
3547 cat > conftest.i <<EOF
3548 #ifndef GCC_PRINTF
3549 #define GCC_PRINTF 0
3550 #endif
3551 #ifndef GCC_SCANF
3552 #define GCC_SCANF 0
3553 #endif
3554 #ifndef GCC_NORETURN
3555 #define GCC_NORETURN /* nothing */
3556 #endif
3557 #ifndef GCC_UNUSED
3558 #define GCC_UNUSED /* nothing */
3559 #endif
3560 EOF
3561 if test "$GCC" = yes
3562 then
3563         { echo "$as_me:3563: checking for $CC __attribute__ directives..." >&5
3564 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3565 cat > "conftest.$ac_ext" <<EOF
3566 #line 3566 "${as_me:-configure}"
3567 #include "confdefs.h"
3568 #include "conftest.h"
3569 #include "conftest.i"
3570 #if     GCC_PRINTF
3571 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3572 #else
3573 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3574 #endif
3575 #if     GCC_SCANF
3576 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3577 #else
3578 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3579 #endif
3580 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3581 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3582 extern GCC_NORETURN void foo(void);
3583 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3584 EOF
3585         cf_printf_attribute=no
3586         cf_scanf_attribute=no
3587         for cf_attribute in scanf printf unused noreturn
3588         do
3589
3590 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3591
3592                 cf_directive="__attribute__(($cf_attribute))"
3593                 echo "checking for $CC $cf_directive" 1>&5
3594
3595                 case "$cf_attribute" in
3596                 (printf)
3597                         cf_printf_attribute=yes
3598                         cat >conftest.h <<EOF
3599 #define GCC_$cf_ATTRIBUTE 1
3600 EOF
3601                         ;;
3602                 (scanf)
3603                         cf_scanf_attribute=yes
3604                         cat >conftest.h <<EOF
3605 #define GCC_$cf_ATTRIBUTE 1
3606 EOF
3607                         ;;
3608                 (*)
3609                         cat >conftest.h <<EOF
3610 #define GCC_$cf_ATTRIBUTE $cf_directive
3611 EOF
3612                         ;;
3613                 esac
3614
3615                 if { (eval echo "$as_me:3615: \"$ac_compile\"") >&5
3616   (eval $ac_compile) 2>&5
3617   ac_status=$?
3618   echo "$as_me:3618: \$? = $ac_status" >&5
3619   (exit "$ac_status"); }; then
3620                         test -n "$verbose" && echo "$as_me:3620: result: ... $cf_attribute" >&5
3621 echo "${ECHO_T}... $cf_attribute" >&6
3622                         cat conftest.h >>confdefs.h
3623                         case "$cf_attribute" in
3624                         (noreturn)
3625
3626 cat >>confdefs.h <<EOF
3627 #define GCC_NORETURN $cf_directive
3628 EOF
3629
3630                                 ;;
3631                         (printf)
3632                                 cf_value='/* nothing */'
3633                                 if test "$cf_printf_attribute" != no ; then
3634                                         cf_value='__attribute__((format(printf,fmt,var)))'
3635
3636 cat >>confdefs.h <<\EOF
3637 #define GCC_PRINTF 1
3638 EOF
3639
3640                                 fi
3641
3642 cat >>confdefs.h <<EOF
3643 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3644 EOF
3645
3646                                 ;;
3647                         (scanf)
3648                                 cf_value='/* nothing */'
3649                                 if test "$cf_scanf_attribute" != no ; then
3650                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3651
3652 cat >>confdefs.h <<\EOF
3653 #define GCC_SCANF 1
3654 EOF
3655
3656                                 fi
3657
3658 cat >>confdefs.h <<EOF
3659 #define GCC_SCANFLIKE(fmt,var) $cf_value
3660 EOF
3661
3662                                 ;;
3663                         (unused)
3664
3665 cat >>confdefs.h <<EOF
3666 #define GCC_UNUSED $cf_directive
3667 EOF
3668
3669                                 ;;
3670                         esac
3671                 fi
3672         done
3673 else
3674         ${FGREP-fgrep} define conftest.i >>confdefs.h
3675 fi
3676 rm -rf ./conftest*
3677 fi
3678
3679 echo "$as_me:3679: checking if you want to work around bogus compiler/loader warnings" >&5
3680 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3681
3682 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3683 if test "${enable_string_hacks+set}" = set; then
3684   enableval="$enable_string_hacks"
3685   enable_string_hacks=$enableval
3686 else
3687   enable_string_hacks=no
3688 fi;
3689 echo "$as_me:3689: result: $enable_string_hacks" >&5
3690 echo "${ECHO_T}$enable_string_hacks" >&6
3691
3692 if test "x$enable_string_hacks" = "xyes"; then
3693
3694 cat >>confdefs.h <<\EOF
3695 #define USE_STRING_HACKS 1
3696 EOF
3697
3698         { echo "$as_me:3698: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3699 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3700         echo "$as_me:3700: checking for strlcat" >&5
3701 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3702 if test "${ac_cv_func_strlcat+set}" = set; then
3703   echo $ECHO_N "(cached) $ECHO_C" >&6
3704 else
3705   cat >"conftest.$ac_ext" <<_ACEOF
3706 #line 3706 "configure"
3707 #include "confdefs.h"
3708 #define strlcat autoconf_temporary
3709 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3710 #undef strlcat
3711
3712 #ifdef __cplusplus
3713 extern "C"
3714 #endif
3715
3716 /* We use char because int might match the return type of a gcc2
3717    builtin and then its argument prototype would still apply.  */
3718 char strlcat (void);
3719
3720 int
3721 main (void)
3722 {
3723
3724 /* The GNU C library defines stubs for functions which it implements
3725     to always fail with ENOSYS.  Some functions are actually named
3726     something starting with __ and the normal name is an alias.  */
3727 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3728 #error found stub for strlcat
3729 #endif
3730
3731         return strlcat ();
3732   ;
3733   return 0;
3734 }
3735 _ACEOF
3736 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3737 if { (eval echo "$as_me:3737: \"$ac_link\"") >&5
3738   (eval $ac_link) 2>&5
3739   ac_status=$?
3740   echo "$as_me:3740: \$? = $ac_status" >&5
3741   (exit "$ac_status"); } &&
3742          { ac_try='test -s "conftest$ac_exeext"'
3743   { (eval echo "$as_me:3743: \"$ac_try\"") >&5
3744   (eval $ac_try) 2>&5
3745   ac_status=$?
3746   echo "$as_me:3746: \$? = $ac_status" >&5
3747   (exit "$ac_status"); }; }; then
3748   ac_cv_func_strlcat=yes
3749 else
3750   echo "$as_me: failed program was:" >&5
3751 cat "conftest.$ac_ext" >&5
3752 ac_cv_func_strlcat=no
3753 fi
3754 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3755 fi
3756 echo "$as_me:3756: result: $ac_cv_func_strlcat" >&5
3757 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3758 if test "$ac_cv_func_strlcat" = yes; then
3759
3760 cat >>confdefs.h <<\EOF
3761 #define HAVE_STRLCAT 1
3762 EOF
3763
3764 else
3765
3766                 echo "$as_me:3766: checking for strlcat in -lbsd" >&5
3767 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3768 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3769   echo $ECHO_N "(cached) $ECHO_C" >&6
3770 else
3771   ac_check_lib_save_LIBS=$LIBS
3772 LIBS="-lbsd  $LIBS"
3773 cat >"conftest.$ac_ext" <<_ACEOF
3774 #line 3774 "configure"
3775 #include "confdefs.h"
3776
3777 /* Override any gcc2 internal prototype to avoid an error.  */
3778 #ifdef __cplusplus
3779 extern "C"
3780 #endif
3781 /* We use char because int might match the return type of a gcc2
3782    builtin and then its argument prototype would still apply.  */
3783 char strlcat ();
3784 int
3785 main (void)
3786 {
3787 strlcat ();
3788   ;
3789   return 0;
3790 }
3791 _ACEOF
3792 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3793 if { (eval echo "$as_me:3793: \"$ac_link\"") >&5
3794   (eval $ac_link) 2>&5
3795   ac_status=$?
3796   echo "$as_me:3796: \$? = $ac_status" >&5
3797   (exit "$ac_status"); } &&
3798          { ac_try='test -s "conftest$ac_exeext"'
3799   { (eval echo "$as_me:3799: \"$ac_try\"") >&5
3800   (eval $ac_try) 2>&5
3801   ac_status=$?
3802   echo "$as_me:3802: \$? = $ac_status" >&5
3803   (exit "$ac_status"); }; }; then
3804   ac_cv_lib_bsd_strlcat=yes
3805 else
3806   echo "$as_me: failed program was:" >&5
3807 cat "conftest.$ac_ext" >&5
3808 ac_cv_lib_bsd_strlcat=no
3809 fi
3810 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3811 LIBS=$ac_check_lib_save_LIBS
3812 fi
3813 echo "$as_me:3813: result: $ac_cv_lib_bsd_strlcat" >&5
3814 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3815 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3816
3817 cf_add_libs="$LIBS"
3818 # reverse order
3819 cf_add_0lib=
3820 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3821 # filter duplicates
3822 for cf_add_1lib in $cf_add_0lib; do
3823         for cf_add_2lib in $cf_add_libs; do
3824                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3825                         cf_add_1lib=
3826                         break
3827                 fi
3828         done
3829         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3830 done
3831 LIBS="$cf_add_libs"
3832
3833 for ac_header in bsd/string.h
3834 do
3835 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3836 echo "$as_me:3836: checking for $ac_header" >&5
3837 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3838 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3839   echo $ECHO_N "(cached) $ECHO_C" >&6
3840 else
3841   cat >"conftest.$ac_ext" <<_ACEOF
3842 #line 3842 "configure"
3843 #include "confdefs.h"
3844 #include <$ac_header>
3845 _ACEOF
3846 if { (eval echo "$as_me:3846: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3847   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3848   ac_status=$?
3849   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3850   rm -f conftest.er1
3851   cat conftest.err >&5
3852   echo "$as_me:3852: \$? = $ac_status" >&5
3853   (exit "$ac_status"); } >/dev/null; then
3854   if test -s conftest.err; then
3855     ac_cpp_err=$ac_c_preproc_warn_flag
3856   else
3857     ac_cpp_err=
3858   fi
3859 else
3860   ac_cpp_err=yes
3861 fi
3862 if test -z "$ac_cpp_err"; then
3863   eval "$as_ac_Header=yes"
3864 else
3865   echo "$as_me: failed program was:" >&5
3866   cat "conftest.$ac_ext" >&5
3867   eval "$as_ac_Header=no"
3868 fi
3869 rm -f conftest.err "conftest.$ac_ext"
3870 fi
3871 echo "$as_me:3871: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3872 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3873 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3874   cat >>confdefs.h <<EOF
3875 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3876 EOF
3877
3878 fi
3879 done
3880
3881 cat >>confdefs.h <<\EOF
3882 #define HAVE_STRLCAT 1
3883 EOF
3884
3885 fi
3886
3887 fi
3888
3889 for ac_func in strlcpy snprintf
3890 do
3891 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3892 echo "$as_me:3892: checking for $ac_func" >&5
3893 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3894 if eval "test \"\${$as_ac_var+set}\" = set"; then
3895   echo $ECHO_N "(cached) $ECHO_C" >&6
3896 else
3897   cat >"conftest.$ac_ext" <<_ACEOF
3898 #line 3898 "configure"
3899 #include "confdefs.h"
3900 #define $ac_func autoconf_temporary
3901 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3902 #undef $ac_func
3903
3904 #ifdef __cplusplus
3905 extern "C"
3906 #endif
3907
3908 /* We use char because int might match the return type of a gcc2
3909    builtin and then its argument prototype would still apply.  */
3910 char $ac_func (void);
3911
3912 int
3913 main (void)
3914 {
3915
3916 /* The GNU C library defines stubs for functions which it implements
3917     to always fail with ENOSYS.  Some functions are actually named
3918     something starting with __ and the normal name is an alias.  */
3919 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3920 #error found stub for $ac_func
3921 #endif
3922
3923         return $ac_func ();
3924   ;
3925   return 0;
3926 }
3927 _ACEOF
3928 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3929 if { (eval echo "$as_me:3929: \"$ac_link\"") >&5
3930   (eval $ac_link) 2>&5
3931   ac_status=$?
3932   echo "$as_me:3932: \$? = $ac_status" >&5
3933   (exit "$ac_status"); } &&
3934          { ac_try='test -s "conftest$ac_exeext"'
3935   { (eval echo "$as_me:3935: \"$ac_try\"") >&5
3936   (eval $ac_try) 2>&5
3937   ac_status=$?
3938   echo "$as_me:3938: \$? = $ac_status" >&5
3939   (exit "$ac_status"); }; }; then
3940   eval "$as_ac_var=yes"
3941 else
3942   echo "$as_me: failed program was:" >&5
3943 cat "conftest.$ac_ext" >&5
3944 eval "$as_ac_var=no"
3945 fi
3946 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3947 fi
3948 echo "$as_me:3948: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3949 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3950 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3951   cat >>confdefs.h <<EOF
3952 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3953 EOF
3954
3955 fi
3956 done
3957
3958 fi
3959
3960 echo "$as_me:3960: checking if the POSIX test-macros are already defined" >&5
3961 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3962 if test "${cf_cv_posix_visible+set}" = set; then
3963   echo $ECHO_N "(cached) $ECHO_C" >&6
3964 else
3965
3966 cat >"conftest.$ac_ext" <<_ACEOF
3967 #line 3967 "configure"
3968 #include "confdefs.h"
3969 #include <stdio.h>
3970 int
3971 main (void)
3972 {
3973
3974 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3975         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3976         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3977         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3978 #error conflicting symbols found
3979 #endif
3980
3981   ;
3982   return 0;
3983 }
3984 _ACEOF
3985 rm -f "conftest.$ac_objext"
3986 if { (eval echo "$as_me:3986: \"$ac_compile\"") >&5
3987   (eval $ac_compile) 2>&5
3988   ac_status=$?
3989   echo "$as_me:3989: \$? = $ac_status" >&5
3990   (exit "$ac_status"); } &&
3991          { ac_try='test -s "conftest.$ac_objext"'
3992   { (eval echo "$as_me:3992: \"$ac_try\"") >&5
3993   (eval $ac_try) 2>&5
3994   ac_status=$?
3995   echo "$as_me:3995: \$? = $ac_status" >&5
3996   (exit "$ac_status"); }; }; then
3997   cf_cv_posix_visible=no
3998 else
3999   echo "$as_me: failed program was:" >&5
4000 cat "conftest.$ac_ext" >&5
4001 cf_cv_posix_visible=yes
4002 fi
4003 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4004
4005 fi
4006 echo "$as_me:4006: result: $cf_cv_posix_visible" >&5
4007 echo "${ECHO_T}$cf_cv_posix_visible" >&6
4008
4009 if test "$cf_cv_posix_visible" = no; then
4010
4011 cf_XOPEN_SOURCE=600
4012 cf_POSIX_C_SOURCE=199506L
4013 cf_xopen_source=
4014
4015 case "$host_os" in
4016 (aix[4-7]*)
4017         cf_xopen_source="-D_ALL_SOURCE"
4018         ;;
4019 (msys)
4020         cf_XOPEN_SOURCE=600
4021         ;;
4022 (darwin[0-8].*)
4023         cf_xopen_source="-D_APPLE_C_SOURCE"
4024         ;;
4025 (darwin*)
4026         cf_xopen_source="-D_DARWIN_C_SOURCE"
4027         cf_XOPEN_SOURCE=
4028         ;;
4029 (freebsd*|dragonfly*|midnightbsd*)
4030         # 5.x headers associate
4031         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
4032         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
4033         cf_POSIX_C_SOURCE=200112L
4034         cf_XOPEN_SOURCE=600
4035         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4036         ;;
4037 (hpux11*)
4038         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
4039         ;;
4040 (hpux*)
4041         cf_xopen_source="-D_HPUX_SOURCE"
4042         ;;
4043 (irix[56].*)
4044         cf_xopen_source="-D_SGI_SOURCE"
4045         cf_XOPEN_SOURCE=
4046         ;;
4047 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
4048
4049 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
4050
4051 echo "$as_me:4051: checking if this is the GNU C library" >&5
4052 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
4053 if test "${cf_cv_gnu_library+set}" = set; then
4054   echo $ECHO_N "(cached) $ECHO_C" >&6
4055 else
4056
4057 cat >"conftest.$ac_ext" <<_ACEOF
4058 #line 4058 "configure"
4059 #include "confdefs.h"
4060 #include <sys/types.h>
4061 int
4062 main (void)
4063 {
4064
4065         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
4066                 return 0;
4067         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
4068                 return 0;
4069         #else
4070         #       error not GNU C library
4071         #endif
4072   ;
4073   return 0;
4074 }
4075 _ACEOF
4076 rm -f "conftest.$ac_objext"
4077 if { (eval echo "$as_me:4077: \"$ac_compile\"") >&5
4078   (eval $ac_compile) 2>&5
4079   ac_status=$?
4080   echo "$as_me:4080: \$? = $ac_status" >&5
4081   (exit "$ac_status"); } &&
4082          { ac_try='test -s "conftest.$ac_objext"'
4083   { (eval echo "$as_me:4083: \"$ac_try\"") >&5
4084   (eval $ac_try) 2>&5
4085   ac_status=$?
4086   echo "$as_me:4086: \$? = $ac_status" >&5
4087   (exit "$ac_status"); }; }; then
4088   cf_cv_gnu_library=yes
4089 else
4090   echo "$as_me: failed program was:" >&5
4091 cat "conftest.$ac_ext" >&5
4092 cf_cv_gnu_library=no
4093 fi
4094 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4095
4096 fi
4097 echo "$as_me:4097: result: $cf_cv_gnu_library" >&5
4098 echo "${ECHO_T}$cf_cv_gnu_library" >&6
4099
4100 if test x$cf_cv_gnu_library = xyes; then
4101
4102         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
4103         # was changed to help a little.  newlib incorporated the change about 4
4104         # years later.
4105         echo "$as_me:4105: checking if _DEFAULT_SOURCE can be used as a basis" >&5
4106 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
4107 if test "${cf_cv_gnu_library_219+set}" = set; then
4108   echo $ECHO_N "(cached) $ECHO_C" >&6
4109 else
4110
4111                 cf_save="$CPPFLAGS"
4112
4113         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4114         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4115
4116                 cat >"conftest.$ac_ext" <<_ACEOF
4117 #line 4117 "configure"
4118 #include "confdefs.h"
4119 #include <sys/types.h>
4120 int
4121 main (void)
4122 {
4123
4124                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
4125                                 return 0;
4126                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4127                                 return 0;
4128                         #else
4129                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4130                         #endif
4131   ;
4132   return 0;
4133 }
4134 _ACEOF
4135 rm -f "conftest.$ac_objext"
4136 if { (eval echo "$as_me:4136: \"$ac_compile\"") >&5
4137   (eval $ac_compile) 2>&5
4138   ac_status=$?
4139   echo "$as_me:4139: \$? = $ac_status" >&5
4140   (exit "$ac_status"); } &&
4141          { ac_try='test -s "conftest.$ac_objext"'
4142   { (eval echo "$as_me:4142: \"$ac_try\"") >&5
4143   (eval $ac_try) 2>&5
4144   ac_status=$?
4145   echo "$as_me:4145: \$? = $ac_status" >&5
4146   (exit "$ac_status"); }; }; then
4147   cf_cv_gnu_library_219=yes
4148 else
4149   echo "$as_me: failed program was:" >&5
4150 cat "conftest.$ac_ext" >&5
4151 cf_cv_gnu_library_219=no
4152 fi
4153 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4154                 CPPFLAGS="$cf_save"
4155
4156 fi
4157 echo "$as_me:4157: result: $cf_cv_gnu_library_219" >&5
4158 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4159
4160         if test "x$cf_cv_gnu_library_219" = xyes; then
4161                 cf_save="$CPPFLAGS"
4162                 echo "$as_me:4162: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4163 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4164 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4165   echo $ECHO_N "(cached) $ECHO_C" >&6
4166 else
4167
4168 cf_fix_cppflags=no
4169 cf_new_cflags=
4170 cf_new_cppflags=
4171 cf_new_extra_cppflags=
4172
4173 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4174 do
4175 case "$cf_fix_cppflags" in
4176 (no)
4177         case "$cf_add_cflags" in
4178         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4179                 case "$cf_add_cflags" in
4180                 (-D*)
4181                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4182
4183                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4184                                 && test -z "${cf_tst_cflags}" \
4185                                 && cf_fix_cppflags=yes
4186
4187                         if test "$cf_fix_cppflags" = yes ; then
4188
4189         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4190         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4191
4192                                 continue
4193                         elif test "${cf_tst_cflags}" = "\"'" ; then
4194
4195         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4196         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4197
4198                                 continue
4199                         fi
4200                         ;;
4201                 esac
4202                 case "$CPPFLAGS" in
4203                 (*$cf_add_cflags)
4204                         ;;
4205                 (*)
4206                         case "$cf_add_cflags" in
4207                         (-D*)
4208                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4209
4210 CPPFLAGS=`echo "$CPPFLAGS" | \
4211         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4212                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4213
4214                                 ;;
4215                         esac
4216
4217         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4218         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4219
4220                         ;;
4221                 esac
4222                 ;;
4223         (*)
4224
4225         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4226         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4227
4228                 ;;
4229         esac
4230         ;;
4231 (yes)
4232
4233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4235
4236         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4237
4238         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4239                 && test -z "${cf_tst_cflags}" \
4240                 && cf_fix_cppflags=no
4241         ;;
4242 esac
4243 done
4244
4245 if test -n "$cf_new_cflags" ; then
4246
4247         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4248         CFLAGS="${CFLAGS}$cf_new_cflags"
4249
4250 fi
4251
4252 if test -n "$cf_new_cppflags" ; then
4253
4254         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4255         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4256
4257 fi
4258
4259 if test -n "$cf_new_extra_cppflags" ; then
4260
4261         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4262         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4263
4264 fi
4265
4266                         cat >"conftest.$ac_ext" <<_ACEOF
4267 #line 4267 "configure"
4268 #include "confdefs.h"
4269
4270                                 #include <limits.h>
4271                                 #include <sys/types.h>
4272
4273 int
4274 main (void)
4275 {
4276
4277                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4278                                         return 0;
4279                                 #else
4280                                 #       error GNU C library is too old
4281                                 #endif
4282   ;
4283   return 0;
4284 }
4285 _ACEOF
4286 rm -f "conftest.$ac_objext"
4287 if { (eval echo "$as_me:4287: \"$ac_compile\"") >&5
4288   (eval $ac_compile) 2>&5
4289   ac_status=$?
4290   echo "$as_me:4290: \$? = $ac_status" >&5
4291   (exit "$ac_status"); } &&
4292          { ac_try='test -s "conftest.$ac_objext"'
4293   { (eval echo "$as_me:4293: \"$ac_try\"") >&5
4294   (eval $ac_try) 2>&5
4295   ac_status=$?
4296   echo "$as_me:4296: \$? = $ac_status" >&5
4297   (exit "$ac_status"); }; }; then
4298   cf_cv_gnu_dftsrc_219=yes
4299 else
4300   echo "$as_me: failed program was:" >&5
4301 cat "conftest.$ac_ext" >&5
4302 cf_cv_gnu_dftsrc_219=no
4303 fi
4304 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4305
4306 fi
4307 echo "$as_me:4307: result: $cf_cv_gnu_dftsrc_219" >&5
4308 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4309                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4310         else
4311                 cf_cv_gnu_dftsrc_219=maybe
4312         fi
4313
4314         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4315
4316                 echo "$as_me:4316: checking if we must define _GNU_SOURCE" >&5
4317 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4318 if test "${cf_cv_gnu_source+set}" = set; then
4319   echo $ECHO_N "(cached) $ECHO_C" >&6
4320 else
4321
4322                 cat >"conftest.$ac_ext" <<_ACEOF
4323 #line 4323 "configure"
4324 #include "confdefs.h"
4325 #include <sys/types.h>
4326 int
4327 main (void)
4328 {
4329
4330                         #ifndef _XOPEN_SOURCE
4331                         #error  expected _XOPEN_SOURCE to be defined
4332                         #endif
4333   ;
4334   return 0;
4335 }
4336 _ACEOF
4337 rm -f "conftest.$ac_objext"
4338 if { (eval echo "$as_me:4338: \"$ac_compile\"") >&5
4339   (eval $ac_compile) 2>&5
4340   ac_status=$?
4341   echo "$as_me:4341: \$? = $ac_status" >&5
4342   (exit "$ac_status"); } &&
4343          { ac_try='test -s "conftest.$ac_objext"'
4344   { (eval echo "$as_me:4344: \"$ac_try\"") >&5
4345   (eval $ac_try) 2>&5
4346   ac_status=$?
4347   echo "$as_me:4347: \$? = $ac_status" >&5
4348   (exit "$ac_status"); }; }; then
4349   cf_cv_gnu_source=no
4350 else
4351   echo "$as_me: failed program was:" >&5
4352 cat "conftest.$ac_ext" >&5
4353 cf_save="$CPPFLAGS"
4354
4355 cf_fix_cppflags=no
4356 cf_new_cflags=
4357 cf_new_cppflags=
4358 cf_new_extra_cppflags=
4359
4360 for cf_add_cflags in -D_GNU_SOURCE
4361 do
4362 case "$cf_fix_cppflags" in
4363 (no)
4364         case "$cf_add_cflags" in
4365         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4366                 case "$cf_add_cflags" in
4367                 (-D*)
4368                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4369
4370                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4371                                 && test -z "${cf_tst_cflags}" \
4372                                 && cf_fix_cppflags=yes
4373
4374                         if test "$cf_fix_cppflags" = yes ; then
4375
4376         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4377         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4378
4379                                 continue
4380                         elif test "${cf_tst_cflags}" = "\"'" ; then
4381
4382         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4383         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4384
4385                                 continue
4386                         fi
4387                         ;;
4388                 esac
4389                 case "$CPPFLAGS" in
4390                 (*$cf_add_cflags)
4391                         ;;
4392                 (*)
4393                         case "$cf_add_cflags" in
4394                         (-D*)
4395                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4396
4397 CPPFLAGS=`echo "$CPPFLAGS" | \
4398         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4399                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4400
4401                                 ;;
4402                         esac
4403
4404         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4405         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4406
4407                         ;;
4408                 esac
4409                 ;;
4410         (*)
4411
4412         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4413         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4414
4415                 ;;
4416         esac
4417         ;;
4418 (yes)
4419
4420         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4421         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4422
4423         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4424
4425         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4426                 && test -z "${cf_tst_cflags}" \
4427                 && cf_fix_cppflags=no
4428         ;;
4429 esac
4430 done
4431
4432 if test -n "$cf_new_cflags" ; then
4433
4434         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4435         CFLAGS="${CFLAGS}$cf_new_cflags"
4436
4437 fi
4438
4439 if test -n "$cf_new_cppflags" ; then
4440
4441         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4442         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4443
4444 fi
4445
4446 if test -n "$cf_new_extra_cppflags" ; then
4447
4448         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4449         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4450
4451 fi
4452
4453                          cat >"conftest.$ac_ext" <<_ACEOF
4454 #line 4454 "configure"
4455 #include "confdefs.h"
4456 #include <sys/types.h>
4457 int
4458 main (void)
4459 {
4460
4461                                 #ifdef _XOPEN_SOURCE
4462                                 #error  expected _XOPEN_SOURCE to be undefined
4463                                 #endif
4464   ;
4465   return 0;
4466 }
4467 _ACEOF
4468 rm -f "conftest.$ac_objext"
4469 if { (eval echo "$as_me:4469: \"$ac_compile\"") >&5
4470   (eval $ac_compile) 2>&5
4471   ac_status=$?
4472   echo "$as_me:4472: \$? = $ac_status" >&5
4473   (exit "$ac_status"); } &&
4474          { ac_try='test -s "conftest.$ac_objext"'
4475   { (eval echo "$as_me:4475: \"$ac_try\"") >&5
4476   (eval $ac_try) 2>&5
4477   ac_status=$?
4478   echo "$as_me:4478: \$? = $ac_status" >&5
4479   (exit "$ac_status"); }; }; then
4480   cf_cv_gnu_source=no
4481 else
4482   echo "$as_me: failed program was:" >&5
4483 cat "conftest.$ac_ext" >&5
4484 cf_cv_gnu_source=yes
4485 fi
4486 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4487                         CPPFLAGS="$cf_save"
4488
4489 fi
4490 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4491
4492 fi
4493 echo "$as_me:4493: result: $cf_cv_gnu_source" >&5
4494 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4495
4496                 if test "$cf_cv_gnu_source" = yes
4497                 then
4498                 echo "$as_me:4498: checking if we should also define _DEFAULT_SOURCE" >&5
4499 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4500 if test "${cf_cv_default_source+set}" = set; then
4501   echo $ECHO_N "(cached) $ECHO_C" >&6
4502 else
4503
4504         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4505         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4506
4507                         cat >"conftest.$ac_ext" <<_ACEOF
4508 #line 4508 "configure"
4509 #include "confdefs.h"
4510 #include <sys/types.h>
4511 int
4512 main (void)
4513 {
4514
4515                                 #ifdef _DEFAULT_SOURCE
4516                                 #error  expected _DEFAULT_SOURCE to be undefined
4517                                 #endif
4518   ;
4519   return 0;
4520 }
4521 _ACEOF
4522 rm -f "conftest.$ac_objext"
4523 if { (eval echo "$as_me:4523: \"$ac_compile\"") >&5
4524   (eval $ac_compile) 2>&5
4525   ac_status=$?
4526   echo "$as_me:4526: \$? = $ac_status" >&5
4527   (exit "$ac_status"); } &&
4528          { ac_try='test -s "conftest.$ac_objext"'
4529   { (eval echo "$as_me:4529: \"$ac_try\"") >&5
4530   (eval $ac_try) 2>&5
4531   ac_status=$?
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit "$ac_status"); }; }; then
4534   cf_cv_default_source=no
4535 else
4536   echo "$as_me: failed program was:" >&5
4537 cat "conftest.$ac_ext" >&5
4538 cf_cv_default_source=yes
4539 fi
4540 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4541
4542 fi
4543 echo "$as_me:4543: result: $cf_cv_default_source" >&5
4544 echo "${ECHO_T}$cf_cv_default_source" >&6
4545                         if test "$cf_cv_default_source" = yes
4546                         then
4547
4548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4549         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4550
4551                         fi
4552                 fi
4553         fi
4554
4555 fi
4556
4557         ;;
4558 (minix*)
4559         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4560         ;;
4561 (mirbsd*)
4562         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4563         cf_XOPEN_SOURCE=
4564
4565 if test "$cf_cv_posix_visible" = no; then
4566
4567 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4568
4569 cf_save_CFLAGS="$CFLAGS"
4570 cf_save_CPPFLAGS="$CPPFLAGS"
4571
4572 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4573         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4574                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4575
4576 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4577         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4578                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4579
4580 echo "$as_me:4580: checking if we should define _POSIX_C_SOURCE" >&5
4581 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4582 if test "${cf_cv_posix_c_source+set}" = set; then
4583   echo $ECHO_N "(cached) $ECHO_C" >&6
4584 else
4585
4586 echo "${as_me:-configure}:4586: testing if the symbol is already defined go no further ..." 1>&5
4587
4588         cat >"conftest.$ac_ext" <<_ACEOF
4589 #line 4589 "configure"
4590 #include "confdefs.h"
4591 #include <sys/types.h>
4592 int
4593 main (void)
4594 {
4595
4596 #ifndef _POSIX_C_SOURCE
4597 make an error
4598 #endif
4599   ;
4600   return 0;
4601 }
4602 _ACEOF
4603 rm -f "conftest.$ac_objext"
4604 if { (eval echo "$as_me:4604: \"$ac_compile\"") >&5
4605   (eval $ac_compile) 2>&5
4606   ac_status=$?
4607   echo "$as_me:4607: \$? = $ac_status" >&5
4608   (exit "$ac_status"); } &&
4609          { ac_try='test -s "conftest.$ac_objext"'
4610   { (eval echo "$as_me:4610: \"$ac_try\"") >&5
4611   (eval $ac_try) 2>&5
4612   ac_status=$?
4613   echo "$as_me:4613: \$? = $ac_status" >&5
4614   (exit "$ac_status"); }; }; then
4615   cf_cv_posix_c_source=no
4616 else
4617   echo "$as_me: failed program was:" >&5
4618 cat "conftest.$ac_ext" >&5
4619 cf_want_posix_source=no
4620          case .$cf_POSIX_C_SOURCE in
4621          (.[12]??*)
4622                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4623                 ;;
4624          (.2)
4625                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4626                 cf_want_posix_source=yes
4627                 ;;
4628          (.*)
4629                 cf_want_posix_source=yes
4630                 ;;
4631          esac
4632          if test "$cf_want_posix_source" = yes ; then
4633                 cat >"conftest.$ac_ext" <<_ACEOF
4634 #line 4634 "configure"
4635 #include "confdefs.h"
4636 #include <sys/types.h>
4637 int
4638 main (void)
4639 {
4640
4641 #ifdef _POSIX_SOURCE
4642 make an error
4643 #endif
4644   ;
4645   return 0;
4646 }
4647 _ACEOF
4648 rm -f "conftest.$ac_objext"
4649 if { (eval echo "$as_me:4649: \"$ac_compile\"") >&5
4650   (eval $ac_compile) 2>&5
4651   ac_status=$?
4652   echo "$as_me:4652: \$? = $ac_status" >&5
4653   (exit "$ac_status"); } &&
4654          { ac_try='test -s "conftest.$ac_objext"'
4655   { (eval echo "$as_me:4655: \"$ac_try\"") >&5
4656   (eval $ac_try) 2>&5
4657   ac_status=$?
4658   echo "$as_me:4658: \$? = $ac_status" >&5
4659   (exit "$ac_status"); }; }; then
4660   :
4661 else
4662   echo "$as_me: failed program was:" >&5
4663 cat "conftest.$ac_ext" >&5
4664 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4665 fi
4666 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4667          fi
4668
4669 echo "${as_me:-configure}:4669: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4670
4671          CFLAGS="$cf_trim_CFLAGS"
4672          CPPFLAGS="$cf_trim_CPPFLAGS"
4673
4674         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4675         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4676
4677 echo "${as_me:-configure}:4677: testing if the second compile does not leave our definition intact error ..." 1>&5
4678
4679          cat >"conftest.$ac_ext" <<_ACEOF
4680 #line 4680 "configure"
4681 #include "confdefs.h"
4682 #include <sys/types.h>
4683 int
4684 main (void)
4685 {
4686
4687 #ifndef _POSIX_C_SOURCE
4688 make an error
4689 #endif
4690   ;
4691   return 0;
4692 }
4693 _ACEOF
4694 rm -f "conftest.$ac_objext"
4695 if { (eval echo "$as_me:4695: \"$ac_compile\"") >&5
4696   (eval $ac_compile) 2>&5
4697   ac_status=$?
4698   echo "$as_me:4698: \$? = $ac_status" >&5
4699   (exit "$ac_status"); } &&
4700          { ac_try='test -s "conftest.$ac_objext"'
4701   { (eval echo "$as_me:4701: \"$ac_try\"") >&5
4702   (eval $ac_try) 2>&5
4703   ac_status=$?
4704   echo "$as_me:4704: \$? = $ac_status" >&5
4705   (exit "$ac_status"); }; }; then
4706   :
4707 else
4708   echo "$as_me: failed program was:" >&5
4709 cat "conftest.$ac_ext" >&5
4710 cf_cv_posix_c_source=no
4711 fi
4712 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4713          CFLAGS="$cf_save_CFLAGS"
4714          CPPFLAGS="$cf_save_CPPFLAGS"
4715
4716 fi
4717 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4718
4719 fi
4720 echo "$as_me:4720: result: $cf_cv_posix_c_source" >&5
4721 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4722
4723 if test "$cf_cv_posix_c_source" != no ; then
4724         CFLAGS="$cf_trim_CFLAGS"
4725         CPPFLAGS="$cf_trim_CPPFLAGS"
4726
4727 cf_fix_cppflags=no
4728 cf_new_cflags=
4729 cf_new_cppflags=
4730 cf_new_extra_cppflags=
4731
4732 for cf_add_cflags in $cf_cv_posix_c_source
4733 do
4734 case "$cf_fix_cppflags" in
4735 (no)
4736         case "$cf_add_cflags" in
4737         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4738                 case "$cf_add_cflags" in
4739                 (-D*)
4740                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4741
4742                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4743                                 && test -z "${cf_tst_cflags}" \
4744                                 && cf_fix_cppflags=yes
4745
4746                         if test "$cf_fix_cppflags" = yes ; then
4747
4748         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4749         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4750
4751                                 continue
4752                         elif test "${cf_tst_cflags}" = "\"'" ; then
4753
4754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4756
4757                                 continue
4758                         fi
4759                         ;;
4760                 esac
4761                 case "$CPPFLAGS" in
4762                 (*$cf_add_cflags)
4763                         ;;
4764                 (*)
4765                         case "$cf_add_cflags" in
4766                         (-D*)
4767                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4768
4769 CPPFLAGS=`echo "$CPPFLAGS" | \
4770         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4771                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4772
4773                                 ;;
4774                         esac
4775
4776         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4777         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4778
4779                         ;;
4780                 esac
4781                 ;;
4782         (*)
4783
4784         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4785         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4786
4787                 ;;
4788         esac
4789         ;;
4790 (yes)
4791
4792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4794
4795         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4796
4797         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4798                 && test -z "${cf_tst_cflags}" \
4799                 && cf_fix_cppflags=no
4800         ;;
4801 esac
4802 done
4803
4804 if test -n "$cf_new_cflags" ; then
4805
4806         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4807         CFLAGS="${CFLAGS}$cf_new_cflags"
4808
4809 fi
4810
4811 if test -n "$cf_new_cppflags" ; then
4812
4813         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4814         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4815
4816 fi
4817
4818 if test -n "$cf_new_extra_cppflags" ; then
4819
4820         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4821         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4822
4823 fi
4824
4825 fi
4826
4827 fi # cf_cv_posix_visible
4828
4829         ;;
4830 (netbsd*)
4831         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4832         ;;
4833 (openbsd[6-9]*)
4834         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4835         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4836         # Abusing the conformance level is a workaround.
4837         { echo "$as_me:4837: WARNING: this system does not provide usable locale support" >&5
4838 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4839         cf_xopen_source="-D_BSD_SOURCE"
4840         cf_XOPEN_SOURCE=700
4841         ;;
4842 (openbsd[4-5]*)
4843         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4844         cf_xopen_source="-D_BSD_SOURCE"
4845         cf_XOPEN_SOURCE=600
4846         ;;
4847 (openbsd*)
4848         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4849         ;;
4850 (osf[45]*)
4851         cf_xopen_source="-D_OSF_SOURCE"
4852         ;;
4853 (nto-qnx*)
4854         cf_xopen_source="-D_QNX_SOURCE"
4855         ;;
4856 (sco*)
4857         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4858         ;;
4859 (solaris2.*)
4860         cf_xopen_source="-D__EXTENSIONS__"
4861         cf_cv_xopen_source=broken
4862         ;;
4863 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4864         cf_XOPEN_SOURCE=
4865         cf_POSIX_C_SOURCE=
4866         ;;
4867 (*)
4868
4869 echo "$as_me:4869: checking if we should define _XOPEN_SOURCE" >&5
4870 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4871 if test "${cf_cv_xopen_source+set}" = set; then
4872   echo $ECHO_N "(cached) $ECHO_C" >&6
4873 else
4874
4875         cat >"conftest.$ac_ext" <<_ACEOF
4876 #line 4876 "configure"
4877 #include "confdefs.h"
4878
4879 #include <stdlib.h>
4880 #include <string.h>
4881 #include <sys/types.h>
4882
4883 int
4884 main (void)
4885 {
4886
4887 #ifndef _XOPEN_SOURCE
4888 make an error
4889 #endif
4890   ;
4891   return 0;
4892 }
4893 _ACEOF
4894 rm -f "conftest.$ac_objext"
4895 if { (eval echo "$as_me:4895: \"$ac_compile\"") >&5
4896   (eval $ac_compile) 2>&5
4897   ac_status=$?
4898   echo "$as_me:4898: \$? = $ac_status" >&5
4899   (exit "$ac_status"); } &&
4900          { ac_try='test -s "conftest.$ac_objext"'
4901   { (eval echo "$as_me:4901: \"$ac_try\"") >&5
4902   (eval $ac_try) 2>&5
4903   ac_status=$?
4904   echo "$as_me:4904: \$? = $ac_status" >&5
4905   (exit "$ac_status"); }; }; then
4906   cf_cv_xopen_source=no
4907 else
4908   echo "$as_me: failed program was:" >&5
4909 cat "conftest.$ac_ext" >&5
4910 cf_save="$CPPFLAGS"
4911
4912         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4913         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4914
4915          cat >"conftest.$ac_ext" <<_ACEOF
4916 #line 4916 "configure"
4917 #include "confdefs.h"
4918
4919 #include <stdlib.h>
4920 #include <string.h>
4921 #include <sys/types.h>
4922
4923 int
4924 main (void)
4925 {
4926
4927 #ifdef _XOPEN_SOURCE
4928 make an error
4929 #endif
4930   ;
4931   return 0;
4932 }
4933 _ACEOF
4934 rm -f "conftest.$ac_objext"
4935 if { (eval echo "$as_me:4935: \"$ac_compile\"") >&5
4936   (eval $ac_compile) 2>&5
4937   ac_status=$?
4938   echo "$as_me:4938: \$? = $ac_status" >&5
4939   (exit "$ac_status"); } &&
4940          { ac_try='test -s "conftest.$ac_objext"'
4941   { (eval echo "$as_me:4941: \"$ac_try\"") >&5
4942   (eval $ac_try) 2>&5
4943   ac_status=$?
4944   echo "$as_me:4944: \$? = $ac_status" >&5
4945   (exit "$ac_status"); }; }; then
4946   cf_cv_xopen_source=no
4947 else
4948   echo "$as_me: failed program was:" >&5
4949 cat "conftest.$ac_ext" >&5
4950 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4951 fi
4952 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4953         CPPFLAGS="$cf_save"
4954
4955 fi
4956 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4957
4958 fi
4959 echo "$as_me:4959: result: $cf_cv_xopen_source" >&5
4960 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4961
4962 if test "$cf_cv_xopen_source" != no ; then
4963
4964 CFLAGS=`echo "$CFLAGS" | \
4965         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4966                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4967
4968 CPPFLAGS=`echo "$CPPFLAGS" | \
4969         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4970                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4971
4972         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4973
4974 for cf_add_cflags in $cf_temp_xopen_source
4975 do
4976         case "x$cf_add_cflags" in
4977         (x-[DU]*)
4978
4979 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4980 while true
4981 do
4982         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4983         test "$CFLAGS" != "$cf_old_cflag" || break
4984
4985         CFLAGS="$cf_old_cflag"
4986 done
4987
4988 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4989 while true
4990 do
4991         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
4992         test "$CPPFLAGS" != "$cf_old_cflag" || break
4993
4994         CPPFLAGS="$cf_old_cflag"
4995 done
4996
4997                 ;;
4998         esac
4999
5000 cf_fix_cppflags=no
5001 cf_new_cflags=
5002 cf_new_cppflags=
5003 cf_new_extra_cppflags=
5004
5005 for cf_add_cflags in $cf_add_cflags
5006 do
5007 case "$cf_fix_cppflags" in
5008 (no)
5009         case "$cf_add_cflags" in
5010         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5011                 case "$cf_add_cflags" in
5012                 (-D*)
5013                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5014
5015                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5016                                 && test -z "${cf_tst_cflags}" \
5017                                 && cf_fix_cppflags=yes
5018
5019                         if test "$cf_fix_cppflags" = yes ; then
5020
5021         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5022         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5023
5024                                 continue
5025                         elif test "${cf_tst_cflags}" = "\"'" ; then
5026
5027         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5028         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5029
5030                                 continue
5031                         fi
5032                         ;;
5033                 esac
5034                 case "$CPPFLAGS" in
5035                 (*$cf_add_cflags)
5036                         ;;
5037                 (*)
5038                         case "$cf_add_cflags" in
5039                         (-D*)
5040                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5041
5042 CPPFLAGS=`echo "$CPPFLAGS" | \
5043         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5044                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5045
5046                                 ;;
5047                         esac
5048
5049         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5050         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5051
5052                         ;;
5053                 esac
5054                 ;;
5055         (*)
5056
5057         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5058         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5059
5060                 ;;
5061         esac
5062         ;;
5063 (yes)
5064
5065         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5066         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5067
5068         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5069
5070         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5071                 && test -z "${cf_tst_cflags}" \
5072                 && cf_fix_cppflags=no
5073         ;;
5074 esac
5075 done
5076
5077 if test -n "$cf_new_cflags" ; then
5078
5079         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5080         CFLAGS="${CFLAGS}$cf_new_cflags"
5081
5082 fi
5083
5084 if test -n "$cf_new_cppflags" ; then
5085
5086         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5087         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5088
5089 fi
5090
5091 if test -n "$cf_new_extra_cppflags" ; then
5092
5093         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5094         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5095
5096 fi
5097
5098 done
5099
5100 fi
5101
5102 if test "$cf_cv_posix_visible" = no; then
5103
5104 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5105
5106 cf_save_CFLAGS="$CFLAGS"
5107 cf_save_CPPFLAGS="$CPPFLAGS"
5108
5109 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5110         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5111                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5112
5113 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5114         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5115                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5116
5117 echo "$as_me:5117: checking if we should define _POSIX_C_SOURCE" >&5
5118 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5119 if test "${cf_cv_posix_c_source+set}" = set; then
5120   echo $ECHO_N "(cached) $ECHO_C" >&6
5121 else
5122
5123 echo "${as_me:-configure}:5123: testing if the symbol is already defined go no further ..." 1>&5
5124
5125         cat >"conftest.$ac_ext" <<_ACEOF
5126 #line 5126 "configure"
5127 #include "confdefs.h"
5128 #include <sys/types.h>
5129 int
5130 main (void)
5131 {
5132
5133 #ifndef _POSIX_C_SOURCE
5134 make an error
5135 #endif
5136   ;
5137   return 0;
5138 }
5139 _ACEOF
5140 rm -f "conftest.$ac_objext"
5141 if { (eval echo "$as_me:5141: \"$ac_compile\"") >&5
5142   (eval $ac_compile) 2>&5
5143   ac_status=$?
5144   echo "$as_me:5144: \$? = $ac_status" >&5
5145   (exit "$ac_status"); } &&
5146          { ac_try='test -s "conftest.$ac_objext"'
5147   { (eval echo "$as_me:5147: \"$ac_try\"") >&5
5148   (eval $ac_try) 2>&5
5149   ac_status=$?
5150   echo "$as_me:5150: \$? = $ac_status" >&5
5151   (exit "$ac_status"); }; }; then
5152   cf_cv_posix_c_source=no
5153 else
5154   echo "$as_me: failed program was:" >&5
5155 cat "conftest.$ac_ext" >&5
5156 cf_want_posix_source=no
5157          case .$cf_POSIX_C_SOURCE in
5158          (.[12]??*)
5159                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5160                 ;;
5161          (.2)
5162                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5163                 cf_want_posix_source=yes
5164                 ;;
5165          (.*)
5166                 cf_want_posix_source=yes
5167                 ;;
5168          esac
5169          if test "$cf_want_posix_source" = yes ; then
5170                 cat >"conftest.$ac_ext" <<_ACEOF
5171 #line 5171 "configure"
5172 #include "confdefs.h"
5173 #include <sys/types.h>
5174 int
5175 main (void)
5176 {
5177
5178 #ifdef _POSIX_SOURCE
5179 make an error
5180 #endif
5181   ;
5182   return 0;
5183 }
5184 _ACEOF
5185 rm -f "conftest.$ac_objext"
5186 if { (eval echo "$as_me:5186: \"$ac_compile\"") >&5
5187   (eval $ac_compile) 2>&5
5188   ac_status=$?
5189   echo "$as_me:5189: \$? = $ac_status" >&5
5190   (exit "$ac_status"); } &&
5191          { ac_try='test -s "conftest.$ac_objext"'
5192   { (eval echo "$as_me:5192: \"$ac_try\"") >&5
5193   (eval $ac_try) 2>&5
5194   ac_status=$?
5195   echo "$as_me:5195: \$? = $ac_status" >&5
5196   (exit "$ac_status"); }; }; then
5197   :
5198 else
5199   echo "$as_me: failed program was:" >&5
5200 cat "conftest.$ac_ext" >&5
5201 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5202 fi
5203 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5204          fi
5205
5206 echo "${as_me:-configure}:5206: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5207
5208          CFLAGS="$cf_trim_CFLAGS"
5209          CPPFLAGS="$cf_trim_CPPFLAGS"
5210
5211         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5212         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5213
5214 echo "${as_me:-configure}:5214: testing if the second compile does not leave our definition intact error ..." 1>&5
5215
5216          cat >"conftest.$ac_ext" <<_ACEOF
5217 #line 5217 "configure"
5218 #include "confdefs.h"
5219 #include <sys/types.h>
5220 int
5221 main (void)
5222 {
5223
5224 #ifndef _POSIX_C_SOURCE
5225 make an error
5226 #endif
5227   ;
5228   return 0;
5229 }
5230 _ACEOF
5231 rm -f "conftest.$ac_objext"
5232 if { (eval echo "$as_me:5232: \"$ac_compile\"") >&5
5233   (eval $ac_compile) 2>&5
5234   ac_status=$?
5235   echo "$as_me:5235: \$? = $ac_status" >&5
5236   (exit "$ac_status"); } &&
5237          { ac_try='test -s "conftest.$ac_objext"'
5238   { (eval echo "$as_me:5238: \"$ac_try\"") >&5
5239   (eval $ac_try) 2>&5
5240   ac_status=$?
5241   echo "$as_me:5241: \$? = $ac_status" >&5
5242   (exit "$ac_status"); }; }; then
5243   :
5244 else
5245   echo "$as_me: failed program was:" >&5
5246 cat "conftest.$ac_ext" >&5
5247 cf_cv_posix_c_source=no
5248 fi
5249 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5250          CFLAGS="$cf_save_CFLAGS"
5251          CPPFLAGS="$cf_save_CPPFLAGS"
5252
5253 fi
5254 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5255
5256 fi
5257 echo "$as_me:5257: result: $cf_cv_posix_c_source" >&5
5258 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5259
5260 if test "$cf_cv_posix_c_source" != no ; then
5261         CFLAGS="$cf_trim_CFLAGS"
5262         CPPFLAGS="$cf_trim_CPPFLAGS"
5263
5264 cf_fix_cppflags=no
5265 cf_new_cflags=
5266 cf_new_cppflags=
5267 cf_new_extra_cppflags=
5268
5269 for cf_add_cflags in $cf_cv_posix_c_source
5270 do
5271 case "$cf_fix_cppflags" in
5272 (no)
5273         case "$cf_add_cflags" in
5274         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5275                 case "$cf_add_cflags" in
5276                 (-D*)
5277                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5278
5279                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5280                                 && test -z "${cf_tst_cflags}" \
5281                                 && cf_fix_cppflags=yes
5282
5283                         if test "$cf_fix_cppflags" = yes ; then
5284
5285         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5286         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5287
5288                                 continue
5289                         elif test "${cf_tst_cflags}" = "\"'" ; then
5290
5291         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5292         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5293
5294                                 continue
5295                         fi
5296                         ;;
5297                 esac
5298                 case "$CPPFLAGS" in
5299                 (*$cf_add_cflags)
5300                         ;;
5301                 (*)
5302                         case "$cf_add_cflags" in
5303                         (-D*)
5304                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5305
5306 CPPFLAGS=`echo "$CPPFLAGS" | \
5307         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5308                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5309
5310                                 ;;
5311                         esac
5312
5313         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5314         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5315
5316                         ;;
5317                 esac
5318                 ;;
5319         (*)
5320
5321         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5322         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5323
5324                 ;;
5325         esac
5326         ;;
5327 (yes)
5328
5329         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5330         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5331
5332         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5333
5334         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5335                 && test -z "${cf_tst_cflags}" \
5336                 && cf_fix_cppflags=no
5337         ;;
5338 esac
5339 done
5340
5341 if test -n "$cf_new_cflags" ; then
5342
5343         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5344         CFLAGS="${CFLAGS}$cf_new_cflags"
5345
5346 fi
5347
5348 if test -n "$cf_new_cppflags" ; then
5349
5350         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5351         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5352
5353 fi
5354
5355 if test -n "$cf_new_extra_cppflags" ; then
5356
5357         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5358         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5359
5360 fi
5361
5362 fi
5363
5364 fi # cf_cv_posix_visible
5365
5366         ;;
5367 esac
5368
5369 if test -n "$cf_xopen_source" ; then
5370
5371 for cf_add_cflags in $cf_xopen_source
5372 do
5373         case "x$cf_add_cflags" in
5374         (x-[DU]*)
5375
5376 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5377 while true
5378 do
5379         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5380         test "$CFLAGS" != "$cf_old_cflag" || break
5381         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
5382
5383 echo "${as_me:-configure}:5383: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
5384
5385         CFLAGS="$cf_old_cflag"
5386 done
5387
5388 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5389 while true
5390 do
5391         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5392         test "$CPPFLAGS" != "$cf_old_cflag" || break
5393         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
5394
5395 echo "${as_me:-configure}:5395: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
5396
5397         CPPFLAGS="$cf_old_cflag"
5398 done
5399
5400                 ;;
5401         esac
5402
5403 cf_fix_cppflags=no
5404 cf_new_cflags=
5405 cf_new_cppflags=
5406 cf_new_extra_cppflags=
5407
5408 for cf_add_cflags in $cf_add_cflags
5409 do
5410 case "$cf_fix_cppflags" in
5411 (no)
5412         case "$cf_add_cflags" in
5413         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5414                 case "$cf_add_cflags" in
5415                 (-D*)
5416                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5417
5418                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5419                                 && test -z "${cf_tst_cflags}" \
5420                                 && cf_fix_cppflags=yes
5421
5422                         if test "$cf_fix_cppflags" = yes ; then
5423
5424         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5425         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5426
5427                                 continue
5428                         elif test "${cf_tst_cflags}" = "\"'" ; then
5429
5430         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5431         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5432
5433                                 continue
5434                         fi
5435                         ;;
5436                 esac
5437                 case "$CPPFLAGS" in
5438                 (*$cf_add_cflags)
5439                         ;;
5440                 (*)
5441                         case "$cf_add_cflags" in
5442                         (-D*)
5443                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5444
5445 CPPFLAGS=`echo "$CPPFLAGS" | \
5446         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5447                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5448
5449                                 ;;
5450                         esac
5451
5452         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5453         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5454
5455                         ;;
5456                 esac
5457                 ;;
5458         (*)
5459
5460         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5461         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5462
5463                 ;;
5464         esac
5465         ;;
5466 (yes)
5467
5468         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5469         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5470
5471         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5472
5473         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5474                 && test -z "${cf_tst_cflags}" \
5475                 && cf_fix_cppflags=no
5476         ;;
5477 esac
5478 done
5479
5480 if test -n "$cf_new_cflags" ; then
5481         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5482
5483 echo "${as_me:-configure}:5483: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5484
5485         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5486         CFLAGS="${CFLAGS}$cf_new_cflags"
5487
5488 fi
5489
5490 if test -n "$cf_new_cppflags" ; then
5491         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5492
5493 echo "${as_me:-configure}:5493: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5494
5495         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5496         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5497
5498 fi
5499
5500 if test -n "$cf_new_extra_cppflags" ; then
5501         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5502
5503 echo "${as_me:-configure}:5503: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5504
5505         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5506         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5507
5508 fi
5509
5510 done
5511
5512 fi
5513
5514 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5515         echo "$as_me:5515: checking if _XOPEN_SOURCE really is set" >&5
5516 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5517         cat >"conftest.$ac_ext" <<_ACEOF
5518 #line 5518 "configure"
5519 #include "confdefs.h"
5520 #include <stdlib.h>
5521 int
5522 main (void)
5523 {
5524
5525 #ifndef _XOPEN_SOURCE
5526 make an error
5527 #endif
5528   ;
5529   return 0;
5530 }
5531 _ACEOF
5532 rm -f "conftest.$ac_objext"
5533 if { (eval echo "$as_me:5533: \"$ac_compile\"") >&5
5534   (eval $ac_compile) 2>&5
5535   ac_status=$?
5536   echo "$as_me:5536: \$? = $ac_status" >&5
5537   (exit "$ac_status"); } &&
5538          { ac_try='test -s "conftest.$ac_objext"'
5539   { (eval echo "$as_me:5539: \"$ac_try\"") >&5
5540   (eval $ac_try) 2>&5
5541   ac_status=$?
5542   echo "$as_me:5542: \$? = $ac_status" >&5
5543   (exit "$ac_status"); }; }; then
5544   cf_XOPEN_SOURCE_set=yes
5545 else
5546   echo "$as_me: failed program was:" >&5
5547 cat "conftest.$ac_ext" >&5
5548 cf_XOPEN_SOURCE_set=no
5549 fi
5550 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5551         echo "$as_me:5551: result: $cf_XOPEN_SOURCE_set" >&5
5552 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5553         if test "$cf_XOPEN_SOURCE_set" = yes
5554         then
5555                 cat >"conftest.$ac_ext" <<_ACEOF
5556 #line 5556 "configure"
5557 #include "confdefs.h"
5558 #include <stdlib.h>
5559 int
5560 main (void)
5561 {
5562
5563 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5564 make an error
5565 #endif
5566   ;
5567   return 0;
5568 }
5569 _ACEOF
5570 rm -f "conftest.$ac_objext"
5571 if { (eval echo "$as_me:5571: \"$ac_compile\"") >&5
5572   (eval $ac_compile) 2>&5
5573   ac_status=$?
5574   echo "$as_me:5574: \$? = $ac_status" >&5
5575   (exit "$ac_status"); } &&
5576          { ac_try='test -s "conftest.$ac_objext"'
5577   { (eval echo "$as_me:5577: \"$ac_try\"") >&5
5578   (eval $ac_try) 2>&5
5579   ac_status=$?
5580   echo "$as_me:5580: \$? = $ac_status" >&5
5581   (exit "$ac_status"); }; }; then
5582   cf_XOPEN_SOURCE_set_ok=yes
5583 else
5584   echo "$as_me: failed program was:" >&5
5585 cat "conftest.$ac_ext" >&5
5586 cf_XOPEN_SOURCE_set_ok=no
5587 fi
5588 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5589                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5590                 then
5591                         { echo "$as_me:5591: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5592 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5593                 fi
5594         else
5595
5596 echo "$as_me:5596: checking if we should define _XOPEN_SOURCE" >&5
5597 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5598 if test "${cf_cv_xopen_source+set}" = set; then
5599   echo $ECHO_N "(cached) $ECHO_C" >&6
5600 else
5601
5602         cat >"conftest.$ac_ext" <<_ACEOF
5603 #line 5603 "configure"
5604 #include "confdefs.h"
5605
5606 #include <stdlib.h>
5607 #include <string.h>
5608 #include <sys/types.h>
5609
5610 int
5611 main (void)
5612 {
5613
5614 #ifndef _XOPEN_SOURCE
5615 make an error
5616 #endif
5617   ;
5618   return 0;
5619 }
5620 _ACEOF
5621 rm -f "conftest.$ac_objext"
5622 if { (eval echo "$as_me:5622: \"$ac_compile\"") >&5
5623   (eval $ac_compile) 2>&5
5624   ac_status=$?
5625   echo "$as_me:5625: \$? = $ac_status" >&5
5626   (exit "$ac_status"); } &&
5627          { ac_try='test -s "conftest.$ac_objext"'
5628   { (eval echo "$as_me:5628: \"$ac_try\"") >&5
5629   (eval $ac_try) 2>&5
5630   ac_status=$?
5631   echo "$as_me:5631: \$? = $ac_status" >&5
5632   (exit "$ac_status"); }; }; then
5633   cf_cv_xopen_source=no
5634 else
5635   echo "$as_me: failed program was:" >&5
5636 cat "conftest.$ac_ext" >&5
5637 cf_save="$CPPFLAGS"
5638
5639         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5640         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5641
5642          cat >"conftest.$ac_ext" <<_ACEOF
5643 #line 5643 "configure"
5644 #include "confdefs.h"
5645
5646 #include <stdlib.h>
5647 #include <string.h>
5648 #include <sys/types.h>
5649
5650 int
5651 main (void)
5652 {
5653
5654 #ifdef _XOPEN_SOURCE
5655 make an error
5656 #endif
5657   ;
5658   return 0;
5659 }
5660 _ACEOF
5661 rm -f "conftest.$ac_objext"
5662 if { (eval echo "$as_me:5662: \"$ac_compile\"") >&5
5663   (eval $ac_compile) 2>&5
5664   ac_status=$?
5665   echo "$as_me:5665: \$? = $ac_status" >&5
5666   (exit "$ac_status"); } &&
5667          { ac_try='test -s "conftest.$ac_objext"'
5668   { (eval echo "$as_me:5668: \"$ac_try\"") >&5
5669   (eval $ac_try) 2>&5
5670   ac_status=$?
5671   echo "$as_me:5671: \$? = $ac_status" >&5
5672   (exit "$ac_status"); }; }; then
5673   cf_cv_xopen_source=no
5674 else
5675   echo "$as_me: failed program was:" >&5
5676 cat "conftest.$ac_ext" >&5
5677 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5678 fi
5679 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5680         CPPFLAGS="$cf_save"
5681
5682 fi
5683 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5684
5685 fi
5686 echo "$as_me:5686: result: $cf_cv_xopen_source" >&5
5687 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5688
5689 if test "$cf_cv_xopen_source" != no ; then
5690
5691 CFLAGS=`echo "$CFLAGS" | \
5692         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5693                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5694
5695 CPPFLAGS=`echo "$CPPFLAGS" | \
5696         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5697                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5698
5699         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5700
5701 for cf_add_cflags in $cf_temp_xopen_source
5702 do
5703         case "x$cf_add_cflags" in
5704         (x-[DU]*)
5705
5706 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5707 while true
5708 do
5709         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5710         test "$CFLAGS" != "$cf_old_cflag" || break
5711
5712         CFLAGS="$cf_old_cflag"
5713 done
5714
5715 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5716 while true
5717 do
5718         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5719         test "$CPPFLAGS" != "$cf_old_cflag" || break
5720
5721         CPPFLAGS="$cf_old_cflag"
5722 done
5723
5724                 ;;
5725         esac
5726
5727 cf_fix_cppflags=no
5728 cf_new_cflags=
5729 cf_new_cppflags=
5730 cf_new_extra_cppflags=
5731
5732 for cf_add_cflags in $cf_add_cflags
5733 do
5734 case "$cf_fix_cppflags" in
5735 (no)
5736         case "$cf_add_cflags" in
5737         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5738                 case "$cf_add_cflags" in
5739                 (-D*)
5740                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5741
5742                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5743                                 && test -z "${cf_tst_cflags}" \
5744                                 && cf_fix_cppflags=yes
5745
5746                         if test "$cf_fix_cppflags" = yes ; then
5747
5748         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5749         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5750
5751                                 continue
5752                         elif test "${cf_tst_cflags}" = "\"'" ; then
5753
5754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5756
5757                                 continue
5758                         fi
5759                         ;;
5760                 esac
5761                 case "$CPPFLAGS" in
5762                 (*$cf_add_cflags)
5763                         ;;
5764                 (*)
5765                         case "$cf_add_cflags" in
5766                         (-D*)
5767                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5768
5769 CPPFLAGS=`echo "$CPPFLAGS" | \
5770         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5771                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5772
5773                                 ;;
5774                         esac
5775
5776         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5777         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5778
5779                         ;;
5780                 esac
5781                 ;;
5782         (*)
5783
5784         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5785         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5786
5787                 ;;
5788         esac
5789         ;;
5790 (yes)
5791
5792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5794
5795         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5796
5797         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5798                 && test -z "${cf_tst_cflags}" \
5799                 && cf_fix_cppflags=no
5800         ;;
5801 esac
5802 done
5803
5804 if test -n "$cf_new_cflags" ; then
5805
5806         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5807         CFLAGS="${CFLAGS}$cf_new_cflags"
5808
5809 fi
5810
5811 if test -n "$cf_new_cppflags" ; then
5812
5813         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5814         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5815
5816 fi
5817
5818 if test -n "$cf_new_extra_cppflags" ; then
5819
5820         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5821         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5822
5823 fi
5824
5825 done
5826
5827 fi
5828
5829         fi
5830 fi
5831 fi # cf_cv_posix_visible
5832
5833 echo "$as_me:5833: checking for signal global datatype" >&5
5834 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5835 if test "${cf_cv_sig_atomic_t+set}" = set; then
5836   echo $ECHO_N "(cached) $ECHO_C" >&6
5837 else
5838
5839         for cf_type in \
5840                 "volatile sig_atomic_t" \
5841                 "sig_atomic_t" \
5842                 "int"
5843         do
5844         cat >"conftest.$ac_ext" <<_ACEOF
5845 #line 5845 "configure"
5846 #include "confdefs.h"
5847
5848 #include <sys/types.h>
5849 #include <signal.h>
5850 #include <stdio.h>
5851
5852 extern $cf_type x;
5853 $cf_type x;
5854 static void handler(int sig)
5855 {
5856         (void)sig;
5857         x = 5;
5858 }
5859 int
5860 main (void)
5861 {
5862 signal(SIGINT, handler);
5863                  x = 1
5864   ;
5865   return 0;
5866 }
5867 _ACEOF
5868 rm -f "conftest.$ac_objext"
5869 if { (eval echo "$as_me:5869: \"$ac_compile\"") >&5
5870   (eval $ac_compile) 2>&5
5871   ac_status=$?
5872   echo "$as_me:5872: \$? = $ac_status" >&5
5873   (exit "$ac_status"); } &&
5874          { ac_try='test -s "conftest.$ac_objext"'
5875   { (eval echo "$as_me:5875: \"$ac_try\"") >&5
5876   (eval $ac_try) 2>&5
5877   ac_status=$?
5878   echo "$as_me:5878: \$? = $ac_status" >&5
5879   (exit "$ac_status"); }; }; then
5880   cf_cv_sig_atomic_t=$cf_type
5881 else
5882   echo "$as_me: failed program was:" >&5
5883 cat "conftest.$ac_ext" >&5
5884 cf_cv_sig_atomic_t=no
5885 fi
5886 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5887                 test "$cf_cv_sig_atomic_t" != no && break
5888         done
5889
5890 fi
5891
5892 echo "$as_me:5892: result: $cf_cv_sig_atomic_t" >&5
5893 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5894 test "$cf_cv_sig_atomic_t" != no &&
5895 cat >>confdefs.h <<EOF
5896 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5897 EOF
5898
5899 # Work around breakage on OS X
5900
5901 echo "$as_me:5901: checking if SIGWINCH is defined" >&5
5902 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5903 if test "${cf_cv_define_sigwinch+set}" = set; then
5904   echo $ECHO_N "(cached) $ECHO_C" >&6
5905 else
5906
5907         cat >"conftest.$ac_ext" <<_ACEOF
5908 #line 5908 "configure"
5909 #include "confdefs.h"
5910
5911 #include <sys/types.h>
5912 #include <sys/signal.h>
5913
5914 int
5915 main (void)
5916 {
5917 int x = SIGWINCH; (void)x
5918   ;
5919   return 0;
5920 }
5921 _ACEOF
5922 rm -f "conftest.$ac_objext"
5923 if { (eval echo "$as_me:5923: \"$ac_compile\"") >&5
5924   (eval $ac_compile) 2>&5
5925   ac_status=$?
5926   echo "$as_me:5926: \$? = $ac_status" >&5
5927   (exit "$ac_status"); } &&
5928          { ac_try='test -s "conftest.$ac_objext"'
5929   { (eval echo "$as_me:5929: \"$ac_try\"") >&5
5930   (eval $ac_try) 2>&5
5931   ac_status=$?
5932   echo "$as_me:5932: \$? = $ac_status" >&5
5933   (exit "$ac_status"); }; }; then
5934   cf_cv_define_sigwinch=yes
5935 else
5936   echo "$as_me: failed program was:" >&5
5937 cat "conftest.$ac_ext" >&5
5938 cat >"conftest.$ac_ext" <<_ACEOF
5939 #line 5939 "configure"
5940 #include "confdefs.h"
5941
5942 #undef _XOPEN_SOURCE
5943 #undef _POSIX_SOURCE
5944 #undef _POSIX_C_SOURCE
5945 #include <sys/types.h>
5946 #include <sys/signal.h>
5947
5948 int
5949 main (void)
5950 {
5951 int x = SIGWINCH; (void)x
5952   ;
5953   return 0;
5954 }
5955 _ACEOF
5956 rm -f "conftest.$ac_objext"
5957 if { (eval echo "$as_me:5957: \"$ac_compile\"") >&5
5958   (eval $ac_compile) 2>&5
5959   ac_status=$?
5960   echo "$as_me:5960: \$? = $ac_status" >&5
5961   (exit "$ac_status"); } &&
5962          { ac_try='test -s "conftest.$ac_objext"'
5963   { (eval echo "$as_me:5963: \"$ac_try\"") >&5
5964   (eval $ac_try) 2>&5
5965   ac_status=$?
5966   echo "$as_me:5966: \$? = $ac_status" >&5
5967   (exit "$ac_status"); }; }; then
5968   cf_cv_define_sigwinch=maybe
5969 else
5970   echo "$as_me: failed program was:" >&5
5971 cat "conftest.$ac_ext" >&5
5972 cf_cv_define_sigwinch=no
5973 fi
5974 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5975
5976 fi
5977 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5978
5979 fi
5980 echo "$as_me:5980: result: $cf_cv_define_sigwinch" >&5
5981 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5982
5983 if test "$cf_cv_define_sigwinch" = maybe ; then
5984 echo "$as_me:5984: checking for actual SIGWINCH definition" >&5
5985 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5986 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5987   echo $ECHO_N "(cached) $ECHO_C" >&6
5988 else
5989
5990 cf_cv_fixup_sigwinch=unknown
5991 cf_sigwinch=32
5992 while test "$cf_sigwinch" != 1
5993 do
5994         cat >"conftest.$ac_ext" <<_ACEOF
5995 #line 5995 "configure"
5996 #include "confdefs.h"
5997
5998 #undef _XOPEN_SOURCE
5999 #undef _POSIX_SOURCE
6000 #undef _POSIX_C_SOURCE
6001 #include <sys/types.h>
6002 #include <sys/signal.h>
6003
6004 int
6005 main (void)
6006 {
6007
6008 #if SIGWINCH != $cf_sigwinch
6009 make an error
6010 #endif
6011 int x = SIGWINCH; (void)x
6012   ;
6013   return 0;
6014 }
6015 _ACEOF
6016 rm -f "conftest.$ac_objext"
6017 if { (eval echo "$as_me:6017: \"$ac_compile\"") >&5
6018   (eval $ac_compile) 2>&5
6019   ac_status=$?
6020   echo "$as_me:6020: \$? = $ac_status" >&5
6021   (exit "$ac_status"); } &&
6022          { ac_try='test -s "conftest.$ac_objext"'
6023   { (eval echo "$as_me:6023: \"$ac_try\"") >&5
6024   (eval $ac_try) 2>&5
6025   ac_status=$?
6026   echo "$as_me:6026: \$? = $ac_status" >&5
6027   (exit "$ac_status"); }; }; then
6028   cf_cv_fixup_sigwinch=$cf_sigwinch
6029          break
6030 else
6031   echo "$as_me: failed program was:" >&5
6032 cat "conftest.$ac_ext" >&5
6033 fi
6034 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6035
6036 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
6037 done
6038
6039 fi
6040 echo "$as_me:6040: result: $cf_cv_fixup_sigwinch" >&5
6041 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
6042
6043         if test "$cf_cv_fixup_sigwinch" != unknown ; then
6044                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
6045         fi
6046 fi
6047
6048 # Checks for CODESET support.
6049
6050 echo "$as_me:6050: checking for nl_langinfo and CODESET" >&5
6051 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
6052 if test "${am_cv_langinfo_codeset+set}" = set; then
6053   echo $ECHO_N "(cached) $ECHO_C" >&6
6054 else
6055   cat >"conftest.$ac_ext" <<_ACEOF
6056 #line 6056 "configure"
6057 #include "confdefs.h"
6058 #include <langinfo.h>
6059 int
6060 main (void)
6061 {
6062 char* cs = nl_langinfo(CODESET); (void)cs
6063   ;
6064   return 0;
6065 }
6066 _ACEOF
6067 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6068 if { (eval echo "$as_me:6068: \"$ac_link\"") >&5
6069   (eval $ac_link) 2>&5
6070   ac_status=$?
6071   echo "$as_me:6071: \$? = $ac_status" >&5
6072   (exit "$ac_status"); } &&
6073          { ac_try='test -s "conftest$ac_exeext"'
6074   { (eval echo "$as_me:6074: \"$ac_try\"") >&5
6075   (eval $ac_try) 2>&5
6076   ac_status=$?
6077   echo "$as_me:6077: \$? = $ac_status" >&5
6078   (exit "$ac_status"); }; }; then
6079   am_cv_langinfo_codeset=yes
6080 else
6081   echo "$as_me: failed program was:" >&5
6082 cat "conftest.$ac_ext" >&5
6083 am_cv_langinfo_codeset=no
6084 fi
6085 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6086
6087 fi
6088 echo "$as_me:6088: result: $am_cv_langinfo_codeset" >&5
6089 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
6090         if test "$am_cv_langinfo_codeset" = yes; then
6091
6092 cat >>confdefs.h <<\EOF
6093 #define HAVE_LANGINFO_CODESET 1
6094 EOF
6095
6096         fi
6097
6098 echo "$as_me:6098: checking if you want to use pkg-config" >&5
6099 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
6100
6101 # Check whether --with-pkg-config or --without-pkg-config was given.
6102 if test "${with_pkg_config+set}" = set; then
6103   withval="$with_pkg_config"
6104   cf_pkg_config=$withval
6105 else
6106   cf_pkg_config=yes
6107 fi;
6108 echo "$as_me:6108: result: $cf_pkg_config" >&5
6109 echo "${ECHO_T}$cf_pkg_config" >&6
6110
6111 case "$cf_pkg_config" in
6112 (no)
6113         PKG_CONFIG=none
6114         ;;
6115 (yes)
6116
6117 if test -n "$ac_tool_prefix"; then
6118   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
6119 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
6120 echo "$as_me:6120: checking for $ac_word" >&5
6121 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6122 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
6123   echo $ECHO_N "(cached) $ECHO_C" >&6
6124 else
6125   case $PKG_CONFIG in
6126   [\\/]* | ?:[\\/]*)
6127   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6128   ;;
6129   *)
6130   ac_save_IFS=$IFS; IFS=$ac_path_separator
6131 ac_dummy="$PATH"
6132 for ac_dir in $ac_dummy; do
6133   IFS=$ac_save_IFS
6134   test -z "$ac_dir" && ac_dir=.
6135   if $as_executable_p "$ac_dir/$ac_word"; then
6136    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
6137    echo "$as_me:6137: found $ac_dir/$ac_word" >&5
6138    break
6139 fi
6140 done
6141
6142   ;;
6143 esac
6144 fi
6145 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
6146
6147 if test -n "$PKG_CONFIG"; then
6148   echo "$as_me:6148: result: $PKG_CONFIG" >&5
6149 echo "${ECHO_T}$PKG_CONFIG" >&6
6150 else
6151   echo "$as_me:6151: result: no" >&5
6152 echo "${ECHO_T}no" >&6
6153 fi
6154
6155 fi
6156 if test -z "$ac_cv_path_PKG_CONFIG"; then
6157   ac_pt_PKG_CONFIG=$PKG_CONFIG
6158   # Extract the first word of "pkg-config", so it can be a program name with args.
6159 set dummy pkg-config; ac_word=$2
6160 echo "$as_me:6160: checking for $ac_word" >&5
6161 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6162 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6163   echo $ECHO_N "(cached) $ECHO_C" >&6
6164 else
6165   case $ac_pt_PKG_CONFIG in
6166   [\\/]* | ?:[\\/]*)
6167   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6168   ;;
6169   *)
6170   ac_save_IFS=$IFS; IFS=$ac_path_separator
6171 ac_dummy="$PATH"
6172 for ac_dir in $ac_dummy; do
6173   IFS=$ac_save_IFS
6174   test -z "$ac_dir" && ac_dir=.
6175   if $as_executable_p "$ac_dir/$ac_word"; then
6176    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
6177    echo "$as_me:6177: found $ac_dir/$ac_word" >&5
6178    break
6179 fi
6180 done
6181
6182   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6183   ;;
6184 esac
6185 fi
6186 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6187
6188 if test -n "$ac_pt_PKG_CONFIG"; then
6189   echo "$as_me:6189: result: $ac_pt_PKG_CONFIG" >&5
6190 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6191 else
6192   echo "$as_me:6192: result: no" >&5
6193 echo "${ECHO_T}no" >&6
6194 fi
6195
6196   PKG_CONFIG=$ac_pt_PKG_CONFIG
6197 else
6198   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6199 fi
6200
6201         ;;
6202 (*)
6203         PKG_CONFIG=$withval
6204         ;;
6205 esac
6206
6207 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6208 if test "$PKG_CONFIG" != none ; then
6209
6210 if test "x$prefix" != xNONE; then
6211         cf_path_syntax="$prefix"
6212 else
6213         cf_path_syntax="$ac_default_prefix"
6214 fi
6215
6216 case ".$PKG_CONFIG" in
6217 (.\$\(*\)*|.\'*\'*)
6218         ;;
6219 (..|./*|.\\*)
6220         ;;
6221 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6222         ;;
6223 (.\$\{*prefix\}*|.\$\{*dir\}*)
6224         eval PKG_CONFIG="$PKG_CONFIG"
6225         case ".$PKG_CONFIG" in
6226         (.NONE/*)
6227                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6228                 ;;
6229         esac
6230         ;;
6231 (.no|.NONE/*)
6232         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6233         ;;
6234 (*)
6235         { { echo "$as_me:6235: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6236 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6237    { (exit 1); exit 1; }; }
6238         ;;
6239 esac
6240
6241 elif test "x$cf_pkg_config" != xno ; then
6242         { echo "$as_me:6242: WARNING: pkg-config is not installed" >&5
6243 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6244 fi
6245
6246 echo "$as_me:6246: checking if you want to see long compiling messages" >&5
6247 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6248
6249 # Check whether --enable-echo or --disable-echo was given.
6250 if test "${enable_echo+set}" = set; then
6251   enableval="$enable_echo"
6252   test "$enableval" != no && enableval=yes
6253         if test "$enableval" != "yes" ; then
6254
6255         ECHO_LT='--silent'
6256         ECHO_LD='@echo linking $@;'
6257         RULE_CC='@echo compiling $<'
6258         SHOW_CC='@echo compiling $@'
6259         ECHO_CC='@'
6260
6261         else
6262
6263         ECHO_LT=''
6264         ECHO_LD=''
6265         RULE_CC=''
6266         SHOW_CC=''
6267         ECHO_CC=''
6268
6269         fi
6270 else
6271   enableval=yes
6272
6273         ECHO_LT=''
6274         ECHO_LD=''
6275         RULE_CC=''
6276         SHOW_CC=''
6277         ECHO_CC=''
6278
6279 fi;
6280 echo "$as_me:6280: result: $enableval" >&5
6281 echo "${ECHO_T}$enableval" >&6
6282
6283 echo "$as_me:6283: checking for ncurses wrap-prefix" >&5
6284 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6285
6286 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6287 if test "${with_ncurses_wrap_prefix+set}" = set; then
6288   withval="$with_ncurses_wrap_prefix"
6289   NCURSES_WRAP_PREFIX=$withval
6290 else
6291   NCURSES_WRAP_PREFIX=_nc_
6292 fi;
6293 echo "$as_me:6293: result: $NCURSES_WRAP_PREFIX" >&5
6294 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6295
6296 echo "$as_me:6296: checking if you want to check for wide-character functions" >&5
6297 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6298
6299 # Check whether --enable-widec or --disable-widec was given.
6300 if test "${enable_widec+set}" = set; then
6301   enableval="$enable_widec"
6302   test "$enableval" != no && enableval=yes
6303         if test "$enableval" != "yes" ; then
6304     cf_enable_widec=no
6305         else
6306                 cf_enable_widec=yes
6307         fi
6308 else
6309   enableval=yes
6310         cf_enable_widec=yes
6311
6312 fi;
6313 echo "$as_me:6313: result: $cf_enable_widec" >&5
6314 echo "${ECHO_T}$cf_enable_widec" >&6
6315
6316 echo "$as_me:6316: checking for specific curses-directory" >&5
6317 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6318
6319 # Check whether --with-curses-dir or --without-curses-dir was given.
6320 if test "${with_curses_dir+set}" = set; then
6321   withval="$with_curses_dir"
6322   cf_cv_curses_dir=$withval
6323 else
6324   cf_cv_curses_dir=no
6325 fi;
6326 echo "$as_me:6326: result: $cf_cv_curses_dir" >&5
6327 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6328
6329 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6330 then
6331
6332 if test "x$prefix" != xNONE; then
6333         cf_path_syntax="$prefix"
6334 else
6335         cf_path_syntax="$ac_default_prefix"
6336 fi
6337
6338 case ".$withval" in
6339 (.\$\(*\)*|.\'*\'*)
6340         ;;
6341 (..|./*|.\\*)
6342         ;;
6343 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6344         ;;
6345 (.\$\{*prefix\}*|.\$\{*dir\}*)
6346         eval withval="$withval"
6347         case ".$withval" in
6348         (.NONE/*)
6349                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6350                 ;;
6351         esac
6352         ;;
6353 (.no|.NONE/*)
6354         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6355         ;;
6356 (*)
6357         { { echo "$as_me:6357: error: expected a pathname, not \"$withval\"" >&5
6358 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6359    { (exit 1); exit 1; }; }
6360         ;;
6361 esac
6362
6363         if test -d "$cf_cv_curses_dir"
6364         then
6365
6366 if test -n "$cf_cv_curses_dir/include" ; then
6367   for cf_add_incdir in $cf_cv_curses_dir/include
6368   do
6369         while test "$cf_add_incdir" != /usr/include
6370         do
6371           if test -d "$cf_add_incdir"
6372           then
6373                 cf_have_incdir=no
6374                 if test -n "$CFLAGS$CPPFLAGS" ; then
6375                   # a loop is needed to ensure we can add subdirs of existing dirs
6376                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6377                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6378                           cf_have_incdir=yes; break
6379                         fi
6380                   done
6381                 fi
6382
6383                 if test "$cf_have_incdir" = no ; then
6384                   if test "$cf_add_incdir" = /usr/local/include ; then
6385                         if test "$GCC" = yes
6386                         then
6387                           cf_save_CPPFLAGS=$CPPFLAGS
6388
6389         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6390         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6391
6392                           cat >"conftest.$ac_ext" <<_ACEOF
6393 #line 6393 "configure"
6394 #include "confdefs.h"
6395 #include <stdio.h>
6396 int
6397 main (void)
6398 {
6399 printf("Hello")
6400   ;
6401   return 0;
6402 }
6403 _ACEOF
6404 rm -f "conftest.$ac_objext"
6405 if { (eval echo "$as_me:6405: \"$ac_compile\"") >&5
6406   (eval $ac_compile) 2>&5
6407   ac_status=$?
6408   echo "$as_me:6408: \$? = $ac_status" >&5
6409   (exit "$ac_status"); } &&
6410          { ac_try='test -s "conftest.$ac_objext"'
6411   { (eval echo "$as_me:6411: \"$ac_try\"") >&5
6412   (eval $ac_try) 2>&5
6413   ac_status=$?
6414   echo "$as_me:6414: \$? = $ac_status" >&5
6415   (exit "$ac_status"); }; }; then
6416   :
6417 else
6418   echo "$as_me: failed program was:" >&5
6419 cat "conftest.$ac_ext" >&5
6420 cf_have_incdir=yes
6421 fi
6422 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6423                           CPPFLAGS=$cf_save_CPPFLAGS
6424                         fi
6425                   fi
6426                 fi
6427
6428                 if test "$cf_have_incdir" = no ; then
6429                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6430
6431 echo "${as_me:-configure}:6431: testing adding $cf_add_incdir to include-path ..." 1>&5
6432
6433                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6434
6435                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6436                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6437                   cf_add_incdir="$cf_top_incdir"
6438                 else
6439                   break
6440                 fi
6441           else
6442                 break
6443           fi
6444         done
6445   done
6446 fi
6447
6448 if test -n "$cf_cv_curses_dir/lib" ; then
6449         for cf_add_libdir in $cf_cv_curses_dir/lib
6450         do
6451                 if test "$cf_add_libdir" = /usr/lib ; then
6452                         :
6453                 elif test -d "$cf_add_libdir"
6454                 then
6455                         cf_have_libdir=no
6456                         if test -n "$LDFLAGS$LIBS" ; then
6457                                 # a loop is needed to ensure we can add subdirs of existing dirs
6458                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6459                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6460                                                 cf_have_libdir=yes; break
6461                                         fi
6462                                 done
6463                         fi
6464                         if test "$cf_have_libdir" = no ; then
6465                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6466
6467 echo "${as_me:-configure}:6467: testing adding $cf_add_libdir to library-path ..." 1>&5
6468
6469                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6470                         fi
6471                 fi
6472         done
6473 fi
6474
6475         fi
6476 fi
6477
6478 cf_cv_screen=curses
6479
6480 echo "$as_me:6480: checking for specified curses library type" >&5
6481 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6482
6483 # Check whether --with-screen or --without-screen was given.
6484 if test "${with_screen+set}" = set; then
6485   withval="$with_screen"
6486   cf_cv_screen=$withval
6487 else
6488
6489 # Check whether --with-ncursesw or --without-ncursesw was given.
6490 if test "${with_ncursesw+set}" = set; then
6491   withval="$with_ncursesw"
6492   cf_cv_screen=ncursesw
6493 else
6494
6495 # Check whether --with-ncurses or --without-ncurses was given.
6496 if test "${with_ncurses+set}" = set; then
6497   withval="$with_ncurses"
6498   cf_cv_screen=ncurses
6499 else
6500
6501 # Check whether --with-pdcurses or --without-pdcurses was given.
6502 if test "${with_pdcurses+set}" = set; then
6503   withval="$with_pdcurses"
6504   cf_cv_screen=pdcurses
6505 else
6506
6507 # Check whether --with-curses-colr or --without-curses-colr was given.
6508 if test "${with_curses_colr+set}" = set; then
6509   withval="$with_curses_colr"
6510   cf_cv_screen=curses_colr
6511 else
6512
6513 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6514 if test "${with_curses_5lib+set}" = set; then
6515   withval="$with_curses_5lib"
6516   cf_cv_screen=curses_5lib
6517 fi;
6518 fi;
6519 fi;
6520 fi;
6521 fi;
6522 fi;
6523
6524 echo "$as_me:6524: result: $cf_cv_screen" >&5
6525 echo "${ECHO_T}$cf_cv_screen" >&6
6526
6527 case $cf_cv_screen in
6528 (curses|curses_*)
6529
6530 echo "$as_me:6530: checking for extra include directories" >&5
6531 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6532 if test "${cf_cv_curses_incdir+set}" = set; then
6533   echo $ECHO_N "(cached) $ECHO_C" >&6
6534 else
6535
6536 cf_cv_curses_incdir=no
6537 case "$host_os" in
6538 (hpux10.*)
6539         if test "x$cf_cv_screen" = "xcurses_colr"
6540         then
6541                 test -d /usr/include/curses_colr && \
6542                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6543         fi
6544         ;;
6545 (sunos3*|sunos4*)
6546         if test "x$cf_cv_screen" = "xcurses_5lib"
6547         then
6548                 test -d /usr/5lib && \
6549                 test -d /usr/5include && \
6550                 cf_cv_curses_incdir="-I/usr/5include"
6551         fi
6552         ;;
6553 esac
6554
6555 fi
6556 echo "$as_me:6556: result: $cf_cv_curses_incdir" >&5
6557 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6558 if test "$cf_cv_curses_incdir" != no
6559 then
6560
6561         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6562         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6563
6564 fi
6565
6566 echo "$as_me:6566: checking if we have identified curses headers" >&5
6567 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6568 if test "${cf_cv_ncurses_header+set}" = set; then
6569   echo $ECHO_N "(cached) $ECHO_C" >&6
6570 else
6571
6572 cf_cv_ncurses_header=none
6573 for cf_header in \
6574         ncurses.h  \
6575         curses.h  ncurses/ncurses.h ncurses/curses.h
6576 do
6577 cat >"conftest.$ac_ext" <<_ACEOF
6578 #line 6578 "configure"
6579 #include "confdefs.h"
6580 #include <${cf_header}>
6581 int
6582 main (void)
6583 {
6584 initscr(); tgoto("?", 0,0)
6585   ;
6586   return 0;
6587 }
6588 _ACEOF
6589 rm -f "conftest.$ac_objext"
6590 if { (eval echo "$as_me:6590: \"$ac_compile\"") >&5
6591   (eval $ac_compile) 2>&5
6592   ac_status=$?
6593   echo "$as_me:6593: \$? = $ac_status" >&5
6594   (exit "$ac_status"); } &&
6595          { ac_try='test -s "conftest.$ac_objext"'
6596   { (eval echo "$as_me:6596: \"$ac_try\"") >&5
6597   (eval $ac_try) 2>&5
6598   ac_status=$?
6599   echo "$as_me:6599: \$? = $ac_status" >&5
6600   (exit "$ac_status"); }; }; then
6601   cf_cv_ncurses_header=$cf_header; break
6602 else
6603   echo "$as_me: failed program was:" >&5
6604 cat "conftest.$ac_ext" >&5
6605 fi
6606 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6607 done
6608
6609 fi
6610 echo "$as_me:6610: result: $cf_cv_ncurses_header" >&5
6611 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6612
6613 if test "$cf_cv_ncurses_header" = none ; then
6614         { { echo "$as_me:6614: error: No curses header-files found" >&5
6615 echo "$as_me: error: No curses header-files found" >&2;}
6616    { (exit 1); exit 1; }; }
6617 fi
6618
6619 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6620
6621 for ac_header in $cf_cv_ncurses_header
6622 do
6623 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6624 echo "$as_me:6624: checking for $ac_header" >&5
6625 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6626 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6627   echo $ECHO_N "(cached) $ECHO_C" >&6
6628 else
6629   cat >"conftest.$ac_ext" <<_ACEOF
6630 #line 6630 "configure"
6631 #include "confdefs.h"
6632 #include <$ac_header>
6633 _ACEOF
6634 if { (eval echo "$as_me:6634: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6635   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6636   ac_status=$?
6637   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6638   rm -f conftest.er1
6639   cat conftest.err >&5
6640   echo "$as_me:6640: \$? = $ac_status" >&5
6641   (exit "$ac_status"); } >/dev/null; then
6642   if test -s conftest.err; then
6643     ac_cpp_err=$ac_c_preproc_warn_flag
6644   else
6645     ac_cpp_err=
6646   fi
6647 else
6648   ac_cpp_err=yes
6649 fi
6650 if test -z "$ac_cpp_err"; then
6651   eval "$as_ac_Header=yes"
6652 else
6653   echo "$as_me: failed program was:" >&5
6654   cat "conftest.$ac_ext" >&5
6655   eval "$as_ac_Header=no"
6656 fi
6657 rm -f conftest.err "conftest.$ac_ext"
6658 fi
6659 echo "$as_me:6659: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6660 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6661 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6662   cat >>confdefs.h <<EOF
6663 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6664 EOF
6665
6666 fi
6667 done
6668
6669 echo "$as_me:6669: checking for terminfo header" >&5
6670 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6671 if test "${cf_cv_term_header+set}" = set; then
6672   echo $ECHO_N "(cached) $ECHO_C" >&6
6673 else
6674
6675 case "${cf_cv_ncurses_header}" in
6676 (*/ncurses.h|*/ncursesw.h)
6677         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6678         ;;
6679 (*)
6680         cf_term_header=term.h
6681         ;;
6682 esac
6683
6684 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6685 do
6686 cat >"conftest.$ac_ext" <<_ACEOF
6687 #line 6687 "configure"
6688 #include "confdefs.h"
6689 #include <stdio.h>
6690 #include <${cf_cv_ncurses_header:-curses.h}>
6691 #include <$cf_test>
6692
6693 int
6694 main (void)
6695 {
6696 int x = auto_left_margin; (void)x
6697   ;
6698   return 0;
6699 }
6700 _ACEOF
6701 rm -f "conftest.$ac_objext"
6702 if { (eval echo "$as_me:6702: \"$ac_compile\"") >&5
6703   (eval $ac_compile) 2>&5
6704   ac_status=$?
6705   echo "$as_me:6705: \$? = $ac_status" >&5
6706   (exit "$ac_status"); } &&
6707          { ac_try='test -s "conftest.$ac_objext"'
6708   { (eval echo "$as_me:6708: \"$ac_try\"") >&5
6709   (eval $ac_try) 2>&5
6710   ac_status=$?
6711   echo "$as_me:6711: \$? = $ac_status" >&5
6712   (exit "$ac_status"); }; }; then
6713
6714         cf_cv_term_header="$cf_test"
6715 else
6716   echo "$as_me: failed program was:" >&5
6717 cat "conftest.$ac_ext" >&5
6718
6719         cf_cv_term_header=unknown
6720
6721 fi
6722 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6723         test "$cf_cv_term_header" != unknown && break
6724 done
6725
6726 fi
6727 echo "$as_me:6727: result: $cf_cv_term_header" >&5
6728 echo "${ECHO_T}$cf_cv_term_header" >&6
6729
6730 # Set definitions to allow ifdef'ing to accommodate subdirectories
6731
6732 case "$cf_cv_term_header" in
6733 (*term.h)
6734
6735 cat >>confdefs.h <<\EOF
6736 #define HAVE_TERM_H 1
6737 EOF
6738
6739         ;;
6740 esac
6741
6742 case "$cf_cv_term_header" in
6743 (ncurses/term.h)
6744
6745 cat >>confdefs.h <<\EOF
6746 #define HAVE_NCURSES_TERM_H 1
6747 EOF
6748
6749         ;;
6750 (ncursesw/term.h)
6751
6752 cat >>confdefs.h <<\EOF
6753 #define HAVE_NCURSESW_TERM_H 1
6754 EOF
6755
6756         ;;
6757 esac
6758
6759 echo "$as_me:6759: checking for ncurses version" >&5
6760 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6761 if test "${cf_cv_ncurses_version+set}" = set; then
6762   echo $ECHO_N "(cached) $ECHO_C" >&6
6763 else
6764
6765         cf_cv_ncurses_version=no
6766         cf_tempfile=out$$
6767         rm -f "$cf_tempfile"
6768         if test "$cross_compiling" = yes; then
6769
6770         # This will not work if the preprocessor splits the line after the
6771         # Autoconf token.  The 'unproto' program does that.
6772         cat > "conftest.$ac_ext" <<EOF
6773 #include <${cf_cv_ncurses_header:-curses.h}>
6774 #undef Autoconf
6775 #ifdef NCURSES_VERSION
6776 Autoconf NCURSES_VERSION
6777 #else
6778 #ifdef __NCURSES_H
6779 Autoconf "old"
6780 #endif
6781 ;
6782 #endif
6783 EOF
6784         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6785         { (eval echo "$as_me:6785: \"$cf_try\"") >&5
6786   (eval $cf_try) 2>&5
6787   ac_status=$?
6788   echo "$as_me:6788: \$? = $ac_status" >&5
6789   (exit "$ac_status"); }
6790         if test -f conftest.out ; then
6791                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6792                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6793                 rm -f conftest.out
6794         fi
6795
6796 else
6797   cat >"conftest.$ac_ext" <<_ACEOF
6798 #line 6798 "configure"
6799 #include "confdefs.h"
6800
6801 #include <${cf_cv_ncurses_header:-curses.h}>
6802 #include <stdio.h>
6803 int main(void)
6804 {
6805         FILE *fp = fopen("$cf_tempfile", "w");
6806 #ifdef NCURSES_VERSION
6807 # ifdef NCURSES_VERSION_PATCH
6808         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6809 # else
6810         fprintf(fp, "%s\\n", NCURSES_VERSION);
6811 # endif
6812 #else
6813 # ifdef __NCURSES_H
6814         fprintf(fp, "old\\n");
6815 # else
6816         make an error
6817 # endif
6818 #endif
6819         ${cf_cv_main_return:-return}(0);
6820 }
6821 _ACEOF
6822 rm -f "conftest$ac_exeext"
6823 if { (eval echo "$as_me:6823: \"$ac_link\"") >&5
6824   (eval $ac_link) 2>&5
6825   ac_status=$?
6826   echo "$as_me:6826: \$? = $ac_status" >&5
6827   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6828   { (eval echo "$as_me:6828: \"$ac_try\"") >&5
6829   (eval $ac_try) 2>&5
6830   ac_status=$?
6831   echo "$as_me:6831: \$? = $ac_status" >&5
6832   (exit "$ac_status"); }; }; then
6833
6834         cf_cv_ncurses_version=`cat $cf_tempfile`
6835 else
6836   echo "$as_me: program exited with status $ac_status" >&5
6837 echo "$as_me: failed program was:" >&5
6838 cat "conftest.$ac_ext" >&5
6839 fi
6840 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6841 fi
6842         rm -f "$cf_tempfile"
6843
6844 fi
6845 echo "$as_me:6845: result: $cf_cv_ncurses_version" >&5
6846 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6847 test "$cf_cv_ncurses_version" = no ||
6848 cat >>confdefs.h <<\EOF
6849 #define NCURSES 1
6850 EOF
6851
6852 echo "$as_me:6852: checking if we have identified curses libraries" >&5
6853 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6854 cat >"conftest.$ac_ext" <<_ACEOF
6855 #line 6855 "configure"
6856 #include "confdefs.h"
6857 #include <${cf_cv_ncurses_header:-curses.h}>
6858 int
6859 main (void)
6860 {
6861 initscr(); tgoto("?", 0,0)
6862   ;
6863   return 0;
6864 }
6865 _ACEOF
6866 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6867 if { (eval echo "$as_me:6867: \"$ac_link\"") >&5
6868   (eval $ac_link) 2>&5
6869   ac_status=$?
6870   echo "$as_me:6870: \$? = $ac_status" >&5
6871   (exit "$ac_status"); } &&
6872          { ac_try='test -s "conftest$ac_exeext"'
6873   { (eval echo "$as_me:6873: \"$ac_try\"") >&5
6874   (eval $ac_try) 2>&5
6875   ac_status=$?
6876   echo "$as_me:6876: \$? = $ac_status" >&5
6877   (exit "$ac_status"); }; }; then
6878   cf_result=yes
6879 else
6880   echo "$as_me: failed program was:" >&5
6881 cat "conftest.$ac_ext" >&5
6882 cf_result=no
6883 fi
6884 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6885 echo "$as_me:6885: result: $cf_result" >&5
6886 echo "${ECHO_T}$cf_result" >&6
6887
6888 if test "$cf_result" = no ; then
6889 case "$host_os" in
6890 (freebsd*)
6891         echo "$as_me:6891: checking for tgoto in -lmytinfo" >&5
6892 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6893 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6894   echo $ECHO_N "(cached) $ECHO_C" >&6
6895 else
6896   ac_check_lib_save_LIBS=$LIBS
6897 LIBS="-lmytinfo  $LIBS"
6898 cat >"conftest.$ac_ext" <<_ACEOF
6899 #line 6899 "configure"
6900 #include "confdefs.h"
6901
6902 /* Override any gcc2 internal prototype to avoid an error.  */
6903 #ifdef __cplusplus
6904 extern "C"
6905 #endif
6906 /* We use char because int might match the return type of a gcc2
6907    builtin and then its argument prototype would still apply.  */
6908 char tgoto ();
6909 int
6910 main (void)
6911 {
6912 tgoto ();
6913   ;
6914   return 0;
6915 }
6916 _ACEOF
6917 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6918 if { (eval echo "$as_me:6918: \"$ac_link\"") >&5
6919   (eval $ac_link) 2>&5
6920   ac_status=$?
6921   echo "$as_me:6921: \$? = $ac_status" >&5
6922   (exit "$ac_status"); } &&
6923          { ac_try='test -s "conftest$ac_exeext"'
6924   { (eval echo "$as_me:6924: \"$ac_try\"") >&5
6925   (eval $ac_try) 2>&5
6926   ac_status=$?
6927   echo "$as_me:6927: \$? = $ac_status" >&5
6928   (exit "$ac_status"); }; }; then
6929   ac_cv_lib_mytinfo_tgoto=yes
6930 else
6931   echo "$as_me: failed program was:" >&5
6932 cat "conftest.$ac_ext" >&5
6933 ac_cv_lib_mytinfo_tgoto=no
6934 fi
6935 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6936 LIBS=$ac_check_lib_save_LIBS
6937 fi
6938 echo "$as_me:6938: result: $ac_cv_lib_mytinfo_tgoto" >&5
6939 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6940 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6941
6942 cf_add_libs="$LIBS"
6943 # reverse order
6944 cf_add_0lib=
6945 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6946 # filter duplicates
6947 for cf_add_1lib in $cf_add_0lib; do
6948         for cf_add_2lib in $cf_add_libs; do
6949                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6950                         cf_add_1lib=
6951                         break
6952                 fi
6953         done
6954         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6955 done
6956 LIBS="$cf_add_libs"
6957
6958 fi
6959
6960         ;;
6961 (hpux10.*)
6962         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6963         # next (1998), and xcurses "newer" (2000).  There is no header file for
6964         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6965         # term.h) for cur_colr
6966         if test "x$cf_cv_screen" = "xcurses_colr"
6967         then
6968                 echo "$as_me:6968: checking for initscr in -lcur_colr" >&5
6969 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6970 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6971   echo $ECHO_N "(cached) $ECHO_C" >&6
6972 else
6973   ac_check_lib_save_LIBS=$LIBS
6974 LIBS="-lcur_colr  $LIBS"
6975 cat >"conftest.$ac_ext" <<_ACEOF
6976 #line 6976 "configure"
6977 #include "confdefs.h"
6978
6979 /* Override any gcc2 internal prototype to avoid an error.  */
6980 #ifdef __cplusplus
6981 extern "C"
6982 #endif
6983 /* We use char because int might match the return type of a gcc2
6984    builtin and then its argument prototype would still apply.  */
6985 char initscr ();
6986 int
6987 main (void)
6988 {
6989 initscr ();
6990   ;
6991   return 0;
6992 }
6993 _ACEOF
6994 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6995 if { (eval echo "$as_me:6995: \"$ac_link\"") >&5
6996   (eval $ac_link) 2>&5
6997   ac_status=$?
6998   echo "$as_me:6998: \$? = $ac_status" >&5
6999   (exit "$ac_status"); } &&
7000          { ac_try='test -s "conftest$ac_exeext"'
7001   { (eval echo "$as_me:7001: \"$ac_try\"") >&5
7002   (eval $ac_try) 2>&5
7003   ac_status=$?
7004   echo "$as_me:7004: \$? = $ac_status" >&5
7005   (exit "$ac_status"); }; }; then
7006   ac_cv_lib_cur_colr_initscr=yes
7007 else
7008   echo "$as_me: failed program was:" >&5
7009 cat "conftest.$ac_ext" >&5
7010 ac_cv_lib_cur_colr_initscr=no
7011 fi
7012 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7013 LIBS=$ac_check_lib_save_LIBS
7014 fi
7015 echo "$as_me:7015: result: $ac_cv_lib_cur_colr_initscr" >&5
7016 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
7017 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
7018
7019 cf_add_libs="$LIBS"
7020 # reverse order
7021 cf_add_0lib=
7022 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7023 # filter duplicates
7024 for cf_add_1lib in $cf_add_0lib; do
7025         for cf_add_2lib in $cf_add_libs; do
7026                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7027                         cf_add_1lib=
7028                         break
7029                 fi
7030         done
7031         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7032 done
7033 LIBS="$cf_add_libs"
7034
7035                         ac_cv_func_initscr=yes
7036
7037 else
7038
7039                 echo "$as_me:7039: checking for initscr in -lHcurses" >&5
7040 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
7041 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
7042   echo $ECHO_N "(cached) $ECHO_C" >&6
7043 else
7044   ac_check_lib_save_LIBS=$LIBS
7045 LIBS="-lHcurses  $LIBS"
7046 cat >"conftest.$ac_ext" <<_ACEOF
7047 #line 7047 "configure"
7048 #include "confdefs.h"
7049
7050 /* Override any gcc2 internal prototype to avoid an error.  */
7051 #ifdef __cplusplus
7052 extern "C"
7053 #endif
7054 /* We use char because int might match the return type of a gcc2
7055    builtin and then its argument prototype would still apply.  */
7056 char initscr ();
7057 int
7058 main (void)
7059 {
7060 initscr ();
7061   ;
7062   return 0;
7063 }
7064 _ACEOF
7065 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7066 if { (eval echo "$as_me:7066: \"$ac_link\"") >&5
7067   (eval $ac_link) 2>&5
7068   ac_status=$?
7069   echo "$as_me:7069: \$? = $ac_status" >&5
7070   (exit "$ac_status"); } &&
7071          { ac_try='test -s "conftest$ac_exeext"'
7072   { (eval echo "$as_me:7072: \"$ac_try\"") >&5
7073   (eval $ac_try) 2>&5
7074   ac_status=$?
7075   echo "$as_me:7075: \$? = $ac_status" >&5
7076   (exit "$ac_status"); }; }; then
7077   ac_cv_lib_Hcurses_initscr=yes
7078 else
7079   echo "$as_me: failed program was:" >&5
7080 cat "conftest.$ac_ext" >&5
7081 ac_cv_lib_Hcurses_initscr=no
7082 fi
7083 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7084 LIBS=$ac_check_lib_save_LIBS
7085 fi
7086 echo "$as_me:7086: result: $ac_cv_lib_Hcurses_initscr" >&5
7087 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
7088 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
7089
7090                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
7091
7092 cf_add_libs="$LIBS"
7093 # reverse order
7094 cf_add_0lib=
7095 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7096 # filter duplicates
7097 for cf_add_1lib in $cf_add_0lib; do
7098         for cf_add_2lib in $cf_add_libs; do
7099                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7100                         cf_add_1lib=
7101                         break
7102                 fi
7103         done
7104         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7105 done
7106 LIBS="$cf_add_libs"
7107
7108         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7109         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
7110
7111                         ac_cv_func_initscr=yes
7112
7113 fi
7114
7115 fi
7116
7117         fi
7118         ;;
7119 (linux*)
7120         case `arch 2>/dev/null` in
7121         (x86_64)
7122                 if test -d /lib64
7123                 then
7124
7125 if test -n "/lib64" ; then
7126         for cf_add_libdir in /lib64
7127         do
7128                 if test "$cf_add_libdir" = /usr/lib ; then
7129                         :
7130                 elif test -d "$cf_add_libdir"
7131                 then
7132                         cf_have_libdir=no
7133                         if test -n "$LDFLAGS$LIBS" ; then
7134                                 # a loop is needed to ensure we can add subdirs of existing dirs
7135                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7136                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7137                                                 cf_have_libdir=yes; break
7138                                         fi
7139                                 done
7140                         fi
7141                         if test "$cf_have_libdir" = no ; then
7142                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7143
7144 echo "${as_me:-configure}:7144: testing adding $cf_add_libdir to library-path ..." 1>&5
7145
7146                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7147                         fi
7148                 fi
7149         done
7150 fi
7151
7152                 else
7153
7154 if test -n "/lib" ; then
7155         for cf_add_libdir in /lib
7156         do
7157                 if test "$cf_add_libdir" = /usr/lib ; then
7158                         :
7159                 elif test -d "$cf_add_libdir"
7160                 then
7161                         cf_have_libdir=no
7162                         if test -n "$LDFLAGS$LIBS" ; then
7163                                 # a loop is needed to ensure we can add subdirs of existing dirs
7164                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7165                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7166                                                 cf_have_libdir=yes; break
7167                                         fi
7168                                 done
7169                         fi
7170                         if test "$cf_have_libdir" = no ; then
7171                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7172
7173 echo "${as_me:-configure}:7173: testing adding $cf_add_libdir to library-path ..." 1>&5
7174
7175                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7176                         fi
7177                 fi
7178         done
7179 fi
7180
7181                 fi
7182                 ;;
7183         (*)
7184
7185 if test -n "/lib" ; then
7186         for cf_add_libdir in /lib
7187         do
7188                 if test "$cf_add_libdir" = /usr/lib ; then
7189                         :
7190                 elif test -d "$cf_add_libdir"
7191                 then
7192                         cf_have_libdir=no
7193                         if test -n "$LDFLAGS$LIBS" ; then
7194                                 # a loop is needed to ensure we can add subdirs of existing dirs
7195                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7196                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7197                                                 cf_have_libdir=yes; break
7198                                         fi
7199                                 done
7200                         fi
7201                         if test "$cf_have_libdir" = no ; then
7202                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7203
7204 echo "${as_me:-configure}:7204: testing adding $cf_add_libdir to library-path ..." 1>&5
7205
7206                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7207                         fi
7208                 fi
7209         done
7210 fi
7211
7212                 ;;
7213         esac
7214         ;;
7215 (sunos3*|sunos4*)
7216         if test "x$cf_cv_screen" = "xcurses_5lib"
7217         then
7218                 if test -d /usr/5lib ; then
7219
7220 if test -n "/usr/5lib" ; then
7221         for cf_add_libdir in /usr/5lib
7222         do
7223                 if test "$cf_add_libdir" = /usr/lib ; then
7224                         :
7225                 elif test -d "$cf_add_libdir"
7226                 then
7227                         cf_have_libdir=no
7228                         if test -n "$LDFLAGS$LIBS" ; then
7229                                 # a loop is needed to ensure we can add subdirs of existing dirs
7230                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7231                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7232                                                 cf_have_libdir=yes; break
7233                                         fi
7234                                 done
7235                         fi
7236                         if test "$cf_have_libdir" = no ; then
7237                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7238
7239 echo "${as_me:-configure}:7239: testing adding $cf_add_libdir to library-path ..." 1>&5
7240
7241                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7242                         fi
7243                 fi
7244         done
7245 fi
7246
7247 cf_add_libs="$LIBS"
7248 # reverse order
7249 cf_add_0lib=
7250 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7251 # filter duplicates
7252 for cf_add_1lib in $cf_add_0lib; do
7253         for cf_add_2lib in $cf_add_libs; do
7254                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7255                         cf_add_1lib=
7256                         break
7257                 fi
7258         done
7259         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7260 done
7261 LIBS="$cf_add_libs"
7262
7263                 fi
7264         fi
7265         ac_cv_func_initscr=yes
7266         ;;
7267 esac
7268
7269 if test ".$ac_cv_func_initscr" != .yes ; then
7270         cf_save_LIBS="$LIBS"
7271
7272         if test ".${cf_cv_ncurses_version:-no}" != .no
7273         then
7274                 cf_check_list="ncurses curses cursesX"
7275         else
7276                 cf_check_list="cursesX curses ncurses"
7277         fi
7278
7279         # Check for library containing tgoto.  Do this before curses library
7280         # because it may be needed to link the test-case for initscr.
7281         if test "x$cf_term_lib" = x
7282         then
7283                 echo "$as_me:7283: checking for tgoto" >&5
7284 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7285 if test "${ac_cv_func_tgoto+set}" = set; then
7286   echo $ECHO_N "(cached) $ECHO_C" >&6
7287 else
7288   cat >"conftest.$ac_ext" <<_ACEOF
7289 #line 7289 "configure"
7290 #include "confdefs.h"
7291 #define tgoto autoconf_temporary
7292 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7293 #undef tgoto
7294
7295 #ifdef __cplusplus
7296 extern "C"
7297 #endif
7298
7299 /* We use char because int might match the return type of a gcc2
7300    builtin and then its argument prototype would still apply.  */
7301 char tgoto (void);
7302
7303 int
7304 main (void)
7305 {
7306
7307 /* The GNU C library defines stubs for functions which it implements
7308     to always fail with ENOSYS.  Some functions are actually named
7309     something starting with __ and the normal name is an alias.  */
7310 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7311 #error found stub for tgoto
7312 #endif
7313
7314         return tgoto ();
7315   ;
7316   return 0;
7317 }
7318 _ACEOF
7319 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7320 if { (eval echo "$as_me:7320: \"$ac_link\"") >&5
7321   (eval $ac_link) 2>&5
7322   ac_status=$?
7323   echo "$as_me:7323: \$? = $ac_status" >&5
7324   (exit "$ac_status"); } &&
7325          { ac_try='test -s "conftest$ac_exeext"'
7326   { (eval echo "$as_me:7326: \"$ac_try\"") >&5
7327   (eval $ac_try) 2>&5
7328   ac_status=$?
7329   echo "$as_me:7329: \$? = $ac_status" >&5
7330   (exit "$ac_status"); }; }; then
7331   ac_cv_func_tgoto=yes
7332 else
7333   echo "$as_me: failed program was:" >&5
7334 cat "conftest.$ac_ext" >&5
7335 ac_cv_func_tgoto=no
7336 fi
7337 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7338 fi
7339 echo "$as_me:7339: result: $ac_cv_func_tgoto" >&5
7340 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7341 if test "$ac_cv_func_tgoto" = yes; then
7342   cf_term_lib=predefined
7343 else
7344
7345                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7346                         do
7347                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7348 echo "$as_me:7348: checking for tgoto in -l$cf_term_lib" >&5
7349 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7350 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7351   echo $ECHO_N "(cached) $ECHO_C" >&6
7352 else
7353   ac_check_lib_save_LIBS=$LIBS
7354 LIBS="-l$cf_term_lib  $LIBS"
7355 cat >"conftest.$ac_ext" <<_ACEOF
7356 #line 7356 "configure"
7357 #include "confdefs.h"
7358
7359 /* Override any gcc2 internal prototype to avoid an error.  */
7360 #ifdef __cplusplus
7361 extern "C"
7362 #endif
7363 /* We use char because int might match the return type of a gcc2
7364    builtin and then its argument prototype would still apply.  */
7365 char tgoto ();
7366 int
7367 main (void)
7368 {
7369 tgoto ();
7370   ;
7371   return 0;
7372 }
7373 _ACEOF
7374 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7375 if { (eval echo "$as_me:7375: \"$ac_link\"") >&5
7376   (eval $ac_link) 2>&5
7377   ac_status=$?
7378   echo "$as_me:7378: \$? = $ac_status" >&5
7379   (exit "$ac_status"); } &&
7380          { ac_try='test -s "conftest$ac_exeext"'
7381   { (eval echo "$as_me:7381: \"$ac_try\"") >&5
7382   (eval $ac_try) 2>&5
7383   ac_status=$?
7384   echo "$as_me:7384: \$? = $ac_status" >&5
7385   (exit "$ac_status"); }; }; then
7386   eval "$as_ac_Lib=yes"
7387 else
7388   echo "$as_me: failed program was:" >&5
7389 cat "conftest.$ac_ext" >&5
7390 eval "$as_ac_Lib=no"
7391 fi
7392 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7393 LIBS=$ac_check_lib_save_LIBS
7394 fi
7395 echo "$as_me:7395: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7396 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7397 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7398
7399                                         : "${cf_nculib_root:=$cf_term_lib}"
7400                                         break
7401
7402 fi
7403
7404                         done
7405
7406 fi
7407
7408         fi
7409
7410         # Check for library containing initscr
7411         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7412         if test "x$cf_curs_lib" = x
7413         then
7414                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7415                 do
7416                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7417                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7418                                 echo "$as_me:7418: checking if we can link with $cf_curs_lib library" >&5
7419 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7420                                 cat >"conftest.$ac_ext" <<_ACEOF
7421 #line 7421 "configure"
7422 #include "confdefs.h"
7423 #include <${cf_cv_ncurses_header:-curses.h}>
7424 int
7425 main (void)
7426 {
7427 initscr()
7428   ;
7429   return 0;
7430 }
7431 _ACEOF
7432 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7433 if { (eval echo "$as_me:7433: \"$ac_link\"") >&5
7434   (eval $ac_link) 2>&5
7435   ac_status=$?
7436   echo "$as_me:7436: \$? = $ac_status" >&5
7437   (exit "$ac_status"); } &&
7438          { ac_try='test -s "conftest$ac_exeext"'
7439   { (eval echo "$as_me:7439: \"$ac_try\"") >&5
7440   (eval $ac_try) 2>&5
7441   ac_status=$?
7442   echo "$as_me:7442: \$? = $ac_status" >&5
7443   (exit "$ac_status"); }; }; then
7444   cf_result=yes
7445 else
7446   echo "$as_me: failed program was:" >&5
7447 cat "conftest.$ac_ext" >&5
7448 cf_result=no
7449 fi
7450 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7451                                 echo "$as_me:7451: result: $cf_result" >&5
7452 echo "${ECHO_T}$cf_result" >&6
7453                                 test "$cf_result" = yes && break
7454                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7455                                 cf_result=no
7456                         elif test "$cf_term_lib" != predefined ; then
7457                                 echo "$as_me:7457: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7458 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7459                                 cat >"conftest.$ac_ext" <<_ACEOF
7460 #line 7460 "configure"
7461 #include "confdefs.h"
7462 #include <${cf_cv_ncurses_header:-curses.h}>
7463 int
7464 main (void)
7465 {
7466 initscr(); tgoto((char *)0, 0, 0);
7467   ;
7468   return 0;
7469 }
7470 _ACEOF
7471 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7472 if { (eval echo "$as_me:7472: \"$ac_link\"") >&5
7473   (eval $ac_link) 2>&5
7474   ac_status=$?
7475   echo "$as_me:7475: \$? = $ac_status" >&5
7476   (exit "$ac_status"); } &&
7477          { ac_try='test -s "conftest$ac_exeext"'
7478   { (eval echo "$as_me:7478: \"$ac_try\"") >&5
7479   (eval $ac_try) 2>&5
7480   ac_status=$?
7481   echo "$as_me:7481: \$? = $ac_status" >&5
7482   (exit "$ac_status"); }; }; then
7483   cf_result=no
7484 else
7485   echo "$as_me: failed program was:" >&5
7486 cat "conftest.$ac_ext" >&5
7487
7488                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7489                                         cat >"conftest.$ac_ext" <<_ACEOF
7490 #line 7490 "configure"
7491 #include "confdefs.h"
7492 #include <${cf_cv_ncurses_header:-curses.h}>
7493 int
7494 main (void)
7495 {
7496 initscr()
7497   ;
7498   return 0;
7499 }
7500 _ACEOF
7501 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7502 if { (eval echo "$as_me:7502: \"$ac_link\"") >&5
7503   (eval $ac_link) 2>&5
7504   ac_status=$?
7505   echo "$as_me:7505: \$? = $ac_status" >&5
7506   (exit "$ac_status"); } &&
7507          { ac_try='test -s "conftest$ac_exeext"'
7508   { (eval echo "$as_me:7508: \"$ac_try\"") >&5
7509   (eval $ac_try) 2>&5
7510   ac_status=$?
7511   echo "$as_me:7511: \$? = $ac_status" >&5
7512   (exit "$ac_status"); }; }; then
7513   cf_result=yes
7514 else
7515   echo "$as_me: failed program was:" >&5
7516 cat "conftest.$ac_ext" >&5
7517 cf_result=error
7518 fi
7519 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7520
7521 fi
7522 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7523                                 echo "$as_me:7523: result: $cf_result" >&5
7524 echo "${ECHO_T}$cf_result" >&6
7525                                 test "$cf_result" != error && break
7526                         fi
7527                 done
7528         fi
7529         test "$cf_curs_lib" = unknown && { { echo "$as_me:7529: error: no curses library found" >&5
7530 echo "$as_me: error: no curses library found" >&2;}
7531    { (exit 1); exit 1; }; }
7532 fi
7533 fi
7534
7535         ;;
7536 (ncursesw*)
7537
7538 for ac_header in wchar.h
7539 do
7540 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7541 echo "$as_me:7541: checking for $ac_header" >&5
7542 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7543 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7544   echo $ECHO_N "(cached) $ECHO_C" >&6
7545 else
7546   cat >"conftest.$ac_ext" <<_ACEOF
7547 #line 7547 "configure"
7548 #include "confdefs.h"
7549 #include <$ac_header>
7550 _ACEOF
7551 if { (eval echo "$as_me:7551: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7552   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7553   ac_status=$?
7554   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7555   rm -f conftest.er1
7556   cat conftest.err >&5
7557   echo "$as_me:7557: \$? = $ac_status" >&5
7558   (exit "$ac_status"); } >/dev/null; then
7559   if test -s conftest.err; then
7560     ac_cpp_err=$ac_c_preproc_warn_flag
7561   else
7562     ac_cpp_err=
7563   fi
7564 else
7565   ac_cpp_err=yes
7566 fi
7567 if test -z "$ac_cpp_err"; then
7568   eval "$as_ac_Header=yes"
7569 else
7570   echo "$as_me: failed program was:" >&5
7571   cat "conftest.$ac_ext" >&5
7572   eval "$as_ac_Header=no"
7573 fi
7574 rm -f conftest.err "conftest.$ac_ext"
7575 fi
7576 echo "$as_me:7576: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7577 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7578 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7579   cat >>confdefs.h <<EOF
7580 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7581 EOF
7582
7583 fi
7584 done
7585
7586 echo "$as_me:7586: checking for multibyte character support" >&5
7587 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7588 if test "${cf_cv_utf8_lib+set}" = set; then
7589   echo $ECHO_N "(cached) $ECHO_C" >&6
7590 else
7591
7592         cf_save_LIBS="$LIBS"
7593         cat >"conftest.$ac_ext" <<_ACEOF
7594 #line 7594 "configure"
7595 #include "confdefs.h"
7596
7597 #include <stdlib.h>
7598 #include <stdio.h>
7599 #ifdef HAVE_WCHAR_H
7600 #include <wchar.h>
7601 #endif
7602
7603 int
7604 main (void)
7605 {
7606 putwc(0,0);
7607   ;
7608   return 0;
7609 }
7610 _ACEOF
7611 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7612 if { (eval echo "$as_me:7612: \"$ac_link\"") >&5
7613   (eval $ac_link) 2>&5
7614   ac_status=$?
7615   echo "$as_me:7615: \$? = $ac_status" >&5
7616   (exit "$ac_status"); } &&
7617          { ac_try='test -s "conftest$ac_exeext"'
7618   { (eval echo "$as_me:7618: \"$ac_try\"") >&5
7619   (eval $ac_try) 2>&5
7620   ac_status=$?
7621   echo "$as_me:7621: \$? = $ac_status" >&5
7622   (exit "$ac_status"); }; }; then
7623   cf_cv_utf8_lib=yes
7624 else
7625   echo "$as_me: failed program was:" >&5
7626 cat "conftest.$ac_ext" >&5
7627
7628 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7629 # will be set on completion of the AC_TRY_LINK below.
7630 cf_cv_header_path_utf8=
7631 cf_cv_library_path_utf8=
7632
7633 echo "${as_me:-configure}:7633: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7634
7635 cf_save_LIBS="$LIBS"
7636
7637 cat >"conftest.$ac_ext" <<_ACEOF
7638 #line 7638 "configure"
7639 #include "confdefs.h"
7640
7641 #include <libutf8.h>
7642 int
7643 main (void)
7644 {
7645 putwc(0,0);
7646   ;
7647   return 0;
7648 }
7649 _ACEOF
7650 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7651 if { (eval echo "$as_me:7651: \"$ac_link\"") >&5
7652   (eval $ac_link) 2>&5
7653   ac_status=$?
7654   echo "$as_me:7654: \$? = $ac_status" >&5
7655   (exit "$ac_status"); } &&
7656          { ac_try='test -s "conftest$ac_exeext"'
7657   { (eval echo "$as_me:7657: \"$ac_try\"") >&5
7658   (eval $ac_try) 2>&5
7659   ac_status=$?
7660   echo "$as_me:7660: \$? = $ac_status" >&5
7661   (exit "$ac_status"); }; }; then
7662
7663         cf_cv_find_linkage_utf8=yes
7664         cf_cv_header_path_utf8=/usr/include
7665         cf_cv_library_path_utf8=/usr/lib
7666
7667 else
7668   echo "$as_me: failed program was:" >&5
7669 cat "conftest.$ac_ext" >&5
7670
7671 LIBS="-lutf8  $cf_save_LIBS"
7672
7673 cat >"conftest.$ac_ext" <<_ACEOF
7674 #line 7674 "configure"
7675 #include "confdefs.h"
7676
7677 #include <libutf8.h>
7678 int
7679 main (void)
7680 {
7681 putwc(0,0);
7682   ;
7683   return 0;
7684 }
7685 _ACEOF
7686 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7687 if { (eval echo "$as_me:7687: \"$ac_link\"") >&5
7688   (eval $ac_link) 2>&5
7689   ac_status=$?
7690   echo "$as_me:7690: \$? = $ac_status" >&5
7691   (exit "$ac_status"); } &&
7692          { ac_try='test -s "conftest$ac_exeext"'
7693   { (eval echo "$as_me:7693: \"$ac_try\"") >&5
7694   (eval $ac_try) 2>&5
7695   ac_status=$?
7696   echo "$as_me:7696: \$? = $ac_status" >&5
7697   (exit "$ac_status"); }; }; then
7698
7699         cf_cv_find_linkage_utf8=yes
7700         cf_cv_header_path_utf8=/usr/include
7701         cf_cv_library_path_utf8=/usr/lib
7702         cf_cv_library_file_utf8="-lutf8"
7703
7704 else
7705   echo "$as_me: failed program was:" >&5
7706 cat "conftest.$ac_ext" >&5
7707
7708         cf_cv_find_linkage_utf8=no
7709         LIBS="$cf_save_LIBS"
7710
7711         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7712
7713 echo "${as_me:-configure}:7713: testing find linkage for utf8 library ..." 1>&5
7714
7715 echo "${as_me:-configure}:7715: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7716
7717         cf_save_CPPFLAGS="$CPPFLAGS"
7718         cf_test_CPPFLAGS="$CPPFLAGS"
7719
7720 cf_search=
7721
7722 # collect the current set of include-directories from compiler flags
7723 cf_header_path_list=""
7724 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7725         for cf_header_path in $CPPFLAGS $CFLAGS
7726         do
7727                 case "$cf_header_path" in
7728                 (-I*)
7729                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7730
7731 test "x$cf_header_path" != "xNONE" && \
7732 test -d "$cf_header_path" && \
7733  {
7734         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7735         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7736         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7737         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7738         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7739         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7740 }
7741
7742                         cf_header_path_list="$cf_header_path_list $cf_search"
7743                         ;;
7744                 esac
7745         done
7746 fi
7747
7748 # add the variations for the package we are looking for
7749
7750 cf_search=
7751
7752 test "x$prefix" != "xNONE" && \
7753 test -d "$prefix" && \
7754  {
7755         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7756         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7757         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7758         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7759         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7760         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7761 }
7762
7763 for cf_subdir_prefix in \
7764         /usr \
7765         /usr/local \
7766         /usr/pkg \
7767         /opt \
7768         /opt/local \
7769         $HOME
7770 do
7771
7772 test "x$cf_subdir_prefix" != "x$prefix" && \
7773 test -d "$cf_subdir_prefix" && \
7774 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7775         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7776         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7777         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7778         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7779         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7780         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7781 }
7782
7783 done
7784
7785 test "$includedir" != NONE && \
7786 test "$includedir" != "/usr/include" && \
7787 test -d "$includedir" && {
7788         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7789         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7790 }
7791
7792 test "$oldincludedir" != NONE && \
7793 test "$oldincludedir" != "/usr/include" && \
7794 test -d "$oldincludedir" && {
7795         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7796         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7797 }
7798
7799 cf_search="$cf_search $cf_header_path_list"
7800
7801         for cf_cv_header_path_utf8 in $cf_search
7802         do
7803                 if test -d "$cf_cv_header_path_utf8" ; then
7804                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7805
7806 echo "${as_me:-configure}:7806: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7807
7808                         CPPFLAGS="$cf_save_CPPFLAGS"
7809
7810         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7811         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7812
7813                         cat >"conftest.$ac_ext" <<_ACEOF
7814 #line 7814 "configure"
7815 #include "confdefs.h"
7816
7817 #include <libutf8.h>
7818 int
7819 main (void)
7820 {
7821 putwc(0,0);
7822   ;
7823   return 0;
7824 }
7825 _ACEOF
7826 rm -f "conftest.$ac_objext"
7827 if { (eval echo "$as_me:7827: \"$ac_compile\"") >&5
7828   (eval $ac_compile) 2>&5
7829   ac_status=$?
7830   echo "$as_me:7830: \$? = $ac_status" >&5
7831   (exit "$ac_status"); } &&
7832          { ac_try='test -s "conftest.$ac_objext"'
7833   { (eval echo "$as_me:7833: \"$ac_try\"") >&5
7834   (eval $ac_try) 2>&5
7835   ac_status=$?
7836   echo "$as_me:7836: \$? = $ac_status" >&5
7837   (exit "$ac_status"); }; }; then
7838
7839                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7840
7841 echo "${as_me:-configure}:7841: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7842
7843                                 cf_cv_find_linkage_utf8=maybe
7844                                 cf_test_CPPFLAGS="$CPPFLAGS"
7845                                 break
7846 else
7847   echo "$as_me: failed program was:" >&5
7848 cat "conftest.$ac_ext" >&5
7849
7850                                 CPPFLAGS="$cf_save_CPPFLAGS"
7851
7852 fi
7853 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7854                 fi
7855         done
7856
7857         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7858
7859 echo "${as_me:-configure}:7859: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7860
7861                 cf_save_LIBS="$LIBS"
7862                 cf_save_LDFLAGS="$LDFLAGS"
7863
7864                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7865
7866 cf_search=
7867 cf_library_path_list=""
7868 if test -n "${LDFLAGS}${LIBS}" ; then
7869         for cf_library_path in $LDFLAGS $LIBS
7870         do
7871                 case "$cf_library_path" in
7872                 (-L*)
7873                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7874
7875 test "x$cf_library_path" != "xNONE" && \
7876 test -d "$cf_library_path" && \
7877  {
7878         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7879         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7880         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7881         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7882         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7883         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7884 }
7885
7886                         cf_library_path_list="$cf_library_path_list $cf_search"
7887                         ;;
7888                 esac
7889         done
7890 fi
7891
7892 cf_search=
7893
7894 test "x$prefix" != "xNONE" && \
7895 test -d "$prefix" && \
7896  {
7897         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7898         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7899         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7900         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7901         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7902         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7903 }
7904
7905 for cf_subdir_prefix in \
7906         /usr \
7907         /usr/local \
7908         /usr/pkg \
7909         /opt \
7910         /opt/local \
7911         $HOME
7912 do
7913
7914 test "x$cf_subdir_prefix" != "x$prefix" && \
7915 test -d "$cf_subdir_prefix" && \
7916 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7917         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7918         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7919         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7920         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7921         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7922         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7923 }
7924
7925 done
7926
7927 cf_search="$cf_library_path_list $cf_search"
7928
7929                         for cf_cv_library_path_utf8 in $cf_search
7930                         do
7931                                 if test -d "$cf_cv_library_path_utf8" ; then
7932                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7933
7934 echo "${as_me:-configure}:7934: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7935
7936                                         CPPFLAGS="$cf_test_CPPFLAGS"
7937                                         LIBS="-lutf8  $cf_save_LIBS"
7938                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7939                                         cat >"conftest.$ac_ext" <<_ACEOF
7940 #line 7940 "configure"
7941 #include "confdefs.h"
7942
7943 #include <libutf8.h>
7944 int
7945 main (void)
7946 {
7947 putwc(0,0);
7948   ;
7949   return 0;
7950 }
7951 _ACEOF
7952 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7953 if { (eval echo "$as_me:7953: \"$ac_link\"") >&5
7954   (eval $ac_link) 2>&5
7955   ac_status=$?
7956   echo "$as_me:7956: \$? = $ac_status" >&5
7957   (exit "$ac_status"); } &&
7958          { ac_try='test -s "conftest$ac_exeext"'
7959   { (eval echo "$as_me:7959: \"$ac_try\"") >&5
7960   (eval $ac_try) 2>&5
7961   ac_status=$?
7962   echo "$as_me:7962: \$? = $ac_status" >&5
7963   (exit "$ac_status"); }; }; then
7964
7965                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7966
7967 echo "${as_me:-configure}:7967: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7968
7969                                         cf_cv_find_linkage_utf8=yes
7970                                         cf_cv_library_file_utf8="-lutf8"
7971                                         break
7972 else
7973   echo "$as_me: failed program was:" >&5
7974 cat "conftest.$ac_ext" >&5
7975
7976                                         CPPFLAGS="$cf_save_CPPFLAGS"
7977                                         LIBS="$cf_save_LIBS"
7978                                         LDFLAGS="$cf_save_LDFLAGS"
7979
7980 fi
7981 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7982                                 fi
7983                         done
7984                         CPPFLAGS="$cf_save_CPPFLAGS"
7985                         LDFLAGS="$cf_save_LDFLAGS"
7986                 fi
7987
7988         else
7989                 cf_cv_find_linkage_utf8=no
7990         fi
7991
7992 fi
7993 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7994
7995 fi
7996 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7997
7998 LIBS="$cf_save_LIBS"
7999
8000 if test "$cf_cv_find_linkage_utf8" = yes ; then
8001 cf_cv_utf8_lib=add-on
8002 else
8003 cf_cv_utf8_lib=no
8004 fi
8005
8006 fi
8007 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8008 fi
8009 echo "$as_me:8009: result: $cf_cv_utf8_lib" >&5
8010 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8011
8012 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8013 # ncurses/ncursesw:
8014 if test "$cf_cv_utf8_lib" = "add-on" ; then
8015
8016 cat >>confdefs.h <<\EOF
8017 #define HAVE_LIBUTF8_H 1
8018 EOF
8019
8020 if test -n "$cf_cv_header_path_utf8" ; then
8021   for cf_add_incdir in $cf_cv_header_path_utf8
8022   do
8023         while test "$cf_add_incdir" != /usr/include
8024         do
8025           if test -d "$cf_add_incdir"
8026           then
8027                 cf_have_incdir=no
8028                 if test -n "$CFLAGS$CPPFLAGS" ; then
8029                   # a loop is needed to ensure we can add subdirs of existing dirs
8030                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8031                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8032                           cf_have_incdir=yes; break
8033                         fi
8034                   done
8035                 fi
8036
8037                 if test "$cf_have_incdir" = no ; then
8038                   if test "$cf_add_incdir" = /usr/local/include ; then
8039                         if test "$GCC" = yes
8040                         then
8041                           cf_save_CPPFLAGS=$CPPFLAGS
8042
8043         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8044         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8045
8046                           cat >"conftest.$ac_ext" <<_ACEOF
8047 #line 8047 "configure"
8048 #include "confdefs.h"
8049 #include <stdio.h>
8050 int
8051 main (void)
8052 {
8053 printf("Hello")
8054   ;
8055   return 0;
8056 }
8057 _ACEOF
8058 rm -f "conftest.$ac_objext"
8059 if { (eval echo "$as_me:8059: \"$ac_compile\"") >&5
8060   (eval $ac_compile) 2>&5
8061   ac_status=$?
8062   echo "$as_me:8062: \$? = $ac_status" >&5
8063   (exit "$ac_status"); } &&
8064          { ac_try='test -s "conftest.$ac_objext"'
8065   { (eval echo "$as_me:8065: \"$ac_try\"") >&5
8066   (eval $ac_try) 2>&5
8067   ac_status=$?
8068   echo "$as_me:8068: \$? = $ac_status" >&5
8069   (exit "$ac_status"); }; }; then
8070   :
8071 else
8072   echo "$as_me: failed program was:" >&5
8073 cat "conftest.$ac_ext" >&5
8074 cf_have_incdir=yes
8075 fi
8076 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8077                           CPPFLAGS=$cf_save_CPPFLAGS
8078                         fi
8079                   fi
8080                 fi
8081
8082                 if test "$cf_have_incdir" = no ; then
8083                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8084
8085 echo "${as_me:-configure}:8085: testing adding $cf_add_incdir to include-path ..." 1>&5
8086
8087                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8088
8089                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8090                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8091                   cf_add_incdir="$cf_top_incdir"
8092                 else
8093                   break
8094                 fi
8095           else
8096                 break
8097           fi
8098         done
8099   done
8100 fi
8101
8102 if test -n "$cf_cv_library_path_utf8" ; then
8103         for cf_add_libdir in $cf_cv_library_path_utf8
8104         do
8105                 if test "$cf_add_libdir" = /usr/lib ; then
8106                         :
8107                 elif test -d "$cf_add_libdir"
8108                 then
8109                         cf_have_libdir=no
8110                         if test -n "$LDFLAGS$LIBS" ; then
8111                                 # a loop is needed to ensure we can add subdirs of existing dirs
8112                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
8113                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8114                                                 cf_have_libdir=yes; break
8115                                         fi
8116                                 done
8117                         fi
8118                         if test "$cf_have_libdir" = no ; then
8119                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8120
8121 echo "${as_me:-configure}:8121: testing adding $cf_add_libdir to library-path ..." 1>&5
8122
8123                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8124                         fi
8125                 fi
8126         done
8127 fi
8128
8129 cf_add_libs="$LIBS"
8130 # reverse order
8131 cf_add_0lib=
8132 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8133 # filter duplicates
8134 for cf_add_1lib in $cf_add_0lib; do
8135         for cf_add_2lib in $cf_add_libs; do
8136                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8137                         cf_add_1lib=
8138                         break
8139                 fi
8140         done
8141         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8142 done
8143 LIBS="$cf_add_libs"
8144
8145 fi
8146
8147 cf_ncuconfig_root=$cf_cv_screen
8148 cf_have_ncuconfig=no
8149
8150 if test "x${PKG_CONFIG:=none}" != xnone; then
8151         echo "$as_me:8151: checking pkg-config for $cf_ncuconfig_root" >&5
8152 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8153         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8154                 echo "$as_me:8154: result: yes" >&5
8155 echo "${ECHO_T}yes" >&6
8156
8157                 echo "$as_me:8157: checking if the $cf_ncuconfig_root package files work" >&5
8158 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8159                 cf_have_ncuconfig=unknown
8160
8161                 cf_save_CFLAGS="$CFLAGS"
8162                 cf_save_CPPFLAGS="$CPPFLAGS"
8163                 cf_save_LIBS="$LIBS"
8164
8165                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8166                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8167
8168                 # while -W for passing linker flags is prevalent, it is not "standard".
8169                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8170                 # incompatible _and_ non-standard -W option which gives an error.  Work
8171                 # around that pitfall.
8172                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8173                 (x*c[89]9@@*-W*)
8174
8175 cf_fix_cppflags=no
8176 cf_new_cflags=
8177 cf_new_cppflags=
8178 cf_new_extra_cppflags=
8179
8180 for cf_add_cflags in $cf_pkg_cflags
8181 do
8182 case "$cf_fix_cppflags" in
8183 (no)
8184         case "$cf_add_cflags" in
8185         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8186                 case "$cf_add_cflags" in
8187                 (-D*)
8188                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8189
8190                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8191                                 && test -z "${cf_tst_cflags}" \
8192                                 && cf_fix_cppflags=yes
8193
8194                         if test "$cf_fix_cppflags" = yes ; then
8195
8196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8198
8199                                 continue
8200                         elif test "${cf_tst_cflags}" = "\"'" ; then
8201
8202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8204
8205                                 continue
8206                         fi
8207                         ;;
8208                 esac
8209                 case "$CPPFLAGS" in
8210                 (*$cf_add_cflags)
8211                         ;;
8212                 (*)
8213                         case "$cf_add_cflags" in
8214                         (-D*)
8215                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8216
8217 CPPFLAGS=`echo "$CPPFLAGS" | \
8218         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8219                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8220
8221                                 ;;
8222                         esac
8223
8224         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8225         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8226
8227                         ;;
8228                 esac
8229                 ;;
8230         (*)
8231
8232         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8233         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8234
8235                 ;;
8236         esac
8237         ;;
8238 (yes)
8239
8240         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8241         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8242
8243         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8244
8245         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8246                 && test -z "${cf_tst_cflags}" \
8247                 && cf_fix_cppflags=no
8248         ;;
8249 esac
8250 done
8251
8252 if test -n "$cf_new_cflags" ; then
8253
8254         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8255         CFLAGS="${CFLAGS}$cf_new_cflags"
8256
8257 fi
8258
8259 if test -n "$cf_new_cppflags" ; then
8260
8261         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8262         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8263
8264 fi
8265
8266 if test -n "$cf_new_extra_cppflags" ; then
8267
8268         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8269         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8270
8271 fi
8272
8273 cf_add_libs="$LIBS"
8274 # reverse order
8275 cf_add_0lib=
8276 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8277 # filter duplicates
8278 for cf_add_1lib in $cf_add_0lib; do
8279         for cf_add_2lib in $cf_add_libs; do
8280                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8281                         cf_add_1lib=
8282                         break
8283                 fi
8284         done
8285         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8286 done
8287 LIBS="$cf_add_libs"
8288
8289                         cat >"conftest.$ac_ext" <<_ACEOF
8290 #line 8290 "configure"
8291 #include "confdefs.h"
8292 #include <${cf_cv_ncurses_header:-curses.h}>
8293 int
8294 main (void)
8295 {
8296 initscr(); mousemask(0,0); tigetstr((char *)0);
8297   ;
8298   return 0;
8299 }
8300 _ACEOF
8301 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8302 if { (eval echo "$as_me:8302: \"$ac_link\"") >&5
8303   (eval $ac_link) 2>&5
8304   ac_status=$?
8305   echo "$as_me:8305: \$? = $ac_status" >&5
8306   (exit "$ac_status"); } &&
8307          { ac_try='test -s "conftest$ac_exeext"'
8308   { (eval echo "$as_me:8308: \"$ac_try\"") >&5
8309   (eval $ac_try) 2>&5
8310   ac_status=$?
8311   echo "$as_me:8311: \$? = $ac_status" >&5
8312   (exit "$ac_status"); }; }; then
8313   if test "$cross_compiling" = yes; then
8314   cf_test_ncuconfig=maybe
8315 else
8316   cat >"conftest.$ac_ext" <<_ACEOF
8317 #line 8317 "configure"
8318 #include "confdefs.h"
8319 #include <${cf_cv_ncurses_header:-curses.h}>
8320                                         int main(void)
8321                                         { const char *xx = curses_version(); return (xx == 0); }
8322 _ACEOF
8323 rm -f "conftest$ac_exeext"
8324 if { (eval echo "$as_me:8324: \"$ac_link\"") >&5
8325   (eval $ac_link) 2>&5
8326   ac_status=$?
8327   echo "$as_me:8327: \$? = $ac_status" >&5
8328   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8329   { (eval echo "$as_me:8329: \"$ac_try\"") >&5
8330   (eval $ac_try) 2>&5
8331   ac_status=$?
8332   echo "$as_me:8332: \$? = $ac_status" >&5
8333   (exit "$ac_status"); }; }; then
8334   cf_test_ncuconfig=yes
8335 else
8336   echo "$as_me: program exited with status $ac_status" >&5
8337 echo "$as_me: failed program was:" >&5
8338 cat "conftest.$ac_ext" >&5
8339 cf_test_ncuconfig=no
8340 fi
8341 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8342 fi
8343 else
8344   echo "$as_me: failed program was:" >&5
8345 cat "conftest.$ac_ext" >&5
8346 cf_test_ncuconfig=no
8347 fi
8348 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8349
8350                         CFLAGS="$cf_save_CFLAGS"
8351                         CPPFLAGS="$cf_save_CPPFLAGS"
8352                         LIBS="$cf_save_LIBS"
8353
8354                         if test "x$cf_test_ncuconfig" != xyes; then
8355                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8356                                 cf_pkg_cflags="$cf_temp"
8357                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8358                                 cf_pkg_libs="$cf_temp"
8359                         fi
8360                         ;;
8361                 esac
8362
8363 for cf_add_cflags in $cf_pkg_cflags
8364 do
8365         case "x$cf_add_cflags" in
8366         (x-[DU]*)
8367
8368 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8369 while true
8370 do
8371         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8372         test "$CFLAGS" != "$cf_old_cflag" || break
8373
8374         CFLAGS="$cf_old_cflag"
8375 done
8376
8377 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8378 while true
8379 do
8380         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8381         test "$CPPFLAGS" != "$cf_old_cflag" || break
8382
8383         CPPFLAGS="$cf_old_cflag"
8384 done
8385
8386                 ;;
8387         esac
8388
8389 cf_fix_cppflags=no
8390 cf_new_cflags=
8391 cf_new_cppflags=
8392 cf_new_extra_cppflags=
8393
8394 for cf_add_cflags in $cf_add_cflags
8395 do
8396 case "$cf_fix_cppflags" in
8397 (no)
8398         case "$cf_add_cflags" in
8399         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8400                 case "$cf_add_cflags" in
8401                 (-D*)
8402                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8403
8404                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8405                                 && test -z "${cf_tst_cflags}" \
8406                                 && cf_fix_cppflags=yes
8407
8408                         if test "$cf_fix_cppflags" = yes ; then
8409
8410         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8411         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8412
8413                                 continue
8414                         elif test "${cf_tst_cflags}" = "\"'" ; then
8415
8416         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8417         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8418
8419                                 continue
8420                         fi
8421                         ;;
8422                 esac
8423                 case "$CPPFLAGS" in
8424                 (*$cf_add_cflags)
8425                         ;;
8426                 (*)
8427                         case "$cf_add_cflags" in
8428                         (-D*)
8429                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8430
8431 CPPFLAGS=`echo "$CPPFLAGS" | \
8432         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8433                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8434
8435                                 ;;
8436                         esac
8437
8438         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8439         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8440
8441                         ;;
8442                 esac
8443                 ;;
8444         (*)
8445
8446         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8447         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8448
8449                 ;;
8450         esac
8451         ;;
8452 (yes)
8453
8454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8456
8457         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8458
8459         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8460                 && test -z "${cf_tst_cflags}" \
8461                 && cf_fix_cppflags=no
8462         ;;
8463 esac
8464 done
8465
8466 if test -n "$cf_new_cflags" ; then
8467
8468         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8469         CFLAGS="${CFLAGS}$cf_new_cflags"
8470
8471 fi
8472
8473 if test -n "$cf_new_cppflags" ; then
8474
8475         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8476         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8477
8478 fi
8479
8480 if test -n "$cf_new_extra_cppflags" ; then
8481
8482         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8483         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8484
8485 fi
8486
8487 done
8488
8489 cf_add_libs="$LIBS"
8490 # reverse order
8491 cf_add_0lib=
8492 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8493 # filter duplicates
8494 for cf_add_1lib in $cf_add_0lib; do
8495         for cf_add_2lib in $cf_add_libs; do
8496                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8497                         cf_add_1lib=
8498                         break
8499                 fi
8500         done
8501         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8502 done
8503 LIBS="$cf_add_libs"
8504
8505                 cat >"conftest.$ac_ext" <<_ACEOF
8506 #line 8506 "configure"
8507 #include "confdefs.h"
8508 #include <${cf_cv_ncurses_header:-curses.h}>
8509 int
8510 main (void)
8511 {
8512 initscr(); mousemask(0,0); tigetstr((char *)0);
8513   ;
8514   return 0;
8515 }
8516 _ACEOF
8517 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8518 if { (eval echo "$as_me:8518: \"$ac_link\"") >&5
8519   (eval $ac_link) 2>&5
8520   ac_status=$?
8521   echo "$as_me:8521: \$? = $ac_status" >&5
8522   (exit "$ac_status"); } &&
8523          { ac_try='test -s "conftest$ac_exeext"'
8524   { (eval echo "$as_me:8524: \"$ac_try\"") >&5
8525   (eval $ac_try) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit "$ac_status"); }; }; then
8529   if test "$cross_compiling" = yes; then
8530   cf_have_ncuconfig=maybe
8531 else
8532   cat >"conftest.$ac_ext" <<_ACEOF
8533 #line 8533 "configure"
8534 #include "confdefs.h"
8535 #include <${cf_cv_ncurses_header:-curses.h}>
8536                                 int main(void)
8537                                 { const char *xx = curses_version(); return (xx == 0); }
8538 _ACEOF
8539 rm -f "conftest$ac_exeext"
8540 if { (eval echo "$as_me:8540: \"$ac_link\"") >&5
8541   (eval $ac_link) 2>&5
8542   ac_status=$?
8543   echo "$as_me:8543: \$? = $ac_status" >&5
8544   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8545   { (eval echo "$as_me:8545: \"$ac_try\"") >&5
8546   (eval $ac_try) 2>&5
8547   ac_status=$?
8548   echo "$as_me:8548: \$? = $ac_status" >&5
8549   (exit "$ac_status"); }; }; then
8550   cf_have_ncuconfig=yes
8551 else
8552   echo "$as_me: program exited with status $ac_status" >&5
8553 echo "$as_me: failed program was:" >&5
8554 cat "conftest.$ac_ext" >&5
8555 cf_have_ncuconfig=no
8556 fi
8557 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8558 fi
8559 else
8560   echo "$as_me: failed program was:" >&5
8561 cat "conftest.$ac_ext" >&5
8562 cf_have_ncuconfig=no
8563 fi
8564 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8565                 echo "$as_me:8565: result: $cf_have_ncuconfig" >&5
8566 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8567                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8568                 if test "$cf_have_ncuconfig" != "yes"
8569                 then
8570                         CPPFLAGS="$cf_save_CPPFLAGS"
8571                         LIBS="$cf_save_LIBS"
8572                         NCURSES_CONFIG_PKG=none
8573                 else
8574
8575 cat >>confdefs.h <<\EOF
8576 #define NCURSES 1
8577 EOF
8578
8579                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8580
8581 echo "$as_me:8581: checking for terminfo header" >&5
8582 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8583 if test "${cf_cv_term_header+set}" = set; then
8584   echo $ECHO_N "(cached) $ECHO_C" >&6
8585 else
8586
8587 case "${cf_cv_ncurses_header}" in
8588 (*/ncurses.h|*/ncursesw.h)
8589         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8590         ;;
8591 (*)
8592         cf_term_header=term.h
8593         ;;
8594 esac
8595
8596 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8597 do
8598 cat >"conftest.$ac_ext" <<_ACEOF
8599 #line 8599 "configure"
8600 #include "confdefs.h"
8601 #include <stdio.h>
8602 #include <${cf_cv_ncurses_header:-curses.h}>
8603 #include <$cf_test>
8604
8605 int
8606 main (void)
8607 {
8608 int x = auto_left_margin; (void)x
8609   ;
8610   return 0;
8611 }
8612 _ACEOF
8613 rm -f "conftest.$ac_objext"
8614 if { (eval echo "$as_me:8614: \"$ac_compile\"") >&5
8615   (eval $ac_compile) 2>&5
8616   ac_status=$?
8617   echo "$as_me:8617: \$? = $ac_status" >&5
8618   (exit "$ac_status"); } &&
8619          { ac_try='test -s "conftest.$ac_objext"'
8620   { (eval echo "$as_me:8620: \"$ac_try\"") >&5
8621   (eval $ac_try) 2>&5
8622   ac_status=$?
8623   echo "$as_me:8623: \$? = $ac_status" >&5
8624   (exit "$ac_status"); }; }; then
8625
8626         cf_cv_term_header="$cf_test"
8627 else
8628   echo "$as_me: failed program was:" >&5
8629 cat "conftest.$ac_ext" >&5
8630
8631         cf_cv_term_header=unknown
8632
8633 fi
8634 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8635         test "$cf_cv_term_header" != unknown && break
8636 done
8637
8638 fi
8639 echo "$as_me:8639: result: $cf_cv_term_header" >&5
8640 echo "${ECHO_T}$cf_cv_term_header" >&6
8641
8642 # Set definitions to allow ifdef'ing to accommodate subdirectories
8643
8644 case "$cf_cv_term_header" in
8645 (*term.h)
8646
8647 cat >>confdefs.h <<\EOF
8648 #define HAVE_TERM_H 1
8649 EOF
8650
8651         ;;
8652 esac
8653
8654 case "$cf_cv_term_header" in
8655 (ncurses/term.h)
8656
8657 cat >>confdefs.h <<\EOF
8658 #define HAVE_NCURSES_TERM_H 1
8659 EOF
8660
8661         ;;
8662 (ncursesw/term.h)
8663
8664 cat >>confdefs.h <<\EOF
8665 #define HAVE_NCURSESW_TERM_H 1
8666 EOF
8667
8668         ;;
8669 esac
8670
8671                 fi
8672
8673         else
8674                 echo "$as_me:8674: result: no" >&5
8675 echo "${ECHO_T}no" >&6
8676                 NCURSES_CONFIG_PKG=none
8677         fi
8678 else
8679         NCURSES_CONFIG_PKG=none
8680 fi
8681
8682 if test "x$cf_have_ncuconfig" = "xno"; then
8683         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8684
8685 if test -n "$ac_tool_prefix"; then
8686   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8687   do
8688     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8689 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8690 echo "$as_me:8690: checking for $ac_word" >&5
8691 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8692 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8693   echo $ECHO_N "(cached) $ECHO_C" >&6
8694 else
8695   if test -n "$NCURSES_CONFIG"; then
8696   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8697 else
8698   ac_save_IFS=$IFS; IFS=$ac_path_separator
8699 ac_dummy="$PATH"
8700 for ac_dir in $ac_dummy; do
8701   IFS=$ac_save_IFS
8702   test -z "$ac_dir" && ac_dir=.
8703   $as_executable_p "$ac_dir/$ac_word" || continue
8704 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8705 echo "$as_me:8705: found $ac_dir/$ac_word" >&5
8706 break
8707 done
8708
8709 fi
8710 fi
8711 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8712 if test -n "$NCURSES_CONFIG"; then
8713   echo "$as_me:8713: result: $NCURSES_CONFIG" >&5
8714 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8715 else
8716   echo "$as_me:8716: result: no" >&5
8717 echo "${ECHO_T}no" >&6
8718 fi
8719
8720     test -n "$NCURSES_CONFIG" && break
8721   done
8722 fi
8723 if test -z "$NCURSES_CONFIG"; then
8724   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8725   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8726 do
8727   # Extract the first word of "$ac_prog", so it can be a program name with args.
8728 set dummy $ac_prog; ac_word=$2
8729 echo "$as_me:8729: checking for $ac_word" >&5
8730 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8731 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8732   echo $ECHO_N "(cached) $ECHO_C" >&6
8733 else
8734   if test -n "$ac_ct_NCURSES_CONFIG"; then
8735   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8736 else
8737   ac_save_IFS=$IFS; IFS=$ac_path_separator
8738 ac_dummy="$PATH"
8739 for ac_dir in $ac_dummy; do
8740   IFS=$ac_save_IFS
8741   test -z "$ac_dir" && ac_dir=.
8742   $as_executable_p "$ac_dir/$ac_word" || continue
8743 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8744 echo "$as_me:8744: found $ac_dir/$ac_word" >&5
8745 break
8746 done
8747
8748 fi
8749 fi
8750 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8751 if test -n "$ac_ct_NCURSES_CONFIG"; then
8752   echo "$as_me:8752: result: $ac_ct_NCURSES_CONFIG" >&5
8753 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8754 else
8755   echo "$as_me:8755: result: no" >&5
8756 echo "${ECHO_T}no" >&6
8757 fi
8758
8759   test -n "$ac_ct_NCURSES_CONFIG" && break
8760 done
8761 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8762
8763   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8764 fi
8765
8766         if test "$NCURSES_CONFIG" != none ; then
8767
8768 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8769 do
8770         case "x$cf_add_cflags" in
8771         (x-[DU]*)
8772
8773 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8774 while true
8775 do
8776         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8777         test "$CFLAGS" != "$cf_old_cflag" || break
8778
8779         CFLAGS="$cf_old_cflag"
8780 done
8781
8782 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8783 while true
8784 do
8785         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8786         test "$CPPFLAGS" != "$cf_old_cflag" || break
8787
8788         CPPFLAGS="$cf_old_cflag"
8789 done
8790
8791                 ;;
8792         esac
8793
8794 cf_fix_cppflags=no
8795 cf_new_cflags=
8796 cf_new_cppflags=
8797 cf_new_extra_cppflags=
8798
8799 for cf_add_cflags in $cf_add_cflags
8800 do
8801 case "$cf_fix_cppflags" in
8802 (no)
8803         case "$cf_add_cflags" in
8804         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8805                 case "$cf_add_cflags" in
8806                 (-D*)
8807                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8808
8809                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8810                                 && test -z "${cf_tst_cflags}" \
8811                                 && cf_fix_cppflags=yes
8812
8813                         if test "$cf_fix_cppflags" = yes ; then
8814
8815         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8816         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8817
8818                                 continue
8819                         elif test "${cf_tst_cflags}" = "\"'" ; then
8820
8821         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8822         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8823
8824                                 continue
8825                         fi
8826                         ;;
8827                 esac
8828                 case "$CPPFLAGS" in
8829                 (*$cf_add_cflags)
8830                         ;;
8831                 (*)
8832                         case "$cf_add_cflags" in
8833                         (-D*)
8834                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8835
8836 CPPFLAGS=`echo "$CPPFLAGS" | \
8837         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8838                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8839
8840                                 ;;
8841                         esac
8842
8843         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8844         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8845
8846                         ;;
8847                 esac
8848                 ;;
8849         (*)
8850
8851         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8852         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8853
8854                 ;;
8855         esac
8856         ;;
8857 (yes)
8858
8859         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8860         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8861
8862         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8863
8864         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8865                 && test -z "${cf_tst_cflags}" \
8866                 && cf_fix_cppflags=no
8867         ;;
8868 esac
8869 done
8870
8871 if test -n "$cf_new_cflags" ; then
8872
8873         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8874         CFLAGS="${CFLAGS}$cf_new_cflags"
8875
8876 fi
8877
8878 if test -n "$cf_new_cppflags" ; then
8879
8880         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8881         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8882
8883 fi
8884
8885 if test -n "$cf_new_extra_cppflags" ; then
8886
8887         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8888         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8889
8890 fi
8891
8892 done
8893
8894 cf_add_libs="$LIBS"
8895 # reverse order
8896 cf_add_0lib=
8897 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8898 # filter duplicates
8899 for cf_add_1lib in $cf_add_0lib; do
8900         for cf_add_2lib in $cf_add_libs; do
8901                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8902                         cf_add_1lib=
8903                         break
8904                 fi
8905         done
8906         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8907 done
8908 LIBS="$cf_add_libs"
8909
8910                 # even with config script, some packages use no-override for curses.h
8911
8912 echo "$as_me:8912: checking if we have identified curses headers" >&5
8913 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8914 if test "${cf_cv_ncurses_header+set}" = set; then
8915   echo $ECHO_N "(cached) $ECHO_C" >&6
8916 else
8917
8918 cf_cv_ncurses_header=none
8919 for cf_header in \
8920         ncurses.h $cf_cv_screen/ncurses.h \
8921         curses.h $cf_cv_screen/curses.h
8922 do
8923 cat >"conftest.$ac_ext" <<_ACEOF
8924 #line 8924 "configure"
8925 #include "confdefs.h"
8926 #include <${cf_header}>
8927 int
8928 main (void)
8929 {
8930 initscr(); tgoto("?", 0,0)
8931   ;
8932   return 0;
8933 }
8934 _ACEOF
8935 rm -f "conftest.$ac_objext"
8936 if { (eval echo "$as_me:8936: \"$ac_compile\"") >&5
8937   (eval $ac_compile) 2>&5
8938   ac_status=$?
8939   echo "$as_me:8939: \$? = $ac_status" >&5
8940   (exit "$ac_status"); } &&
8941          { ac_try='test -s "conftest.$ac_objext"'
8942   { (eval echo "$as_me:8942: \"$ac_try\"") >&5
8943   (eval $ac_try) 2>&5
8944   ac_status=$?
8945   echo "$as_me:8945: \$? = $ac_status" >&5
8946   (exit "$ac_status"); }; }; then
8947   cf_cv_ncurses_header=$cf_header; break
8948 else
8949   echo "$as_me: failed program was:" >&5
8950 cat "conftest.$ac_ext" >&5
8951 fi
8952 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8953 done
8954
8955 fi
8956 echo "$as_me:8956: result: $cf_cv_ncurses_header" >&5
8957 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8958
8959 if test "$cf_cv_ncurses_header" = none ; then
8960         { { echo "$as_me:8960: error: No curses header-files found" >&5
8961 echo "$as_me: error: No curses header-files found" >&2;}
8962    { (exit 1); exit 1; }; }
8963 fi
8964
8965 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8966
8967 for ac_header in $cf_cv_ncurses_header
8968 do
8969 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8970 echo "$as_me:8970: checking for $ac_header" >&5
8971 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8972 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8973   echo $ECHO_N "(cached) $ECHO_C" >&6
8974 else
8975   cat >"conftest.$ac_ext" <<_ACEOF
8976 #line 8976 "configure"
8977 #include "confdefs.h"
8978 #include <$ac_header>
8979 _ACEOF
8980 if { (eval echo "$as_me:8980: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8981   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8982   ac_status=$?
8983   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8984   rm -f conftest.er1
8985   cat conftest.err >&5
8986   echo "$as_me:8986: \$? = $ac_status" >&5
8987   (exit "$ac_status"); } >/dev/null; then
8988   if test -s conftest.err; then
8989     ac_cpp_err=$ac_c_preproc_warn_flag
8990   else
8991     ac_cpp_err=
8992   fi
8993 else
8994   ac_cpp_err=yes
8995 fi
8996 if test -z "$ac_cpp_err"; then
8997   eval "$as_ac_Header=yes"
8998 else
8999   echo "$as_me: failed program was:" >&5
9000   cat "conftest.$ac_ext" >&5
9001   eval "$as_ac_Header=no"
9002 fi
9003 rm -f conftest.err "conftest.$ac_ext"
9004 fi
9005 echo "$as_me:9005: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9006 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9007 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9008   cat >>confdefs.h <<EOF
9009 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9010 EOF
9011
9012 fi
9013 done
9014
9015 cat >>confdefs.h <<\EOF
9016 #define NCURSES 1
9017 EOF
9018
9019 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9020
9021                 cat >>confdefs.h <<EOF
9022 #define $cf_nculib_ROOT 1
9023 EOF
9024
9025                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9026
9027         else
9028
9029 cf_ncuhdr_root=$cf_cv_screen
9030
9031 test -n "$cf_cv_curses_dir" && \
9032 test "$cf_cv_curses_dir" != "no" && { \
9033
9034 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9035   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9036   do
9037         while test "$cf_add_incdir" != /usr/include
9038         do
9039           if test -d "$cf_add_incdir"
9040           then
9041                 cf_have_incdir=no
9042                 if test -n "$CFLAGS$CPPFLAGS" ; then
9043                   # a loop is needed to ensure we can add subdirs of existing dirs
9044                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9045                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9046                           cf_have_incdir=yes; break
9047                         fi
9048                   done
9049                 fi
9050
9051                 if test "$cf_have_incdir" = no ; then
9052                   if test "$cf_add_incdir" = /usr/local/include ; then
9053                         if test "$GCC" = yes
9054                         then
9055                           cf_save_CPPFLAGS=$CPPFLAGS
9056
9057         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9058         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9059
9060                           cat >"conftest.$ac_ext" <<_ACEOF
9061 #line 9061 "configure"
9062 #include "confdefs.h"
9063 #include <stdio.h>
9064 int
9065 main (void)
9066 {
9067 printf("Hello")
9068   ;
9069   return 0;
9070 }
9071 _ACEOF
9072 rm -f "conftest.$ac_objext"
9073 if { (eval echo "$as_me:9073: \"$ac_compile\"") >&5
9074   (eval $ac_compile) 2>&5
9075   ac_status=$?
9076   echo "$as_me:9076: \$? = $ac_status" >&5
9077   (exit "$ac_status"); } &&
9078          { ac_try='test -s "conftest.$ac_objext"'
9079   { (eval echo "$as_me:9079: \"$ac_try\"") >&5
9080   (eval $ac_try) 2>&5
9081   ac_status=$?
9082   echo "$as_me:9082: \$? = $ac_status" >&5
9083   (exit "$ac_status"); }; }; then
9084   :
9085 else
9086   echo "$as_me: failed program was:" >&5
9087 cat "conftest.$ac_ext" >&5
9088 cf_have_incdir=yes
9089 fi
9090 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9091                           CPPFLAGS=$cf_save_CPPFLAGS
9092                         fi
9093                   fi
9094                 fi
9095
9096                 if test "$cf_have_incdir" = no ; then
9097                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9098
9099 echo "${as_me:-configure}:9099: testing adding $cf_add_incdir to include-path ..." 1>&5
9100
9101                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9102
9103                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9104                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9105                   cf_add_incdir="$cf_top_incdir"
9106                 else
9107                   break
9108                 fi
9109           else
9110                 break
9111           fi
9112         done
9113   done
9114 fi
9115
9116 }
9117
9118 echo "$as_me:9118: checking for $cf_ncuhdr_root header in include-path" >&5
9119 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9120 if test "${cf_cv_ncurses_h+set}" = set; then
9121   echo $ECHO_N "(cached) $ECHO_C" >&6
9122 else
9123
9124         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9125         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9126         for cf_header in $cf_header_list
9127         do
9128
9129         cat >"conftest.$ac_ext" <<_ACEOF
9130 #line 9130 "configure"
9131 #include "confdefs.h"
9132
9133 #include <$cf_header>
9134 int
9135 main (void)
9136 {
9137
9138 #ifdef NCURSES_VERSION
9139
9140 printf("%s\\n", NCURSES_VERSION);
9141 #else
9142 #ifdef __NCURSES_H
9143 printf("old\\n");
9144 #else
9145         make an error
9146 #endif
9147 #endif
9148
9149   ;
9150   return 0;
9151 }
9152 _ACEOF
9153 rm -f "conftest.$ac_objext"
9154 if { (eval echo "$as_me:9154: \"$ac_compile\"") >&5
9155   (eval $ac_compile) 2>&5
9156   ac_status=$?
9157   echo "$as_me:9157: \$? = $ac_status" >&5
9158   (exit "$ac_status"); } &&
9159          { ac_try='test -s "conftest.$ac_objext"'
9160   { (eval echo "$as_me:9160: \"$ac_try\"") >&5
9161   (eval $ac_try) 2>&5
9162   ac_status=$?
9163   echo "$as_me:9163: \$? = $ac_status" >&5
9164   (exit "$ac_status"); }; }; then
9165   cf_cv_ncurses_h=$cf_header
9166
9167 else
9168   echo "$as_me: failed program was:" >&5
9169 cat "conftest.$ac_ext" >&5
9170 cf_cv_ncurses_h=no
9171 fi
9172 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9173
9174                 test "$cf_cv_ncurses_h" != no && break
9175         done
9176
9177 fi
9178 echo "$as_me:9178: result: $cf_cv_ncurses_h" >&5
9179 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9180
9181 if test "$cf_cv_ncurses_h" != no ; then
9182         cf_cv_ncurses_header=$cf_cv_ncurses_h
9183 else
9184
9185 echo "$as_me:9185: checking for $cf_ncuhdr_root include-path" >&5
9186 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9187 if test "${cf_cv_ncurses_h2+set}" = set; then
9188   echo $ECHO_N "(cached) $ECHO_C" >&6
9189 else
9190
9191         test -n "$verbose" && echo
9192
9193 cf_search=
9194
9195 # collect the current set of include-directories from compiler flags
9196 cf_header_path_list=""
9197 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9198         for cf_header_path in $CPPFLAGS $CFLAGS
9199         do
9200                 case "$cf_header_path" in
9201                 (-I*)
9202                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9203
9204 test "x$cf_header_path" != "xNONE" && \
9205 test -d "$cf_header_path" && \
9206  {
9207         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9208         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
9209         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9210         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9211         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9212         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"
9213 }
9214
9215                         cf_header_path_list="$cf_header_path_list $cf_search"
9216                         ;;
9217                 esac
9218         done
9219 fi
9220
9221 # add the variations for the package we are looking for
9222
9223 cf_search=
9224
9225 test "x$prefix" != "xNONE" && \
9226 test -d "$prefix" && \
9227  {
9228         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9229         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
9230         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9231         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9232         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9233         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9234 }
9235
9236 for cf_subdir_prefix in \
9237         /usr \
9238         /usr/local \
9239         /usr/pkg \
9240         /opt \
9241         /opt/local \
9242         $HOME
9243 do
9244
9245 test "x$cf_subdir_prefix" != "x$prefix" && \
9246 test -d "$cf_subdir_prefix" && \
9247 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9248         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9249         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
9250         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9251         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9252         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9253         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"
9254 }
9255
9256 done
9257
9258 test "$includedir" != NONE && \
9259 test "$includedir" != "/usr/include" && \
9260 test -d "$includedir" && {
9261         test -d "$includedir" &&    cf_search="$cf_search $includedir"
9262         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9263 }
9264
9265 test "$oldincludedir" != NONE && \
9266 test "$oldincludedir" != "/usr/include" && \
9267 test -d "$oldincludedir" && {
9268         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
9269         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9270 }
9271
9272 cf_search="$cf_search $cf_header_path_list"
9273
9274         test -n "$verbose" && echo "search path $cf_search"
9275         cf_save2_CPPFLAGS="$CPPFLAGS"
9276         for cf_incdir in $cf_search
9277         do
9278
9279 if test -n "$cf_incdir" ; then
9280   for cf_add_incdir in $cf_incdir
9281   do
9282         while test "$cf_add_incdir" != /usr/include
9283         do
9284           if test -d "$cf_add_incdir"
9285           then
9286                 cf_have_incdir=no
9287                 if test -n "$CFLAGS$CPPFLAGS" ; then
9288                   # a loop is needed to ensure we can add subdirs of existing dirs
9289                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9290                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9291                           cf_have_incdir=yes; break
9292                         fi
9293                   done
9294                 fi
9295
9296                 if test "$cf_have_incdir" = no ; then
9297                   if test "$cf_add_incdir" = /usr/local/include ; then
9298                         if test "$GCC" = yes
9299                         then
9300                           cf_save_CPPFLAGS=$CPPFLAGS
9301
9302         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9303         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9304
9305                           cat >"conftest.$ac_ext" <<_ACEOF
9306 #line 9306 "configure"
9307 #include "confdefs.h"
9308 #include <stdio.h>
9309 int
9310 main (void)
9311 {
9312 printf("Hello")
9313   ;
9314   return 0;
9315 }
9316 _ACEOF
9317 rm -f "conftest.$ac_objext"
9318 if { (eval echo "$as_me:9318: \"$ac_compile\"") >&5
9319   (eval $ac_compile) 2>&5
9320   ac_status=$?
9321   echo "$as_me:9321: \$? = $ac_status" >&5
9322   (exit "$ac_status"); } &&
9323          { ac_try='test -s "conftest.$ac_objext"'
9324   { (eval echo "$as_me:9324: \"$ac_try\"") >&5
9325   (eval $ac_try) 2>&5
9326   ac_status=$?
9327   echo "$as_me:9327: \$? = $ac_status" >&5
9328   (exit "$ac_status"); }; }; then
9329   :
9330 else
9331   echo "$as_me: failed program was:" >&5
9332 cat "conftest.$ac_ext" >&5
9333 cf_have_incdir=yes
9334 fi
9335 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9336                           CPPFLAGS=$cf_save_CPPFLAGS
9337                         fi
9338                   fi
9339                 fi
9340
9341                 if test "$cf_have_incdir" = no ; then
9342                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9343
9344 echo "${as_me:-configure}:9344: testing adding $cf_add_incdir to include-path ..." 1>&5
9345
9346                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9347
9348                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9349                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9350                   cf_add_incdir="$cf_top_incdir"
9351                 else
9352                   break
9353                 fi
9354           else
9355                 break
9356           fi
9357         done
9358   done
9359 fi
9360
9361                 for cf_header in \
9362                         ncurses.h \
9363                         curses.h
9364                 do
9365
9366         cat >"conftest.$ac_ext" <<_ACEOF
9367 #line 9367 "configure"
9368 #include "confdefs.h"
9369
9370 #include <$cf_header>
9371 int
9372 main (void)
9373 {
9374
9375 #ifdef NCURSES_VERSION
9376
9377 printf("%s\\n", NCURSES_VERSION);
9378 #else
9379 #ifdef __NCURSES_H
9380 printf("old\\n");
9381 #else
9382         make an error
9383 #endif
9384 #endif
9385
9386   ;
9387   return 0;
9388 }
9389 _ACEOF
9390 rm -f "conftest.$ac_objext"
9391 if { (eval echo "$as_me:9391: \"$ac_compile\"") >&5
9392   (eval $ac_compile) 2>&5
9393   ac_status=$?
9394   echo "$as_me:9394: \$? = $ac_status" >&5
9395   (exit "$ac_status"); } &&
9396          { ac_try='test -s "conftest.$ac_objext"'
9397   { (eval echo "$as_me:9397: \"$ac_try\"") >&5
9398   (eval $ac_try) 2>&5
9399   ac_status=$?
9400   echo "$as_me:9400: \$? = $ac_status" >&5
9401   (exit "$ac_status"); }; }; then
9402   cf_cv_ncurses_h2=$cf_header
9403
9404 else
9405   echo "$as_me: failed program was:" >&5
9406 cat "conftest.$ac_ext" >&5
9407 cf_cv_ncurses_h2=no
9408 fi
9409 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9410
9411                         if test "$cf_cv_ncurses_h2" != no ; then
9412                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9413                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9414                                 break
9415                         fi
9416                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9417                 done
9418                 CPPFLAGS="$cf_save2_CPPFLAGS"
9419                 test "$cf_cv_ncurses_h2" != no && break
9420         done
9421         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9421: error: not found" >&5
9422 echo "$as_me: error: not found" >&2;}
9423    { (exit 1); exit 1; }; }
9424
9425 fi
9426 echo "$as_me:9426: result: $cf_cv_ncurses_h2" >&5
9427 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9428
9429         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9430         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9431         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9432                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9433         fi
9434
9435 if test -n "$cf_1st_incdir" ; then
9436   for cf_add_incdir in $cf_1st_incdir
9437   do
9438         while test "$cf_add_incdir" != /usr/include
9439         do
9440           if test -d "$cf_add_incdir"
9441           then
9442                 cf_have_incdir=no
9443                 if test -n "$CFLAGS$CPPFLAGS" ; then
9444                   # a loop is needed to ensure we can add subdirs of existing dirs
9445                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9446                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9447                           cf_have_incdir=yes; break
9448                         fi
9449                   done
9450                 fi
9451
9452                 if test "$cf_have_incdir" = no ; then
9453                   if test "$cf_add_incdir" = /usr/local/include ; then
9454                         if test "$GCC" = yes
9455                         then
9456                           cf_save_CPPFLAGS=$CPPFLAGS
9457
9458         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9459         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9460
9461                           cat >"conftest.$ac_ext" <<_ACEOF
9462 #line 9462 "configure"
9463 #include "confdefs.h"
9464 #include <stdio.h>
9465 int
9466 main (void)
9467 {
9468 printf("Hello")
9469   ;
9470   return 0;
9471 }
9472 _ACEOF
9473 rm -f "conftest.$ac_objext"
9474 if { (eval echo "$as_me:9474: \"$ac_compile\"") >&5
9475   (eval $ac_compile) 2>&5
9476   ac_status=$?
9477   echo "$as_me:9477: \$? = $ac_status" >&5
9478   (exit "$ac_status"); } &&
9479          { ac_try='test -s "conftest.$ac_objext"'
9480   { (eval echo "$as_me:9480: \"$ac_try\"") >&5
9481   (eval $ac_try) 2>&5
9482   ac_status=$?
9483   echo "$as_me:9483: \$? = $ac_status" >&5
9484   (exit "$ac_status"); }; }; then
9485   :
9486 else
9487   echo "$as_me: failed program was:" >&5
9488 cat "conftest.$ac_ext" >&5
9489 cf_have_incdir=yes
9490 fi
9491 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9492                           CPPFLAGS=$cf_save_CPPFLAGS
9493                         fi
9494                   fi
9495                 fi
9496
9497                 if test "$cf_have_incdir" = no ; then
9498                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9499
9500 echo "${as_me:-configure}:9500: testing adding $cf_add_incdir to include-path ..." 1>&5
9501
9502                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9503
9504                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9505                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9506                   cf_add_incdir="$cf_top_incdir"
9507                 else
9508                   break
9509                 fi
9510           else
9511                 break
9512           fi
9513         done
9514   done
9515 fi
9516
9517 fi
9518
9519 # Set definitions to allow ifdef'ing for ncurses.h
9520
9521 case "$cf_cv_ncurses_header" in
9522 (*ncurses.h)
9523
9524 cat >>confdefs.h <<\EOF
9525 #define HAVE_NCURSES_H 1
9526 EOF
9527
9528         ;;
9529 esac
9530
9531 case "$cf_cv_ncurses_header" in
9532 (ncurses/curses.h|ncurses/ncurses.h)
9533
9534 cat >>confdefs.h <<\EOF
9535 #define HAVE_NCURSES_NCURSES_H 1
9536 EOF
9537
9538         ;;
9539 (ncursesw/curses.h|ncursesw/ncurses.h)
9540
9541 cat >>confdefs.h <<\EOF
9542 #define HAVE_NCURSESW_NCURSES_H 1
9543 EOF
9544
9545         ;;
9546 esac
9547
9548 echo "$as_me:9548: checking for terminfo header" >&5
9549 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9550 if test "${cf_cv_term_header+set}" = set; then
9551   echo $ECHO_N "(cached) $ECHO_C" >&6
9552 else
9553
9554 case "${cf_cv_ncurses_header}" in
9555 (*/ncurses.h|*/ncursesw.h)
9556         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9557         ;;
9558 (*)
9559         cf_term_header=term.h
9560         ;;
9561 esac
9562
9563 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9564 do
9565 cat >"conftest.$ac_ext" <<_ACEOF
9566 #line 9566 "configure"
9567 #include "confdefs.h"
9568 #include <stdio.h>
9569 #include <${cf_cv_ncurses_header:-curses.h}>
9570 #include <$cf_test>
9571
9572 int
9573 main (void)
9574 {
9575 int x = auto_left_margin; (void)x
9576   ;
9577   return 0;
9578 }
9579 _ACEOF
9580 rm -f "conftest.$ac_objext"
9581 if { (eval echo "$as_me:9581: \"$ac_compile\"") >&5
9582   (eval $ac_compile) 2>&5
9583   ac_status=$?
9584   echo "$as_me:9584: \$? = $ac_status" >&5
9585   (exit "$ac_status"); } &&
9586          { ac_try='test -s "conftest.$ac_objext"'
9587   { (eval echo "$as_me:9587: \"$ac_try\"") >&5
9588   (eval $ac_try) 2>&5
9589   ac_status=$?
9590   echo "$as_me:9590: \$? = $ac_status" >&5
9591   (exit "$ac_status"); }; }; then
9592
9593         cf_cv_term_header="$cf_test"
9594 else
9595   echo "$as_me: failed program was:" >&5
9596 cat "conftest.$ac_ext" >&5
9597
9598         cf_cv_term_header=unknown
9599
9600 fi
9601 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9602         test "$cf_cv_term_header" != unknown && break
9603 done
9604
9605 fi
9606 echo "$as_me:9606: result: $cf_cv_term_header" >&5
9607 echo "${ECHO_T}$cf_cv_term_header" >&6
9608
9609 # Set definitions to allow ifdef'ing to accommodate subdirectories
9610
9611 case "$cf_cv_term_header" in
9612 (*term.h)
9613
9614 cat >>confdefs.h <<\EOF
9615 #define HAVE_TERM_H 1
9616 EOF
9617
9618         ;;
9619 esac
9620
9621 case "$cf_cv_term_header" in
9622 (ncurses/term.h)
9623
9624 cat >>confdefs.h <<\EOF
9625 #define HAVE_NCURSES_TERM_H 1
9626 EOF
9627
9628         ;;
9629 (ncursesw/term.h)
9630
9631 cat >>confdefs.h <<\EOF
9632 #define HAVE_NCURSESW_TERM_H 1
9633 EOF
9634
9635         ;;
9636 esac
9637
9638 # some applications need this, but should check for NCURSES_VERSION
9639
9640 cat >>confdefs.h <<\EOF
9641 #define NCURSES 1
9642 EOF
9643
9644 echo "$as_me:9644: checking for ncurses version" >&5
9645 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9646 if test "${cf_cv_ncurses_version+set}" = set; then
9647   echo $ECHO_N "(cached) $ECHO_C" >&6
9648 else
9649
9650         cf_cv_ncurses_version=no
9651         cf_tempfile=out$$
9652         rm -f "$cf_tempfile"
9653         if test "$cross_compiling" = yes; then
9654
9655         # This will not work if the preprocessor splits the line after the
9656         # Autoconf token.  The 'unproto' program does that.
9657         cat > "conftest.$ac_ext" <<EOF
9658 #include <${cf_cv_ncurses_header:-curses.h}>
9659 #undef Autoconf
9660 #ifdef NCURSES_VERSION
9661 Autoconf NCURSES_VERSION
9662 #else
9663 #ifdef __NCURSES_H
9664 Autoconf "old"
9665 #endif
9666 ;
9667 #endif
9668 EOF
9669         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9670         { (eval echo "$as_me:9670: \"$cf_try\"") >&5
9671   (eval $cf_try) 2>&5
9672   ac_status=$?
9673   echo "$as_me:9673: \$? = $ac_status" >&5
9674   (exit "$ac_status"); }
9675         if test -f conftest.out ; then
9676                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9677                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9678                 rm -f conftest.out
9679         fi
9680
9681 else
9682   cat >"conftest.$ac_ext" <<_ACEOF
9683 #line 9683 "configure"
9684 #include "confdefs.h"
9685
9686 #include <${cf_cv_ncurses_header:-curses.h}>
9687 #include <stdio.h>
9688 int main(void)
9689 {
9690         FILE *fp = fopen("$cf_tempfile", "w");
9691 #ifdef NCURSES_VERSION
9692 # ifdef NCURSES_VERSION_PATCH
9693         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9694 # else
9695         fprintf(fp, "%s\\n", NCURSES_VERSION);
9696 # endif
9697 #else
9698 # ifdef __NCURSES_H
9699         fprintf(fp, "old\\n");
9700 # else
9701         make an error
9702 # endif
9703 #endif
9704         ${cf_cv_main_return:-return}(0);
9705 }
9706 _ACEOF
9707 rm -f "conftest$ac_exeext"
9708 if { (eval echo "$as_me:9708: \"$ac_link\"") >&5
9709   (eval $ac_link) 2>&5
9710   ac_status=$?
9711   echo "$as_me:9711: \$? = $ac_status" >&5
9712   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9713   { (eval echo "$as_me:9713: \"$ac_try\"") >&5
9714   (eval $ac_try) 2>&5
9715   ac_status=$?
9716   echo "$as_me:9716: \$? = $ac_status" >&5
9717   (exit "$ac_status"); }; }; then
9718
9719         cf_cv_ncurses_version=`cat $cf_tempfile`
9720 else
9721   echo "$as_me: program exited with status $ac_status" >&5
9722 echo "$as_me: failed program was:" >&5
9723 cat "conftest.$ac_ext" >&5
9724 fi
9725 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9726 fi
9727         rm -f "$cf_tempfile"
9728
9729 fi
9730 echo "$as_me:9730: result: $cf_cv_ncurses_version" >&5
9731 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9732 test "$cf_cv_ncurses_version" = no ||
9733 cat >>confdefs.h <<\EOF
9734 #define NCURSES 1
9735 EOF
9736
9737 cf_nculib_root=$cf_cv_screen
9738         # This works, except for the special case where we find gpm, but
9739         # ncurses is in a nonstandard location via $LIBS, and we really want
9740         # to link gpm.
9741 cf_ncurses_LIBS=""
9742 cf_ncurses_SAVE="$LIBS"
9743 echo "$as_me:9743: checking for Gpm_Open in -lgpm" >&5
9744 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9745 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9746   echo $ECHO_N "(cached) $ECHO_C" >&6
9747 else
9748   ac_check_lib_save_LIBS=$LIBS
9749 LIBS="-lgpm  $LIBS"
9750 cat >"conftest.$ac_ext" <<_ACEOF
9751 #line 9751 "configure"
9752 #include "confdefs.h"
9753
9754 /* Override any gcc2 internal prototype to avoid an error.  */
9755 #ifdef __cplusplus
9756 extern "C"
9757 #endif
9758 /* We use char because int might match the return type of a gcc2
9759    builtin and then its argument prototype would still apply.  */
9760 char Gpm_Open ();
9761 int
9762 main (void)
9763 {
9764 Gpm_Open ();
9765   ;
9766   return 0;
9767 }
9768 _ACEOF
9769 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9770 if { (eval echo "$as_me:9770: \"$ac_link\"") >&5
9771   (eval $ac_link) 2>&5
9772   ac_status=$?
9773   echo "$as_me:9773: \$? = $ac_status" >&5
9774   (exit "$ac_status"); } &&
9775          { ac_try='test -s "conftest$ac_exeext"'
9776   { (eval echo "$as_me:9776: \"$ac_try\"") >&5
9777   (eval $ac_try) 2>&5
9778   ac_status=$?
9779   echo "$as_me:9779: \$? = $ac_status" >&5
9780   (exit "$ac_status"); }; }; then
9781   ac_cv_lib_gpm_Gpm_Open=yes
9782 else
9783   echo "$as_me: failed program was:" >&5
9784 cat "conftest.$ac_ext" >&5
9785 ac_cv_lib_gpm_Gpm_Open=no
9786 fi
9787 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9788 LIBS=$ac_check_lib_save_LIBS
9789 fi
9790 echo "$as_me:9790: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9791 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9792 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9793   echo "$as_me:9793: checking for initscr in -lgpm" >&5
9794 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9795 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9796   echo $ECHO_N "(cached) $ECHO_C" >&6
9797 else
9798   ac_check_lib_save_LIBS=$LIBS
9799 LIBS="-lgpm  $LIBS"
9800 cat >"conftest.$ac_ext" <<_ACEOF
9801 #line 9801 "configure"
9802 #include "confdefs.h"
9803
9804 /* Override any gcc2 internal prototype to avoid an error.  */
9805 #ifdef __cplusplus
9806 extern "C"
9807 #endif
9808 /* We use char because int might match the return type of a gcc2
9809    builtin and then its argument prototype would still apply.  */
9810 char initscr ();
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   ac_cv_lib_gpm_initscr=yes
9832 else
9833   echo "$as_me: failed program was:" >&5
9834 cat "conftest.$ac_ext" >&5
9835 ac_cv_lib_gpm_initscr=no
9836 fi
9837 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9838 LIBS=$ac_check_lib_save_LIBS
9839 fi
9840 echo "$as_me:9840: result: $ac_cv_lib_gpm_initscr" >&5
9841 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9842 if test "$ac_cv_lib_gpm_initscr" = yes; then
9843   LIBS="$cf_ncurses_SAVE"
9844 else
9845   cf_ncurses_LIBS="-lgpm"
9846 fi
9847
9848 fi
9849
9850 case "$host_os" in
9851 (freebsd*)
9852         # This is only necessary if you are linking against an obsolete
9853         # version of ncurses (but it should do no harm, since it is static).
9854         if test "$cf_nculib_root" = ncurses ; then
9855                 echo "$as_me:9855: checking for tgoto in -lmytinfo" >&5
9856 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9857 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9858   echo $ECHO_N "(cached) $ECHO_C" >&6
9859 else
9860   ac_check_lib_save_LIBS=$LIBS
9861 LIBS="-lmytinfo  $LIBS"
9862 cat >"conftest.$ac_ext" <<_ACEOF
9863 #line 9863 "configure"
9864 #include "confdefs.h"
9865
9866 /* Override any gcc2 internal prototype to avoid an error.  */
9867 #ifdef __cplusplus
9868 extern "C"
9869 #endif
9870 /* We use char because int might match the return type of a gcc2
9871    builtin and then its argument prototype would still apply.  */
9872 char tgoto ();
9873 int
9874 main (void)
9875 {
9876 tgoto ();
9877   ;
9878   return 0;
9879 }
9880 _ACEOF
9881 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9882 if { (eval echo "$as_me:9882: \"$ac_link\"") >&5
9883   (eval $ac_link) 2>&5
9884   ac_status=$?
9885   echo "$as_me:9885: \$? = $ac_status" >&5
9886   (exit "$ac_status"); } &&
9887          { ac_try='test -s "conftest$ac_exeext"'
9888   { (eval echo "$as_me:9888: \"$ac_try\"") >&5
9889   (eval $ac_try) 2>&5
9890   ac_status=$?
9891   echo "$as_me:9891: \$? = $ac_status" >&5
9892   (exit "$ac_status"); }; }; then
9893   ac_cv_lib_mytinfo_tgoto=yes
9894 else
9895   echo "$as_me: failed program was:" >&5
9896 cat "conftest.$ac_ext" >&5
9897 ac_cv_lib_mytinfo_tgoto=no
9898 fi
9899 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9900 LIBS=$ac_check_lib_save_LIBS
9901 fi
9902 echo "$as_me:9902: result: $ac_cv_lib_mytinfo_tgoto" >&5
9903 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9904 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9905   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9906 fi
9907
9908         fi
9909         ;;
9910 esac
9911
9912 cf_add_libs="$LIBS"
9913 # reverse order
9914 cf_add_0lib=
9915 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9916 # filter duplicates
9917 for cf_add_1lib in $cf_add_0lib; do
9918         for cf_add_2lib in $cf_add_libs; do
9919                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9920                         cf_add_1lib=
9921                         break
9922                 fi
9923         done
9924         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9925 done
9926 LIBS="$cf_add_libs"
9927
9928 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9929 then
9930
9931 cf_add_libs="$LIBS"
9932 # reverse order
9933 cf_add_0lib=
9934 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9935 # filter duplicates
9936 for cf_add_1lib in $cf_add_0lib; do
9937         for cf_add_2lib in $cf_add_libs; do
9938                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9939                         cf_add_1lib=
9940                         break
9941                 fi
9942         done
9943         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9944 done
9945 LIBS="$cf_add_libs"
9946
9947 else
9948
9949         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9950         cf_libdir=""
9951         echo "$as_me:9951: checking for initscr" >&5
9952 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9953 if test "${ac_cv_func_initscr+set}" = set; then
9954   echo $ECHO_N "(cached) $ECHO_C" >&6
9955 else
9956   cat >"conftest.$ac_ext" <<_ACEOF
9957 #line 9957 "configure"
9958 #include "confdefs.h"
9959 #define initscr autoconf_temporary
9960 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9961 #undef initscr
9962
9963 #ifdef __cplusplus
9964 extern "C"
9965 #endif
9966
9967 /* We use char because int might match the return type of a gcc2
9968    builtin and then its argument prototype would still apply.  */
9969 char initscr (void);
9970
9971 int
9972 main (void)
9973 {
9974
9975 /* The GNU C library defines stubs for functions which it implements
9976     to always fail with ENOSYS.  Some functions are actually named
9977     something starting with __ and the normal name is an alias.  */
9978 #if defined (__stub_initscr) || defined (__stub___initscr)
9979 #error found stub for initscr
9980 #endif
9981
9982         return initscr ();
9983   ;
9984   return 0;
9985 }
9986 _ACEOF
9987 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9988 if { (eval echo "$as_me:9988: \"$ac_link\"") >&5
9989   (eval $ac_link) 2>&5
9990   ac_status=$?
9991   echo "$as_me:9991: \$? = $ac_status" >&5
9992   (exit "$ac_status"); } &&
9993          { ac_try='test -s "conftest$ac_exeext"'
9994   { (eval echo "$as_me:9994: \"$ac_try\"") >&5
9995   (eval $ac_try) 2>&5
9996   ac_status=$?
9997   echo "$as_me:9997: \$? = $ac_status" >&5
9998   (exit "$ac_status"); }; }; then
9999   ac_cv_func_initscr=yes
10000 else
10001   echo "$as_me: failed program was:" >&5
10002 cat "conftest.$ac_ext" >&5
10003 ac_cv_func_initscr=no
10004 fi
10005 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10006 fi
10007 echo "$as_me:10007: result: $ac_cv_func_initscr" >&5
10008 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10009 if test "$ac_cv_func_initscr" = yes; then
10010   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10011 else
10012
10013                 cf_save_LIBS="$LIBS"
10014                 echo "$as_me:10014: checking for initscr in -l$cf_nculib_root" >&5
10015 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10016                 LIBS="-l$cf_nculib_root $LIBS"
10017                 cat >"conftest.$ac_ext" <<_ACEOF
10018 #line 10018 "configure"
10019 #include "confdefs.h"
10020 #include <${cf_cv_ncurses_header:-curses.h}>
10021 int
10022 main (void)
10023 {
10024 initscr()
10025   ;
10026   return 0;
10027 }
10028 _ACEOF
10029 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10030 if { (eval echo "$as_me:10030: \"$ac_link\"") >&5
10031   (eval $ac_link) 2>&5
10032   ac_status=$?
10033   echo "$as_me:10033: \$? = $ac_status" >&5
10034   (exit "$ac_status"); } &&
10035          { ac_try='test -s "conftest$ac_exeext"'
10036   { (eval echo "$as_me:10036: \"$ac_try\"") >&5
10037   (eval $ac_try) 2>&5
10038   ac_status=$?
10039   echo "$as_me:10039: \$? = $ac_status" >&5
10040   (exit "$ac_status"); }; }; then
10041   echo "$as_me:10041: result: yes" >&5
10042 echo "${ECHO_T}yes" >&6
10043                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10044
10045 else
10046   echo "$as_me: failed program was:" >&5
10047 cat "conftest.$ac_ext" >&5
10048 echo "$as_me:10048: result: no" >&5
10049 echo "${ECHO_T}no" >&6
10050
10051 cf_search=
10052 cf_library_path_list=""
10053 if test -n "${LDFLAGS}${LIBS}" ; then
10054         for cf_library_path in $LDFLAGS $LIBS
10055         do
10056                 case "$cf_library_path" in
10057                 (-L*)
10058                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10059
10060 test "x$cf_library_path" != "xNONE" && \
10061 test -d "$cf_library_path" && \
10062  {
10063         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10064         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10065         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10066         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10067         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10068         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"
10069 }
10070
10071                         cf_library_path_list="$cf_library_path_list $cf_search"
10072                         ;;
10073                 esac
10074         done
10075 fi
10076
10077 cf_search=
10078
10079 test "x$prefix" != "xNONE" && \
10080 test -d "$prefix" && \
10081  {
10082         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10083         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10084         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10085         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10086         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10087         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10088 }
10089
10090 for cf_subdir_prefix in \
10091         /usr \
10092         /usr/local \
10093         /usr/pkg \
10094         /opt \
10095         /opt/local \
10096         $HOME
10097 do
10098
10099 test "x$cf_subdir_prefix" != "x$prefix" && \
10100 test -d "$cf_subdir_prefix" && \
10101 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10102         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10103         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10104         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10105         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10106         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10107         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"
10108 }
10109
10110 done
10111
10112 cf_search="$cf_library_path_list $cf_search"
10113
10114                         for cf_libdir in $cf_search
10115                         do
10116                                 echo "$as_me:10116: checking for -l$cf_nculib_root in $cf_libdir" >&5
10117 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10118                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10119                                 cat >"conftest.$ac_ext" <<_ACEOF
10120 #line 10120 "configure"
10121 #include "confdefs.h"
10122 #include <${cf_cv_ncurses_header:-curses.h}>
10123 int
10124 main (void)
10125 {
10126 initscr()
10127   ;
10128   return 0;
10129 }
10130 _ACEOF
10131 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10132 if { (eval echo "$as_me:10132: \"$ac_link\"") >&5
10133   (eval $ac_link) 2>&5
10134   ac_status=$?
10135   echo "$as_me:10135: \$? = $ac_status" >&5
10136   (exit "$ac_status"); } &&
10137          { ac_try='test -s "conftest$ac_exeext"'
10138   { (eval echo "$as_me:10138: \"$ac_try\"") >&5
10139   (eval $ac_try) 2>&5
10140   ac_status=$?
10141   echo "$as_me:10141: \$? = $ac_status" >&5
10142   (exit "$ac_status"); }; }; then
10143   echo "$as_me:10143: result: yes" >&5
10144 echo "${ECHO_T}yes" >&6
10145                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10146                                          break
10147 else
10148   echo "$as_me: failed program was:" >&5
10149 cat "conftest.$ac_ext" >&5
10150 echo "$as_me:10150: result: no" >&5
10151 echo "${ECHO_T}no" >&6
10152                                          LIBS="$cf_save_LIBS"
10153 fi
10154 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10155                         done
10156
10157 fi
10158 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10159
10160 fi
10161
10162 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10163
10164 if test "$cf_found_library" = no ; then
10165         { { echo "$as_me:10165: error: Cannot link $cf_nculib_root library" >&5
10166 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10167    { (exit 1); exit 1; }; }
10168 fi
10169
10170 fi
10171
10172 if test -n "$cf_ncurses_LIBS" ; then
10173         echo "$as_me:10173: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10174 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10175         cf_ncurses_SAVE="$LIBS"
10176         for p in $cf_ncurses_LIBS ; do
10177                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
10178                 if test "$q" != "$LIBS" ; then
10179                         LIBS="$q"
10180                 fi
10181         done
10182         cat >"conftest.$ac_ext" <<_ACEOF
10183 #line 10183 "configure"
10184 #include "confdefs.h"
10185 #include <${cf_cv_ncurses_header:-curses.h}>
10186 int
10187 main (void)
10188 {
10189 initscr(); mousemask(0,0); tigetstr((char *)0);
10190   ;
10191   return 0;
10192 }
10193 _ACEOF
10194 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10195 if { (eval echo "$as_me:10195: \"$ac_link\"") >&5
10196   (eval $ac_link) 2>&5
10197   ac_status=$?
10198   echo "$as_me:10198: \$? = $ac_status" >&5
10199   (exit "$ac_status"); } &&
10200          { ac_try='test -s "conftest$ac_exeext"'
10201   { (eval echo "$as_me:10201: \"$ac_try\"") >&5
10202   (eval $ac_try) 2>&5
10203   ac_status=$?
10204   echo "$as_me:10204: \$? = $ac_status" >&5
10205   (exit "$ac_status"); }; }; then
10206   echo "$as_me:10206: result: yes" >&5
10207 echo "${ECHO_T}yes" >&6
10208 else
10209   echo "$as_me: failed program was:" >&5
10210 cat "conftest.$ac_ext" >&5
10211 echo "$as_me:10211: result: no" >&5
10212 echo "${ECHO_T}no" >&6
10213                  LIBS="$cf_ncurses_SAVE"
10214 fi
10215 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10216 fi
10217
10218 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10219
10220 cat >>confdefs.h <<EOF
10221 #define $cf_nculib_ROOT 1
10222 EOF
10223
10224         fi
10225 else
10226         NCURSES_CONFIG=none
10227 fi
10228
10229         ;;
10230 (ncurses*)
10231
10232 cf_ncuconfig_root=$cf_cv_screen
10233 cf_have_ncuconfig=no
10234
10235 if test "x${PKG_CONFIG:=none}" != xnone; then
10236         echo "$as_me:10236: checking pkg-config for $cf_ncuconfig_root" >&5
10237 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10238         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
10239                 echo "$as_me:10239: result: yes" >&5
10240 echo "${ECHO_T}yes" >&6
10241
10242                 echo "$as_me:10242: checking if the $cf_ncuconfig_root package files work" >&5
10243 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10244                 cf_have_ncuconfig=unknown
10245
10246                 cf_save_CFLAGS="$CFLAGS"
10247                 cf_save_CPPFLAGS="$CPPFLAGS"
10248                 cf_save_LIBS="$LIBS"
10249
10250                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10251                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
10252
10253                 # while -W for passing linker flags is prevalent, it is not "standard".
10254                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10255                 # incompatible _and_ non-standard -W option which gives an error.  Work
10256                 # around that pitfall.
10257                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10258                 (x*c[89]9@@*-W*)
10259
10260 cf_fix_cppflags=no
10261 cf_new_cflags=
10262 cf_new_cppflags=
10263 cf_new_extra_cppflags=
10264
10265 for cf_add_cflags in $cf_pkg_cflags
10266 do
10267 case "$cf_fix_cppflags" in
10268 (no)
10269         case "$cf_add_cflags" in
10270         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10271                 case "$cf_add_cflags" in
10272                 (-D*)
10273                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10274
10275                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10276                                 && test -z "${cf_tst_cflags}" \
10277                                 && cf_fix_cppflags=yes
10278
10279                         if test "$cf_fix_cppflags" = yes ; then
10280
10281         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10282         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10283
10284                                 continue
10285                         elif test "${cf_tst_cflags}" = "\"'" ; then
10286
10287         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10288         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10289
10290                                 continue
10291                         fi
10292                         ;;
10293                 esac
10294                 case "$CPPFLAGS" in
10295                 (*$cf_add_cflags)
10296                         ;;
10297                 (*)
10298                         case "$cf_add_cflags" in
10299                         (-D*)
10300                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10301
10302 CPPFLAGS=`echo "$CPPFLAGS" | \
10303         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10304                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10305
10306                                 ;;
10307                         esac
10308
10309         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10310         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10311
10312                         ;;
10313                 esac
10314                 ;;
10315         (*)
10316
10317         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10318         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10319
10320                 ;;
10321         esac
10322         ;;
10323 (yes)
10324
10325         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10326         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10327
10328         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10329
10330         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10331                 && test -z "${cf_tst_cflags}" \
10332                 && cf_fix_cppflags=no
10333         ;;
10334 esac
10335 done
10336
10337 if test -n "$cf_new_cflags" ; then
10338
10339         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10340         CFLAGS="${CFLAGS}$cf_new_cflags"
10341
10342 fi
10343
10344 if test -n "$cf_new_cppflags" ; then
10345
10346         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10347         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10348
10349 fi
10350
10351 if test -n "$cf_new_extra_cppflags" ; then
10352
10353         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10354         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10355
10356 fi
10357
10358 cf_add_libs="$LIBS"
10359 # reverse order
10360 cf_add_0lib=
10361 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10362 # filter duplicates
10363 for cf_add_1lib in $cf_add_0lib; do
10364         for cf_add_2lib in $cf_add_libs; do
10365                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10366                         cf_add_1lib=
10367                         break
10368                 fi
10369         done
10370         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10371 done
10372 LIBS="$cf_add_libs"
10373
10374                         cat >"conftest.$ac_ext" <<_ACEOF
10375 #line 10375 "configure"
10376 #include "confdefs.h"
10377 #include <${cf_cv_ncurses_header:-curses.h}>
10378 int
10379 main (void)
10380 {
10381 initscr(); mousemask(0,0); tigetstr((char *)0);
10382   ;
10383   return 0;
10384 }
10385 _ACEOF
10386 rm -f "conftest.$ac_objext" "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"); } &&
10392          { ac_try='test -s "conftest$ac_exeext"'
10393   { (eval echo "$as_me:10393: \"$ac_try\"") >&5
10394   (eval $ac_try) 2>&5
10395   ac_status=$?
10396   echo "$as_me:10396: \$? = $ac_status" >&5
10397   (exit "$ac_status"); }; }; then
10398   if test "$cross_compiling" = yes; then
10399   cf_test_ncuconfig=maybe
10400 else
10401   cat >"conftest.$ac_ext" <<_ACEOF
10402 #line 10402 "configure"
10403 #include "confdefs.h"
10404 #include <${cf_cv_ncurses_header:-curses.h}>
10405                                         int main(void)
10406                                         { const char *xx = curses_version(); return (xx == 0); }
10407 _ACEOF
10408 rm -f "conftest$ac_exeext"
10409 if { (eval echo "$as_me:10409: \"$ac_link\"") >&5
10410   (eval $ac_link) 2>&5
10411   ac_status=$?
10412   echo "$as_me:10412: \$? = $ac_status" >&5
10413   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10414   { (eval echo "$as_me:10414: \"$ac_try\"") >&5
10415   (eval $ac_try) 2>&5
10416   ac_status=$?
10417   echo "$as_me:10417: \$? = $ac_status" >&5
10418   (exit "$ac_status"); }; }; then
10419   cf_test_ncuconfig=yes
10420 else
10421   echo "$as_me: program exited with status $ac_status" >&5
10422 echo "$as_me: failed program was:" >&5
10423 cat "conftest.$ac_ext" >&5
10424 cf_test_ncuconfig=no
10425 fi
10426 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10427 fi
10428 else
10429   echo "$as_me: failed program was:" >&5
10430 cat "conftest.$ac_ext" >&5
10431 cf_test_ncuconfig=no
10432 fi
10433 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10434
10435                         CFLAGS="$cf_save_CFLAGS"
10436                         CPPFLAGS="$cf_save_CPPFLAGS"
10437                         LIBS="$cf_save_LIBS"
10438
10439                         if test "x$cf_test_ncuconfig" != xyes; then
10440                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10441                                 cf_pkg_cflags="$cf_temp"
10442                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10443                                 cf_pkg_libs="$cf_temp"
10444                         fi
10445                         ;;
10446                 esac
10447
10448 for cf_add_cflags in $cf_pkg_cflags
10449 do
10450         case "x$cf_add_cflags" in
10451         (x-[DU]*)
10452
10453 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10454 while true
10455 do
10456         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10457         test "$CFLAGS" != "$cf_old_cflag" || break
10458
10459         CFLAGS="$cf_old_cflag"
10460 done
10461
10462 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10463 while true
10464 do
10465         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10466         test "$CPPFLAGS" != "$cf_old_cflag" || break
10467
10468         CPPFLAGS="$cf_old_cflag"
10469 done
10470
10471                 ;;
10472         esac
10473
10474 cf_fix_cppflags=no
10475 cf_new_cflags=
10476 cf_new_cppflags=
10477 cf_new_extra_cppflags=
10478
10479 for cf_add_cflags in $cf_add_cflags
10480 do
10481 case "$cf_fix_cppflags" in
10482 (no)
10483         case "$cf_add_cflags" in
10484         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10485                 case "$cf_add_cflags" in
10486                 (-D*)
10487                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10488
10489                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10490                                 && test -z "${cf_tst_cflags}" \
10491                                 && cf_fix_cppflags=yes
10492
10493                         if test "$cf_fix_cppflags" = yes ; then
10494
10495         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10496         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10497
10498                                 continue
10499                         elif test "${cf_tst_cflags}" = "\"'" ; then
10500
10501         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10502         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10503
10504                                 continue
10505                         fi
10506                         ;;
10507                 esac
10508                 case "$CPPFLAGS" in
10509                 (*$cf_add_cflags)
10510                         ;;
10511                 (*)
10512                         case "$cf_add_cflags" in
10513                         (-D*)
10514                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10515
10516 CPPFLAGS=`echo "$CPPFLAGS" | \
10517         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10518                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10519
10520                                 ;;
10521                         esac
10522
10523         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10524         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10525
10526                         ;;
10527                 esac
10528                 ;;
10529         (*)
10530
10531         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10532         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10533
10534                 ;;
10535         esac
10536         ;;
10537 (yes)
10538
10539         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10540         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10541
10542         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10543
10544         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10545                 && test -z "${cf_tst_cflags}" \
10546                 && cf_fix_cppflags=no
10547         ;;
10548 esac
10549 done
10550
10551 if test -n "$cf_new_cflags" ; then
10552
10553         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10554         CFLAGS="${CFLAGS}$cf_new_cflags"
10555
10556 fi
10557
10558 if test -n "$cf_new_cppflags" ; then
10559
10560         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10561         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10562
10563 fi
10564
10565 if test -n "$cf_new_extra_cppflags" ; then
10566
10567         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10568         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10569
10570 fi
10571
10572 done
10573
10574 cf_add_libs="$LIBS"
10575 # reverse order
10576 cf_add_0lib=
10577 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10578 # filter duplicates
10579 for cf_add_1lib in $cf_add_0lib; do
10580         for cf_add_2lib in $cf_add_libs; do
10581                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10582                         cf_add_1lib=
10583                         break
10584                 fi
10585         done
10586         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10587 done
10588 LIBS="$cf_add_libs"
10589
10590                 cat >"conftest.$ac_ext" <<_ACEOF
10591 #line 10591 "configure"
10592 #include "confdefs.h"
10593 #include <${cf_cv_ncurses_header:-curses.h}>
10594 int
10595 main (void)
10596 {
10597 initscr(); mousemask(0,0); tigetstr((char *)0);
10598   ;
10599   return 0;
10600 }
10601 _ACEOF
10602 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10603 if { (eval echo "$as_me:10603: \"$ac_link\"") >&5
10604   (eval $ac_link) 2>&5
10605   ac_status=$?
10606   echo "$as_me:10606: \$? = $ac_status" >&5
10607   (exit "$ac_status"); } &&
10608          { ac_try='test -s "conftest$ac_exeext"'
10609   { (eval echo "$as_me:10609: \"$ac_try\"") >&5
10610   (eval $ac_try) 2>&5
10611   ac_status=$?
10612   echo "$as_me:10612: \$? = $ac_status" >&5
10613   (exit "$ac_status"); }; }; then
10614   if test "$cross_compiling" = yes; then
10615   cf_have_ncuconfig=maybe
10616 else
10617   cat >"conftest.$ac_ext" <<_ACEOF
10618 #line 10618 "configure"
10619 #include "confdefs.h"
10620 #include <${cf_cv_ncurses_header:-curses.h}>
10621                                 int main(void)
10622                                 { const char *xx = curses_version(); return (xx == 0); }
10623 _ACEOF
10624 rm -f "conftest$ac_exeext"
10625 if { (eval echo "$as_me:10625: \"$ac_link\"") >&5
10626   (eval $ac_link) 2>&5
10627   ac_status=$?
10628   echo "$as_me:10628: \$? = $ac_status" >&5
10629   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10630   { (eval echo "$as_me:10630: \"$ac_try\"") >&5
10631   (eval $ac_try) 2>&5
10632   ac_status=$?
10633   echo "$as_me:10633: \$? = $ac_status" >&5
10634   (exit "$ac_status"); }; }; then
10635   cf_have_ncuconfig=yes
10636 else
10637   echo "$as_me: program exited with status $ac_status" >&5
10638 echo "$as_me: failed program was:" >&5
10639 cat "conftest.$ac_ext" >&5
10640 cf_have_ncuconfig=no
10641 fi
10642 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10643 fi
10644 else
10645   echo "$as_me: failed program was:" >&5
10646 cat "conftest.$ac_ext" >&5
10647 cf_have_ncuconfig=no
10648 fi
10649 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10650                 echo "$as_me:10650: result: $cf_have_ncuconfig" >&5
10651 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10652                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10653                 if test "$cf_have_ncuconfig" != "yes"
10654                 then
10655                         CPPFLAGS="$cf_save_CPPFLAGS"
10656                         LIBS="$cf_save_LIBS"
10657                         NCURSES_CONFIG_PKG=none
10658                 else
10659
10660 cat >>confdefs.h <<\EOF
10661 #define NCURSES 1
10662 EOF
10663
10664                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10665
10666 echo "$as_me:10666: checking for terminfo header" >&5
10667 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10668 if test "${cf_cv_term_header+set}" = set; then
10669   echo $ECHO_N "(cached) $ECHO_C" >&6
10670 else
10671
10672 case "${cf_cv_ncurses_header}" in
10673 (*/ncurses.h|*/ncursesw.h)
10674         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10675         ;;
10676 (*)
10677         cf_term_header=term.h
10678         ;;
10679 esac
10680
10681 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10682 do
10683 cat >"conftest.$ac_ext" <<_ACEOF
10684 #line 10684 "configure"
10685 #include "confdefs.h"
10686 #include <stdio.h>
10687 #include <${cf_cv_ncurses_header:-curses.h}>
10688 #include <$cf_test>
10689
10690 int
10691 main (void)
10692 {
10693 int x = auto_left_margin; (void)x
10694   ;
10695   return 0;
10696 }
10697 _ACEOF
10698 rm -f "conftest.$ac_objext"
10699 if { (eval echo "$as_me:10699: \"$ac_compile\"") >&5
10700   (eval $ac_compile) 2>&5
10701   ac_status=$?
10702   echo "$as_me:10702: \$? = $ac_status" >&5
10703   (exit "$ac_status"); } &&
10704          { ac_try='test -s "conftest.$ac_objext"'
10705   { (eval echo "$as_me:10705: \"$ac_try\"") >&5
10706   (eval $ac_try) 2>&5
10707   ac_status=$?
10708   echo "$as_me:10708: \$? = $ac_status" >&5
10709   (exit "$ac_status"); }; }; then
10710
10711         cf_cv_term_header="$cf_test"
10712 else
10713   echo "$as_me: failed program was:" >&5
10714 cat "conftest.$ac_ext" >&5
10715
10716         cf_cv_term_header=unknown
10717
10718 fi
10719 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10720         test "$cf_cv_term_header" != unknown && break
10721 done
10722
10723 fi
10724 echo "$as_me:10724: result: $cf_cv_term_header" >&5
10725 echo "${ECHO_T}$cf_cv_term_header" >&6
10726
10727 # Set definitions to allow ifdef'ing to accommodate subdirectories
10728
10729 case "$cf_cv_term_header" in
10730 (*term.h)
10731
10732 cat >>confdefs.h <<\EOF
10733 #define HAVE_TERM_H 1
10734 EOF
10735
10736         ;;
10737 esac
10738
10739 case "$cf_cv_term_header" in
10740 (ncurses/term.h)
10741
10742 cat >>confdefs.h <<\EOF
10743 #define HAVE_NCURSES_TERM_H 1
10744 EOF
10745
10746         ;;
10747 (ncursesw/term.h)
10748
10749 cat >>confdefs.h <<\EOF
10750 #define HAVE_NCURSESW_TERM_H 1
10751 EOF
10752
10753         ;;
10754 esac
10755
10756                 fi
10757
10758         else
10759                 echo "$as_me:10759: result: no" >&5
10760 echo "${ECHO_T}no" >&6
10761                 NCURSES_CONFIG_PKG=none
10762         fi
10763 else
10764         NCURSES_CONFIG_PKG=none
10765 fi
10766
10767 if test "x$cf_have_ncuconfig" = "xno"; then
10768         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10769
10770 if test -n "$ac_tool_prefix"; then
10771   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10772   do
10773     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10774 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10775 echo "$as_me:10775: checking for $ac_word" >&5
10776 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10777 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10778   echo $ECHO_N "(cached) $ECHO_C" >&6
10779 else
10780   if test -n "$NCURSES_CONFIG"; then
10781   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10782 else
10783   ac_save_IFS=$IFS; IFS=$ac_path_separator
10784 ac_dummy="$PATH"
10785 for ac_dir in $ac_dummy; do
10786   IFS=$ac_save_IFS
10787   test -z "$ac_dir" && ac_dir=.
10788   $as_executable_p "$ac_dir/$ac_word" || continue
10789 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10790 echo "$as_me:10790: found $ac_dir/$ac_word" >&5
10791 break
10792 done
10793
10794 fi
10795 fi
10796 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10797 if test -n "$NCURSES_CONFIG"; then
10798   echo "$as_me:10798: result: $NCURSES_CONFIG" >&5
10799 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10800 else
10801   echo "$as_me:10801: result: no" >&5
10802 echo "${ECHO_T}no" >&6
10803 fi
10804
10805     test -n "$NCURSES_CONFIG" && break
10806   done
10807 fi
10808 if test -z "$NCURSES_CONFIG"; then
10809   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10810   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10811 do
10812   # Extract the first word of "$ac_prog", so it can be a program name with args.
10813 set dummy $ac_prog; ac_word=$2
10814 echo "$as_me:10814: checking for $ac_word" >&5
10815 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10816 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10817   echo $ECHO_N "(cached) $ECHO_C" >&6
10818 else
10819   if test -n "$ac_ct_NCURSES_CONFIG"; then
10820   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10821 else
10822   ac_save_IFS=$IFS; IFS=$ac_path_separator
10823 ac_dummy="$PATH"
10824 for ac_dir in $ac_dummy; do
10825   IFS=$ac_save_IFS
10826   test -z "$ac_dir" && ac_dir=.
10827   $as_executable_p "$ac_dir/$ac_word" || continue
10828 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10829 echo "$as_me:10829: found $ac_dir/$ac_word" >&5
10830 break
10831 done
10832
10833 fi
10834 fi
10835 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10836 if test -n "$ac_ct_NCURSES_CONFIG"; then
10837   echo "$as_me:10837: result: $ac_ct_NCURSES_CONFIG" >&5
10838 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10839 else
10840   echo "$as_me:10840: result: no" >&5
10841 echo "${ECHO_T}no" >&6
10842 fi
10843
10844   test -n "$ac_ct_NCURSES_CONFIG" && break
10845 done
10846 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10847
10848   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10849 fi
10850
10851         if test "$NCURSES_CONFIG" != none ; then
10852
10853 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10854 do
10855         case "x$cf_add_cflags" in
10856         (x-[DU]*)
10857
10858 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10859 while true
10860 do
10861         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10862         test "$CFLAGS" != "$cf_old_cflag" || break
10863
10864         CFLAGS="$cf_old_cflag"
10865 done
10866
10867 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10868 while true
10869 do
10870         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10871         test "$CPPFLAGS" != "$cf_old_cflag" || break
10872
10873         CPPFLAGS="$cf_old_cflag"
10874 done
10875
10876                 ;;
10877         esac
10878
10879 cf_fix_cppflags=no
10880 cf_new_cflags=
10881 cf_new_cppflags=
10882 cf_new_extra_cppflags=
10883
10884 for cf_add_cflags in $cf_add_cflags
10885 do
10886 case "$cf_fix_cppflags" in
10887 (no)
10888         case "$cf_add_cflags" in
10889         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10890                 case "$cf_add_cflags" in
10891                 (-D*)
10892                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10893
10894                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10895                                 && test -z "${cf_tst_cflags}" \
10896                                 && cf_fix_cppflags=yes
10897
10898                         if test "$cf_fix_cppflags" = yes ; then
10899
10900         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10901         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10902
10903                                 continue
10904                         elif test "${cf_tst_cflags}" = "\"'" ; then
10905
10906         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10907         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10908
10909                                 continue
10910                         fi
10911                         ;;
10912                 esac
10913                 case "$CPPFLAGS" in
10914                 (*$cf_add_cflags)
10915                         ;;
10916                 (*)
10917                         case "$cf_add_cflags" in
10918                         (-D*)
10919                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10920
10921 CPPFLAGS=`echo "$CPPFLAGS" | \
10922         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10923                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10924
10925                                 ;;
10926                         esac
10927
10928         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10929         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10930
10931                         ;;
10932                 esac
10933                 ;;
10934         (*)
10935
10936         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10937         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10938
10939                 ;;
10940         esac
10941         ;;
10942 (yes)
10943
10944         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10945         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10946
10947         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10948
10949         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10950                 && test -z "${cf_tst_cflags}" \
10951                 && cf_fix_cppflags=no
10952         ;;
10953 esac
10954 done
10955
10956 if test -n "$cf_new_cflags" ; then
10957
10958         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10959         CFLAGS="${CFLAGS}$cf_new_cflags"
10960
10961 fi
10962
10963 if test -n "$cf_new_cppflags" ; then
10964
10965         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10966         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10967
10968 fi
10969
10970 if test -n "$cf_new_extra_cppflags" ; then
10971
10972         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10973         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10974
10975 fi
10976
10977 done
10978
10979 cf_add_libs="$LIBS"
10980 # reverse order
10981 cf_add_0lib=
10982 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10983 # filter duplicates
10984 for cf_add_1lib in $cf_add_0lib; do
10985         for cf_add_2lib in $cf_add_libs; do
10986                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10987                         cf_add_1lib=
10988                         break
10989                 fi
10990         done
10991         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10992 done
10993 LIBS="$cf_add_libs"
10994
10995                 # even with config script, some packages use no-override for curses.h
10996
10997 echo "$as_me:10997: checking if we have identified curses headers" >&5
10998 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10999 if test "${cf_cv_ncurses_header+set}" = set; then
11000   echo $ECHO_N "(cached) $ECHO_C" >&6
11001 else
11002
11003 cf_cv_ncurses_header=none
11004 for cf_header in \
11005         ncurses.h $cf_cv_screen/ncurses.h \
11006         curses.h $cf_cv_screen/curses.h
11007 do
11008 cat >"conftest.$ac_ext" <<_ACEOF
11009 #line 11009 "configure"
11010 #include "confdefs.h"
11011 #include <${cf_header}>
11012 int
11013 main (void)
11014 {
11015 initscr(); tgoto("?", 0,0)
11016   ;
11017   return 0;
11018 }
11019 _ACEOF
11020 rm -f "conftest.$ac_objext"
11021 if { (eval echo "$as_me:11021: \"$ac_compile\"") >&5
11022   (eval $ac_compile) 2>&5
11023   ac_status=$?
11024   echo "$as_me:11024: \$? = $ac_status" >&5
11025   (exit "$ac_status"); } &&
11026          { ac_try='test -s "conftest.$ac_objext"'
11027   { (eval echo "$as_me:11027: \"$ac_try\"") >&5
11028   (eval $ac_try) 2>&5
11029   ac_status=$?
11030   echo "$as_me:11030: \$? = $ac_status" >&5
11031   (exit "$ac_status"); }; }; then
11032   cf_cv_ncurses_header=$cf_header; break
11033 else
11034   echo "$as_me: failed program was:" >&5
11035 cat "conftest.$ac_ext" >&5
11036 fi
11037 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11038 done
11039
11040 fi
11041 echo "$as_me:11041: result: $cf_cv_ncurses_header" >&5
11042 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
11043
11044 if test "$cf_cv_ncurses_header" = none ; then
11045         { { echo "$as_me:11045: error: No curses header-files found" >&5
11046 echo "$as_me: error: No curses header-files found" >&2;}
11047    { (exit 1); exit 1; }; }
11048 fi
11049
11050 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
11051
11052 for ac_header in $cf_cv_ncurses_header
11053 do
11054 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11055 echo "$as_me:11055: checking for $ac_header" >&5
11056 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11057 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11058   echo $ECHO_N "(cached) $ECHO_C" >&6
11059 else
11060   cat >"conftest.$ac_ext" <<_ACEOF
11061 #line 11061 "configure"
11062 #include "confdefs.h"
11063 #include <$ac_header>
11064 _ACEOF
11065 if { (eval echo "$as_me:11065: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11066   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
11067   ac_status=$?
11068   $EGREP -v '^ *\+' conftest.er1 >conftest.err
11069   rm -f conftest.er1
11070   cat conftest.err >&5
11071   echo "$as_me:11071: \$? = $ac_status" >&5
11072   (exit "$ac_status"); } >/dev/null; then
11073   if test -s conftest.err; then
11074     ac_cpp_err=$ac_c_preproc_warn_flag
11075   else
11076     ac_cpp_err=
11077   fi
11078 else
11079   ac_cpp_err=yes
11080 fi
11081 if test -z "$ac_cpp_err"; then
11082   eval "$as_ac_Header=yes"
11083 else
11084   echo "$as_me: failed program was:" >&5
11085   cat "conftest.$ac_ext" >&5
11086   eval "$as_ac_Header=no"
11087 fi
11088 rm -f conftest.err "conftest.$ac_ext"
11089 fi
11090 echo "$as_me:11090: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
11091 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
11092 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
11093   cat >>confdefs.h <<EOF
11094 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11095 EOF
11096
11097 fi
11098 done
11099
11100 cat >>confdefs.h <<\EOF
11101 #define NCURSES 1
11102 EOF
11103
11104 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11105
11106                 cat >>confdefs.h <<EOF
11107 #define $cf_nculib_ROOT 1
11108 EOF
11109
11110                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
11111
11112         else
11113
11114 cf_ncuhdr_root=$cf_cv_screen
11115
11116 test -n "$cf_cv_curses_dir" && \
11117 test "$cf_cv_curses_dir" != "no" && { \
11118
11119 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
11120   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
11121   do
11122         while test "$cf_add_incdir" != /usr/include
11123         do
11124           if test -d "$cf_add_incdir"
11125           then
11126                 cf_have_incdir=no
11127                 if test -n "$CFLAGS$CPPFLAGS" ; then
11128                   # a loop is needed to ensure we can add subdirs of existing dirs
11129                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11130                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11131                           cf_have_incdir=yes; break
11132                         fi
11133                   done
11134                 fi
11135
11136                 if test "$cf_have_incdir" = no ; then
11137                   if test "$cf_add_incdir" = /usr/local/include ; then
11138                         if test "$GCC" = yes
11139                         then
11140                           cf_save_CPPFLAGS=$CPPFLAGS
11141
11142         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11143         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11144
11145                           cat >"conftest.$ac_ext" <<_ACEOF
11146 #line 11146 "configure"
11147 #include "confdefs.h"
11148 #include <stdio.h>
11149 int
11150 main (void)
11151 {
11152 printf("Hello")
11153   ;
11154   return 0;
11155 }
11156 _ACEOF
11157 rm -f "conftest.$ac_objext"
11158 if { (eval echo "$as_me:11158: \"$ac_compile\"") >&5
11159   (eval $ac_compile) 2>&5
11160   ac_status=$?
11161   echo "$as_me:11161: \$? = $ac_status" >&5
11162   (exit "$ac_status"); } &&
11163          { ac_try='test -s "conftest.$ac_objext"'
11164   { (eval echo "$as_me:11164: \"$ac_try\"") >&5
11165   (eval $ac_try) 2>&5
11166   ac_status=$?
11167   echo "$as_me:11167: \$? = $ac_status" >&5
11168   (exit "$ac_status"); }; }; then
11169   :
11170 else
11171   echo "$as_me: failed program was:" >&5
11172 cat "conftest.$ac_ext" >&5
11173 cf_have_incdir=yes
11174 fi
11175 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11176                           CPPFLAGS=$cf_save_CPPFLAGS
11177                         fi
11178                   fi
11179                 fi
11180
11181                 if test "$cf_have_incdir" = no ; then
11182                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11183
11184 echo "${as_me:-configure}:11184: testing adding $cf_add_incdir to include-path ..." 1>&5
11185
11186                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11187
11188                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11189                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11190                   cf_add_incdir="$cf_top_incdir"
11191                 else
11192                   break
11193                 fi
11194           else
11195                 break
11196           fi
11197         done
11198   done
11199 fi
11200
11201 }
11202
11203 echo "$as_me:11203: checking for $cf_ncuhdr_root header in include-path" >&5
11204 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
11205 if test "${cf_cv_ncurses_h+set}" = set; then
11206   echo $ECHO_N "(cached) $ECHO_C" >&6
11207 else
11208
11209         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
11210         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
11211         for cf_header in $cf_header_list
11212         do
11213
11214         cat >"conftest.$ac_ext" <<_ACEOF
11215 #line 11215 "configure"
11216 #include "confdefs.h"
11217
11218 #include <$cf_header>
11219 int
11220 main (void)
11221 {
11222
11223 #ifdef NCURSES_VERSION
11224
11225 printf("%s\\n", NCURSES_VERSION);
11226 #else
11227 #ifdef __NCURSES_H
11228 printf("old\\n");
11229 #else
11230         make an error
11231 #endif
11232 #endif
11233
11234   ;
11235   return 0;
11236 }
11237 _ACEOF
11238 rm -f "conftest.$ac_objext"
11239 if { (eval echo "$as_me:11239: \"$ac_compile\"") >&5
11240   (eval $ac_compile) 2>&5
11241   ac_status=$?
11242   echo "$as_me:11242: \$? = $ac_status" >&5
11243   (exit "$ac_status"); } &&
11244          { ac_try='test -s "conftest.$ac_objext"'
11245   { (eval echo "$as_me:11245: \"$ac_try\"") >&5
11246   (eval $ac_try) 2>&5
11247   ac_status=$?
11248   echo "$as_me:11248: \$? = $ac_status" >&5
11249   (exit "$ac_status"); }; }; then
11250   cf_cv_ncurses_h=$cf_header
11251
11252 else
11253   echo "$as_me: failed program was:" >&5
11254 cat "conftest.$ac_ext" >&5
11255 cf_cv_ncurses_h=no
11256 fi
11257 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11258
11259                 test "$cf_cv_ncurses_h" != no && break
11260         done
11261
11262 fi
11263 echo "$as_me:11263: result: $cf_cv_ncurses_h" >&5
11264 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
11265
11266 if test "$cf_cv_ncurses_h" != no ; then
11267         cf_cv_ncurses_header=$cf_cv_ncurses_h
11268 else
11269
11270 echo "$as_me:11270: checking for $cf_ncuhdr_root include-path" >&5
11271 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11272 if test "${cf_cv_ncurses_h2+set}" = set; then
11273   echo $ECHO_N "(cached) $ECHO_C" >&6
11274 else
11275
11276         test -n "$verbose" && echo
11277
11278 cf_search=
11279
11280 # collect the current set of include-directories from compiler flags
11281 cf_header_path_list=""
11282 if test -n "${CFLAGS}${CPPFLAGS}" ; then
11283         for cf_header_path in $CPPFLAGS $CFLAGS
11284         do
11285                 case "$cf_header_path" in
11286                 (-I*)
11287                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11288
11289 test "x$cf_header_path" != "xNONE" && \
11290 test -d "$cf_header_path" && \
11291  {
11292         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
11293         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
11294         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11295         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11296         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11297         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"
11298 }
11299
11300                         cf_header_path_list="$cf_header_path_list $cf_search"
11301                         ;;
11302                 esac
11303         done
11304 fi
11305
11306 # add the variations for the package we are looking for
11307
11308 cf_search=
11309
11310 test "x$prefix" != "xNONE" && \
11311 test -d "$prefix" && \
11312  {
11313         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
11314         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
11315         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11316         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11317         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11318         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
11319 }
11320
11321 for cf_subdir_prefix in \
11322         /usr \
11323         /usr/local \
11324         /usr/pkg \
11325         /opt \
11326         /opt/local \
11327         $HOME
11328 do
11329
11330 test "x$cf_subdir_prefix" != "x$prefix" && \
11331 test -d "$cf_subdir_prefix" && \
11332 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11333         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11334         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11335         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11336         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11337         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11338         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"
11339 }
11340
11341 done
11342
11343 test "$includedir" != NONE && \
11344 test "$includedir" != "/usr/include" && \
11345 test -d "$includedir" && {
11346         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11347         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11348 }
11349
11350 test "$oldincludedir" != NONE && \
11351 test "$oldincludedir" != "/usr/include" && \
11352 test -d "$oldincludedir" && {
11353         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11354         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11355 }
11356
11357 cf_search="$cf_search $cf_header_path_list"
11358
11359         test -n "$verbose" && echo "search path $cf_search"
11360         cf_save2_CPPFLAGS="$CPPFLAGS"
11361         for cf_incdir in $cf_search
11362         do
11363
11364 if test -n "$cf_incdir" ; then
11365   for cf_add_incdir in $cf_incdir
11366   do
11367         while test "$cf_add_incdir" != /usr/include
11368         do
11369           if test -d "$cf_add_incdir"
11370           then
11371                 cf_have_incdir=no
11372                 if test -n "$CFLAGS$CPPFLAGS" ; then
11373                   # a loop is needed to ensure we can add subdirs of existing dirs
11374                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11375                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11376                           cf_have_incdir=yes; break
11377                         fi
11378                   done
11379                 fi
11380
11381                 if test "$cf_have_incdir" = no ; then
11382                   if test "$cf_add_incdir" = /usr/local/include ; then
11383                         if test "$GCC" = yes
11384                         then
11385                           cf_save_CPPFLAGS=$CPPFLAGS
11386
11387         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11388         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11389
11390                           cat >"conftest.$ac_ext" <<_ACEOF
11391 #line 11391 "configure"
11392 #include "confdefs.h"
11393 #include <stdio.h>
11394 int
11395 main (void)
11396 {
11397 printf("Hello")
11398   ;
11399   return 0;
11400 }
11401 _ACEOF
11402 rm -f "conftest.$ac_objext"
11403 if { (eval echo "$as_me:11403: \"$ac_compile\"") >&5
11404   (eval $ac_compile) 2>&5
11405   ac_status=$?
11406   echo "$as_me:11406: \$? = $ac_status" >&5
11407   (exit "$ac_status"); } &&
11408          { ac_try='test -s "conftest.$ac_objext"'
11409   { (eval echo "$as_me:11409: \"$ac_try\"") >&5
11410   (eval $ac_try) 2>&5
11411   ac_status=$?
11412   echo "$as_me:11412: \$? = $ac_status" >&5
11413   (exit "$ac_status"); }; }; then
11414   :
11415 else
11416   echo "$as_me: failed program was:" >&5
11417 cat "conftest.$ac_ext" >&5
11418 cf_have_incdir=yes
11419 fi
11420 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11421                           CPPFLAGS=$cf_save_CPPFLAGS
11422                         fi
11423                   fi
11424                 fi
11425
11426                 if test "$cf_have_incdir" = no ; then
11427                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11428
11429 echo "${as_me:-configure}:11429: testing adding $cf_add_incdir to include-path ..." 1>&5
11430
11431                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11432
11433                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11434                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11435                   cf_add_incdir="$cf_top_incdir"
11436                 else
11437                   break
11438                 fi
11439           else
11440                 break
11441           fi
11442         done
11443   done
11444 fi
11445
11446                 for cf_header in \
11447                         ncurses.h \
11448                         curses.h
11449                 do
11450
11451         cat >"conftest.$ac_ext" <<_ACEOF
11452 #line 11452 "configure"
11453 #include "confdefs.h"
11454
11455 #include <$cf_header>
11456 int
11457 main (void)
11458 {
11459
11460 #ifdef NCURSES_VERSION
11461
11462 printf("%s\\n", NCURSES_VERSION);
11463 #else
11464 #ifdef __NCURSES_H
11465 printf("old\\n");
11466 #else
11467         make an error
11468 #endif
11469 #endif
11470
11471   ;
11472   return 0;
11473 }
11474 _ACEOF
11475 rm -f "conftest.$ac_objext"
11476 if { (eval echo "$as_me:11476: \"$ac_compile\"") >&5
11477   (eval $ac_compile) 2>&5
11478   ac_status=$?
11479   echo "$as_me:11479: \$? = $ac_status" >&5
11480   (exit "$ac_status"); } &&
11481          { ac_try='test -s "conftest.$ac_objext"'
11482   { (eval echo "$as_me:11482: \"$ac_try\"") >&5
11483   (eval $ac_try) 2>&5
11484   ac_status=$?
11485   echo "$as_me:11485: \$? = $ac_status" >&5
11486   (exit "$ac_status"); }; }; then
11487   cf_cv_ncurses_h2=$cf_header
11488
11489 else
11490   echo "$as_me: failed program was:" >&5
11491 cat "conftest.$ac_ext" >&5
11492 cf_cv_ncurses_h2=no
11493 fi
11494 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11495
11496                         if test "$cf_cv_ncurses_h2" != no ; then
11497                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11498                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11499                                 break
11500                         fi
11501                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11502                 done
11503                 CPPFLAGS="$cf_save2_CPPFLAGS"
11504                 test "$cf_cv_ncurses_h2" != no && break
11505         done
11506         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11506: error: not found" >&5
11507 echo "$as_me: error: not found" >&2;}
11508    { (exit 1); exit 1; }; }
11509
11510 fi
11511 echo "$as_me:11511: result: $cf_cv_ncurses_h2" >&5
11512 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11513
11514         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11515         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11516         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11517                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11518         fi
11519
11520 if test -n "$cf_1st_incdir" ; then
11521   for cf_add_incdir in $cf_1st_incdir
11522   do
11523         while test "$cf_add_incdir" != /usr/include
11524         do
11525           if test -d "$cf_add_incdir"
11526           then
11527                 cf_have_incdir=no
11528                 if test -n "$CFLAGS$CPPFLAGS" ; then
11529                   # a loop is needed to ensure we can add subdirs of existing dirs
11530                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11531                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11532                           cf_have_incdir=yes; break
11533                         fi
11534                   done
11535                 fi
11536
11537                 if test "$cf_have_incdir" = no ; then
11538                   if test "$cf_add_incdir" = /usr/local/include ; then
11539                         if test "$GCC" = yes
11540                         then
11541                           cf_save_CPPFLAGS=$CPPFLAGS
11542
11543         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11544         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11545
11546                           cat >"conftest.$ac_ext" <<_ACEOF
11547 #line 11547 "configure"
11548 #include "confdefs.h"
11549 #include <stdio.h>
11550 int
11551 main (void)
11552 {
11553 printf("Hello")
11554   ;
11555   return 0;
11556 }
11557 _ACEOF
11558 rm -f "conftest.$ac_objext"
11559 if { (eval echo "$as_me:11559: \"$ac_compile\"") >&5
11560   (eval $ac_compile) 2>&5
11561   ac_status=$?
11562   echo "$as_me:11562: \$? = $ac_status" >&5
11563   (exit "$ac_status"); } &&
11564          { ac_try='test -s "conftest.$ac_objext"'
11565   { (eval echo "$as_me:11565: \"$ac_try\"") >&5
11566   (eval $ac_try) 2>&5
11567   ac_status=$?
11568   echo "$as_me:11568: \$? = $ac_status" >&5
11569   (exit "$ac_status"); }; }; then
11570   :
11571 else
11572   echo "$as_me: failed program was:" >&5
11573 cat "conftest.$ac_ext" >&5
11574 cf_have_incdir=yes
11575 fi
11576 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11577                           CPPFLAGS=$cf_save_CPPFLAGS
11578                         fi
11579                   fi
11580                 fi
11581
11582                 if test "$cf_have_incdir" = no ; then
11583                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11584
11585 echo "${as_me:-configure}:11585: testing adding $cf_add_incdir to include-path ..." 1>&5
11586
11587                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11588
11589                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11590                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11591                   cf_add_incdir="$cf_top_incdir"
11592                 else
11593                   break
11594                 fi
11595           else
11596                 break
11597           fi
11598         done
11599   done
11600 fi
11601
11602 fi
11603
11604 # Set definitions to allow ifdef'ing for ncurses.h
11605
11606 case "$cf_cv_ncurses_header" in
11607 (*ncurses.h)
11608
11609 cat >>confdefs.h <<\EOF
11610 #define HAVE_NCURSES_H 1
11611 EOF
11612
11613         ;;
11614 esac
11615
11616 case "$cf_cv_ncurses_header" in
11617 (ncurses/curses.h|ncurses/ncurses.h)
11618
11619 cat >>confdefs.h <<\EOF
11620 #define HAVE_NCURSES_NCURSES_H 1
11621 EOF
11622
11623         ;;
11624 (ncursesw/curses.h|ncursesw/ncurses.h)
11625
11626 cat >>confdefs.h <<\EOF
11627 #define HAVE_NCURSESW_NCURSES_H 1
11628 EOF
11629
11630         ;;
11631 esac
11632
11633 echo "$as_me:11633: checking for terminfo header" >&5
11634 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11635 if test "${cf_cv_term_header+set}" = set; then
11636   echo $ECHO_N "(cached) $ECHO_C" >&6
11637 else
11638
11639 case "${cf_cv_ncurses_header}" in
11640 (*/ncurses.h|*/ncursesw.h)
11641         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11642         ;;
11643 (*)
11644         cf_term_header=term.h
11645         ;;
11646 esac
11647
11648 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11649 do
11650 cat >"conftest.$ac_ext" <<_ACEOF
11651 #line 11651 "configure"
11652 #include "confdefs.h"
11653 #include <stdio.h>
11654 #include <${cf_cv_ncurses_header:-curses.h}>
11655 #include <$cf_test>
11656
11657 int
11658 main (void)
11659 {
11660 int x = auto_left_margin; (void)x
11661   ;
11662   return 0;
11663 }
11664 _ACEOF
11665 rm -f "conftest.$ac_objext"
11666 if { (eval echo "$as_me:11666: \"$ac_compile\"") >&5
11667   (eval $ac_compile) 2>&5
11668   ac_status=$?
11669   echo "$as_me:11669: \$? = $ac_status" >&5
11670   (exit "$ac_status"); } &&
11671          { ac_try='test -s "conftest.$ac_objext"'
11672   { (eval echo "$as_me:11672: \"$ac_try\"") >&5
11673   (eval $ac_try) 2>&5
11674   ac_status=$?
11675   echo "$as_me:11675: \$? = $ac_status" >&5
11676   (exit "$ac_status"); }; }; then
11677
11678         cf_cv_term_header="$cf_test"
11679 else
11680   echo "$as_me: failed program was:" >&5
11681 cat "conftest.$ac_ext" >&5
11682
11683         cf_cv_term_header=unknown
11684
11685 fi
11686 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11687         test "$cf_cv_term_header" != unknown && break
11688 done
11689
11690 fi
11691 echo "$as_me:11691: result: $cf_cv_term_header" >&5
11692 echo "${ECHO_T}$cf_cv_term_header" >&6
11693
11694 # Set definitions to allow ifdef'ing to accommodate subdirectories
11695
11696 case "$cf_cv_term_header" in
11697 (*term.h)
11698
11699 cat >>confdefs.h <<\EOF
11700 #define HAVE_TERM_H 1
11701 EOF
11702
11703         ;;
11704 esac
11705
11706 case "$cf_cv_term_header" in
11707 (ncurses/term.h)
11708
11709 cat >>confdefs.h <<\EOF
11710 #define HAVE_NCURSES_TERM_H 1
11711 EOF
11712
11713         ;;
11714 (ncursesw/term.h)
11715
11716 cat >>confdefs.h <<\EOF
11717 #define HAVE_NCURSESW_TERM_H 1
11718 EOF
11719
11720         ;;
11721 esac
11722
11723 # some applications need this, but should check for NCURSES_VERSION
11724
11725 cat >>confdefs.h <<\EOF
11726 #define NCURSES 1
11727 EOF
11728
11729 echo "$as_me:11729: checking for ncurses version" >&5
11730 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11731 if test "${cf_cv_ncurses_version+set}" = set; then
11732   echo $ECHO_N "(cached) $ECHO_C" >&6
11733 else
11734
11735         cf_cv_ncurses_version=no
11736         cf_tempfile=out$$
11737         rm -f "$cf_tempfile"
11738         if test "$cross_compiling" = yes; then
11739
11740         # This will not work if the preprocessor splits the line after the
11741         # Autoconf token.  The 'unproto' program does that.
11742         cat > "conftest.$ac_ext" <<EOF
11743 #include <${cf_cv_ncurses_header:-curses.h}>
11744 #undef Autoconf
11745 #ifdef NCURSES_VERSION
11746 Autoconf NCURSES_VERSION
11747 #else
11748 #ifdef __NCURSES_H
11749 Autoconf "old"
11750 #endif
11751 ;
11752 #endif
11753 EOF
11754         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11755         { (eval echo "$as_me:11755: \"$cf_try\"") >&5
11756   (eval $cf_try) 2>&5
11757   ac_status=$?
11758   echo "$as_me:11758: \$? = $ac_status" >&5
11759   (exit "$ac_status"); }
11760         if test -f conftest.out ; then
11761                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11762                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11763                 rm -f conftest.out
11764         fi
11765
11766 else
11767   cat >"conftest.$ac_ext" <<_ACEOF
11768 #line 11768 "configure"
11769 #include "confdefs.h"
11770
11771 #include <${cf_cv_ncurses_header:-curses.h}>
11772 #include <stdio.h>
11773 int main(void)
11774 {
11775         FILE *fp = fopen("$cf_tempfile", "w");
11776 #ifdef NCURSES_VERSION
11777 # ifdef NCURSES_VERSION_PATCH
11778         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11779 # else
11780         fprintf(fp, "%s\\n", NCURSES_VERSION);
11781 # endif
11782 #else
11783 # ifdef __NCURSES_H
11784         fprintf(fp, "old\\n");
11785 # else
11786         make an error
11787 # endif
11788 #endif
11789         ${cf_cv_main_return:-return}(0);
11790 }
11791 _ACEOF
11792 rm -f "conftest$ac_exeext"
11793 if { (eval echo "$as_me:11793: \"$ac_link\"") >&5
11794   (eval $ac_link) 2>&5
11795   ac_status=$?
11796   echo "$as_me:11796: \$? = $ac_status" >&5
11797   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11798   { (eval echo "$as_me:11798: \"$ac_try\"") >&5
11799   (eval $ac_try) 2>&5
11800   ac_status=$?
11801   echo "$as_me:11801: \$? = $ac_status" >&5
11802   (exit "$ac_status"); }; }; then
11803
11804         cf_cv_ncurses_version=`cat $cf_tempfile`
11805 else
11806   echo "$as_me: program exited with status $ac_status" >&5
11807 echo "$as_me: failed program was:" >&5
11808 cat "conftest.$ac_ext" >&5
11809 fi
11810 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11811 fi
11812         rm -f "$cf_tempfile"
11813
11814 fi
11815 echo "$as_me:11815: result: $cf_cv_ncurses_version" >&5
11816 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11817 test "$cf_cv_ncurses_version" = no ||
11818 cat >>confdefs.h <<\EOF
11819 #define NCURSES 1
11820 EOF
11821
11822 cf_nculib_root=$cf_cv_screen
11823         # This works, except for the special case where we find gpm, but
11824         # ncurses is in a nonstandard location via $LIBS, and we really want
11825         # to link gpm.
11826 cf_ncurses_LIBS=""
11827 cf_ncurses_SAVE="$LIBS"
11828 echo "$as_me:11828: checking for Gpm_Open in -lgpm" >&5
11829 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11830 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11831   echo $ECHO_N "(cached) $ECHO_C" >&6
11832 else
11833   ac_check_lib_save_LIBS=$LIBS
11834 LIBS="-lgpm  $LIBS"
11835 cat >"conftest.$ac_ext" <<_ACEOF
11836 #line 11836 "configure"
11837 #include "confdefs.h"
11838
11839 /* Override any gcc2 internal prototype to avoid an error.  */
11840 #ifdef __cplusplus
11841 extern "C"
11842 #endif
11843 /* We use char because int might match the return type of a gcc2
11844    builtin and then its argument prototype would still apply.  */
11845 char Gpm_Open ();
11846 int
11847 main (void)
11848 {
11849 Gpm_Open ();
11850   ;
11851   return 0;
11852 }
11853 _ACEOF
11854 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11855 if { (eval echo "$as_me:11855: \"$ac_link\"") >&5
11856   (eval $ac_link) 2>&5
11857   ac_status=$?
11858   echo "$as_me:11858: \$? = $ac_status" >&5
11859   (exit "$ac_status"); } &&
11860          { ac_try='test -s "conftest$ac_exeext"'
11861   { (eval echo "$as_me:11861: \"$ac_try\"") >&5
11862   (eval $ac_try) 2>&5
11863   ac_status=$?
11864   echo "$as_me:11864: \$? = $ac_status" >&5
11865   (exit "$ac_status"); }; }; then
11866   ac_cv_lib_gpm_Gpm_Open=yes
11867 else
11868   echo "$as_me: failed program was:" >&5
11869 cat "conftest.$ac_ext" >&5
11870 ac_cv_lib_gpm_Gpm_Open=no
11871 fi
11872 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11873 LIBS=$ac_check_lib_save_LIBS
11874 fi
11875 echo "$as_me:11875: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11876 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11877 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11878   echo "$as_me:11878: checking for initscr in -lgpm" >&5
11879 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11880 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11881   echo $ECHO_N "(cached) $ECHO_C" >&6
11882 else
11883   ac_check_lib_save_LIBS=$LIBS
11884 LIBS="-lgpm  $LIBS"
11885 cat >"conftest.$ac_ext" <<_ACEOF
11886 #line 11886 "configure"
11887 #include "confdefs.h"
11888
11889 /* Override any gcc2 internal prototype to avoid an error.  */
11890 #ifdef __cplusplus
11891 extern "C"
11892 #endif
11893 /* We use char because int might match the return type of a gcc2
11894    builtin and then its argument prototype would still apply.  */
11895 char initscr ();
11896 int
11897 main (void)
11898 {
11899 initscr ();
11900   ;
11901   return 0;
11902 }
11903 _ACEOF
11904 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11905 if { (eval echo "$as_me:11905: \"$ac_link\"") >&5
11906   (eval $ac_link) 2>&5
11907   ac_status=$?
11908   echo "$as_me:11908: \$? = $ac_status" >&5
11909   (exit "$ac_status"); } &&
11910          { ac_try='test -s "conftest$ac_exeext"'
11911   { (eval echo "$as_me:11911: \"$ac_try\"") >&5
11912   (eval $ac_try) 2>&5
11913   ac_status=$?
11914   echo "$as_me:11914: \$? = $ac_status" >&5
11915   (exit "$ac_status"); }; }; then
11916   ac_cv_lib_gpm_initscr=yes
11917 else
11918   echo "$as_me: failed program was:" >&5
11919 cat "conftest.$ac_ext" >&5
11920 ac_cv_lib_gpm_initscr=no
11921 fi
11922 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11923 LIBS=$ac_check_lib_save_LIBS
11924 fi
11925 echo "$as_me:11925: result: $ac_cv_lib_gpm_initscr" >&5
11926 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11927 if test "$ac_cv_lib_gpm_initscr" = yes; then
11928   LIBS="$cf_ncurses_SAVE"
11929 else
11930   cf_ncurses_LIBS="-lgpm"
11931 fi
11932
11933 fi
11934
11935 case "$host_os" in
11936 (freebsd*)
11937         # This is only necessary if you are linking against an obsolete
11938         # version of ncurses (but it should do no harm, since it is static).
11939         if test "$cf_nculib_root" = ncurses ; then
11940                 echo "$as_me:11940: checking for tgoto in -lmytinfo" >&5
11941 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11942 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11943   echo $ECHO_N "(cached) $ECHO_C" >&6
11944 else
11945   ac_check_lib_save_LIBS=$LIBS
11946 LIBS="-lmytinfo  $LIBS"
11947 cat >"conftest.$ac_ext" <<_ACEOF
11948 #line 11948 "configure"
11949 #include "confdefs.h"
11950
11951 /* Override any gcc2 internal prototype to avoid an error.  */
11952 #ifdef __cplusplus
11953 extern "C"
11954 #endif
11955 /* We use char because int might match the return type of a gcc2
11956    builtin and then its argument prototype would still apply.  */
11957 char tgoto ();
11958 int
11959 main (void)
11960 {
11961 tgoto ();
11962   ;
11963   return 0;
11964 }
11965 _ACEOF
11966 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11967 if { (eval echo "$as_me:11967: \"$ac_link\"") >&5
11968   (eval $ac_link) 2>&5
11969   ac_status=$?
11970   echo "$as_me:11970: \$? = $ac_status" >&5
11971   (exit "$ac_status"); } &&
11972          { ac_try='test -s "conftest$ac_exeext"'
11973   { (eval echo "$as_me:11973: \"$ac_try\"") >&5
11974   (eval $ac_try) 2>&5
11975   ac_status=$?
11976   echo "$as_me:11976: \$? = $ac_status" >&5
11977   (exit "$ac_status"); }; }; then
11978   ac_cv_lib_mytinfo_tgoto=yes
11979 else
11980   echo "$as_me: failed program was:" >&5
11981 cat "conftest.$ac_ext" >&5
11982 ac_cv_lib_mytinfo_tgoto=no
11983 fi
11984 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11985 LIBS=$ac_check_lib_save_LIBS
11986 fi
11987 echo "$as_me:11987: result: $ac_cv_lib_mytinfo_tgoto" >&5
11988 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11989 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11990   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11991 fi
11992
11993         fi
11994         ;;
11995 esac
11996
11997 cf_add_libs="$LIBS"
11998 # reverse order
11999 cf_add_0lib=
12000 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12001 # filter duplicates
12002 for cf_add_1lib in $cf_add_0lib; do
12003         for cf_add_2lib in $cf_add_libs; do
12004                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12005                         cf_add_1lib=
12006                         break
12007                 fi
12008         done
12009         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12010 done
12011 LIBS="$cf_add_libs"
12012
12013 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
12014 then
12015
12016 cf_add_libs="$LIBS"
12017 # reverse order
12018 cf_add_0lib=
12019 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12020 # filter duplicates
12021 for cf_add_1lib in $cf_add_0lib; do
12022         for cf_add_2lib in $cf_add_libs; do
12023                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12024                         cf_add_1lib=
12025                         break
12026                 fi
12027         done
12028         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12029 done
12030 LIBS="$cf_add_libs"
12031
12032 else
12033
12034         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
12035         cf_libdir=""
12036         echo "$as_me:12036: checking for initscr" >&5
12037 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
12038 if test "${ac_cv_func_initscr+set}" = set; then
12039   echo $ECHO_N "(cached) $ECHO_C" >&6
12040 else
12041   cat >"conftest.$ac_ext" <<_ACEOF
12042 #line 12042 "configure"
12043 #include "confdefs.h"
12044 #define initscr autoconf_temporary
12045 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12046 #undef initscr
12047
12048 #ifdef __cplusplus
12049 extern "C"
12050 #endif
12051
12052 /* We use char because int might match the return type of a gcc2
12053    builtin and then its argument prototype would still apply.  */
12054 char initscr (void);
12055
12056 int
12057 main (void)
12058 {
12059
12060 /* The GNU C library defines stubs for functions which it implements
12061     to always fail with ENOSYS.  Some functions are actually named
12062     something starting with __ and the normal name is an alias.  */
12063 #if defined (__stub_initscr) || defined (__stub___initscr)
12064 #error found stub for initscr
12065 #endif
12066
12067         return initscr ();
12068   ;
12069   return 0;
12070 }
12071 _ACEOF
12072 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12073 if { (eval echo "$as_me:12073: \"$ac_link\"") >&5
12074   (eval $ac_link) 2>&5
12075   ac_status=$?
12076   echo "$as_me:12076: \$? = $ac_status" >&5
12077   (exit "$ac_status"); } &&
12078          { ac_try='test -s "conftest$ac_exeext"'
12079   { (eval echo "$as_me:12079: \"$ac_try\"") >&5
12080   (eval $ac_try) 2>&5
12081   ac_status=$?
12082   echo "$as_me:12082: \$? = $ac_status" >&5
12083   (exit "$ac_status"); }; }; then
12084   ac_cv_func_initscr=yes
12085 else
12086   echo "$as_me: failed program was:" >&5
12087 cat "conftest.$ac_ext" >&5
12088 ac_cv_func_initscr=no
12089 fi
12090 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12091 fi
12092 echo "$as_me:12092: result: $ac_cv_func_initscr" >&5
12093 echo "${ECHO_T}$ac_cv_func_initscr" >&6
12094 if test "$ac_cv_func_initscr" = yes; then
12095   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12096 else
12097
12098                 cf_save_LIBS="$LIBS"
12099                 echo "$as_me:12099: checking for initscr in -l$cf_nculib_root" >&5
12100 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
12101                 LIBS="-l$cf_nculib_root $LIBS"
12102                 cat >"conftest.$ac_ext" <<_ACEOF
12103 #line 12103 "configure"
12104 #include "confdefs.h"
12105 #include <${cf_cv_ncurses_header:-curses.h}>
12106 int
12107 main (void)
12108 {
12109 initscr()
12110   ;
12111   return 0;
12112 }
12113 _ACEOF
12114 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12115 if { (eval echo "$as_me:12115: \"$ac_link\"") >&5
12116   (eval $ac_link) 2>&5
12117   ac_status=$?
12118   echo "$as_me:12118: \$? = $ac_status" >&5
12119   (exit "$ac_status"); } &&
12120          { ac_try='test -s "conftest$ac_exeext"'
12121   { (eval echo "$as_me:12121: \"$ac_try\"") >&5
12122   (eval $ac_try) 2>&5
12123   ac_status=$?
12124   echo "$as_me:12124: \$? = $ac_status" >&5
12125   (exit "$ac_status"); }; }; then
12126   echo "$as_me:12126: result: yes" >&5
12127 echo "${ECHO_T}yes" >&6
12128                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12129
12130 else
12131   echo "$as_me: failed program was:" >&5
12132 cat "conftest.$ac_ext" >&5
12133 echo "$as_me:12133: result: no" >&5
12134 echo "${ECHO_T}no" >&6
12135
12136 cf_search=
12137 cf_library_path_list=""
12138 if test -n "${LDFLAGS}${LIBS}" ; then
12139         for cf_library_path in $LDFLAGS $LIBS
12140         do
12141                 case "$cf_library_path" in
12142                 (-L*)
12143                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
12144
12145 test "x$cf_library_path" != "xNONE" && \
12146 test -d "$cf_library_path" && \
12147  {
12148         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
12149         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
12150         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
12151         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
12152         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
12153         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"
12154 }
12155
12156                         cf_library_path_list="$cf_library_path_list $cf_search"
12157                         ;;
12158                 esac
12159         done
12160 fi
12161
12162 cf_search=
12163
12164 test "x$prefix" != "xNONE" && \
12165 test -d "$prefix" && \
12166  {
12167         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
12168         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
12169         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
12170         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
12171         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
12172         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
12173 }
12174
12175 for cf_subdir_prefix in \
12176         /usr \
12177         /usr/local \
12178         /usr/pkg \
12179         /opt \
12180         /opt/local \
12181         $HOME
12182 do
12183
12184 test "x$cf_subdir_prefix" != "x$prefix" && \
12185 test -d "$cf_subdir_prefix" && \
12186 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
12187         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
12188         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
12189         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
12190         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
12191         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
12192         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"
12193 }
12194
12195 done
12196
12197 cf_search="$cf_library_path_list $cf_search"
12198
12199                         for cf_libdir in $cf_search
12200                         do
12201                                 echo "$as_me:12201: checking for -l$cf_nculib_root in $cf_libdir" >&5
12202 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
12203                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
12204                                 cat >"conftest.$ac_ext" <<_ACEOF
12205 #line 12205 "configure"
12206 #include "confdefs.h"
12207 #include <${cf_cv_ncurses_header:-curses.h}>
12208 int
12209 main (void)
12210 {
12211 initscr()
12212   ;
12213   return 0;
12214 }
12215 _ACEOF
12216 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12217 if { (eval echo "$as_me:12217: \"$ac_link\"") >&5
12218   (eval $ac_link) 2>&5
12219   ac_status=$?
12220   echo "$as_me:12220: \$? = $ac_status" >&5
12221   (exit "$ac_status"); } &&
12222          { ac_try='test -s "conftest$ac_exeext"'
12223   { (eval echo "$as_me:12223: \"$ac_try\"") >&5
12224   (eval $ac_try) 2>&5
12225   ac_status=$?
12226   echo "$as_me:12226: \$? = $ac_status" >&5
12227   (exit "$ac_status"); }; }; then
12228   echo "$as_me:12228: result: yes" >&5
12229 echo "${ECHO_T}yes" >&6
12230                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12231                                          break
12232 else
12233   echo "$as_me: failed program was:" >&5
12234 cat "conftest.$ac_ext" >&5
12235 echo "$as_me:12235: result: no" >&5
12236 echo "${ECHO_T}no" >&6
12237                                          LIBS="$cf_save_LIBS"
12238 fi
12239 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12240                         done
12241
12242 fi
12243 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12244
12245 fi
12246
12247 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
12248
12249 if test "$cf_found_library" = no ; then
12250         { { echo "$as_me:12250: error: Cannot link $cf_nculib_root library" >&5
12251 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
12252    { (exit 1); exit 1; }; }
12253 fi
12254
12255 fi
12256
12257 if test -n "$cf_ncurses_LIBS" ; then
12258         echo "$as_me:12258: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
12259 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
12260         cf_ncurses_SAVE="$LIBS"
12261         for p in $cf_ncurses_LIBS ; do
12262                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
12263                 if test "$q" != "$LIBS" ; then
12264                         LIBS="$q"
12265                 fi
12266         done
12267         cat >"conftest.$ac_ext" <<_ACEOF
12268 #line 12268 "configure"
12269 #include "confdefs.h"
12270 #include <${cf_cv_ncurses_header:-curses.h}>
12271 int
12272 main (void)
12273 {
12274 initscr(); mousemask(0,0); tigetstr((char *)0);
12275   ;
12276   return 0;
12277 }
12278 _ACEOF
12279 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12280 if { (eval echo "$as_me:12280: \"$ac_link\"") >&5
12281   (eval $ac_link) 2>&5
12282   ac_status=$?
12283   echo "$as_me:12283: \$? = $ac_status" >&5
12284   (exit "$ac_status"); } &&
12285          { ac_try='test -s "conftest$ac_exeext"'
12286   { (eval echo "$as_me:12286: \"$ac_try\"") >&5
12287   (eval $ac_try) 2>&5
12288   ac_status=$?
12289   echo "$as_me:12289: \$? = $ac_status" >&5
12290   (exit "$ac_status"); }; }; then
12291   echo "$as_me:12291: result: yes" >&5
12292 echo "${ECHO_T}yes" >&6
12293 else
12294   echo "$as_me: failed program was:" >&5
12295 cat "conftest.$ac_ext" >&5
12296 echo "$as_me:12296: result: no" >&5
12297 echo "${ECHO_T}no" >&6
12298                  LIBS="$cf_ncurses_SAVE"
12299 fi
12300 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12301 fi
12302
12303 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12304
12305 cat >>confdefs.h <<EOF
12306 #define $cf_nculib_ROOT 1
12307 EOF
12308
12309         fi
12310 else
12311         NCURSES_CONFIG=none
12312 fi
12313
12314         ;;
12315 (pdcurses)
12316         echo "$as_me:12316: checking for X" >&5
12317 echo $ECHO_N "checking for X... $ECHO_C" >&6
12318
12319 # Check whether --with-x or --without-x was given.
12320 if test "${with_x+set}" = set; then
12321   withval="$with_x"
12322
12323 fi;
12324 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12325 if test "x$with_x" = xno; then
12326   # The user explicitly disabled X.
12327   have_x=disabled
12328 else
12329   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12330     # Both variables are already set.
12331     have_x=yes
12332   else
12333     if test "${ac_cv_have_x+set}" = set; then
12334   echo $ECHO_N "(cached) $ECHO_C" >&6
12335 else
12336   # One or both of the vars are not set, and there is no cached value.
12337 ac_x_includes=no ac_x_libraries=no
12338 rm -fr conftest.dir
12339 if mkdir conftest.dir; then
12340   cd conftest.dir
12341   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12342   cat >Imakefile <<'EOF'
12343 acfindx:
12344         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12345 EOF
12346   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12347     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12348     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12349     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12350     for ac_extension in a so sl dylib dll; do
12351       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12352          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12353         ac_im_usrlibdir=$ac_im_libdir; break
12354       fi
12355     done
12356     # Screen out bogus values from the imake configuration.  They are
12357     # bogus both because they are the default anyway, and because
12358     # using them would break gcc on systems where it needs fixed includes.
12359     case $ac_im_incroot in
12360         /usr/include) ;;
12361         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12362     esac
12363     case $ac_im_usrlibdir in
12364         /usr/lib | /lib) ;;
12365         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12366     esac
12367   fi
12368   cd ..
12369   rm -fr conftest.dir
12370 fi
12371
12372 # Standard set of common directories for X headers.
12373 # Check X11 before X11Rn because it is often a symlink to the current release.
12374 ac_x_header_dirs='
12375 /usr/X11/include
12376 /usr/X11R7/include
12377 /usr/X11R6/include
12378 /usr/X11R5/include
12379 /usr/X11R4/include
12380
12381 /opt/local/include
12382 /opt/X11/include
12383
12384 /usr/include/X11
12385 /usr/include/X11R7
12386 /usr/include/X11R6
12387 /usr/include/X11R5
12388 /usr/include/X11R4
12389
12390 /usr/local/X11/include
12391 /usr/local/X11R7/include
12392 /usr/local/X11R6/include
12393 /usr/local/X11R5/include
12394 /usr/local/X11R4/include
12395
12396 /usr/local/include/X11
12397 /usr/local/include/X11R7
12398 /usr/local/include/X11R6
12399 /usr/local/include/X11R5
12400 /usr/local/include/X11R4
12401
12402 /usr/X386/include
12403 /usr/x386/include
12404 /usr/XFree86/include/X11
12405
12406 /usr/include
12407 /usr/local/include
12408 /usr/unsupported/include
12409 /usr/athena/include
12410 /usr/local/x11r5/include
12411 /usr/lpp/Xamples/include
12412
12413 /usr/openwin/include
12414 /usr/openwin/share/include'
12415
12416 if test "$ac_x_includes" = no; then
12417   # Guess where to find include files, by looking for Intrinsic.h.
12418   # First, try using that file with no special directory specified.
12419   cat >"conftest.$ac_ext" <<_ACEOF
12420 #line 12420 "configure"
12421 #include "confdefs.h"
12422 #include <X11/Intrinsic.h>
12423 _ACEOF
12424 if { (eval echo "$as_me:12424: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12425   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12426   ac_status=$?
12427   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12428   rm -f conftest.er1
12429   cat conftest.err >&5
12430   echo "$as_me:12430: \$? = $ac_status" >&5
12431   (exit "$ac_status"); } >/dev/null; then
12432   if test -s conftest.err; then
12433     ac_cpp_err=$ac_c_preproc_warn_flag
12434   else
12435     ac_cpp_err=
12436   fi
12437 else
12438   ac_cpp_err=yes
12439 fi
12440 if test -z "$ac_cpp_err"; then
12441   # We can compile using X headers with no special include directory.
12442 ac_x_includes=
12443 else
12444   echo "$as_me: failed program was:" >&5
12445   cat "conftest.$ac_ext" >&5
12446   for ac_dir in $ac_x_header_dirs; do
12447   if test -r "$ac_dir/X11/Intrinsic.h"; then
12448     ac_x_includes=$ac_dir
12449     break
12450   fi
12451 done
12452 fi
12453 rm -f conftest.err "conftest.$ac_ext"
12454 fi # $ac_x_includes = no
12455
12456 if test "$ac_x_libraries" = no; then
12457   # Check for the libraries.
12458   # See if we find them without any special options.
12459   # Don't add to $LIBS permanently.
12460   ac_save_LIBS=$LIBS
12461   LIBS="-lXt $LIBS"
12462   cat >"conftest.$ac_ext" <<_ACEOF
12463 #line 12463 "configure"
12464 #include "confdefs.h"
12465 #include <X11/Intrinsic.h>
12466 int
12467 main (void)
12468 {
12469 XtMalloc (0)
12470   ;
12471   return 0;
12472 }
12473 _ACEOF
12474 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12475 if { (eval echo "$as_me:12475: \"$ac_link\"") >&5
12476   (eval $ac_link) 2>&5
12477   ac_status=$?
12478   echo "$as_me:12478: \$? = $ac_status" >&5
12479   (exit "$ac_status"); } &&
12480          { ac_try='test -s "conftest$ac_exeext"'
12481   { (eval echo "$as_me:12481: \"$ac_try\"") >&5
12482   (eval $ac_try) 2>&5
12483   ac_status=$?
12484   echo "$as_me:12484: \$? = $ac_status" >&5
12485   (exit "$ac_status"); }; }; then
12486   LIBS=$ac_save_LIBS
12487 # We can link X programs with no special library path.
12488 ac_x_libraries=
12489 else
12490   echo "$as_me: failed program was:" >&5
12491 cat "conftest.$ac_ext" >&5
12492 LIBS=$ac_save_LIBS
12493 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12494 do
12495   # Don't even attempt the hair of trying to link an X program!
12496   for ac_extension in a so sl dylib dll; do
12497     if test -r "$ac_dir/libXt.$ac_extension"; then
12498       ac_x_libraries=$ac_dir
12499       break 2
12500     fi
12501   done
12502 done
12503 fi
12504 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12505 fi # $ac_x_libraries = no
12506
12507 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12508   # Didn't find X anywhere.  Cache the known absence of X.
12509   ac_cv_have_x="have_x=no"
12510 else
12511   # Record where we found X for the cache.
12512   ac_cv_have_x="have_x=yes \
12513                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12514 fi
12515 fi
12516
12517   fi
12518   eval "$ac_cv_have_x"
12519 fi # $with_x != no
12520
12521 if test "$have_x" != yes; then
12522   echo "$as_me:12522: result: $have_x" >&5
12523 echo "${ECHO_T}$have_x" >&6
12524   no_x=yes
12525 else
12526   # If each of the values was on the command line, it overrides each guess.
12527   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12528   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12529   # Update the cache value to reflect the command line values.
12530   ac_cv_have_x="have_x=yes \
12531                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12532   echo "$as_me:12532: result: libraries $x_libraries, headers $x_includes" >&5
12533 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12534 fi
12535
12536 if test "$no_x" = yes; then
12537   # Not all programs may use this symbol, but it does not hurt to define it.
12538
12539 cat >>confdefs.h <<\EOF
12540 #define X_DISPLAY_MISSING 1
12541 EOF
12542
12543   X_CFLAGS=
12544   X_PRE_LIBS=
12545   X_LIBS=
12546   X_EXTRA_LIBS=
12547 else
12548   if test -n "$x_includes"; then
12549     X_CFLAGS="$X_CFLAGS -I$x_includes"
12550   fi
12551
12552   # It would also be nice to do this for all -L options, not just this one.
12553   if test -n "$x_libraries"; then
12554     X_LIBS="$X_LIBS -L$x_libraries"
12555     # For Solaris; some versions of Sun CC require a space after -R and
12556     # others require no space.  Words are not sufficient . . . .
12557     case `(uname -sr) 2>/dev/null` in
12558     "SunOS 5"*)
12559       echo "$as_me:12559: checking whether -R must be followed by a space" >&5
12560 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12561       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12562       cat >"conftest.$ac_ext" <<_ACEOF
12563 #line 12563 "configure"
12564 #include "confdefs.h"
12565
12566 int
12567 main (void)
12568 {
12569
12570   ;
12571   return 0;
12572 }
12573 _ACEOF
12574 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12575 if { (eval echo "$as_me:12575: \"$ac_link\"") >&5
12576   (eval $ac_link) 2>&5
12577   ac_status=$?
12578   echo "$as_me:12578: \$? = $ac_status" >&5
12579   (exit "$ac_status"); } &&
12580          { ac_try='test -s "conftest$ac_exeext"'
12581   { (eval echo "$as_me:12581: \"$ac_try\"") >&5
12582   (eval $ac_try) 2>&5
12583   ac_status=$?
12584   echo "$as_me:12584: \$? = $ac_status" >&5
12585   (exit "$ac_status"); }; }; then
12586   ac_R_nospace=yes
12587 else
12588   echo "$as_me: failed program was:" >&5
12589 cat "conftest.$ac_ext" >&5
12590 ac_R_nospace=no
12591 fi
12592 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12593       if test $ac_R_nospace = yes; then
12594         echo "$as_me:12594: result: no" >&5
12595 echo "${ECHO_T}no" >&6
12596         X_LIBS="$X_LIBS -R$x_libraries"
12597       else
12598         LIBS="$ac_xsave_LIBS -R $x_libraries"
12599         cat >"conftest.$ac_ext" <<_ACEOF
12600 #line 12600 "configure"
12601 #include "confdefs.h"
12602
12603 int
12604 main (void)
12605 {
12606
12607   ;
12608   return 0;
12609 }
12610 _ACEOF
12611 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12612 if { (eval echo "$as_me:12612: \"$ac_link\"") >&5
12613   (eval $ac_link) 2>&5
12614   ac_status=$?
12615   echo "$as_me:12615: \$? = $ac_status" >&5
12616   (exit "$ac_status"); } &&
12617          { ac_try='test -s "conftest$ac_exeext"'
12618   { (eval echo "$as_me:12618: \"$ac_try\"") >&5
12619   (eval $ac_try) 2>&5
12620   ac_status=$?
12621   echo "$as_me:12621: \$? = $ac_status" >&5
12622   (exit "$ac_status"); }; }; then
12623   ac_R_space=yes
12624 else
12625   echo "$as_me: failed program was:" >&5
12626 cat "conftest.$ac_ext" >&5
12627 ac_R_space=no
12628 fi
12629 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12630         if test $ac_R_space = yes; then
12631           echo "$as_me:12631: result: yes" >&5
12632 echo "${ECHO_T}yes" >&6
12633           X_LIBS="$X_LIBS -R $x_libraries"
12634         else
12635           echo "$as_me:12635: result: neither works" >&5
12636 echo "${ECHO_T}neither works" >&6
12637         fi
12638       fi
12639       LIBS=$ac_xsave_LIBS
12640     esac
12641   fi
12642
12643   # Check for system-dependent libraries X programs must link with.
12644   # Do this before checking for the system-independent R6 libraries
12645   # (-lICE), since we may need -lsocket or whatever for X linking.
12646
12647   if test "$ISC" = yes; then
12648     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12649   else
12650     # Martyn Johnson says this is needed for Ultrix, if the X
12651     # libraries were built with DECnet support.  And Karl Berry says
12652     # the Alpha needs dnet_stub (dnet does not exist).
12653     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12654     cat >"conftest.$ac_ext" <<_ACEOF
12655 #line 12655 "configure"
12656 #include "confdefs.h"
12657
12658 /* Override any gcc2 internal prototype to avoid an error.  */
12659 #ifdef __cplusplus
12660 extern "C"
12661 #endif
12662 /* We use char because int might match the return type of a gcc2
12663    builtin and then its argument prototype would still apply.  */
12664 char XOpenDisplay ();
12665 int
12666 main (void)
12667 {
12668 XOpenDisplay ();
12669   ;
12670   return 0;
12671 }
12672 _ACEOF
12673 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12674 if { (eval echo "$as_me:12674: \"$ac_link\"") >&5
12675   (eval $ac_link) 2>&5
12676   ac_status=$?
12677   echo "$as_me:12677: \$? = $ac_status" >&5
12678   (exit "$ac_status"); } &&
12679          { ac_try='test -s "conftest$ac_exeext"'
12680   { (eval echo "$as_me:12680: \"$ac_try\"") >&5
12681   (eval $ac_try) 2>&5
12682   ac_status=$?
12683   echo "$as_me:12683: \$? = $ac_status" >&5
12684   (exit "$ac_status"); }; }; then
12685   :
12686 else
12687   echo "$as_me: failed program was:" >&5
12688 cat "conftest.$ac_ext" >&5
12689 echo "$as_me:12689: checking for dnet_ntoa in -ldnet" >&5
12690 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12691 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12692   echo $ECHO_N "(cached) $ECHO_C" >&6
12693 else
12694   ac_check_lib_save_LIBS=$LIBS
12695 LIBS="-ldnet  $LIBS"
12696 cat >"conftest.$ac_ext" <<_ACEOF
12697 #line 12697 "configure"
12698 #include "confdefs.h"
12699
12700 /* Override any gcc2 internal prototype to avoid an error.  */
12701 #ifdef __cplusplus
12702 extern "C"
12703 #endif
12704 /* We use char because int might match the return type of a gcc2
12705    builtin and then its argument prototype would still apply.  */
12706 char dnet_ntoa ();
12707 int
12708 main (void)
12709 {
12710 dnet_ntoa ();
12711   ;
12712   return 0;
12713 }
12714 _ACEOF
12715 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12716 if { (eval echo "$as_me:12716: \"$ac_link\"") >&5
12717   (eval $ac_link) 2>&5
12718   ac_status=$?
12719   echo "$as_me:12719: \$? = $ac_status" >&5
12720   (exit "$ac_status"); } &&
12721          { ac_try='test -s "conftest$ac_exeext"'
12722   { (eval echo "$as_me:12722: \"$ac_try\"") >&5
12723   (eval $ac_try) 2>&5
12724   ac_status=$?
12725   echo "$as_me:12725: \$? = $ac_status" >&5
12726   (exit "$ac_status"); }; }; then
12727   ac_cv_lib_dnet_dnet_ntoa=yes
12728 else
12729   echo "$as_me: failed program was:" >&5
12730 cat "conftest.$ac_ext" >&5
12731 ac_cv_lib_dnet_dnet_ntoa=no
12732 fi
12733 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12734 LIBS=$ac_check_lib_save_LIBS
12735 fi
12736 echo "$as_me:12736: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12737 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12738 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12739   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12740 fi
12741
12742     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12743       echo "$as_me:12743: checking for dnet_ntoa in -ldnet_stub" >&5
12744 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12745 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12746   echo $ECHO_N "(cached) $ECHO_C" >&6
12747 else
12748   ac_check_lib_save_LIBS=$LIBS
12749 LIBS="-ldnet_stub  $LIBS"
12750 cat >"conftest.$ac_ext" <<_ACEOF
12751 #line 12751 "configure"
12752 #include "confdefs.h"
12753
12754 /* Override any gcc2 internal prototype to avoid an error.  */
12755 #ifdef __cplusplus
12756 extern "C"
12757 #endif
12758 /* We use char because int might match the return type of a gcc2
12759    builtin and then its argument prototype would still apply.  */
12760 char dnet_ntoa ();
12761 int
12762 main (void)
12763 {
12764 dnet_ntoa ();
12765   ;
12766   return 0;
12767 }
12768 _ACEOF
12769 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12770 if { (eval echo "$as_me:12770: \"$ac_link\"") >&5
12771   (eval $ac_link) 2>&5
12772   ac_status=$?
12773   echo "$as_me:12773: \$? = $ac_status" >&5
12774   (exit "$ac_status"); } &&
12775          { ac_try='test -s "conftest$ac_exeext"'
12776   { (eval echo "$as_me:12776: \"$ac_try\"") >&5
12777   (eval $ac_try) 2>&5
12778   ac_status=$?
12779   echo "$as_me:12779: \$? = $ac_status" >&5
12780   (exit "$ac_status"); }; }; then
12781   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12782 else
12783   echo "$as_me: failed program was:" >&5
12784 cat "conftest.$ac_ext" >&5
12785 ac_cv_lib_dnet_stub_dnet_ntoa=no
12786 fi
12787 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12788 LIBS=$ac_check_lib_save_LIBS
12789 fi
12790 echo "$as_me:12790: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12791 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12792 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12793   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12794 fi
12795
12796     fi
12797 fi
12798 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12799     LIBS="$ac_xsave_LIBS"
12800
12801     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12802     # to get the SysV transport functions.
12803     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12804     # needs -lnsl.
12805     # The nsl library prevents programs from opening the X display
12806     # on Irix 5.2, according to T.E. Dickey.
12807     # The functions gethostbyname, getservbyname, and inet_addr are
12808     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12809     echo "$as_me:12809: checking for gethostbyname" >&5
12810 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12811 if test "${ac_cv_func_gethostbyname+set}" = set; then
12812   echo $ECHO_N "(cached) $ECHO_C" >&6
12813 else
12814   cat >"conftest.$ac_ext" <<_ACEOF
12815 #line 12815 "configure"
12816 #include "confdefs.h"
12817 #define gethostbyname autoconf_temporary
12818 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12819 #undef gethostbyname
12820
12821 #ifdef __cplusplus
12822 extern "C"
12823 #endif
12824
12825 /* We use char because int might match the return type of a gcc2
12826    builtin and then its argument prototype would still apply.  */
12827 char gethostbyname (void);
12828
12829 int
12830 main (void)
12831 {
12832
12833 /* The GNU C library defines stubs for functions which it implements
12834     to always fail with ENOSYS.  Some functions are actually named
12835     something starting with __ and the normal name is an alias.  */
12836 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12837 #error found stub for gethostbyname
12838 #endif
12839
12840         return gethostbyname ();
12841   ;
12842   return 0;
12843 }
12844 _ACEOF
12845 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12846 if { (eval echo "$as_me:12846: \"$ac_link\"") >&5
12847   (eval $ac_link) 2>&5
12848   ac_status=$?
12849   echo "$as_me:12849: \$? = $ac_status" >&5
12850   (exit "$ac_status"); } &&
12851          { ac_try='test -s "conftest$ac_exeext"'
12852   { (eval echo "$as_me:12852: \"$ac_try\"") >&5
12853   (eval $ac_try) 2>&5
12854   ac_status=$?
12855   echo "$as_me:12855: \$? = $ac_status" >&5
12856   (exit "$ac_status"); }; }; then
12857   ac_cv_func_gethostbyname=yes
12858 else
12859   echo "$as_me: failed program was:" >&5
12860 cat "conftest.$ac_ext" >&5
12861 ac_cv_func_gethostbyname=no
12862 fi
12863 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12864 fi
12865 echo "$as_me:12865: result: $ac_cv_func_gethostbyname" >&5
12866 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12867
12868     if test $ac_cv_func_gethostbyname = no; then
12869       echo "$as_me:12869: checking for gethostbyname in -lnsl" >&5
12870 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12871 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12872   echo $ECHO_N "(cached) $ECHO_C" >&6
12873 else
12874   ac_check_lib_save_LIBS=$LIBS
12875 LIBS="-lnsl  $LIBS"
12876 cat >"conftest.$ac_ext" <<_ACEOF
12877 #line 12877 "configure"
12878 #include "confdefs.h"
12879
12880 /* Override any gcc2 internal prototype to avoid an error.  */
12881 #ifdef __cplusplus
12882 extern "C"
12883 #endif
12884 /* We use char because int might match the return type of a gcc2
12885    builtin and then its argument prototype would still apply.  */
12886 char gethostbyname ();
12887 int
12888 main (void)
12889 {
12890 gethostbyname ();
12891   ;
12892   return 0;
12893 }
12894 _ACEOF
12895 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12896 if { (eval echo "$as_me:12896: \"$ac_link\"") >&5
12897   (eval $ac_link) 2>&5
12898   ac_status=$?
12899   echo "$as_me:12899: \$? = $ac_status" >&5
12900   (exit "$ac_status"); } &&
12901          { ac_try='test -s "conftest$ac_exeext"'
12902   { (eval echo "$as_me:12902: \"$ac_try\"") >&5
12903   (eval $ac_try) 2>&5
12904   ac_status=$?
12905   echo "$as_me:12905: \$? = $ac_status" >&5
12906   (exit "$ac_status"); }; }; then
12907   ac_cv_lib_nsl_gethostbyname=yes
12908 else
12909   echo "$as_me: failed program was:" >&5
12910 cat "conftest.$ac_ext" >&5
12911 ac_cv_lib_nsl_gethostbyname=no
12912 fi
12913 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12914 LIBS=$ac_check_lib_save_LIBS
12915 fi
12916 echo "$as_me:12916: result: $ac_cv_lib_nsl_gethostbyname" >&5
12917 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12918 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12919   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12920 fi
12921
12922       if test $ac_cv_lib_nsl_gethostbyname = no; then
12923         echo "$as_me:12923: checking for gethostbyname in -lbsd" >&5
12924 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12925 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12926   echo $ECHO_N "(cached) $ECHO_C" >&6
12927 else
12928   ac_check_lib_save_LIBS=$LIBS
12929 LIBS="-lbsd  $LIBS"
12930 cat >"conftest.$ac_ext" <<_ACEOF
12931 #line 12931 "configure"
12932 #include "confdefs.h"
12933
12934 /* Override any gcc2 internal prototype to avoid an error.  */
12935 #ifdef __cplusplus
12936 extern "C"
12937 #endif
12938 /* We use char because int might match the return type of a gcc2
12939    builtin and then its argument prototype would still apply.  */
12940 char gethostbyname ();
12941 int
12942 main (void)
12943 {
12944 gethostbyname ();
12945   ;
12946   return 0;
12947 }
12948 _ACEOF
12949 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12950 if { (eval echo "$as_me:12950: \"$ac_link\"") >&5
12951   (eval $ac_link) 2>&5
12952   ac_status=$?
12953   echo "$as_me:12953: \$? = $ac_status" >&5
12954   (exit "$ac_status"); } &&
12955          { ac_try='test -s "conftest$ac_exeext"'
12956   { (eval echo "$as_me:12956: \"$ac_try\"") >&5
12957   (eval $ac_try) 2>&5
12958   ac_status=$?
12959   echo "$as_me:12959: \$? = $ac_status" >&5
12960   (exit "$ac_status"); }; }; then
12961   ac_cv_lib_bsd_gethostbyname=yes
12962 else
12963   echo "$as_me: failed program was:" >&5
12964 cat "conftest.$ac_ext" >&5
12965 ac_cv_lib_bsd_gethostbyname=no
12966 fi
12967 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12968 LIBS=$ac_check_lib_save_LIBS
12969 fi
12970 echo "$as_me:12970: result: $ac_cv_lib_bsd_gethostbyname" >&5
12971 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12972 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
12973   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12974 fi
12975
12976       fi
12977     fi
12978
12979     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12980     # socket/setsockopt and other routines are undefined under SCO ODT
12981     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12982     # on later versions), says Simon Leinen: it contains gethostby*
12983     # variants that don't use the nameserver (or something).  -lsocket
12984     # must be given before -lnsl if both are needed.  We assume that
12985     # if connect needs -lnsl, so does gethostbyname.
12986     echo "$as_me:12986: checking for connect" >&5
12987 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12988 if test "${ac_cv_func_connect+set}" = set; then
12989   echo $ECHO_N "(cached) $ECHO_C" >&6
12990 else
12991   cat >"conftest.$ac_ext" <<_ACEOF
12992 #line 12992 "configure"
12993 #include "confdefs.h"
12994 #define connect autoconf_temporary
12995 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12996 #undef connect
12997
12998 #ifdef __cplusplus
12999 extern "C"
13000 #endif
13001
13002 /* We use char because int might match the return type of a gcc2
13003    builtin and then its argument prototype would still apply.  */
13004 char connect (void);
13005
13006 int
13007 main (void)
13008 {
13009
13010 /* The GNU C library defines stubs for functions which it implements
13011     to always fail with ENOSYS.  Some functions are actually named
13012     something starting with __ and the normal name is an alias.  */
13013 #if defined (__stub_connect) || defined (__stub___connect)
13014 #error found stub for connect
13015 #endif
13016
13017         return connect ();
13018   ;
13019   return 0;
13020 }
13021 _ACEOF
13022 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13023 if { (eval echo "$as_me:13023: \"$ac_link\"") >&5
13024   (eval $ac_link) 2>&5
13025   ac_status=$?
13026   echo "$as_me:13026: \$? = $ac_status" >&5
13027   (exit "$ac_status"); } &&
13028          { ac_try='test -s "conftest$ac_exeext"'
13029   { (eval echo "$as_me:13029: \"$ac_try\"") >&5
13030   (eval $ac_try) 2>&5
13031   ac_status=$?
13032   echo "$as_me:13032: \$? = $ac_status" >&5
13033   (exit "$ac_status"); }; }; then
13034   ac_cv_func_connect=yes
13035 else
13036   echo "$as_me: failed program was:" >&5
13037 cat "conftest.$ac_ext" >&5
13038 ac_cv_func_connect=no
13039 fi
13040 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13041 fi
13042 echo "$as_me:13042: result: $ac_cv_func_connect" >&5
13043 echo "${ECHO_T}$ac_cv_func_connect" >&6
13044
13045     if test $ac_cv_func_connect = no; then
13046       echo "$as_me:13046: checking for connect in -lsocket" >&5
13047 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
13048 if test "${ac_cv_lib_socket_connect+set}" = set; then
13049   echo $ECHO_N "(cached) $ECHO_C" >&6
13050 else
13051   ac_check_lib_save_LIBS=$LIBS
13052 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
13053 cat >"conftest.$ac_ext" <<_ACEOF
13054 #line 13054 "configure"
13055 #include "confdefs.h"
13056
13057 /* Override any gcc2 internal prototype to avoid an error.  */
13058 #ifdef __cplusplus
13059 extern "C"
13060 #endif
13061 /* We use char because int might match the return type of a gcc2
13062    builtin and then its argument prototype would still apply.  */
13063 char connect ();
13064 int
13065 main (void)
13066 {
13067 connect ();
13068   ;
13069   return 0;
13070 }
13071 _ACEOF
13072 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13073 if { (eval echo "$as_me:13073: \"$ac_link\"") >&5
13074   (eval $ac_link) 2>&5
13075   ac_status=$?
13076   echo "$as_me:13076: \$? = $ac_status" >&5
13077   (exit "$ac_status"); } &&
13078          { ac_try='test -s "conftest$ac_exeext"'
13079   { (eval echo "$as_me:13079: \"$ac_try\"") >&5
13080   (eval $ac_try) 2>&5
13081   ac_status=$?
13082   echo "$as_me:13082: \$? = $ac_status" >&5
13083   (exit "$ac_status"); }; }; then
13084   ac_cv_lib_socket_connect=yes
13085 else
13086   echo "$as_me: failed program was:" >&5
13087 cat "conftest.$ac_ext" >&5
13088 ac_cv_lib_socket_connect=no
13089 fi
13090 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13091 LIBS=$ac_check_lib_save_LIBS
13092 fi
13093 echo "$as_me:13093: result: $ac_cv_lib_socket_connect" >&5
13094 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
13095 if test "$ac_cv_lib_socket_connect" = yes; then
13096   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
13097 fi
13098
13099     fi
13100
13101     # Guillermo Gomez says -lposix is necessary on A/UX.
13102     echo "$as_me:13102: checking for remove" >&5
13103 echo $ECHO_N "checking for remove... $ECHO_C" >&6
13104 if test "${ac_cv_func_remove+set}" = set; then
13105   echo $ECHO_N "(cached) $ECHO_C" >&6
13106 else
13107   cat >"conftest.$ac_ext" <<_ACEOF
13108 #line 13108 "configure"
13109 #include "confdefs.h"
13110 #define remove autoconf_temporary
13111 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13112 #undef remove
13113
13114 #ifdef __cplusplus
13115 extern "C"
13116 #endif
13117
13118 /* We use char because int might match the return type of a gcc2
13119    builtin and then its argument prototype would still apply.  */
13120 char remove (void);
13121
13122 int
13123 main (void)
13124 {
13125
13126 /* The GNU C library defines stubs for functions which it implements
13127     to always fail with ENOSYS.  Some functions are actually named
13128     something starting with __ and the normal name is an alias.  */
13129 #if defined (__stub_remove) || defined (__stub___remove)
13130 #error found stub for remove
13131 #endif
13132
13133         return remove ();
13134   ;
13135   return 0;
13136 }
13137 _ACEOF
13138 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13139 if { (eval echo "$as_me:13139: \"$ac_link\"") >&5
13140   (eval $ac_link) 2>&5
13141   ac_status=$?
13142   echo "$as_me:13142: \$? = $ac_status" >&5
13143   (exit "$ac_status"); } &&
13144          { ac_try='test -s "conftest$ac_exeext"'
13145   { (eval echo "$as_me:13145: \"$ac_try\"") >&5
13146   (eval $ac_try) 2>&5
13147   ac_status=$?
13148   echo "$as_me:13148: \$? = $ac_status" >&5
13149   (exit "$ac_status"); }; }; then
13150   ac_cv_func_remove=yes
13151 else
13152   echo "$as_me: failed program was:" >&5
13153 cat "conftest.$ac_ext" >&5
13154 ac_cv_func_remove=no
13155 fi
13156 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13157 fi
13158 echo "$as_me:13158: result: $ac_cv_func_remove" >&5
13159 echo "${ECHO_T}$ac_cv_func_remove" >&6
13160
13161     if test $ac_cv_func_remove = no; then
13162       echo "$as_me:13162: checking for remove in -lposix" >&5
13163 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
13164 if test "${ac_cv_lib_posix_remove+set}" = set; then
13165   echo $ECHO_N "(cached) $ECHO_C" >&6
13166 else
13167   ac_check_lib_save_LIBS=$LIBS
13168 LIBS="-lposix  $LIBS"
13169 cat >"conftest.$ac_ext" <<_ACEOF
13170 #line 13170 "configure"
13171 #include "confdefs.h"
13172
13173 /* Override any gcc2 internal prototype to avoid an error.  */
13174 #ifdef __cplusplus
13175 extern "C"
13176 #endif
13177 /* We use char because int might match the return type of a gcc2
13178    builtin and then its argument prototype would still apply.  */
13179 char remove ();
13180 int
13181 main (void)
13182 {
13183 remove ();
13184   ;
13185   return 0;
13186 }
13187 _ACEOF
13188 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13189 if { (eval echo "$as_me:13189: \"$ac_link\"") >&5
13190   (eval $ac_link) 2>&5
13191   ac_status=$?
13192   echo "$as_me:13192: \$? = $ac_status" >&5
13193   (exit "$ac_status"); } &&
13194          { ac_try='test -s "conftest$ac_exeext"'
13195   { (eval echo "$as_me:13195: \"$ac_try\"") >&5
13196   (eval $ac_try) 2>&5
13197   ac_status=$?
13198   echo "$as_me:13198: \$? = $ac_status" >&5
13199   (exit "$ac_status"); }; }; then
13200   ac_cv_lib_posix_remove=yes
13201 else
13202   echo "$as_me: failed program was:" >&5
13203 cat "conftest.$ac_ext" >&5
13204 ac_cv_lib_posix_remove=no
13205 fi
13206 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13207 LIBS=$ac_check_lib_save_LIBS
13208 fi
13209 echo "$as_me:13209: result: $ac_cv_lib_posix_remove" >&5
13210 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
13211 if test "$ac_cv_lib_posix_remove" = yes; then
13212   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
13213 fi
13214
13215     fi
13216
13217     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
13218     echo "$as_me:13218: checking for shmat" >&5
13219 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
13220 if test "${ac_cv_func_shmat+set}" = set; then
13221   echo $ECHO_N "(cached) $ECHO_C" >&6
13222 else
13223   cat >"conftest.$ac_ext" <<_ACEOF
13224 #line 13224 "configure"
13225 #include "confdefs.h"
13226 #define shmat autoconf_temporary
13227 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13228 #undef shmat
13229
13230 #ifdef __cplusplus
13231 extern "C"
13232 #endif
13233
13234 /* We use char because int might match the return type of a gcc2
13235    builtin and then its argument prototype would still apply.  */
13236 char shmat (void);
13237
13238 int
13239 main (void)
13240 {
13241
13242 /* The GNU C library defines stubs for functions which it implements
13243     to always fail with ENOSYS.  Some functions are actually named
13244     something starting with __ and the normal name is an alias.  */
13245 #if defined (__stub_shmat) || defined (__stub___shmat)
13246 #error found stub for shmat
13247 #endif
13248
13249         return shmat ();
13250   ;
13251   return 0;
13252 }
13253 _ACEOF
13254 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13255 if { (eval echo "$as_me:13255: \"$ac_link\"") >&5
13256   (eval $ac_link) 2>&5
13257   ac_status=$?
13258   echo "$as_me:13258: \$? = $ac_status" >&5
13259   (exit "$ac_status"); } &&
13260          { ac_try='test -s "conftest$ac_exeext"'
13261   { (eval echo "$as_me:13261: \"$ac_try\"") >&5
13262   (eval $ac_try) 2>&5
13263   ac_status=$?
13264   echo "$as_me:13264: \$? = $ac_status" >&5
13265   (exit "$ac_status"); }; }; then
13266   ac_cv_func_shmat=yes
13267 else
13268   echo "$as_me: failed program was:" >&5
13269 cat "conftest.$ac_ext" >&5
13270 ac_cv_func_shmat=no
13271 fi
13272 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13273 fi
13274 echo "$as_me:13274: result: $ac_cv_func_shmat" >&5
13275 echo "${ECHO_T}$ac_cv_func_shmat" >&6
13276
13277     if test $ac_cv_func_shmat = no; then
13278       echo "$as_me:13278: checking for shmat in -lipc" >&5
13279 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13280 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13281   echo $ECHO_N "(cached) $ECHO_C" >&6
13282 else
13283   ac_check_lib_save_LIBS=$LIBS
13284 LIBS="-lipc  $LIBS"
13285 cat >"conftest.$ac_ext" <<_ACEOF
13286 #line 13286 "configure"
13287 #include "confdefs.h"
13288
13289 /* Override any gcc2 internal prototype to avoid an error.  */
13290 #ifdef __cplusplus
13291 extern "C"
13292 #endif
13293 /* We use char because int might match the return type of a gcc2
13294    builtin and then its argument prototype would still apply.  */
13295 char shmat ();
13296 int
13297 main (void)
13298 {
13299 shmat ();
13300   ;
13301   return 0;
13302 }
13303 _ACEOF
13304 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13305 if { (eval echo "$as_me:13305: \"$ac_link\"") >&5
13306   (eval $ac_link) 2>&5
13307   ac_status=$?
13308   echo "$as_me:13308: \$? = $ac_status" >&5
13309   (exit "$ac_status"); } &&
13310          { ac_try='test -s "conftest$ac_exeext"'
13311   { (eval echo "$as_me:13311: \"$ac_try\"") >&5
13312   (eval $ac_try) 2>&5
13313   ac_status=$?
13314   echo "$as_me:13314: \$? = $ac_status" >&5
13315   (exit "$ac_status"); }; }; then
13316   ac_cv_lib_ipc_shmat=yes
13317 else
13318   echo "$as_me: failed program was:" >&5
13319 cat "conftest.$ac_ext" >&5
13320 ac_cv_lib_ipc_shmat=no
13321 fi
13322 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13323 LIBS=$ac_check_lib_save_LIBS
13324 fi
13325 echo "$as_me:13325: result: $ac_cv_lib_ipc_shmat" >&5
13326 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
13327 if test "$ac_cv_lib_ipc_shmat" = yes; then
13328   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13329 fi
13330
13331     fi
13332   fi
13333
13334   # Check for libraries that X11R6 Xt/Xaw programs need.
13335   ac_save_LDFLAGS=$LDFLAGS
13336   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13337   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13338   # check for ICE first), but we must link in the order -lSM -lICE or
13339   # we get undefined symbols.  So assume we have SM if we have ICE.
13340   # These have to be linked with before -lX11, unlike the other
13341   # libraries we check for below, so use a different variable.
13342   # John Interrante, Karl Berry
13343   echo "$as_me:13343: checking for IceConnectionNumber in -lICE" >&5
13344 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13345 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13346   echo $ECHO_N "(cached) $ECHO_C" >&6
13347 else
13348   ac_check_lib_save_LIBS=$LIBS
13349 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13350 cat >"conftest.$ac_ext" <<_ACEOF
13351 #line 13351 "configure"
13352 #include "confdefs.h"
13353
13354 /* Override any gcc2 internal prototype to avoid an error.  */
13355 #ifdef __cplusplus
13356 extern "C"
13357 #endif
13358 /* We use char because int might match the return type of a gcc2
13359    builtin and then its argument prototype would still apply.  */
13360 char IceConnectionNumber ();
13361 int
13362 main (void)
13363 {
13364 IceConnectionNumber ();
13365   ;
13366   return 0;
13367 }
13368 _ACEOF
13369 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13370 if { (eval echo "$as_me:13370: \"$ac_link\"") >&5
13371   (eval $ac_link) 2>&5
13372   ac_status=$?
13373   echo "$as_me:13373: \$? = $ac_status" >&5
13374   (exit "$ac_status"); } &&
13375          { ac_try='test -s "conftest$ac_exeext"'
13376   { (eval echo "$as_me:13376: \"$ac_try\"") >&5
13377   (eval $ac_try) 2>&5
13378   ac_status=$?
13379   echo "$as_me:13379: \$? = $ac_status" >&5
13380   (exit "$ac_status"); }; }; then
13381   ac_cv_lib_ICE_IceConnectionNumber=yes
13382 else
13383   echo "$as_me: failed program was:" >&5
13384 cat "conftest.$ac_ext" >&5
13385 ac_cv_lib_ICE_IceConnectionNumber=no
13386 fi
13387 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13388 LIBS=$ac_check_lib_save_LIBS
13389 fi
13390 echo "$as_me:13390: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13391 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13392 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13393   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13394 fi
13395
13396   LDFLAGS=$ac_save_LDFLAGS
13397
13398 fi
13399
13400 cf_x_athena=${cf_x_athena:-Xaw}
13401
13402 echo "$as_me:13402: checking if you want to link with Xaw 3d library" >&5
13403 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13404 withval=
13405
13406 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13407 if test "${with_Xaw3d+set}" = set; then
13408   withval="$with_Xaw3d"
13409
13410 fi;
13411 if test "$withval" = yes ; then
13412         cf_x_athena=Xaw3d
13413         echo "$as_me:13413: result: yes" >&5
13414 echo "${ECHO_T}yes" >&6
13415 else
13416         echo "$as_me:13416: result: no" >&5
13417 echo "${ECHO_T}no" >&6
13418 fi
13419
13420 echo "$as_me:13420: checking if you want to link with Xaw 3d xft library" >&5
13421 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13422 withval=
13423
13424 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13425 if test "${with_Xaw3dxft+set}" = set; then
13426   withval="$with_Xaw3dxft"
13427
13428 fi;
13429 if test "$withval" = yes ; then
13430         cf_x_athena=Xaw3dxft
13431         echo "$as_me:13431: result: yes" >&5
13432 echo "${ECHO_T}yes" >&6
13433 else
13434         echo "$as_me:13434: result: no" >&5
13435 echo "${ECHO_T}no" >&6
13436 fi
13437
13438 echo "$as_me:13438: checking if you want to link with neXT Athena library" >&5
13439 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13440 withval=
13441
13442 # Check whether --with-neXtaw or --without-neXtaw was given.
13443 if test "${with_neXtaw+set}" = set; then
13444   withval="$with_neXtaw"
13445
13446 fi;
13447 if test "$withval" = yes ; then
13448         cf_x_athena=neXtaw
13449         echo "$as_me:13449: result: yes" >&5
13450 echo "${ECHO_T}yes" >&6
13451 else
13452         echo "$as_me:13452: result: no" >&5
13453 echo "${ECHO_T}no" >&6
13454 fi
13455
13456 echo "$as_me:13456: checking if you want to link with Athena-Plus library" >&5
13457 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13458 withval=
13459
13460 # Check whether --with-XawPlus or --without-XawPlus was given.
13461 if test "${with_XawPlus+set}" = set; then
13462   withval="$with_XawPlus"
13463
13464 fi;
13465 if test "$withval" = yes ; then
13466         cf_x_athena=XawPlus
13467         echo "$as_me:13467: result: yes" >&5
13468 echo "${ECHO_T}yes" >&6
13469 else
13470         echo "$as_me:13470: result: no" >&5
13471 echo "${ECHO_T}no" >&6
13472 fi
13473
13474 cf_x_athena_lib=""
13475
13476 if test "$PKG_CONFIG" != none ; then
13477         cf_athena_list=
13478         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13479         for cf_athena_pkg in \
13480                 $cf_athena_list \
13481                 ${cf_x_athena} \
13482                 ${cf_x_athena}-devel \
13483                 lib${cf_x_athena} \
13484                 lib${cf_x_athena}-devel
13485         do
13486
13487 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13488         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13489
13490 echo "${as_me:-configure}:13490: testing found package $cf_athena_pkg ..." 1>&5
13491
13492         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13493         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13494         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13495
13496 echo "${as_me:-configure}:13496: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13497
13498         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13499
13500 echo "${as_me:-configure}:13500: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13501
13502 cf_fix_cppflags=no
13503 cf_new_cflags=
13504 cf_new_cppflags=
13505 cf_new_extra_cppflags=
13506
13507 for cf_add_cflags in $cf_pkgconfig_incs
13508 do
13509 case "$cf_fix_cppflags" in
13510 (no)
13511         case "$cf_add_cflags" in
13512         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13513                 case "$cf_add_cflags" in
13514                 (-D*)
13515                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13516
13517                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13518                                 && test -z "${cf_tst_cflags}" \
13519                                 && cf_fix_cppflags=yes
13520
13521                         if test "$cf_fix_cppflags" = yes ; then
13522
13523         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13524         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13525
13526                                 continue
13527                         elif test "${cf_tst_cflags}" = "\"'" ; then
13528
13529         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13530         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13531
13532                                 continue
13533                         fi
13534                         ;;
13535                 esac
13536                 case "$CPPFLAGS" in
13537                 (*$cf_add_cflags)
13538                         ;;
13539                 (*)
13540                         case "$cf_add_cflags" in
13541                         (-D*)
13542                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13543
13544 CPPFLAGS=`echo "$CPPFLAGS" | \
13545         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13546                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13547
13548                                 ;;
13549                         esac
13550
13551         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13552         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13553
13554                         ;;
13555                 esac
13556                 ;;
13557         (*)
13558
13559         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13560         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13561
13562                 ;;
13563         esac
13564         ;;
13565 (yes)
13566
13567         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13568         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13569
13570         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13571
13572         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13573                 && test -z "${cf_tst_cflags}" \
13574                 && cf_fix_cppflags=no
13575         ;;
13576 esac
13577 done
13578
13579 if test -n "$cf_new_cflags" ; then
13580
13581         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13582         CFLAGS="${CFLAGS}$cf_new_cflags"
13583
13584 fi
13585
13586 if test -n "$cf_new_cppflags" ; then
13587
13588         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13589         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13590
13591 fi
13592
13593 if test -n "$cf_new_extra_cppflags" ; then
13594
13595         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13596         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13597
13598 fi
13599
13600 cf_add_libs="$LIBS"
13601 # reverse order
13602 cf_add_0lib=
13603 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13604 # filter duplicates
13605 for cf_add_1lib in $cf_add_0lib; do
13606         for cf_add_2lib in $cf_add_libs; do
13607                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13608                         cf_add_1lib=
13609                         break
13610                 fi
13611         done
13612         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13613 done
13614 LIBS="$cf_add_libs"
13615
13616                         cf_x_athena_lib="$cf_pkgconfig_libs"
13617
13618 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13619
13620                         cat >>confdefs.h <<EOF
13621 #define $cf_x_athena_LIBS 1
13622 EOF
13623
13624         for cf_trim_lib in Xmu Xt X11
13625         do
13626                 case "$LIBS" in
13627                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13628                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13629                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13630
13631 echo "${as_me:-configure}:13631: testing ..trimmed $LIBS ..." 1>&5
13632
13633                         ;;
13634                 esac
13635         done
13636
13637 echo "$as_me:13637: checking for usable $cf_x_athena/Xmu package" >&5
13638 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13639 if test "${cf_cv_xaw_compat+set}" = set; then
13640   echo $ECHO_N "(cached) $ECHO_C" >&6
13641 else
13642
13643 cat >"conftest.$ac_ext" <<_ACEOF
13644 #line 13644 "configure"
13645 #include "confdefs.h"
13646
13647 #include <X11/Xmu/CharSet.h>
13648
13649 int
13650 main (void)
13651 {
13652
13653 int check = XmuCompareISOLatin1("big", "small");
13654 (void)check;
13655
13656   ;
13657   return 0;
13658 }
13659 _ACEOF
13660 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13661 if { (eval echo "$as_me:13661: \"$ac_link\"") >&5
13662   (eval $ac_link) 2>&5
13663   ac_status=$?
13664   echo "$as_me:13664: \$? = $ac_status" >&5
13665   (exit "$ac_status"); } &&
13666          { ac_try='test -s "conftest$ac_exeext"'
13667   { (eval echo "$as_me:13667: \"$ac_try\"") >&5
13668   (eval $ac_try) 2>&5
13669   ac_status=$?
13670   echo "$as_me:13670: \$? = $ac_status" >&5
13671   (exit "$ac_status"); }; }; then
13672   cf_cv_xaw_compat=yes
13673 else
13674   echo "$as_me: failed program was:" >&5
13675 cat "conftest.$ac_ext" >&5
13676 cf_cv_xaw_compat=no
13677 fi
13678 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13679 fi
13680 echo "$as_me:13680: result: $cf_cv_xaw_compat" >&5
13681 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13682
13683                         if test "$cf_cv_xaw_compat" = no
13684                         then
13685                                 # workaround for broken ".pc" files...
13686                                 case "$cf_x_athena_lib" in
13687                                 (*-lXmu*)
13688                                         ;;
13689                                 (*)
13690                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13691
13692 echo "${as_me:-configure}:13692: testing work around broken package ..." 1>&5
13693
13694                                         cf_save_xmu="$LIBS"
13695                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13696
13697 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13698         test -n "$verbose" && echo "    found package xmu" 1>&6
13699
13700 echo "${as_me:-configure}:13700: testing found package xmu ..." 1>&5
13701
13702         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13703         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13704         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13705
13706 echo "${as_me:-configure}:13706: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13707
13708         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13709
13710 echo "${as_me:-configure}:13710: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13711
13712 cf_fix_cppflags=no
13713 cf_new_cflags=
13714 cf_new_cppflags=
13715 cf_new_extra_cppflags=
13716
13717 for cf_add_cflags in $cf_pkgconfig_incs
13718 do
13719 case "$cf_fix_cppflags" in
13720 (no)
13721         case "$cf_add_cflags" in
13722         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13723                 case "$cf_add_cflags" in
13724                 (-D*)
13725                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13726
13727                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13728                                 && test -z "${cf_tst_cflags}" \
13729                                 && cf_fix_cppflags=yes
13730
13731                         if test "$cf_fix_cppflags" = yes ; then
13732
13733         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13734         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13735
13736                                 continue
13737                         elif test "${cf_tst_cflags}" = "\"'" ; then
13738
13739         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13740         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13741
13742                                 continue
13743                         fi
13744                         ;;
13745                 esac
13746                 case "$CPPFLAGS" in
13747                 (*$cf_add_cflags)
13748                         ;;
13749                 (*)
13750                         case "$cf_add_cflags" in
13751                         (-D*)
13752                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13753
13754 CPPFLAGS=`echo "$CPPFLAGS" | \
13755         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13756                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13757
13758                                 ;;
13759                         esac
13760
13761         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13762         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13763
13764                         ;;
13765                 esac
13766                 ;;
13767         (*)
13768
13769         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13770         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13771
13772                 ;;
13773         esac
13774         ;;
13775 (yes)
13776
13777         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13778         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13779
13780         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13781
13782         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13783                 && test -z "${cf_tst_cflags}" \
13784                 && cf_fix_cppflags=no
13785         ;;
13786 esac
13787 done
13788
13789 if test -n "$cf_new_cflags" ; then
13790
13791         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13792         CFLAGS="${CFLAGS}$cf_new_cflags"
13793
13794 fi
13795
13796 if test -n "$cf_new_cppflags" ; then
13797
13798         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13799         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13800
13801 fi
13802
13803 if test -n "$cf_new_extra_cppflags" ; then
13804
13805         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13806         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13807
13808 fi
13809
13810 cf_add_libs="$LIBS"
13811 # reverse order
13812 cf_add_0lib=
13813 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13814 # filter duplicates
13815 for cf_add_1lib in $cf_add_0lib; do
13816         for cf_add_2lib in $cf_add_libs; do
13817                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13818                         cf_add_1lib=
13819                         break
13820                 fi
13821         done
13822         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13823 done
13824 LIBS="$cf_add_libs"
13825
13826                                                         LIBS="$cf_save_xmu"
13827
13828 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13829
13830 echo "${as_me:-configure}:13830: testing ...before $LIBS ..." 1>&5
13831
13832 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13833 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13834
13835 echo "${as_me:-configure}:13835: testing ...after  $LIBS ..." 1>&5
13836
13837 else
13838         cf_pkgconfig_incs=
13839         cf_pkgconfig_libs=
13840
13841 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13842
13843 echo "${as_me:-configure}:13843: testing ...before $LIBS ..." 1>&5
13844
13845 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13846 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13847
13848 echo "${as_me:-configure}:13848: testing ...after  $LIBS ..." 1>&5
13849
13850 fi
13851
13852         for cf_trim_lib in Xmu Xt X11
13853         do
13854                 case "$LIBS" in
13855                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13856                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13857                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13858
13859 echo "${as_me:-configure}:13859: testing ..trimmed $LIBS ..." 1>&5
13860
13861                         ;;
13862                 esac
13863         done
13864
13865                                         ;;
13866                                 esac
13867                         fi
13868
13869                         break
13870 else
13871         cf_pkgconfig_incs=
13872         cf_pkgconfig_libs=
13873         :
13874 fi
13875
13876         done
13877 fi
13878
13879 if test -z "$cf_x_athena_lib" ; then
13880
13881 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13882         test -n "$verbose" && echo "    found package Xext" 1>&6
13883
13884 echo "${as_me:-configure}:13884: testing found package Xext ..." 1>&5
13885
13886         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13887         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13888         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13889
13890 echo "${as_me:-configure}:13890: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13891
13892         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13893
13894 echo "${as_me:-configure}:13894: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13895
13896 cf_fix_cppflags=no
13897 cf_new_cflags=
13898 cf_new_cppflags=
13899 cf_new_extra_cppflags=
13900
13901 for cf_add_cflags in $cf_pkgconfig_incs
13902 do
13903 case "$cf_fix_cppflags" in
13904 (no)
13905         case "$cf_add_cflags" in
13906         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13907                 case "$cf_add_cflags" in
13908                 (-D*)
13909                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13910
13911                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13912                                 && test -z "${cf_tst_cflags}" \
13913                                 && cf_fix_cppflags=yes
13914
13915                         if test "$cf_fix_cppflags" = yes ; then
13916
13917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13919
13920                                 continue
13921                         elif test "${cf_tst_cflags}" = "\"'" ; then
13922
13923         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13924         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13925
13926                                 continue
13927                         fi
13928                         ;;
13929                 esac
13930                 case "$CPPFLAGS" in
13931                 (*$cf_add_cflags)
13932                         ;;
13933                 (*)
13934                         case "$cf_add_cflags" in
13935                         (-D*)
13936                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13937
13938 CPPFLAGS=`echo "$CPPFLAGS" | \
13939         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13940                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13941
13942                                 ;;
13943                         esac
13944
13945         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13946         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13947
13948                         ;;
13949                 esac
13950                 ;;
13951         (*)
13952
13953         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13954         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13955
13956                 ;;
13957         esac
13958         ;;
13959 (yes)
13960
13961         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13962         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13963
13964         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13965
13966         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13967                 && test -z "${cf_tst_cflags}" \
13968                 && cf_fix_cppflags=no
13969         ;;
13970 esac
13971 done
13972
13973 if test -n "$cf_new_cflags" ; then
13974
13975         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13976         CFLAGS="${CFLAGS}$cf_new_cflags"
13977
13978 fi
13979
13980 if test -n "$cf_new_cppflags" ; then
13981
13982         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13983         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13984
13985 fi
13986
13987 if test -n "$cf_new_extra_cppflags" ; then
13988
13989         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13990         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13991
13992 fi
13993
13994 cf_add_libs="$LIBS"
13995 # reverse order
13996 cf_add_0lib=
13997 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13998 # filter duplicates
13999 for cf_add_1lib in $cf_add_0lib; do
14000         for cf_add_2lib in $cf_add_libs; do
14001                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14002                         cf_add_1lib=
14003                         break
14004                 fi
14005         done
14006         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14007 done
14008 LIBS="$cf_add_libs"
14009
14010         :
14011 else
14012         cf_pkgconfig_incs=
14013         cf_pkgconfig_libs=
14014
14015         echo "$as_me:14015: checking for XextCreateExtension in -lXext" >&5
14016 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
14017 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
14018   echo $ECHO_N "(cached) $ECHO_C" >&6
14019 else
14020   ac_check_lib_save_LIBS=$LIBS
14021 LIBS="-lXext  $LIBS"
14022 cat >"conftest.$ac_ext" <<_ACEOF
14023 #line 14023 "configure"
14024 #include "confdefs.h"
14025
14026 /* Override any gcc2 internal prototype to avoid an error.  */
14027 #ifdef __cplusplus
14028 extern "C"
14029 #endif
14030 /* We use char because int might match the return type of a gcc2
14031    builtin and then its argument prototype would still apply.  */
14032 char XextCreateExtension ();
14033 int
14034 main (void)
14035 {
14036 XextCreateExtension ();
14037   ;
14038   return 0;
14039 }
14040 _ACEOF
14041 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14042 if { (eval echo "$as_me:14042: \"$ac_link\"") >&5
14043   (eval $ac_link) 2>&5
14044   ac_status=$?
14045   echo "$as_me:14045: \$? = $ac_status" >&5
14046   (exit "$ac_status"); } &&
14047          { ac_try='test -s "conftest$ac_exeext"'
14048   { (eval echo "$as_me:14048: \"$ac_try\"") >&5
14049   (eval $ac_try) 2>&5
14050   ac_status=$?
14051   echo "$as_me:14051: \$? = $ac_status" >&5
14052   (exit "$ac_status"); }; }; then
14053   ac_cv_lib_Xext_XextCreateExtension=yes
14054 else
14055   echo "$as_me: failed program was:" >&5
14056 cat "conftest.$ac_ext" >&5
14057 ac_cv_lib_Xext_XextCreateExtension=no
14058 fi
14059 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14060 LIBS=$ac_check_lib_save_LIBS
14061 fi
14062 echo "$as_me:14062: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
14063 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
14064 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
14065
14066 cf_add_libs="$LIBS"
14067 # reverse order
14068 cf_add_0lib=
14069 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14070 # filter duplicates
14071 for cf_add_1lib in $cf_add_0lib; do
14072         for cf_add_2lib in $cf_add_libs; do
14073                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14074                         cf_add_1lib=
14075                         break
14076                 fi
14077         done
14078         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14079 done
14080 LIBS="$cf_add_libs"
14081
14082 fi
14083
14084 fi
14085
14086 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
14087 # in some cases has installed dummy files in the former, other cases replaced
14088 # it with a link to the new location).  This complicates the configure script.
14089 # Check for that pitfall, and recover using pkg-config
14090 #
14091 # If none of these are set, the configuration is almost certainly broken.
14092 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
14093 then
14094
14095 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14096         test -n "$verbose" && echo "    found package x11" 1>&6
14097
14098 echo "${as_me:-configure}:14098: testing found package x11 ..." 1>&5
14099
14100         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14101         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14102         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14103
14104 echo "${as_me:-configure}:14104: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14105
14106         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14107
14108 echo "${as_me:-configure}:14108: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14109
14110 cf_fix_cppflags=no
14111 cf_new_cflags=
14112 cf_new_cppflags=
14113 cf_new_extra_cppflags=
14114
14115 for cf_add_cflags in $cf_pkgconfig_incs
14116 do
14117 case "$cf_fix_cppflags" in
14118 (no)
14119         case "$cf_add_cflags" in
14120         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14121                 case "$cf_add_cflags" in
14122                 (-D*)
14123                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14124
14125                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14126                                 && test -z "${cf_tst_cflags}" \
14127                                 && cf_fix_cppflags=yes
14128
14129                         if test "$cf_fix_cppflags" = yes ; then
14130
14131         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14132         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14133
14134                                 continue
14135                         elif test "${cf_tst_cflags}" = "\"'" ; then
14136
14137         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14138         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14139
14140                                 continue
14141                         fi
14142                         ;;
14143                 esac
14144                 case "$CPPFLAGS" in
14145                 (*$cf_add_cflags)
14146                         ;;
14147                 (*)
14148                         case "$cf_add_cflags" in
14149                         (-D*)
14150                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14151
14152 CPPFLAGS=`echo "$CPPFLAGS" | \
14153         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14154                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14155
14156                                 ;;
14157                         esac
14158
14159         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14160         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14161
14162                         ;;
14163                 esac
14164                 ;;
14165         (*)
14166
14167         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14168         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14169
14170                 ;;
14171         esac
14172         ;;
14173 (yes)
14174
14175         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14176         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14177
14178         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14179
14180         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14181                 && test -z "${cf_tst_cflags}" \
14182                 && cf_fix_cppflags=no
14183         ;;
14184 esac
14185 done
14186
14187 if test -n "$cf_new_cflags" ; then
14188
14189         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14190         CFLAGS="${CFLAGS}$cf_new_cflags"
14191
14192 fi
14193
14194 if test -n "$cf_new_cppflags" ; then
14195
14196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14197         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14198
14199 fi
14200
14201 if test -n "$cf_new_extra_cppflags" ; then
14202
14203         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14204         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14205
14206 fi
14207
14208 cf_add_libs="$LIBS"
14209 # reverse order
14210 cf_add_0lib=
14211 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14212 # filter duplicates
14213 for cf_add_1lib in $cf_add_0lib; do
14214         for cf_add_2lib in $cf_add_libs; do
14215                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14216                         cf_add_1lib=
14217                         break
14218                 fi
14219         done
14220         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14221 done
14222 LIBS="$cf_add_libs"
14223
14224         :
14225 else
14226         cf_pkgconfig_incs=
14227         cf_pkgconfig_libs=
14228         { echo "$as_me:14228: WARNING: unable to find X11 library" >&5
14229 echo "$as_me: WARNING: unable to find X11 library" >&2;}
14230 fi
14231
14232 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14233         test -n "$verbose" && echo "    found package ice" 1>&6
14234
14235 echo "${as_me:-configure}:14235: testing found package ice ..." 1>&5
14236
14237         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14238         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14239         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14240
14241 echo "${as_me:-configure}:14241: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14242
14243         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14244
14245 echo "${as_me:-configure}:14245: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14246
14247 cf_fix_cppflags=no
14248 cf_new_cflags=
14249 cf_new_cppflags=
14250 cf_new_extra_cppflags=
14251
14252 for cf_add_cflags in $cf_pkgconfig_incs
14253 do
14254 case "$cf_fix_cppflags" in
14255 (no)
14256         case "$cf_add_cflags" in
14257         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14258                 case "$cf_add_cflags" in
14259                 (-D*)
14260                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14261
14262                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14263                                 && test -z "${cf_tst_cflags}" \
14264                                 && cf_fix_cppflags=yes
14265
14266                         if test "$cf_fix_cppflags" = yes ; then
14267
14268         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14269         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14270
14271                                 continue
14272                         elif test "${cf_tst_cflags}" = "\"'" ; then
14273
14274         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14275         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14276
14277                                 continue
14278                         fi
14279                         ;;
14280                 esac
14281                 case "$CPPFLAGS" in
14282                 (*$cf_add_cflags)
14283                         ;;
14284                 (*)
14285                         case "$cf_add_cflags" in
14286                         (-D*)
14287                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14288
14289 CPPFLAGS=`echo "$CPPFLAGS" | \
14290         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14291                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14292
14293                                 ;;
14294                         esac
14295
14296         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14297         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14298
14299                         ;;
14300                 esac
14301                 ;;
14302         (*)
14303
14304         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14305         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14306
14307                 ;;
14308         esac
14309         ;;
14310 (yes)
14311
14312         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14313         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14314
14315         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14316
14317         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14318                 && test -z "${cf_tst_cflags}" \
14319                 && cf_fix_cppflags=no
14320         ;;
14321 esac
14322 done
14323
14324 if test -n "$cf_new_cflags" ; then
14325
14326         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14327         CFLAGS="${CFLAGS}$cf_new_cflags"
14328
14329 fi
14330
14331 if test -n "$cf_new_cppflags" ; then
14332
14333         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14334         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14335
14336 fi
14337
14338 if test -n "$cf_new_extra_cppflags" ; then
14339
14340         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14341         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14342
14343 fi
14344
14345 cf_add_libs="$LIBS"
14346 # reverse order
14347 cf_add_0lib=
14348 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14349 # filter duplicates
14350 for cf_add_1lib in $cf_add_0lib; do
14351         for cf_add_2lib in $cf_add_libs; do
14352                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14353                         cf_add_1lib=
14354                         break
14355                 fi
14356         done
14357         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14358 done
14359 LIBS="$cf_add_libs"
14360
14361         :
14362 else
14363         cf_pkgconfig_incs=
14364         cf_pkgconfig_libs=
14365         { echo "$as_me:14365: WARNING: unable to find ICE library" >&5
14366 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14367 fi
14368
14369 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14370         test -n "$verbose" && echo "    found package sm" 1>&6
14371
14372 echo "${as_me:-configure}:14372: testing found package sm ..." 1>&5
14373
14374         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14375         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14376         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14377
14378 echo "${as_me:-configure}:14378: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14379
14380         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14381
14382 echo "${as_me:-configure}:14382: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14383
14384 cf_fix_cppflags=no
14385 cf_new_cflags=
14386 cf_new_cppflags=
14387 cf_new_extra_cppflags=
14388
14389 for cf_add_cflags in $cf_pkgconfig_incs
14390 do
14391 case "$cf_fix_cppflags" in
14392 (no)
14393         case "$cf_add_cflags" in
14394         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14395                 case "$cf_add_cflags" in
14396                 (-D*)
14397                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14398
14399                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14400                                 && test -z "${cf_tst_cflags}" \
14401                                 && cf_fix_cppflags=yes
14402
14403                         if test "$cf_fix_cppflags" = yes ; then
14404
14405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14407
14408                                 continue
14409                         elif test "${cf_tst_cflags}" = "\"'" ; then
14410
14411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14413
14414                                 continue
14415                         fi
14416                         ;;
14417                 esac
14418                 case "$CPPFLAGS" in
14419                 (*$cf_add_cflags)
14420                         ;;
14421                 (*)
14422                         case "$cf_add_cflags" in
14423                         (-D*)
14424                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14425
14426 CPPFLAGS=`echo "$CPPFLAGS" | \
14427         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14428                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14429
14430                                 ;;
14431                         esac
14432
14433         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14434         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14435
14436                         ;;
14437                 esac
14438                 ;;
14439         (*)
14440
14441         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14442         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14443
14444                 ;;
14445         esac
14446         ;;
14447 (yes)
14448
14449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14451
14452         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14453
14454         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14455                 && test -z "${cf_tst_cflags}" \
14456                 && cf_fix_cppflags=no
14457         ;;
14458 esac
14459 done
14460
14461 if test -n "$cf_new_cflags" ; then
14462
14463         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14464         CFLAGS="${CFLAGS}$cf_new_cflags"
14465
14466 fi
14467
14468 if test -n "$cf_new_cppflags" ; then
14469
14470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14471         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14472
14473 fi
14474
14475 if test -n "$cf_new_extra_cppflags" ; then
14476
14477         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14478         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14479
14480 fi
14481
14482 cf_add_libs="$LIBS"
14483 # reverse order
14484 cf_add_0lib=
14485 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14486 # filter duplicates
14487 for cf_add_1lib in $cf_add_0lib; do
14488         for cf_add_2lib in $cf_add_libs; do
14489                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14490                         cf_add_1lib=
14491                         break
14492                 fi
14493         done
14494         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14495 done
14496 LIBS="$cf_add_libs"
14497
14498         :
14499 else
14500         cf_pkgconfig_incs=
14501         cf_pkgconfig_libs=
14502         { echo "$as_me:14502: WARNING: unable to find SM library" >&5
14503 echo "$as_me: WARNING: unable to find SM library" >&2;}
14504 fi
14505
14506 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14507         test -n "$verbose" && echo "    found package xt" 1>&6
14508
14509 echo "${as_me:-configure}:14509: testing found package xt ..." 1>&5
14510
14511         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14512         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14513         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14514
14515 echo "${as_me:-configure}:14515: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14516
14517         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14518
14519 echo "${as_me:-configure}:14519: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14520
14521 cf_fix_cppflags=no
14522 cf_new_cflags=
14523 cf_new_cppflags=
14524 cf_new_extra_cppflags=
14525
14526 for cf_add_cflags in $cf_pkgconfig_incs
14527 do
14528 case "$cf_fix_cppflags" in
14529 (no)
14530         case "$cf_add_cflags" in
14531         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14532                 case "$cf_add_cflags" in
14533                 (-D*)
14534                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14535
14536                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14537                                 && test -z "${cf_tst_cflags}" \
14538                                 && cf_fix_cppflags=yes
14539
14540                         if test "$cf_fix_cppflags" = yes ; then
14541
14542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14544
14545                                 continue
14546                         elif test "${cf_tst_cflags}" = "\"'" ; then
14547
14548         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14549         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14550
14551                                 continue
14552                         fi
14553                         ;;
14554                 esac
14555                 case "$CPPFLAGS" in
14556                 (*$cf_add_cflags)
14557                         ;;
14558                 (*)
14559                         case "$cf_add_cflags" in
14560                         (-D*)
14561                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14562
14563 CPPFLAGS=`echo "$CPPFLAGS" | \
14564         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14565                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14566
14567                                 ;;
14568                         esac
14569
14570         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14571         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14572
14573                         ;;
14574                 esac
14575                 ;;
14576         (*)
14577
14578         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14579         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14580
14581                 ;;
14582         esac
14583         ;;
14584 (yes)
14585
14586         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14587         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14588
14589         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14590
14591         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14592                 && test -z "${cf_tst_cflags}" \
14593                 && cf_fix_cppflags=no
14594         ;;
14595 esac
14596 done
14597
14598 if test -n "$cf_new_cflags" ; then
14599
14600         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14601         CFLAGS="${CFLAGS}$cf_new_cflags"
14602
14603 fi
14604
14605 if test -n "$cf_new_cppflags" ; then
14606
14607         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14608         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14609
14610 fi
14611
14612 if test -n "$cf_new_extra_cppflags" ; then
14613
14614         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14615         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14616
14617 fi
14618
14619 cf_add_libs="$LIBS"
14620 # reverse order
14621 cf_add_0lib=
14622 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14623 # filter duplicates
14624 for cf_add_1lib in $cf_add_0lib; do
14625         for cf_add_2lib in $cf_add_libs; do
14626                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14627                         cf_add_1lib=
14628                         break
14629                 fi
14630         done
14631         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14632 done
14633 LIBS="$cf_add_libs"
14634
14635         :
14636 else
14637         cf_pkgconfig_incs=
14638         cf_pkgconfig_libs=
14639         { echo "$as_me:14639: WARNING: unable to find Xt library" >&5
14640 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14641 fi
14642
14643 else
14644         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14645 fi
14646
14647 cf_have_X_LIBS=no
14648
14649 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14650         test -n "$verbose" && echo "    found package xt" 1>&6
14651
14652 echo "${as_me:-configure}:14652: testing found package xt ..." 1>&5
14653
14654         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14655         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14656         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14657
14658 echo "${as_me:-configure}:14658: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14659
14660         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14661
14662 echo "${as_me:-configure}:14662: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14663
14664 cf_fix_cppflags=no
14665 cf_new_cflags=
14666 cf_new_cppflags=
14667 cf_new_extra_cppflags=
14668
14669 for cf_add_cflags in $cf_pkgconfig_incs
14670 do
14671 case "$cf_fix_cppflags" in
14672 (no)
14673         case "$cf_add_cflags" in
14674         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14675                 case "$cf_add_cflags" in
14676                 (-D*)
14677                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14678
14679                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14680                                 && test -z "${cf_tst_cflags}" \
14681                                 && cf_fix_cppflags=yes
14682
14683                         if test "$cf_fix_cppflags" = yes ; then
14684
14685         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14686         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14687
14688                                 continue
14689                         elif test "${cf_tst_cflags}" = "\"'" ; then
14690
14691         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14692         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14693
14694                                 continue
14695                         fi
14696                         ;;
14697                 esac
14698                 case "$CPPFLAGS" in
14699                 (*$cf_add_cflags)
14700                         ;;
14701                 (*)
14702                         case "$cf_add_cflags" in
14703                         (-D*)
14704                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14705
14706 CPPFLAGS=`echo "$CPPFLAGS" | \
14707         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14708                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14709
14710                                 ;;
14711                         esac
14712
14713         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14714         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14715
14716                         ;;
14717                 esac
14718                 ;;
14719         (*)
14720
14721         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14722         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14723
14724                 ;;
14725         esac
14726         ;;
14727 (yes)
14728
14729         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14730         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14731
14732         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14733
14734         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14735                 && test -z "${cf_tst_cflags}" \
14736                 && cf_fix_cppflags=no
14737         ;;
14738 esac
14739 done
14740
14741 if test -n "$cf_new_cflags" ; then
14742
14743         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14744         CFLAGS="${CFLAGS}$cf_new_cflags"
14745
14746 fi
14747
14748 if test -n "$cf_new_cppflags" ; then
14749
14750         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14751         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14752
14753 fi
14754
14755 if test -n "$cf_new_extra_cppflags" ; then
14756
14757         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14758         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14759
14760 fi
14761
14762 cf_add_libs="$LIBS"
14763 # reverse order
14764 cf_add_0lib=
14765 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14766 # filter duplicates
14767 for cf_add_1lib in $cf_add_0lib; do
14768         for cf_add_2lib in $cf_add_libs; do
14769                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14770                         cf_add_1lib=
14771                         break
14772                 fi
14773         done
14774         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14775 done
14776 LIBS="$cf_add_libs"
14777
14778         case "x$LIBS" in
14779         (*-lX11*)
14780                 ;;
14781         (*)
14782 # we have an "xt" package, but it may omit Xt's dependency on X11
14783 echo "$as_me:14783: checking for usable X dependency" >&5
14784 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14785 if test "${cf_cv_xt_x11_compat+set}" = set; then
14786   echo $ECHO_N "(cached) $ECHO_C" >&6
14787 else
14788
14789 cat >"conftest.$ac_ext" <<_ACEOF
14790 #line 14790 "configure"
14791 #include "confdefs.h"
14792
14793 #include <X11/Xlib.h>
14794
14795 int
14796 main (void)
14797 {
14798
14799         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14800         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14801         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14802         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14803
14804   ;
14805   return 0;
14806 }
14807 _ACEOF
14808 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14809 if { (eval echo "$as_me:14809: \"$ac_link\"") >&5
14810   (eval $ac_link) 2>&5
14811   ac_status=$?
14812   echo "$as_me:14812: \$? = $ac_status" >&5
14813   (exit "$ac_status"); } &&
14814          { ac_try='test -s "conftest$ac_exeext"'
14815   { (eval echo "$as_me:14815: \"$ac_try\"") >&5
14816   (eval $ac_try) 2>&5
14817   ac_status=$?
14818   echo "$as_me:14818: \$? = $ac_status" >&5
14819   (exit "$ac_status"); }; }; then
14820   cf_cv_xt_x11_compat=yes
14821 else
14822   echo "$as_me: failed program was:" >&5
14823 cat "conftest.$ac_ext" >&5
14824 cf_cv_xt_x11_compat=no
14825 fi
14826 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14827 fi
14828 echo "$as_me:14828: result: $cf_cv_xt_x11_compat" >&5
14829 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14830                 if test "$cf_cv_xt_x11_compat" = no
14831                 then
14832                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14833
14834 echo "${as_me:-configure}:14834: testing work around broken X11 dependency ..." 1>&5
14835
14836                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14837
14838 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14839         test -n "$verbose" && echo "    found package x11" 1>&6
14840
14841 echo "${as_me:-configure}:14841: testing found package x11 ..." 1>&5
14842
14843         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14844         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14845         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14846
14847 echo "${as_me:-configure}:14847: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14848
14849         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14850
14851 echo "${as_me:-configure}:14851: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14852
14853 cf_fix_cppflags=no
14854 cf_new_cflags=
14855 cf_new_cppflags=
14856 cf_new_extra_cppflags=
14857
14858 for cf_add_cflags in $cf_pkgconfig_incs
14859 do
14860 case "$cf_fix_cppflags" in
14861 (no)
14862         case "$cf_add_cflags" in
14863         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14864                 case "$cf_add_cflags" in
14865                 (-D*)
14866                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14867
14868                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14869                                 && test -z "${cf_tst_cflags}" \
14870                                 && cf_fix_cppflags=yes
14871
14872                         if test "$cf_fix_cppflags" = yes ; then
14873
14874         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14875         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14876
14877                                 continue
14878                         elif test "${cf_tst_cflags}" = "\"'" ; then
14879
14880         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14881         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14882
14883                                 continue
14884                         fi
14885                         ;;
14886                 esac
14887                 case "$CPPFLAGS" in
14888                 (*$cf_add_cflags)
14889                         ;;
14890                 (*)
14891                         case "$cf_add_cflags" in
14892                         (-D*)
14893                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14894
14895 CPPFLAGS=`echo "$CPPFLAGS" | \
14896         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14897                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14898
14899                                 ;;
14900                         esac
14901
14902         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14903         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14904
14905                         ;;
14906                 esac
14907                 ;;
14908         (*)
14909
14910         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14911         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14912
14913                 ;;
14914         esac
14915         ;;
14916 (yes)
14917
14918         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14919         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14920
14921         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14922
14923         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14924                 && test -z "${cf_tst_cflags}" \
14925                 && cf_fix_cppflags=no
14926         ;;
14927 esac
14928 done
14929
14930 if test -n "$cf_new_cflags" ; then
14931
14932         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14933         CFLAGS="${CFLAGS}$cf_new_cflags"
14934
14935 fi
14936
14937 if test -n "$cf_new_cppflags" ; then
14938
14939         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14940         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14941
14942 fi
14943
14944 if test -n "$cf_new_extra_cppflags" ; then
14945
14946         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14947         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14948
14949 fi
14950
14951 cf_add_libs="$LIBS"
14952 # reverse order
14953 cf_add_0lib=
14954 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14955 # filter duplicates
14956 for cf_add_1lib in $cf_add_0lib; do
14957         for cf_add_2lib in $cf_add_libs; do
14958                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14959                         cf_add_1lib=
14960                         break
14961                 fi
14962         done
14963         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14964 done
14965 LIBS="$cf_add_libs"
14966
14967         :
14968 else
14969         cf_pkgconfig_incs=
14970         cf_pkgconfig_libs=
14971
14972 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14973
14974 echo "${as_me:-configure}:14974: testing ...before $LIBS ..." 1>&5
14975
14976 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14977 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14978
14979 echo "${as_me:-configure}:14979: testing ...after  $LIBS ..." 1>&5
14980
14981 fi
14982
14983                 fi
14984                 ;;
14985         esac
14986
14987 echo "$as_me:14987: checking for usable X Toolkit package" >&5
14988 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14989 if test "${cf_cv_xt_ice_compat+set}" = set; then
14990   echo $ECHO_N "(cached) $ECHO_C" >&6
14991 else
14992
14993 cat >"conftest.$ac_ext" <<_ACEOF
14994 #line 14994 "configure"
14995 #include "confdefs.h"
14996
14997 #include <X11/Shell.h>
14998
14999 int
15000 main (void)
15001 {
15002 int num = IceConnectionNumber(0); (void) num
15003
15004   ;
15005   return 0;
15006 }
15007 _ACEOF
15008 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15009 if { (eval echo "$as_me:15009: \"$ac_link\"") >&5
15010   (eval $ac_link) 2>&5
15011   ac_status=$?
15012   echo "$as_me:15012: \$? = $ac_status" >&5
15013   (exit "$ac_status"); } &&
15014          { ac_try='test -s "conftest$ac_exeext"'
15015   { (eval echo "$as_me:15015: \"$ac_try\"") >&5
15016   (eval $ac_try) 2>&5
15017   ac_status=$?
15018   echo "$as_me:15018: \$? = $ac_status" >&5
15019   (exit "$ac_status"); }; }; then
15020   cf_cv_xt_ice_compat=yes
15021 else
15022   echo "$as_me: failed program was:" >&5
15023 cat "conftest.$ac_ext" >&5
15024 cf_cv_xt_ice_compat=no
15025 fi
15026 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15027 fi
15028 echo "$as_me:15028: result: $cf_cv_xt_ice_compat" >&5
15029 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
15030
15031         if test "$cf_cv_xt_ice_compat" = no
15032         then
15033                 # workaround for broken ".pc" files used for X Toolkit.
15034                 case "x$X_PRE_LIBS" in
15035                 (*-lICE*)
15036                         case "x$LIBS" in
15037                         (*-lICE*)
15038                                 ;;
15039                         (*)
15040                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
15041
15042 echo "${as_me:-configure}:15042: testing work around broken ICE dependency ..." 1>&5
15043
15044 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
15045         test -n "$verbose" && echo "    found package ice" 1>&6
15046
15047 echo "${as_me:-configure}:15047: testing found package ice ..." 1>&5
15048
15049         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
15050         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
15051         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
15052
15053 echo "${as_me:-configure}:15053: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15054
15055         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
15056
15057 echo "${as_me:-configure}:15057: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
15058
15059 cf_fix_cppflags=no
15060 cf_new_cflags=
15061 cf_new_cppflags=
15062 cf_new_extra_cppflags=
15063
15064 for cf_add_cflags in $cf_pkgconfig_incs
15065 do
15066 case "$cf_fix_cppflags" in
15067 (no)
15068         case "$cf_add_cflags" in
15069         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15070                 case "$cf_add_cflags" in
15071                 (-D*)
15072                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15073
15074                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15075                                 && test -z "${cf_tst_cflags}" \
15076                                 && cf_fix_cppflags=yes
15077
15078                         if test "$cf_fix_cppflags" = yes ; then
15079
15080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15082
15083                                 continue
15084                         elif test "${cf_tst_cflags}" = "\"'" ; then
15085
15086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15088
15089                                 continue
15090                         fi
15091                         ;;
15092                 esac
15093                 case "$CPPFLAGS" in
15094                 (*$cf_add_cflags)
15095                         ;;
15096                 (*)
15097                         case "$cf_add_cflags" in
15098                         (-D*)
15099                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15100
15101 CPPFLAGS=`echo "$CPPFLAGS" | \
15102         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15103                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15104
15105                                 ;;
15106                         esac
15107
15108         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15109         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15110
15111                         ;;
15112                 esac
15113                 ;;
15114         (*)
15115
15116         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15117         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15118
15119                 ;;
15120         esac
15121         ;;
15122 (yes)
15123
15124         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15125         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15126
15127         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15128
15129         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15130                 && test -z "${cf_tst_cflags}" \
15131                 && cf_fix_cppflags=no
15132         ;;
15133 esac
15134 done
15135
15136 if test -n "$cf_new_cflags" ; then
15137
15138         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15139         CFLAGS="${CFLAGS}$cf_new_cflags"
15140
15141 fi
15142
15143 if test -n "$cf_new_cppflags" ; then
15144
15145         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15146         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15147
15148 fi
15149
15150 if test -n "$cf_new_extra_cppflags" ; then
15151
15152         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15153         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15154
15155 fi
15156
15157 cf_add_libs="$LIBS"
15158 # reverse order
15159 cf_add_0lib=
15160 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15161 # filter duplicates
15162 for cf_add_1lib in $cf_add_0lib; do
15163         for cf_add_2lib in $cf_add_libs; do
15164                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15165                         cf_add_1lib=
15166                         break
15167                 fi
15168         done
15169         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15170 done
15171 LIBS="$cf_add_libs"
15172
15173 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
15174         test -n "$verbose" && echo "    found package sm" 1>&6
15175
15176 echo "${as_me:-configure}:15176: testing found package sm ..." 1>&5
15177
15178         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
15179         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
15180         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
15181
15182 echo "${as_me:-configure}:15182: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15183
15184         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
15185
15186 echo "${as_me:-configure}:15186: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
15187
15188 cf_fix_cppflags=no
15189 cf_new_cflags=
15190 cf_new_cppflags=
15191 cf_new_extra_cppflags=
15192
15193 for cf_add_cflags in $cf_pkgconfig_incs
15194 do
15195 case "$cf_fix_cppflags" in
15196 (no)
15197         case "$cf_add_cflags" in
15198         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15199                 case "$cf_add_cflags" in
15200                 (-D*)
15201                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15202
15203                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15204                                 && test -z "${cf_tst_cflags}" \
15205                                 && cf_fix_cppflags=yes
15206
15207                         if test "$cf_fix_cppflags" = yes ; then
15208
15209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15211
15212                                 continue
15213                         elif test "${cf_tst_cflags}" = "\"'" ; then
15214
15215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15217
15218                                 continue
15219                         fi
15220                         ;;
15221                 esac
15222                 case "$CPPFLAGS" in
15223                 (*$cf_add_cflags)
15224                         ;;
15225                 (*)
15226                         case "$cf_add_cflags" in
15227                         (-D*)
15228                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15229
15230 CPPFLAGS=`echo "$CPPFLAGS" | \
15231         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15232                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15233
15234                                 ;;
15235                         esac
15236
15237         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15238         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15239
15240                         ;;
15241                 esac
15242                 ;;
15243         (*)
15244
15245         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15246         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15247
15248                 ;;
15249         esac
15250         ;;
15251 (yes)
15252
15253         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15254         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15255
15256         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15257
15258         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15259                 && test -z "${cf_tst_cflags}" \
15260                 && cf_fix_cppflags=no
15261         ;;
15262 esac
15263 done
15264
15265 if test -n "$cf_new_cflags" ; then
15266
15267         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15268         CFLAGS="${CFLAGS}$cf_new_cflags"
15269
15270 fi
15271
15272 if test -n "$cf_new_cppflags" ; then
15273
15274         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15275         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15276
15277 fi
15278
15279 if test -n "$cf_new_extra_cppflags" ; then
15280
15281         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15282         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15283
15284 fi
15285
15286 cf_add_libs="$LIBS"
15287 # reverse order
15288 cf_add_0lib=
15289 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15290 # filter duplicates
15291 for cf_add_1lib in $cf_add_0lib; do
15292         for cf_add_2lib in $cf_add_libs; do
15293                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15294                         cf_add_1lib=
15295                         break
15296                 fi
15297         done
15298         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15299 done
15300 LIBS="$cf_add_libs"
15301
15302         :
15303 else
15304         cf_pkgconfig_incs=
15305         cf_pkgconfig_libs=
15306         :
15307 fi
15308
15309 else
15310         cf_pkgconfig_incs=
15311         cf_pkgconfig_libs=
15312
15313 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15314
15315 echo "${as_me:-configure}:15315: testing ...before $LIBS ..." 1>&5
15316
15317 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
15318 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15319
15320 echo "${as_me:-configure}:15320: testing ...after  $LIBS ..." 1>&5
15321
15322 fi
15323
15324                                 ;;
15325                         esac
15326                         ;;
15327                 esac
15328         fi
15329
15330         cf_have_X_LIBS=yes
15331
15332 else
15333         cf_pkgconfig_incs=
15334         cf_pkgconfig_libs=
15335
15336         LDFLAGS="$X_LIBS $LDFLAGS"
15337
15338 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15339
15340 echo "${as_me:-configure}:15340: testing checking additions to CFLAGS ..." 1>&5
15341
15342 cf_check_cflags="$CFLAGS"
15343 cf_check_cppflags="$CPPFLAGS"
15344
15345 cf_fix_cppflags=no
15346 cf_new_cflags=
15347 cf_new_cppflags=
15348 cf_new_extra_cppflags=
15349
15350 for cf_add_cflags in $X_CFLAGS
15351 do
15352 case "$cf_fix_cppflags" in
15353 (no)
15354         case "$cf_add_cflags" in
15355         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15356                 case "$cf_add_cflags" in
15357                 (-D*)
15358                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15359
15360                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15361                                 && test -z "${cf_tst_cflags}" \
15362                                 && cf_fix_cppflags=yes
15363
15364                         if test "$cf_fix_cppflags" = yes ; then
15365
15366         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15367         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15368
15369                                 continue
15370                         elif test "${cf_tst_cflags}" = "\"'" ; then
15371
15372         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15373         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15374
15375                                 continue
15376                         fi
15377                         ;;
15378                 esac
15379                 case "$CPPFLAGS" in
15380                 (*$cf_add_cflags)
15381                         ;;
15382                 (*)
15383                         case "$cf_add_cflags" in
15384                         (-D*)
15385                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15386
15387 CPPFLAGS=`echo "$CPPFLAGS" | \
15388         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15389                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15390
15391                                 ;;
15392                         esac
15393
15394         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15395         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15396
15397                         ;;
15398                 esac
15399                 ;;
15400         (*)
15401
15402         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15403         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15404
15405                 ;;
15406         esac
15407         ;;
15408 (yes)
15409
15410         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15411         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15412
15413         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15414
15415         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15416                 && test -z "${cf_tst_cflags}" \
15417                 && cf_fix_cppflags=no
15418         ;;
15419 esac
15420 done
15421
15422 if test -n "$cf_new_cflags" ; then
15423         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15424
15425 echo "${as_me:-configure}:15425: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15426
15427         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15428         CFLAGS="${CFLAGS}$cf_new_cflags"
15429
15430 fi
15431
15432 if test -n "$cf_new_cppflags" ; then
15433         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15434
15435 echo "${as_me:-configure}:15435: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15436
15437         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15438         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15439
15440 fi
15441
15442 if test -n "$cf_new_extra_cppflags" ; then
15443         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15444
15445 echo "${as_me:-configure}:15445: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15446
15447         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15448         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15449
15450 fi
15451
15452 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15453 cat >"conftest.$ac_ext" <<_ACEOF
15454 #line 15454 "configure"
15455 #include "confdefs.h"
15456 #include <stdio.h>
15457 int
15458 main (void)
15459 {
15460 printf("Hello world");
15461   ;
15462   return 0;
15463 }
15464 _ACEOF
15465 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15466 if { (eval echo "$as_me:15466: \"$ac_link\"") >&5
15467   (eval $ac_link) 2>&5
15468   ac_status=$?
15469   echo "$as_me:15469: \$? = $ac_status" >&5
15470   (exit "$ac_status"); } &&
15471          { ac_try='test -s "conftest$ac_exeext"'
15472   { (eval echo "$as_me:15472: \"$ac_try\"") >&5
15473   (eval $ac_try) 2>&5
15474   ac_status=$?
15475   echo "$as_me:15475: \$? = $ac_status" >&5
15476   (exit "$ac_status"); }; }; then
15477   :
15478 else
15479   echo "$as_me: failed program was:" >&5
15480 cat "conftest.$ac_ext" >&5
15481 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15482
15483 echo "${as_me:-configure}:15483: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15484
15485          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15486                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15487
15488 echo "${as_me:-configure}:15488: testing but keeping change to \$CPPFLAGS ..." 1>&5
15489
15490          fi
15491          CFLAGS="$cf_check_cflags"
15492 fi
15493 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15494 fi
15495
15496         echo "$as_me:15496: checking for XOpenDisplay" >&5
15497 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15498 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15499   echo $ECHO_N "(cached) $ECHO_C" >&6
15500 else
15501   cat >"conftest.$ac_ext" <<_ACEOF
15502 #line 15502 "configure"
15503 #include "confdefs.h"
15504 #define XOpenDisplay autoconf_temporary
15505 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15506 #undef XOpenDisplay
15507
15508 #ifdef __cplusplus
15509 extern "C"
15510 #endif
15511
15512 /* We use char because int might match the return type of a gcc2
15513    builtin and then its argument prototype would still apply.  */
15514 char XOpenDisplay (void);
15515
15516 int
15517 main (void)
15518 {
15519
15520 /* The GNU C library defines stubs for functions which it implements
15521     to always fail with ENOSYS.  Some functions are actually named
15522     something starting with __ and the normal name is an alias.  */
15523 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15524 #error found stub for XOpenDisplay
15525 #endif
15526
15527         return XOpenDisplay ();
15528   ;
15529   return 0;
15530 }
15531 _ACEOF
15532 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15533 if { (eval echo "$as_me:15533: \"$ac_link\"") >&5
15534   (eval $ac_link) 2>&5
15535   ac_status=$?
15536   echo "$as_me:15536: \$? = $ac_status" >&5
15537   (exit "$ac_status"); } &&
15538          { ac_try='test -s "conftest$ac_exeext"'
15539   { (eval echo "$as_me:15539: \"$ac_try\"") >&5
15540   (eval $ac_try) 2>&5
15541   ac_status=$?
15542   echo "$as_me:15542: \$? = $ac_status" >&5
15543   (exit "$ac_status"); }; }; then
15544   ac_cv_func_XOpenDisplay=yes
15545 else
15546   echo "$as_me: failed program was:" >&5
15547 cat "conftest.$ac_ext" >&5
15548 ac_cv_func_XOpenDisplay=no
15549 fi
15550 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15551 fi
15552 echo "$as_me:15552: result: $ac_cv_func_XOpenDisplay" >&5
15553 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15554 if test "$ac_cv_func_XOpenDisplay" = yes; then
15555   :
15556 else
15557
15558         echo "$as_me:15558: checking for XOpenDisplay in -lX11" >&5
15559 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15560 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15561   echo $ECHO_N "(cached) $ECHO_C" >&6
15562 else
15563   ac_check_lib_save_LIBS=$LIBS
15564 LIBS="-lX11  $LIBS"
15565 cat >"conftest.$ac_ext" <<_ACEOF
15566 #line 15566 "configure"
15567 #include "confdefs.h"
15568
15569 /* Override any gcc2 internal prototype to avoid an error.  */
15570 #ifdef __cplusplus
15571 extern "C"
15572 #endif
15573 /* We use char because int might match the return type of a gcc2
15574    builtin and then its argument prototype would still apply.  */
15575 char XOpenDisplay ();
15576 int
15577 main (void)
15578 {
15579 XOpenDisplay ();
15580   ;
15581   return 0;
15582 }
15583 _ACEOF
15584 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15585 if { (eval echo "$as_me:15585: \"$ac_link\"") >&5
15586   (eval $ac_link) 2>&5
15587   ac_status=$?
15588   echo "$as_me:15588: \$? = $ac_status" >&5
15589   (exit "$ac_status"); } &&
15590          { ac_try='test -s "conftest$ac_exeext"'
15591   { (eval echo "$as_me:15591: \"$ac_try\"") >&5
15592   (eval $ac_try) 2>&5
15593   ac_status=$?
15594   echo "$as_me:15594: \$? = $ac_status" >&5
15595   (exit "$ac_status"); }; }; then
15596   ac_cv_lib_X11_XOpenDisplay=yes
15597 else
15598   echo "$as_me: failed program was:" >&5
15599 cat "conftest.$ac_ext" >&5
15600 ac_cv_lib_X11_XOpenDisplay=no
15601 fi
15602 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15603 LIBS=$ac_check_lib_save_LIBS
15604 fi
15605 echo "$as_me:15605: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15606 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15607 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15608
15609 cf_add_libs="$LIBS"
15610 # reverse order
15611 cf_add_0lib=
15612 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15613 # filter duplicates
15614 for cf_add_1lib in $cf_add_0lib; do
15615         for cf_add_2lib in $cf_add_libs; do
15616                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15617                         cf_add_1lib=
15618                         break
15619                 fi
15620         done
15621         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15622 done
15623 LIBS="$cf_add_libs"
15624
15625 fi
15626
15627 fi
15628
15629         echo "$as_me:15629: checking for XtAppInitialize" >&5
15630 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15631 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15632   echo $ECHO_N "(cached) $ECHO_C" >&6
15633 else
15634   cat >"conftest.$ac_ext" <<_ACEOF
15635 #line 15635 "configure"
15636 #include "confdefs.h"
15637 #define XtAppInitialize autoconf_temporary
15638 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15639 #undef XtAppInitialize
15640
15641 #ifdef __cplusplus
15642 extern "C"
15643 #endif
15644
15645 /* We use char because int might match the return type of a gcc2
15646    builtin and then its argument prototype would still apply.  */
15647 char XtAppInitialize (void);
15648
15649 int
15650 main (void)
15651 {
15652
15653 /* The GNU C library defines stubs for functions which it implements
15654     to always fail with ENOSYS.  Some functions are actually named
15655     something starting with __ and the normal name is an alias.  */
15656 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15657 #error found stub for XtAppInitialize
15658 #endif
15659
15660         return XtAppInitialize ();
15661   ;
15662   return 0;
15663 }
15664 _ACEOF
15665 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15666 if { (eval echo "$as_me:15666: \"$ac_link\"") >&5
15667   (eval $ac_link) 2>&5
15668   ac_status=$?
15669   echo "$as_me:15669: \$? = $ac_status" >&5
15670   (exit "$ac_status"); } &&
15671          { ac_try='test -s "conftest$ac_exeext"'
15672   { (eval echo "$as_me:15672: \"$ac_try\"") >&5
15673   (eval $ac_try) 2>&5
15674   ac_status=$?
15675   echo "$as_me:15675: \$? = $ac_status" >&5
15676   (exit "$ac_status"); }; }; then
15677   ac_cv_func_XtAppInitialize=yes
15678 else
15679   echo "$as_me: failed program was:" >&5
15680 cat "conftest.$ac_ext" >&5
15681 ac_cv_func_XtAppInitialize=no
15682 fi
15683 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15684 fi
15685 echo "$as_me:15685: result: $ac_cv_func_XtAppInitialize" >&5
15686 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15687 if test "$ac_cv_func_XtAppInitialize" = yes; then
15688   :
15689 else
15690
15691         echo "$as_me:15691: checking for XtAppInitialize in -lXt" >&5
15692 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15693 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15694   echo $ECHO_N "(cached) $ECHO_C" >&6
15695 else
15696   ac_check_lib_save_LIBS=$LIBS
15697 LIBS="-lXt  $LIBS"
15698 cat >"conftest.$ac_ext" <<_ACEOF
15699 #line 15699 "configure"
15700 #include "confdefs.h"
15701
15702 /* Override any gcc2 internal prototype to avoid an error.  */
15703 #ifdef __cplusplus
15704 extern "C"
15705 #endif
15706 /* We use char because int might match the return type of a gcc2
15707    builtin and then its argument prototype would still apply.  */
15708 char XtAppInitialize ();
15709 int
15710 main (void)
15711 {
15712 XtAppInitialize ();
15713   ;
15714   return 0;
15715 }
15716 _ACEOF
15717 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15718 if { (eval echo "$as_me:15718: \"$ac_link\"") >&5
15719   (eval $ac_link) 2>&5
15720   ac_status=$?
15721   echo "$as_me:15721: \$? = $ac_status" >&5
15722   (exit "$ac_status"); } &&
15723          { ac_try='test -s "conftest$ac_exeext"'
15724   { (eval echo "$as_me:15724: \"$ac_try\"") >&5
15725   (eval $ac_try) 2>&5
15726   ac_status=$?
15727   echo "$as_me:15727: \$? = $ac_status" >&5
15728   (exit "$ac_status"); }; }; then
15729   ac_cv_lib_Xt_XtAppInitialize=yes
15730 else
15731   echo "$as_me: failed program was:" >&5
15732 cat "conftest.$ac_ext" >&5
15733 ac_cv_lib_Xt_XtAppInitialize=no
15734 fi
15735 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15736 LIBS=$ac_check_lib_save_LIBS
15737 fi
15738 echo "$as_me:15738: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15739 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15740 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15741
15742 cat >>confdefs.h <<\EOF
15743 #define HAVE_LIBXT 1
15744 EOF
15745
15746                  cf_have_X_LIBS=Xt
15747                  LIBS="-lXt $LIBS"
15748 fi
15749
15750 fi
15751
15752 fi
15753
15754 if test "$cf_have_X_LIBS" = no ; then
15755         { echo "$as_me:15755: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15756 test program.  You will have to check and add the proper libraries by hand
15757 to makefile." >&5
15758 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15759 test program.  You will have to check and add the proper libraries by hand
15760 to makefile." >&2;}
15761 fi
15762
15763 cf_x_athena_root=$cf_x_athena
15764 cf_x_athena_inc=""
15765
15766 for cf_path in default \
15767         /usr/contrib/X11R6 \
15768         /usr/contrib/X11R5 \
15769         /usr/lib/X11R5 \
15770         /usr/local
15771 do
15772         if test -z "$cf_x_athena_inc" ; then
15773
15774 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15775 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15776 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15777 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15778 for cf_X_CFLAGS in $X_CFLAGS
15779 do
15780         case "x$cf_X_CFLAGS" in
15781         x-[IUD]*)
15782                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15783                 ;;
15784         *)
15785                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15786                 ;;
15787         esac
15788 done
15789
15790                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15791                 if test "$cf_path" != default ; then
15792
15793         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15794         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15795
15796                         echo "$as_me:15796: checking for $cf_test in $cf_path" >&5
15797 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15798                 else
15799                         echo "$as_me:15799: checking for $cf_test" >&5
15800 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15801                 fi
15802                 cat >"conftest.$ac_ext" <<_ACEOF
15803 #line 15803 "configure"
15804 #include "confdefs.h"
15805
15806 #include <X11/Intrinsic.h>
15807 #include <$cf_test>
15808 int
15809 main (void)
15810 {
15811
15812   ;
15813   return 0;
15814 }
15815 _ACEOF
15816 rm -f "conftest.$ac_objext"
15817 if { (eval echo "$as_me:15817: \"$ac_compile\"") >&5
15818   (eval $ac_compile) 2>&5
15819   ac_status=$?
15820   echo "$as_me:15820: \$? = $ac_status" >&5
15821   (exit "$ac_status"); } &&
15822          { ac_try='test -s "conftest.$ac_objext"'
15823   { (eval echo "$as_me:15823: \"$ac_try\"") >&5
15824   (eval $ac_try) 2>&5
15825   ac_status=$?
15826   echo "$as_me:15826: \$? = $ac_status" >&5
15827   (exit "$ac_status"); }; }; then
15828   cf_result=yes
15829 else
15830   echo "$as_me: failed program was:" >&5
15831 cat "conftest.$ac_ext" >&5
15832 cf_result=no
15833 fi
15834 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15835                 echo "$as_me:15835: result: $cf_result" >&5
15836 echo "${ECHO_T}$cf_result" >&6
15837
15838 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15839 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15840 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15841
15842                 if test "$cf_result" = yes ; then
15843                         test "$cf_path"  = default && cf_x_athena_inc=default
15844                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15845                         break
15846                 fi
15847         fi
15848 done
15849
15850 if test -z "$cf_x_athena_inc" ; then
15851         { echo "$as_me:15851: WARNING: Unable to find Athena header files" >&5
15852 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15853 elif test "$cf_x_athena_inc" != default ; then
15854
15855         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15856         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15857
15858 fi
15859
15860 cf_x_athena_root=$cf_x_athena
15861 cf_x_athena_lib=""
15862
15863 for cf_path in default \
15864         /usr/contrib/X11R6 \
15865         /usr/contrib/X11R5 \
15866         /usr/lib/X11R5 \
15867         /usr/local
15868 do
15869         for cf_lib in \
15870                 ${cf_x_athena_root} \
15871                 ${cf_x_athena_root}7 \
15872                 ${cf_x_athena_root}6
15873         do
15874         for cf_libs in \
15875                 "-l$cf_lib -lXmu" \
15876                 "-l$cf_lib -lXpm -lXmu" \
15877                 "-l${cf_lib}_s -lXmu_s"
15878         do
15879                 test -n "$cf_x_athena_lib" && break
15880
15881 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15882 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15883 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15884 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15885 for cf_X_CFLAGS in $X_CFLAGS
15886 do
15887         case "x$cf_X_CFLAGS" in
15888         x-[IUD]*)
15889                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15890                 ;;
15891         *)
15892                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15893                 ;;
15894         esac
15895 done
15896
15897                 cf_test=XawSimpleMenuAddGlobalActions
15898                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15899
15900 cf_add_libs="$LIBS"
15901 # reverse order
15902 cf_add_0lib=
15903 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15904 # filter duplicates
15905 for cf_add_1lib in $cf_add_0lib; do
15906         for cf_add_2lib in $cf_add_libs; do
15907                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15908                         cf_add_1lib=
15909                         break
15910                 fi
15911         done
15912         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15913 done
15914 LIBS="$cf_add_libs"
15915
15916                 echo "$as_me:15916: checking for $cf_test in $cf_libs" >&5
15917 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15918                 cat >"conftest.$ac_ext" <<_ACEOF
15919 #line 15919 "configure"
15920 #include "confdefs.h"
15921
15922 #include <X11/Intrinsic.h>
15923 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15924
15925 int
15926 main (void)
15927 {
15928
15929 $cf_test((XtAppContext) 0)
15930   ;
15931   return 0;
15932 }
15933 _ACEOF
15934 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15935 if { (eval echo "$as_me:15935: \"$ac_link\"") >&5
15936   (eval $ac_link) 2>&5
15937   ac_status=$?
15938   echo "$as_me:15938: \$? = $ac_status" >&5
15939   (exit "$ac_status"); } &&
15940          { ac_try='test -s "conftest$ac_exeext"'
15941   { (eval echo "$as_me:15941: \"$ac_try\"") >&5
15942   (eval $ac_try) 2>&5
15943   ac_status=$?
15944   echo "$as_me:15944: \$? = $ac_status" >&5
15945   (exit "$ac_status"); }; }; then
15946   cf_result=yes
15947 else
15948   echo "$as_me: failed program was:" >&5
15949 cat "conftest.$ac_ext" >&5
15950 cf_result=no
15951 fi
15952 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15953                 echo "$as_me:15953: result: $cf_result" >&5
15954 echo "${ECHO_T}$cf_result" >&6
15955
15956 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15957 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15958 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15959
15960                 if test "$cf_result" = yes ; then
15961                         cf_x_athena_lib="$cf_libs"
15962                         break
15963                 fi
15964         done # cf_libs
15965                 test -n "$cf_x_athena_lib" && break
15966         done # cf_lib
15967 done
15968
15969 if test -z "$cf_x_athena_lib" ; then
15970         { { echo "$as_me:15970: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15971 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15972    { (exit 1); exit 1; }; }
15973 fi
15974
15975 cf_add_libs="$LIBS"
15976 # reverse order
15977 cf_add_0lib=
15978 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15979 # filter duplicates
15980 for cf_add_1lib in $cf_add_0lib; do
15981         for cf_add_2lib in $cf_add_libs; do
15982                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15983                         cf_add_1lib=
15984                         break
15985                 fi
15986         done
15987         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15988 done
15989 LIBS="$cf_add_libs"
15990
15991 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15992
15993 cat >>confdefs.h <<EOF
15994 #define $cf_x_athena_LIBS 1
15995 EOF
15996
15997 fi
15998
15999 if test -n "$ac_tool_prefix"; then
16000   for ac_prog in xcurses-config
16001   do
16002     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
16003 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
16004 echo "$as_me:16004: checking for $ac_word" >&5
16005 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16006 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
16007   echo $ECHO_N "(cached) $ECHO_C" >&6
16008 else
16009   if test -n "$XCURSES_CONFIG"; then
16010   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
16011 else
16012   ac_save_IFS=$IFS; IFS=$ac_path_separator
16013 ac_dummy="$PATH"
16014 for ac_dir in $ac_dummy; do
16015   IFS=$ac_save_IFS
16016   test -z "$ac_dir" && ac_dir=.
16017   $as_executable_p "$ac_dir/$ac_word" || continue
16018 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
16019 echo "$as_me:16019: found $ac_dir/$ac_word" >&5
16020 break
16021 done
16022
16023 fi
16024 fi
16025 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
16026 if test -n "$XCURSES_CONFIG"; then
16027   echo "$as_me:16027: result: $XCURSES_CONFIG" >&5
16028 echo "${ECHO_T}$XCURSES_CONFIG" >&6
16029 else
16030   echo "$as_me:16030: result: no" >&5
16031 echo "${ECHO_T}no" >&6
16032 fi
16033
16034     test -n "$XCURSES_CONFIG" && break
16035   done
16036 fi
16037 if test -z "$XCURSES_CONFIG"; then
16038   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
16039   for ac_prog in xcurses-config
16040 do
16041   # Extract the first word of "$ac_prog", so it can be a program name with args.
16042 set dummy $ac_prog; ac_word=$2
16043 echo "$as_me:16043: checking for $ac_word" >&5
16044 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16045 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
16046   echo $ECHO_N "(cached) $ECHO_C" >&6
16047 else
16048   if test -n "$ac_ct_XCURSES_CONFIG"; then
16049   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
16050 else
16051   ac_save_IFS=$IFS; IFS=$ac_path_separator
16052 ac_dummy="$PATH"
16053 for ac_dir in $ac_dummy; do
16054   IFS=$ac_save_IFS
16055   test -z "$ac_dir" && ac_dir=.
16056   $as_executable_p "$ac_dir/$ac_word" || continue
16057 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
16058 echo "$as_me:16058: found $ac_dir/$ac_word" >&5
16059 break
16060 done
16061
16062 fi
16063 fi
16064 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
16065 if test -n "$ac_ct_XCURSES_CONFIG"; then
16066   echo "$as_me:16066: result: $ac_ct_XCURSES_CONFIG" >&5
16067 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
16068 else
16069   echo "$as_me:16069: result: no" >&5
16070 echo "${ECHO_T}no" >&6
16071 fi
16072
16073   test -n "$ac_ct_XCURSES_CONFIG" && break
16074 done
16075 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
16076
16077   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
16078 fi
16079
16080 if test "$XCURSES_CONFIG" != none ; then
16081
16082 cf_fix_cppflags=no
16083 cf_new_cflags=
16084 cf_new_cppflags=
16085 cf_new_extra_cppflags=
16086
16087 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
16088 do
16089 case "$cf_fix_cppflags" in
16090 (no)
16091         case "$cf_add_cflags" in
16092         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16093                 case "$cf_add_cflags" in
16094                 (-D*)
16095                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16096
16097                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16098                                 && test -z "${cf_tst_cflags}" \
16099                                 && cf_fix_cppflags=yes
16100
16101                         if test "$cf_fix_cppflags" = yes ; then
16102
16103         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16104         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16105
16106                                 continue
16107                         elif test "${cf_tst_cflags}" = "\"'" ; then
16108
16109         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16110         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16111
16112                                 continue
16113                         fi
16114                         ;;
16115                 esac
16116                 case "$CPPFLAGS" in
16117                 (*$cf_add_cflags)
16118                         ;;
16119                 (*)
16120                         case "$cf_add_cflags" in
16121                         (-D*)
16122                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16123
16124 CPPFLAGS=`echo "$CPPFLAGS" | \
16125         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16126                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16127
16128                                 ;;
16129                         esac
16130
16131         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16132         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16133
16134                         ;;
16135                 esac
16136                 ;;
16137         (*)
16138
16139         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16140         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16141
16142                 ;;
16143         esac
16144         ;;
16145 (yes)
16146
16147         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16148         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16149
16150         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16151
16152         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16153                 && test -z "${cf_tst_cflags}" \
16154                 && cf_fix_cppflags=no
16155         ;;
16156 esac
16157 done
16158
16159 if test -n "$cf_new_cflags" ; then
16160
16161         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16162         CFLAGS="${CFLAGS}$cf_new_cflags"
16163
16164 fi
16165
16166 if test -n "$cf_new_cppflags" ; then
16167
16168         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16169         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16170
16171 fi
16172
16173 if test -n "$cf_new_extra_cppflags" ; then
16174
16175         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16176         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16177
16178 fi
16179
16180 cf_add_libs="$LIBS"
16181 # reverse order
16182 cf_add_0lib=
16183 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16184 # filter duplicates
16185 for cf_add_1lib in $cf_add_0lib; do
16186         for cf_add_2lib in $cf_add_libs; do
16187                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16188                         cf_add_1lib=
16189                         break
16190                 fi
16191         done
16192         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16193 done
16194 LIBS="$cf_add_libs"
16195
16196 cf_cv_lib_XCurses=yes
16197
16198 else
16199
16200 LDFLAGS="$LDFLAGS $X_LIBS"
16201
16202 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
16203
16204 echo "${as_me:-configure}:16204: testing checking additions to CFLAGS ..." 1>&5
16205
16206 cf_check_cflags="$CFLAGS"
16207 cf_check_cppflags="$CPPFLAGS"
16208
16209 cf_fix_cppflags=no
16210 cf_new_cflags=
16211 cf_new_cppflags=
16212 cf_new_extra_cppflags=
16213
16214 for cf_add_cflags in $X_CFLAGS
16215 do
16216 case "$cf_fix_cppflags" in
16217 (no)
16218         case "$cf_add_cflags" in
16219         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16220                 case "$cf_add_cflags" in
16221                 (-D*)
16222                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16223
16224                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16225                                 && test -z "${cf_tst_cflags}" \
16226                                 && cf_fix_cppflags=yes
16227
16228                         if test "$cf_fix_cppflags" = yes ; then
16229
16230         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16231         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16232
16233                                 continue
16234                         elif test "${cf_tst_cflags}" = "\"'" ; then
16235
16236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16238
16239                                 continue
16240                         fi
16241                         ;;
16242                 esac
16243                 case "$CPPFLAGS" in
16244                 (*$cf_add_cflags)
16245                         ;;
16246                 (*)
16247                         case "$cf_add_cflags" in
16248                         (-D*)
16249                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16250
16251 CPPFLAGS=`echo "$CPPFLAGS" | \
16252         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16253                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16254
16255                                 ;;
16256                         esac
16257
16258         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16259         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16260
16261                         ;;
16262                 esac
16263                 ;;
16264         (*)
16265
16266         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16267         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16268
16269                 ;;
16270         esac
16271         ;;
16272 (yes)
16273
16274         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16275         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16276
16277         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16278
16279         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16280                 && test -z "${cf_tst_cflags}" \
16281                 && cf_fix_cppflags=no
16282         ;;
16283 esac
16284 done
16285
16286 if test -n "$cf_new_cflags" ; then
16287         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
16288
16289 echo "${as_me:-configure}:16289: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
16290
16291         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16292         CFLAGS="${CFLAGS}$cf_new_cflags"
16293
16294 fi
16295
16296 if test -n "$cf_new_cppflags" ; then
16297         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16298
16299 echo "${as_me:-configure}:16299: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
16300
16301         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16302         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16303
16304 fi
16305
16306 if test -n "$cf_new_extra_cppflags" ; then
16307         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16308
16309 echo "${as_me:-configure}:16309: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
16310
16311         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16312         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16313
16314 fi
16315
16316 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
16317 cat >"conftest.$ac_ext" <<_ACEOF
16318 #line 16318 "configure"
16319 #include "confdefs.h"
16320 #include <stdio.h>
16321 int
16322 main (void)
16323 {
16324 printf("Hello world");
16325   ;
16326   return 0;
16327 }
16328 _ACEOF
16329 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16330 if { (eval echo "$as_me:16330: \"$ac_link\"") >&5
16331   (eval $ac_link) 2>&5
16332   ac_status=$?
16333   echo "$as_me:16333: \$? = $ac_status" >&5
16334   (exit "$ac_status"); } &&
16335          { ac_try='test -s "conftest$ac_exeext"'
16336   { (eval echo "$as_me:16336: \"$ac_try\"") >&5
16337   (eval $ac_try) 2>&5
16338   ac_status=$?
16339   echo "$as_me:16339: \$? = $ac_status" >&5
16340   (exit "$ac_status"); }; }; then
16341   :
16342 else
16343   echo "$as_me: failed program was:" >&5
16344 cat "conftest.$ac_ext" >&5
16345 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16346
16347 echo "${as_me:-configure}:16347: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16348
16349          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16350                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16351
16352 echo "${as_me:-configure}:16352: testing but keeping change to \$CPPFLAGS ..." 1>&5
16353
16354          fi
16355          CFLAGS="$cf_check_cflags"
16356 fi
16357 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16358 fi
16359
16360 echo "$as_me:16360: checking for XOpenDisplay in -lX11" >&5
16361 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16362 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16363   echo $ECHO_N "(cached) $ECHO_C" >&6
16364 else
16365   ac_check_lib_save_LIBS=$LIBS
16366 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16367 cat >"conftest.$ac_ext" <<_ACEOF
16368 #line 16368 "configure"
16369 #include "confdefs.h"
16370
16371 /* Override any gcc2 internal prototype to avoid an error.  */
16372 #ifdef __cplusplus
16373 extern "C"
16374 #endif
16375 /* We use char because int might match the return type of a gcc2
16376    builtin and then its argument prototype would still apply.  */
16377 char XOpenDisplay ();
16378 int
16379 main (void)
16380 {
16381 XOpenDisplay ();
16382   ;
16383   return 0;
16384 }
16385 _ACEOF
16386 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16387 if { (eval echo "$as_me:16387: \"$ac_link\"") >&5
16388   (eval $ac_link) 2>&5
16389   ac_status=$?
16390   echo "$as_me:16390: \$? = $ac_status" >&5
16391   (exit "$ac_status"); } &&
16392          { ac_try='test -s "conftest$ac_exeext"'
16393   { (eval echo "$as_me:16393: \"$ac_try\"") >&5
16394   (eval $ac_try) 2>&5
16395   ac_status=$?
16396   echo "$as_me:16396: \$? = $ac_status" >&5
16397   (exit "$ac_status"); }; }; then
16398   ac_cv_lib_X11_XOpenDisplay=yes
16399 else
16400   echo "$as_me: failed program was:" >&5
16401 cat "conftest.$ac_ext" >&5
16402 ac_cv_lib_X11_XOpenDisplay=no
16403 fi
16404 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16405 LIBS=$ac_check_lib_save_LIBS
16406 fi
16407 echo "$as_me:16407: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16408 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16409 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16410
16411 cf_add_libs="$LIBS"
16412 # reverse order
16413 cf_add_0lib=
16414 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16415 # filter duplicates
16416 for cf_add_1lib in $cf_add_0lib; do
16417         for cf_add_2lib in $cf_add_libs; do
16418                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16419                         cf_add_1lib=
16420                         break
16421                 fi
16422         done
16423         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16424 done
16425 LIBS="$cf_add_libs"
16426
16427 fi
16428
16429 echo "$as_me:16429: checking for XCurses library" >&5
16430 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16431 if test "${cf_cv_lib_XCurses+set}" = set; then
16432   echo $ECHO_N "(cached) $ECHO_C" >&6
16433 else
16434
16435 cf_add_libs="$LIBS"
16436 # reverse order
16437 cf_add_0lib=
16438 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16439 # filter duplicates
16440 for cf_add_1lib in $cf_add_0lib; do
16441         for cf_add_2lib in $cf_add_libs; do
16442                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16443                         cf_add_1lib=
16444                         break
16445                 fi
16446         done
16447         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16448 done
16449 LIBS="$cf_add_libs"
16450
16451 cat >"conftest.$ac_ext" <<_ACEOF
16452 #line 16452 "configure"
16453 #include "confdefs.h"
16454
16455 #include <xcurses.h>
16456 char *XCursesProgramName = "test";
16457
16458 int
16459 main (void)
16460 {
16461 XCursesExit();
16462   ;
16463   return 0;
16464 }
16465 _ACEOF
16466 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16467 if { (eval echo "$as_me:16467: \"$ac_link\"") >&5
16468   (eval $ac_link) 2>&5
16469   ac_status=$?
16470   echo "$as_me:16470: \$? = $ac_status" >&5
16471   (exit "$ac_status"); } &&
16472          { ac_try='test -s "conftest$ac_exeext"'
16473   { (eval echo "$as_me:16473: \"$ac_try\"") >&5
16474   (eval $ac_try) 2>&5
16475   ac_status=$?
16476   echo "$as_me:16476: \$? = $ac_status" >&5
16477   (exit "$ac_status"); }; }; then
16478   cf_cv_lib_XCurses=yes
16479 else
16480   echo "$as_me: failed program was:" >&5
16481 cat "conftest.$ac_ext" >&5
16482 cf_cv_lib_XCurses=no
16483 fi
16484 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16485
16486 fi
16487 echo "$as_me:16487: result: $cf_cv_lib_XCurses" >&5
16488 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16489
16490 fi
16491
16492 if test "$cf_cv_lib_XCurses" = yes ; then
16493
16494 cat >>confdefs.h <<\EOF
16495 #define UNIX 1
16496 EOF
16497
16498 cat >>confdefs.h <<\EOF
16499 #define XCURSES 1
16500 EOF
16501
16502         echo "$as_me:16502: checking for xcurses.h" >&5
16503 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16504 if test "${ac_cv_header_xcurses_h+set}" = set; then
16505   echo $ECHO_N "(cached) $ECHO_C" >&6
16506 else
16507   cat >"conftest.$ac_ext" <<_ACEOF
16508 #line 16508 "configure"
16509 #include "confdefs.h"
16510 #include <xcurses.h>
16511 _ACEOF
16512 if { (eval echo "$as_me:16512: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16513   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16514   ac_status=$?
16515   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16516   rm -f conftest.er1
16517   cat conftest.err >&5
16518   echo "$as_me:16518: \$? = $ac_status" >&5
16519   (exit "$ac_status"); } >/dev/null; then
16520   if test -s conftest.err; then
16521     ac_cpp_err=$ac_c_preproc_warn_flag
16522   else
16523     ac_cpp_err=
16524   fi
16525 else
16526   ac_cpp_err=yes
16527 fi
16528 if test -z "$ac_cpp_err"; then
16529   ac_cv_header_xcurses_h=yes
16530 else
16531   echo "$as_me: failed program was:" >&5
16532   cat "conftest.$ac_ext" >&5
16533   ac_cv_header_xcurses_h=no
16534 fi
16535 rm -f conftest.err "conftest.$ac_ext"
16536 fi
16537 echo "$as_me:16537: result: $ac_cv_header_xcurses_h" >&5
16538 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16539 if test "$ac_cv_header_xcurses_h" = yes; then
16540
16541 cat >>confdefs.h <<\EOF
16542 #define HAVE_XCURSES 1
16543 EOF
16544
16545 fi
16546
16547 else
16548         { { echo "$as_me:16548: error: Cannot link with XCurses" >&5
16549 echo "$as_me: error: Cannot link with XCurses" >&2;}
16550    { (exit 1); exit 1; }; }
16551 fi
16552
16553         ;;
16554 (*)
16555         { { echo "$as_me:16555: error: unexpected screen-value: $cf_cv_screen" >&5
16556 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16557    { (exit 1); exit 1; }; }
16558         ;;
16559 esac
16560
16561 : ${cf_nculib_root:=$cf_cv_screen}
16562 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16563 echo "$as_me:16563: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16564 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16565 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16566   echo $ECHO_N "(cached) $ECHO_C" >&6
16567 else
16568   ac_check_lib_save_LIBS=$LIBS
16569 LIBS="-l$cf_nculib_root  $LIBS"
16570 cat >"conftest.$ac_ext" <<_ACEOF
16571 #line 16571 "configure"
16572 #include "confdefs.h"
16573
16574 /* Override any gcc2 internal prototype to avoid an error.  */
16575 #ifdef __cplusplus
16576 extern "C"
16577 #endif
16578 /* We use char because int might match the return type of a gcc2
16579    builtin and then its argument prototype would still apply.  */
16580 char _nc_init_pthreads ();
16581 int
16582 main (void)
16583 {
16584 _nc_init_pthreads ();
16585   ;
16586   return 0;
16587 }
16588 _ACEOF
16589 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16590 if { (eval echo "$as_me:16590: \"$ac_link\"") >&5
16591   (eval $ac_link) 2>&5
16592   ac_status=$?
16593   echo "$as_me:16593: \$? = $ac_status" >&5
16594   (exit "$ac_status"); } &&
16595          { ac_try='test -s "conftest$ac_exeext"'
16596   { (eval echo "$as_me:16596: \"$ac_try\"") >&5
16597   (eval $ac_try) 2>&5
16598   ac_status=$?
16599   echo "$as_me:16599: \$? = $ac_status" >&5
16600   (exit "$ac_status"); }; }; then
16601   eval "$as_ac_Lib=yes"
16602 else
16603   echo "$as_me: failed program was:" >&5
16604 cat "conftest.$ac_ext" >&5
16605 eval "$as_ac_Lib=no"
16606 fi
16607 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16608 LIBS=$ac_check_lib_save_LIBS
16609 fi
16610 echo "$as_me:16610: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16611 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16612 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16613   cf_cv_ncurses_pthreads=yes
16614 else
16615   cf_cv_ncurses_pthreads=no
16616 fi
16617
16618 if test "$cf_cv_ncurses_pthreads" = yes
16619 then
16620
16621 cf_add_libs="$LIBS"
16622 # reverse order
16623 cf_add_0lib=
16624 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16625 # filter duplicates
16626 for cf_add_1lib in $cf_add_0lib; do
16627         for cf_add_2lib in $cf_add_libs; do
16628                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16629                         cf_add_1lib=
16630                         break
16631                 fi
16632         done
16633         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16634 done
16635 LIBS="$cf_add_libs"
16636
16637 fi
16638
16639 case $cf_cv_screen in
16640 (ncurses*)
16641         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16642         ;;
16643 esac
16644
16645 echo "$as_me:16645: checking for X11 rgb file" >&5
16646 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16647
16648 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16649 if test "${with_x11_rgb+set}" = set; then
16650   withval="$with_x11_rgb"
16651   RGB_PATH=$withval
16652 else
16653   RGB_PATH=auto
16654 fi;
16655
16656 if test "x$RGB_PATH" = xauto
16657 then
16658         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16659         for cf_path in \
16660                 /opt/local/share/X11/rgb.txt \
16661                 /opt/X11/share/X11/rgb.txt \
16662                 /usr/share/X11/rgb.txt \
16663                 /usr/X11/share/X11/rgb.txt \
16664                 /usr/X11/lib/X11/rgb.txt \
16665                 /usr/lib/X11/rgb.txt \
16666                 /etc/X11/rgb.txt \
16667                 /usr/pkg/lib/X11/rgb.txt \
16668                 /usr/X11R7/lib/X11/rgb.txt \
16669                 /usr/X11R6/lib/X11/rgb.txt \
16670                 /usr/X11R5/lib/X11/rgb.txt \
16671                 /usr/X11R4/lib/X11/rgb.txt \
16672                 /usr/local/lib/X11/rgb.txt \
16673                 /usr/local/share/X11/rgb.txt \
16674                 /usr/lib64/X11/rgb.txt
16675         do
16676                 if test -f "$cf_path" ; then
16677                         RGB_PATH="$cf_path"
16678                         break
16679                 fi
16680         done
16681 else
16682         cf_path=$RGB_PATH
16683
16684 if test "x$prefix" != xNONE; then
16685         cf_path_syntax="$prefix"
16686 else
16687         cf_path_syntax="$ac_default_prefix"
16688 fi
16689
16690 case ".$cf_path" in
16691 (.\$\(*\)*|.\'*\'*)
16692         ;;
16693 (..|./*|.\\*)
16694         ;;
16695 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16696         ;;
16697 (.\$\{*prefix\}*|.\$\{*dir\}*)
16698         eval cf_path="$cf_path"
16699         case ".$cf_path" in
16700         (.NONE/*)
16701                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16702                 ;;
16703         esac
16704         ;;
16705 (.no|.NONE/*)
16706         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16707         ;;
16708 (*)
16709         { { echo "$as_me:16709: error: expected a pathname, not \"$cf_path\"" >&5
16710 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16711    { (exit 1); exit 1; }; }
16712         ;;
16713 esac
16714
16715 fi
16716
16717 echo "$as_me:16717: result: $RGB_PATH" >&5
16718 echo "${ECHO_T}$RGB_PATH" >&6
16719
16720 cat >>confdefs.h <<EOF
16721 #define RGB_PATH "$cf_path"
16722 EOF
16723
16724 no_x11_rgb=
16725 if test "$RGB_PATH" = no
16726 then
16727         no_x11_rgb="#"
16728 fi
16729
16730 cf_curses_headers=
16731
16732 case $cf_cv_screen in
16733 (pdcurses)
16734         cf_default_panel=no
16735         cf_default_form=no
16736         cf_default_menu=no
16737         cf_default_tinfo=no
16738         ;;
16739 (xcurses|bsdcurses)
16740         cf_default_panel=no
16741         cf_default_form=no
16742         cf_default_menu=no
16743         cf_default_tinfo=yes
16744         ;;
16745 (*)
16746         cf_default_panel=yes
16747         cf_default_form=yes
16748         cf_default_menu=yes
16749         cf_default_tinfo=yes
16750         case $cf_cv_screen in
16751         (ncurses*)
16752                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16753                 ;;
16754         esac
16755         ;;
16756 esac
16757
16758 echo "$as_me:16758: checking for desired basename for form library" >&5
16759 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16760
16761 # Check whether --with-form-libname or --without-form-libname was given.
16762 if test "${with_form_libname+set}" = set; then
16763   withval="$with_form_libname"
16764   with_lib_basename=$withval
16765 else
16766   with_lib_basename=form
16767 fi;
16768 FORM_NAME="$with_lib_basename"
16769
16770 case "x$FORM_NAME" in
16771 (x|xno|xnone|xyes)
16772         FORM_NAME=form
16773         ;;
16774 (*)
16775         ;;
16776 esac
16777
16778 echo "$as_me:16778: result: $FORM_NAME" >&5
16779 echo "${ECHO_T}$FORM_NAME" >&6
16780
16781 echo "$as_me:16781: checking for desired basename for menu library" >&5
16782 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16783
16784 # Check whether --with-menu-libname or --without-menu-libname was given.
16785 if test "${with_menu_libname+set}" = set; then
16786   withval="$with_menu_libname"
16787   with_lib_basename=$withval
16788 else
16789   with_lib_basename=menu
16790 fi;
16791 MENU_NAME="$with_lib_basename"
16792
16793 case "x$MENU_NAME" in
16794 (x|xno|xnone|xyes)
16795         MENU_NAME=menu
16796         ;;
16797 (*)
16798         ;;
16799 esac
16800
16801 echo "$as_me:16801: result: $MENU_NAME" >&5
16802 echo "${ECHO_T}$MENU_NAME" >&6
16803
16804 echo "$as_me:16804: checking for desired basename for panel library" >&5
16805 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16806
16807 # Check whether --with-panel-libname or --without-panel-libname was given.
16808 if test "${with_panel_libname+set}" = set; then
16809   withval="$with_panel_libname"
16810   with_lib_basename=$withval
16811 else
16812   with_lib_basename=panel
16813 fi;
16814 PANEL_NAME="$with_lib_basename"
16815
16816 case "x$PANEL_NAME" in
16817 (x|xno|xnone|xyes)
16818         PANEL_NAME=panel
16819         ;;
16820 (*)
16821         ;;
16822 esac
16823
16824 echo "$as_me:16824: result: $PANEL_NAME" >&5
16825 echo "${ECHO_T}$PANEL_NAME" >&6
16826
16827 echo "$as_me:16827: checking if you want to check for panel functions" >&5
16828 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16829
16830 # Check whether --enable-panel or --disable-panel was given.
16831 if test "${enable_panel+set}" = set; then
16832   enableval="$enable_panel"
16833   test "$enableval" != no && enableval=yes
16834         if test "$enableval" != "yes" ; then
16835     cf_enable_panel=no
16836         else
16837                 cf_enable_panel=$cf_default_panel
16838         fi
16839 else
16840   enableval=yes
16841         cf_enable_panel=$cf_default_panel
16842
16843 fi;
16844 echo "$as_me:16844: result: $cf_enable_panel" >&5
16845 echo "${ECHO_T}$cf_enable_panel" >&6
16846 if test $cf_enable_panel = yes
16847 then
16848
16849 cf_have_curses_lib=no
16850
16851 : ${NCURSES_CONFIG_PKG:=none}
16852 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16853         :
16854 elif test "x${PKG_CONFIG:=none}" != xnone; then
16855         echo "$as_me:16855: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16856 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16857         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16858                 echo "$as_me:16858: result: yes" >&5
16859 echo "${ECHO_T}yes" >&6
16860
16861                 echo "$as_me:16861: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16862 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16863
16864                 cf_save_CFLAGS="$CFLAGS"
16865                 cf_save_CPPFLAGS="$CPPFLAGS"
16866                 cf_save_LIBS="$LIBS"
16867
16868 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16869 do
16870         case "x$cf_add_cflags" in
16871         (x-[DU]*)
16872
16873 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16874 while true
16875 do
16876         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
16877         test "$CFLAGS" != "$cf_old_cflag" || break
16878
16879         CFLAGS="$cf_old_cflag"
16880 done
16881
16882 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16883 while true
16884 do
16885         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
16886         test "$CPPFLAGS" != "$cf_old_cflag" || break
16887
16888         CPPFLAGS="$cf_old_cflag"
16889 done
16890
16891                 ;;
16892         esac
16893
16894 cf_fix_cppflags=no
16895 cf_new_cflags=
16896 cf_new_cppflags=
16897 cf_new_extra_cppflags=
16898
16899 for cf_add_cflags in $cf_add_cflags
16900 do
16901 case "$cf_fix_cppflags" in
16902 (no)
16903         case "$cf_add_cflags" in
16904         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16905                 case "$cf_add_cflags" in
16906                 (-D*)
16907                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16908
16909                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16910                                 && test -z "${cf_tst_cflags}" \
16911                                 && cf_fix_cppflags=yes
16912
16913                         if test "$cf_fix_cppflags" = yes ; then
16914
16915         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16916         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16917
16918                                 continue
16919                         elif test "${cf_tst_cflags}" = "\"'" ; then
16920
16921         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16922         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16923
16924                                 continue
16925                         fi
16926                         ;;
16927                 esac
16928                 case "$CPPFLAGS" in
16929                 (*$cf_add_cflags)
16930                         ;;
16931                 (*)
16932                         case "$cf_add_cflags" in
16933                         (-D*)
16934                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16935
16936 CPPFLAGS=`echo "$CPPFLAGS" | \
16937         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16938                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16939
16940                                 ;;
16941                         esac
16942
16943         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16944         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16945
16946                         ;;
16947                 esac
16948                 ;;
16949         (*)
16950
16951         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16952         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16953
16954                 ;;
16955         esac
16956         ;;
16957 (yes)
16958
16959         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16960         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16961
16962         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16963
16964         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16965                 && test -z "${cf_tst_cflags}" \
16966                 && cf_fix_cppflags=no
16967         ;;
16968 esac
16969 done
16970
16971 if test -n "$cf_new_cflags" ; then
16972
16973         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16974         CFLAGS="${CFLAGS}$cf_new_cflags"
16975
16976 fi
16977
16978 if test -n "$cf_new_cppflags" ; then
16979
16980         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16981         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16982
16983 fi
16984
16985 if test -n "$cf_new_extra_cppflags" ; then
16986
16987         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16988         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16989
16990 fi
16991
16992 done
16993
16994 cf_add_libs="$LIBS"
16995 # reverse order
16996 cf_add_0lib=
16997 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16998 # filter duplicates
16999 for cf_add_1lib in $cf_add_0lib; do
17000         for cf_add_2lib in $cf_add_libs; do
17001                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17002                         cf_add_1lib=
17003                         break
17004                 fi
17005         done
17006         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17007 done
17008 LIBS="$cf_add_libs"
17009
17010                 cat >"conftest.$ac_ext" <<_ACEOF
17011 #line 17011 "configure"
17012 #include "confdefs.h"
17013 #include <$PANEL_NAME.h>
17014 int
17015 main (void)
17016 {
17017 (void) new_panel ( 0 );
17018   ;
17019   return 0;
17020 }
17021 _ACEOF
17022 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17023 if { (eval echo "$as_me:17023: \"$ac_link\"") >&5
17024   (eval $ac_link) 2>&5
17025   ac_status=$?
17026   echo "$as_me:17026: \$? = $ac_status" >&5
17027   (exit "$ac_status"); } &&
17028          { ac_try='test -s "conftest$ac_exeext"'
17029   { (eval echo "$as_me:17029: \"$ac_try\"") >&5
17030   (eval $ac_try) 2>&5
17031   ac_status=$?
17032   echo "$as_me:17032: \$? = $ac_status" >&5
17033   (exit "$ac_status"); }; }; then
17034   if test "$cross_compiling" = yes; then
17035   cf_have_curses_lib=maybe
17036 else
17037   cat >"conftest.$ac_ext" <<_ACEOF
17038 #line 17038 "configure"
17039 #include "confdefs.h"
17040 #include <$PANEL_NAME.h>
17041                                 int main(void)
17042                                 { (void) new_panel ( 0 ); return 0; }
17043 _ACEOF
17044 rm -f "conftest$ac_exeext"
17045 if { (eval echo "$as_me:17045: \"$ac_link\"") >&5
17046   (eval $ac_link) 2>&5
17047   ac_status=$?
17048   echo "$as_me:17048: \$? = $ac_status" >&5
17049   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17050   { (eval echo "$as_me:17050: \"$ac_try\"") >&5
17051   (eval $ac_try) 2>&5
17052   ac_status=$?
17053   echo "$as_me:17053: \$? = $ac_status" >&5
17054   (exit "$ac_status"); }; }; then
17055   cf_have_curses_lib=yes
17056 else
17057   echo "$as_me: program exited with status $ac_status" >&5
17058 echo "$as_me: failed program was:" >&5
17059 cat "conftest.$ac_ext" >&5
17060 cf_have_curses_lib=no
17061 fi
17062 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17063 fi
17064 else
17065   echo "$as_me: failed program was:" >&5
17066 cat "conftest.$ac_ext" >&5
17067 cf_have_curses_lib=no
17068 fi
17069 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17070                 echo "$as_me:17070: result: $cf_have_curses_lib" >&5
17071 echo "${ECHO_T}$cf_have_curses_lib" >&6
17072                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17073                 if test "$cf_have_curses_lib" = "yes"
17074                 then
17075
17076 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17077
17078                         cat >>confdefs.h <<EOF
17079 #define $cf_upper 1
17080 EOF
17081
17082                 else
17083                         CFLAGS="$cf_save_CFLAGS"
17084                         CPPFLAGS="$cf_save_CPPFLAGS"
17085                         LIBS="$cf_save_LIBS"
17086                 fi
17087         fi
17088 fi
17089 if test "$cf_have_curses_lib" = no; then
17090         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
17091 echo "$as_me:17091: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
17092 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17093 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17094   echo $ECHO_N "(cached) $ECHO_C" >&6
17095 else
17096   ac_check_lib_save_LIBS=$LIBS
17097 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
17098 cat >"conftest.$ac_ext" <<_ACEOF
17099 #line 17099 "configure"
17100 #include "confdefs.h"
17101
17102 /* Override any gcc2 internal prototype to avoid an error.  */
17103 #ifdef __cplusplus
17104 extern "C"
17105 #endif
17106 /* We use char because int might match the return type of a gcc2
17107    builtin and then its argument prototype would still apply.  */
17108 char new_panel ();
17109 int
17110 main (void)
17111 {
17112 new_panel ();
17113   ;
17114   return 0;
17115 }
17116 _ACEOF
17117 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17118 if { (eval echo "$as_me:17118: \"$ac_link\"") >&5
17119   (eval $ac_link) 2>&5
17120   ac_status=$?
17121   echo "$as_me:17121: \$? = $ac_status" >&5
17122   (exit "$ac_status"); } &&
17123          { ac_try='test -s "conftest$ac_exeext"'
17124   { (eval echo "$as_me:17124: \"$ac_try\"") >&5
17125   (eval $ac_try) 2>&5
17126   ac_status=$?
17127   echo "$as_me:17127: \$? = $ac_status" >&5
17128   (exit "$ac_status"); }; }; then
17129   eval "$as_ac_Lib=yes"
17130 else
17131   echo "$as_me: failed program was:" >&5
17132 cat "conftest.$ac_ext" >&5
17133 eval "$as_ac_Lib=no"
17134 fi
17135 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17136 LIBS=$ac_check_lib_save_LIBS
17137 fi
17138 echo "$as_me:17138: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17139 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17140 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17141
17142 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17143
17144 cf_add_libs="$LIBS"
17145 # reverse order
17146 cf_add_0lib=
17147 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17148 # filter duplicates
17149 for cf_add_1lib in $cf_add_0lib; do
17150         for cf_add_2lib in $cf_add_libs; do
17151                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17152                         cf_add_1lib=
17153                         break
17154                 fi
17155         done
17156         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17157 done
17158 LIBS="$cf_add_libs"
17159
17160                 cat >>confdefs.h <<EOF
17161 #define $cf_upper 1
17162 EOF
17163
17164 fi
17165
17166 fi
17167
17168         cf_curses_headers="$cf_curses_headers panel.h"
17169 fi
17170
17171 echo "$as_me:17171: checking if you want to check for menu functions" >&5
17172 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
17173
17174 # Check whether --enable-menu or --disable-menu was given.
17175 if test "${enable_menu+set}" = set; then
17176   enableval="$enable_menu"
17177   test "$enableval" != no && enableval=yes
17178         if test "$enableval" != "yes" ; then
17179     cf_enable_menu=no
17180         else
17181                 cf_enable_menu=$cf_default_menu
17182         fi
17183 else
17184   enableval=yes
17185         cf_enable_menu=$cf_default_menu
17186
17187 fi;
17188 echo "$as_me:17188: result: $cf_enable_menu" >&5
17189 echo "${ECHO_T}$cf_enable_menu" >&6
17190 if test $cf_enable_menu = yes
17191 then
17192         case $cf_cv_screen in
17193         (ncurses*)
17194                 ;;
17195         (curses*)
17196
17197 echo "$as_me:17197: checking for NetBSD menu.h" >&5
17198 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
17199 if test "${cf_cv_netbsd_menu_h+set}" = set; then
17200   echo $ECHO_N "(cached) $ECHO_C" >&6
17201 else
17202
17203 cat >"conftest.$ac_ext" <<_ACEOF
17204 #line 17204 "configure"
17205 #include "confdefs.h"
17206
17207 #include <${cf_cv_ncurses_header:-curses.h}>
17208 #include <menu.h>
17209
17210 int
17211 main (void)
17212 {
17213
17214         MENU *menu;
17215         int y = menu->max_item_width;
17216
17217   ;
17218   return 0;
17219 }
17220 _ACEOF
17221 rm -f "conftest.$ac_objext"
17222 if { (eval echo "$as_me:17222: \"$ac_compile\"") >&5
17223   (eval $ac_compile) 2>&5
17224   ac_status=$?
17225   echo "$as_me:17225: \$? = $ac_status" >&5
17226   (exit "$ac_status"); } &&
17227          { ac_try='test -s "conftest.$ac_objext"'
17228   { (eval echo "$as_me:17228: \"$ac_try\"") >&5
17229   (eval $ac_try) 2>&5
17230   ac_status=$?
17231   echo "$as_me:17231: \$? = $ac_status" >&5
17232   (exit "$ac_status"); }; }; then
17233   cf_cv_netbsd_menu_h=yes
17234
17235 else
17236   echo "$as_me: failed program was:" >&5
17237 cat "conftest.$ac_ext" >&5
17238 cf_cv_netbsd_menu_h=no
17239 fi
17240 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17241
17242 fi
17243 echo "$as_me:17243: result: $cf_cv_netbsd_menu_h" >&5
17244 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
17245
17246 test "$cf_cv_netbsd_menu_h" = yes &&
17247 cat >>confdefs.h <<\EOF
17248 #define HAVE_NETBSD_MENU_H 1
17249 EOF
17250
17251                 ;;
17252         esac
17253
17254 cf_have_curses_lib=no
17255
17256 : ${NCURSES_CONFIG_PKG:=none}
17257 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17258         :
17259 elif test "x${PKG_CONFIG:=none}" != xnone; then
17260         echo "$as_me:17260: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
17261 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17262         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
17263                 echo "$as_me:17263: result: yes" >&5
17264 echo "${ECHO_T}yes" >&6
17265
17266                 echo "$as_me:17266: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
17267 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17268
17269                 cf_save_CFLAGS="$CFLAGS"
17270                 cf_save_CPPFLAGS="$CPPFLAGS"
17271                 cf_save_LIBS="$LIBS"
17272
17273 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
17274 do
17275         case "x$cf_add_cflags" in
17276         (x-[DU]*)
17277
17278 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17279 while true
17280 do
17281         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17282         test "$CFLAGS" != "$cf_old_cflag" || break
17283
17284         CFLAGS="$cf_old_cflag"
17285 done
17286
17287 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17288 while true
17289 do
17290         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17291         test "$CPPFLAGS" != "$cf_old_cflag" || break
17292
17293         CPPFLAGS="$cf_old_cflag"
17294 done
17295
17296                 ;;
17297         esac
17298
17299 cf_fix_cppflags=no
17300 cf_new_cflags=
17301 cf_new_cppflags=
17302 cf_new_extra_cppflags=
17303
17304 for cf_add_cflags in $cf_add_cflags
17305 do
17306 case "$cf_fix_cppflags" in
17307 (no)
17308         case "$cf_add_cflags" in
17309         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17310                 case "$cf_add_cflags" in
17311                 (-D*)
17312                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17313
17314                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17315                                 && test -z "${cf_tst_cflags}" \
17316                                 && cf_fix_cppflags=yes
17317
17318                         if test "$cf_fix_cppflags" = yes ; then
17319
17320         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17321         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17322
17323                                 continue
17324                         elif test "${cf_tst_cflags}" = "\"'" ; then
17325
17326         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17327         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17328
17329                                 continue
17330                         fi
17331                         ;;
17332                 esac
17333                 case "$CPPFLAGS" in
17334                 (*$cf_add_cflags)
17335                         ;;
17336                 (*)
17337                         case "$cf_add_cflags" in
17338                         (-D*)
17339                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17340
17341 CPPFLAGS=`echo "$CPPFLAGS" | \
17342         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17343                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17344
17345                                 ;;
17346                         esac
17347
17348         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17349         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17350
17351                         ;;
17352                 esac
17353                 ;;
17354         (*)
17355
17356         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17357         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17358
17359                 ;;
17360         esac
17361         ;;
17362 (yes)
17363
17364         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17365         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17366
17367         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17368
17369         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17370                 && test -z "${cf_tst_cflags}" \
17371                 && cf_fix_cppflags=no
17372         ;;
17373 esac
17374 done
17375
17376 if test -n "$cf_new_cflags" ; then
17377
17378         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17379         CFLAGS="${CFLAGS}$cf_new_cflags"
17380
17381 fi
17382
17383 if test -n "$cf_new_cppflags" ; then
17384
17385         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17386         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17387
17388 fi
17389
17390 if test -n "$cf_new_extra_cppflags" ; then
17391
17392         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17393         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17394
17395 fi
17396
17397 done
17398
17399 cf_add_libs="$LIBS"
17400 # reverse order
17401 cf_add_0lib=
17402 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17403 # filter duplicates
17404 for cf_add_1lib in $cf_add_0lib; do
17405         for cf_add_2lib in $cf_add_libs; do
17406                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17407                         cf_add_1lib=
17408                         break
17409                 fi
17410         done
17411         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17412 done
17413 LIBS="$cf_add_libs"
17414
17415                 cat >"conftest.$ac_ext" <<_ACEOF
17416 #line 17416 "configure"
17417 #include "confdefs.h"
17418 #include <$MENU_NAME.h>
17419 int
17420 main (void)
17421 {
17422 (void) menu_driver ( 0,0 );
17423   ;
17424   return 0;
17425 }
17426 _ACEOF
17427 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17428 if { (eval echo "$as_me:17428: \"$ac_link\"") >&5
17429   (eval $ac_link) 2>&5
17430   ac_status=$?
17431   echo "$as_me:17431: \$? = $ac_status" >&5
17432   (exit "$ac_status"); } &&
17433          { ac_try='test -s "conftest$ac_exeext"'
17434   { (eval echo "$as_me:17434: \"$ac_try\"") >&5
17435   (eval $ac_try) 2>&5
17436   ac_status=$?
17437   echo "$as_me:17437: \$? = $ac_status" >&5
17438   (exit "$ac_status"); }; }; then
17439   if test "$cross_compiling" = yes; then
17440   cf_have_curses_lib=maybe
17441 else
17442   cat >"conftest.$ac_ext" <<_ACEOF
17443 #line 17443 "configure"
17444 #include "confdefs.h"
17445 #include <$MENU_NAME.h>
17446                                 int main(void)
17447                                 { (void) menu_driver ( 0,0 ); return 0; }
17448 _ACEOF
17449 rm -f "conftest$ac_exeext"
17450 if { (eval echo "$as_me:17450: \"$ac_link\"") >&5
17451   (eval $ac_link) 2>&5
17452   ac_status=$?
17453   echo "$as_me:17453: \$? = $ac_status" >&5
17454   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17455   { (eval echo "$as_me:17455: \"$ac_try\"") >&5
17456   (eval $ac_try) 2>&5
17457   ac_status=$?
17458   echo "$as_me:17458: \$? = $ac_status" >&5
17459   (exit "$ac_status"); }; }; then
17460   cf_have_curses_lib=yes
17461 else
17462   echo "$as_me: program exited with status $ac_status" >&5
17463 echo "$as_me: failed program was:" >&5
17464 cat "conftest.$ac_ext" >&5
17465 cf_have_curses_lib=no
17466 fi
17467 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17468 fi
17469 else
17470   echo "$as_me: failed program was:" >&5
17471 cat "conftest.$ac_ext" >&5
17472 cf_have_curses_lib=no
17473 fi
17474 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17475                 echo "$as_me:17475: result: $cf_have_curses_lib" >&5
17476 echo "${ECHO_T}$cf_have_curses_lib" >&6
17477                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17478                 if test "$cf_have_curses_lib" = "yes"
17479                 then
17480
17481 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17482
17483                         cat >>confdefs.h <<EOF
17484 #define $cf_upper 1
17485 EOF
17486
17487                 else
17488                         CFLAGS="$cf_save_CFLAGS"
17489                         CPPFLAGS="$cf_save_CPPFLAGS"
17490                         LIBS="$cf_save_LIBS"
17491                 fi
17492         fi
17493 fi
17494 if test "$cf_have_curses_lib" = no; then
17495         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17496 echo "$as_me:17496: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17497 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17498 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17499   echo $ECHO_N "(cached) $ECHO_C" >&6
17500 else
17501   ac_check_lib_save_LIBS=$LIBS
17502 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17503 cat >"conftest.$ac_ext" <<_ACEOF
17504 #line 17504 "configure"
17505 #include "confdefs.h"
17506
17507 /* Override any gcc2 internal prototype to avoid an error.  */
17508 #ifdef __cplusplus
17509 extern "C"
17510 #endif
17511 /* We use char because int might match the return type of a gcc2
17512    builtin and then its argument prototype would still apply.  */
17513 char menu_driver ();
17514 int
17515 main (void)
17516 {
17517 menu_driver ();
17518   ;
17519   return 0;
17520 }
17521 _ACEOF
17522 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17523 if { (eval echo "$as_me:17523: \"$ac_link\"") >&5
17524   (eval $ac_link) 2>&5
17525   ac_status=$?
17526   echo "$as_me:17526: \$? = $ac_status" >&5
17527   (exit "$ac_status"); } &&
17528          { ac_try='test -s "conftest$ac_exeext"'
17529   { (eval echo "$as_me:17529: \"$ac_try\"") >&5
17530   (eval $ac_try) 2>&5
17531   ac_status=$?
17532   echo "$as_me:17532: \$? = $ac_status" >&5
17533   (exit "$ac_status"); }; }; then
17534   eval "$as_ac_Lib=yes"
17535 else
17536   echo "$as_me: failed program was:" >&5
17537 cat "conftest.$ac_ext" >&5
17538 eval "$as_ac_Lib=no"
17539 fi
17540 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17541 LIBS=$ac_check_lib_save_LIBS
17542 fi
17543 echo "$as_me:17543: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17544 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17545 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17546
17547 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17548
17549 cf_add_libs="$LIBS"
17550 # reverse order
17551 cf_add_0lib=
17552 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17553 # filter duplicates
17554 for cf_add_1lib in $cf_add_0lib; do
17555         for cf_add_2lib in $cf_add_libs; do
17556                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17557                         cf_add_1lib=
17558                         break
17559                 fi
17560         done
17561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17562 done
17563 LIBS="$cf_add_libs"
17564
17565                 cat >>confdefs.h <<EOF
17566 #define $cf_upper 1
17567 EOF
17568
17569 fi
17570
17571 fi
17572
17573         cf_curses_headers="$cf_curses_headers menu.h"
17574 fi
17575
17576 echo "$as_me:17576: checking if you want to check for form functions" >&5
17577 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17578
17579 # Check whether --enable-form or --disable-form was given.
17580 if test "${enable_form+set}" = set; then
17581   enableval="$enable_form"
17582   test "$enableval" != no && enableval=yes
17583         if test "$enableval" != "yes" ; then
17584     cf_enable_form=no
17585         else
17586                 cf_enable_form=$cf_default_form
17587         fi
17588 else
17589   enableval=yes
17590         cf_enable_form=$cf_default_form
17591
17592 fi;
17593 echo "$as_me:17593: result: $cf_enable_form" >&5
17594 echo "${ECHO_T}$cf_enable_form" >&6
17595 if test $cf_enable_form = yes
17596 then
17597         case $cf_cv_screen in
17598         (ncurses*)
17599                 ;;
17600         (curses*)
17601
17602 echo "$as_me:17602: checking for NetBSD form.h" >&5
17603 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17604 if test "${cf_cv_netbsd_form_h+set}" = set; then
17605   echo $ECHO_N "(cached) $ECHO_C" >&6
17606 else
17607
17608 cat >"conftest.$ac_ext" <<_ACEOF
17609 #line 17609 "configure"
17610 #include "confdefs.h"
17611
17612 #include <${cf_cv_ncurses_header:-curses.h}>
17613 #include <form.h>
17614
17615 int
17616 main (void)
17617 {
17618
17619         FORM *form;
17620         int y = current_field(form)->cursor_ypos;
17621         int x = current_field(form)->cursor_xpos;
17622
17623   ;
17624   return 0;
17625 }
17626 _ACEOF
17627 rm -f "conftest.$ac_objext"
17628 if { (eval echo "$as_me:17628: \"$ac_compile\"") >&5
17629   (eval $ac_compile) 2>&5
17630   ac_status=$?
17631   echo "$as_me:17631: \$? = $ac_status" >&5
17632   (exit "$ac_status"); } &&
17633          { ac_try='test -s "conftest.$ac_objext"'
17634   { (eval echo "$as_me:17634: \"$ac_try\"") >&5
17635   (eval $ac_try) 2>&5
17636   ac_status=$?
17637   echo "$as_me:17637: \$? = $ac_status" >&5
17638   (exit "$ac_status"); }; }; then
17639   cf_cv_netbsd_form_h=yes
17640
17641 else
17642   echo "$as_me: failed program was:" >&5
17643 cat "conftest.$ac_ext" >&5
17644 cf_cv_netbsd_form_h=no
17645 fi
17646 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17647
17648 fi
17649 echo "$as_me:17649: result: $cf_cv_netbsd_form_h" >&5
17650 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17651
17652 test "$cf_cv_netbsd_form_h" = yes &&
17653 cat >>confdefs.h <<\EOF
17654 #define HAVE_NETBSD_FORM_H 1
17655 EOF
17656
17657                 ;;
17658         esac
17659
17660 cf_have_curses_lib=no
17661
17662 : ${NCURSES_CONFIG_PKG:=none}
17663 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17664         :
17665 elif test "x${PKG_CONFIG:=none}" != xnone; then
17666         echo "$as_me:17666: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17667 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17668         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17669                 echo "$as_me:17669: result: yes" >&5
17670 echo "${ECHO_T}yes" >&6
17671
17672                 echo "$as_me:17672: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17673 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17674
17675                 cf_save_CFLAGS="$CFLAGS"
17676                 cf_save_CPPFLAGS="$CPPFLAGS"
17677                 cf_save_LIBS="$LIBS"
17678
17679 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17680 do
17681         case "x$cf_add_cflags" in
17682         (x-[DU]*)
17683
17684 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17685 while true
17686 do
17687         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17688         test "$CFLAGS" != "$cf_old_cflag" || break
17689
17690         CFLAGS="$cf_old_cflag"
17691 done
17692
17693 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17694 while true
17695 do
17696         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
17697         test "$CPPFLAGS" != "$cf_old_cflag" || break
17698
17699         CPPFLAGS="$cf_old_cflag"
17700 done
17701
17702                 ;;
17703         esac
17704
17705 cf_fix_cppflags=no
17706 cf_new_cflags=
17707 cf_new_cppflags=
17708 cf_new_extra_cppflags=
17709
17710 for cf_add_cflags in $cf_add_cflags
17711 do
17712 case "$cf_fix_cppflags" in
17713 (no)
17714         case "$cf_add_cflags" in
17715         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17716                 case "$cf_add_cflags" in
17717                 (-D*)
17718                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17719
17720                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17721                                 && test -z "${cf_tst_cflags}" \
17722                                 && cf_fix_cppflags=yes
17723
17724                         if test "$cf_fix_cppflags" = yes ; then
17725
17726         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17727         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17728
17729                                 continue
17730                         elif test "${cf_tst_cflags}" = "\"'" ; then
17731
17732         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17733         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17734
17735                                 continue
17736                         fi
17737                         ;;
17738                 esac
17739                 case "$CPPFLAGS" in
17740                 (*$cf_add_cflags)
17741                         ;;
17742                 (*)
17743                         case "$cf_add_cflags" in
17744                         (-D*)
17745                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17746
17747 CPPFLAGS=`echo "$CPPFLAGS" | \
17748         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17749                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17750
17751                                 ;;
17752                         esac
17753
17754         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17755         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17756
17757                         ;;
17758                 esac
17759                 ;;
17760         (*)
17761
17762         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17763         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17764
17765                 ;;
17766         esac
17767         ;;
17768 (yes)
17769
17770         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17771         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17772
17773         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17774
17775         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17776                 && test -z "${cf_tst_cflags}" \
17777                 && cf_fix_cppflags=no
17778         ;;
17779 esac
17780 done
17781
17782 if test -n "$cf_new_cflags" ; then
17783
17784         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17785         CFLAGS="${CFLAGS}$cf_new_cflags"
17786
17787 fi
17788
17789 if test -n "$cf_new_cppflags" ; then
17790
17791         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17792         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17793
17794 fi
17795
17796 if test -n "$cf_new_extra_cppflags" ; then
17797
17798         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17799         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17800
17801 fi
17802
17803 done
17804
17805 cf_add_libs="$LIBS"
17806 # reverse order
17807 cf_add_0lib=
17808 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17809 # filter duplicates
17810 for cf_add_1lib in $cf_add_0lib; do
17811         for cf_add_2lib in $cf_add_libs; do
17812                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17813                         cf_add_1lib=
17814                         break
17815                 fi
17816         done
17817         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17818 done
17819 LIBS="$cf_add_libs"
17820
17821                 cat >"conftest.$ac_ext" <<_ACEOF
17822 #line 17822 "configure"
17823 #include "confdefs.h"
17824 #include <$FORM_NAME.h>
17825 int
17826 main (void)
17827 {
17828 (void) form_driver ( 0,0 );
17829   ;
17830   return 0;
17831 }
17832 _ACEOF
17833 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17834 if { (eval echo "$as_me:17834: \"$ac_link\"") >&5
17835   (eval $ac_link) 2>&5
17836   ac_status=$?
17837   echo "$as_me:17837: \$? = $ac_status" >&5
17838   (exit "$ac_status"); } &&
17839          { ac_try='test -s "conftest$ac_exeext"'
17840   { (eval echo "$as_me:17840: \"$ac_try\"") >&5
17841   (eval $ac_try) 2>&5
17842   ac_status=$?
17843   echo "$as_me:17843: \$? = $ac_status" >&5
17844   (exit "$ac_status"); }; }; then
17845   if test "$cross_compiling" = yes; then
17846   cf_have_curses_lib=maybe
17847 else
17848   cat >"conftest.$ac_ext" <<_ACEOF
17849 #line 17849 "configure"
17850 #include "confdefs.h"
17851 #include <$FORM_NAME.h>
17852                                 int main(void)
17853                                 { (void) form_driver ( 0,0 ); return 0; }
17854 _ACEOF
17855 rm -f "conftest$ac_exeext"
17856 if { (eval echo "$as_me:17856: \"$ac_link\"") >&5
17857   (eval $ac_link) 2>&5
17858   ac_status=$?
17859   echo "$as_me:17859: \$? = $ac_status" >&5
17860   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17861   { (eval echo "$as_me:17861: \"$ac_try\"") >&5
17862   (eval $ac_try) 2>&5
17863   ac_status=$?
17864   echo "$as_me:17864: \$? = $ac_status" >&5
17865   (exit "$ac_status"); }; }; then
17866   cf_have_curses_lib=yes
17867 else
17868   echo "$as_me: program exited with status $ac_status" >&5
17869 echo "$as_me: failed program was:" >&5
17870 cat "conftest.$ac_ext" >&5
17871 cf_have_curses_lib=no
17872 fi
17873 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17874 fi
17875 else
17876   echo "$as_me: failed program was:" >&5
17877 cat "conftest.$ac_ext" >&5
17878 cf_have_curses_lib=no
17879 fi
17880 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17881                 echo "$as_me:17881: result: $cf_have_curses_lib" >&5
17882 echo "${ECHO_T}$cf_have_curses_lib" >&6
17883                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17884                 if test "$cf_have_curses_lib" = "yes"
17885                 then
17886
17887 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17888
17889                         cat >>confdefs.h <<EOF
17890 #define $cf_upper 1
17891 EOF
17892
17893                 else
17894                         CFLAGS="$cf_save_CFLAGS"
17895                         CPPFLAGS="$cf_save_CPPFLAGS"
17896                         LIBS="$cf_save_LIBS"
17897                 fi
17898         fi
17899 fi
17900 if test "$cf_have_curses_lib" = no; then
17901         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17902 echo "$as_me:17902: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17903 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17904 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17905   echo $ECHO_N "(cached) $ECHO_C" >&6
17906 else
17907   ac_check_lib_save_LIBS=$LIBS
17908 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17909 cat >"conftest.$ac_ext" <<_ACEOF
17910 #line 17910 "configure"
17911 #include "confdefs.h"
17912
17913 /* Override any gcc2 internal prototype to avoid an error.  */
17914 #ifdef __cplusplus
17915 extern "C"
17916 #endif
17917 /* We use char because int might match the return type of a gcc2
17918    builtin and then its argument prototype would still apply.  */
17919 char form_driver ();
17920 int
17921 main (void)
17922 {
17923 form_driver ();
17924   ;
17925   return 0;
17926 }
17927 _ACEOF
17928 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17929 if { (eval echo "$as_me:17929: \"$ac_link\"") >&5
17930   (eval $ac_link) 2>&5
17931   ac_status=$?
17932   echo "$as_me:17932: \$? = $ac_status" >&5
17933   (exit "$ac_status"); } &&
17934          { ac_try='test -s "conftest$ac_exeext"'
17935   { (eval echo "$as_me:17935: \"$ac_try\"") >&5
17936   (eval $ac_try) 2>&5
17937   ac_status=$?
17938   echo "$as_me:17938: \$? = $ac_status" >&5
17939   (exit "$ac_status"); }; }; then
17940   eval "$as_ac_Lib=yes"
17941 else
17942   echo "$as_me: failed program was:" >&5
17943 cat "conftest.$ac_ext" >&5
17944 eval "$as_ac_Lib=no"
17945 fi
17946 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17947 LIBS=$ac_check_lib_save_LIBS
17948 fi
17949 echo "$as_me:17949: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17950 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17951 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17952
17953 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17954
17955 cf_add_libs="$LIBS"
17956 # reverse order
17957 cf_add_0lib=
17958 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17959 # filter duplicates
17960 for cf_add_1lib in $cf_add_0lib; do
17961         for cf_add_2lib in $cf_add_libs; do
17962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17963                         cf_add_1lib=
17964                         break
17965                 fi
17966         done
17967         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17968 done
17969 LIBS="$cf_add_libs"
17970
17971                 cat >>confdefs.h <<EOF
17972 #define $cf_upper 1
17973 EOF
17974
17975 fi
17976
17977 fi
17978
17979         cf_curses_headers="$cf_curses_headers form.h"
17980 fi
17981
17982 # look for curses-related headers
17983
17984 for ac_header in $cf_curses_headers
17985 do
17986 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17987 echo "$as_me:17987: checking for $ac_header" >&5
17988 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17989 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17990   echo $ECHO_N "(cached) $ECHO_C" >&6
17991 else
17992   cat >"conftest.$ac_ext" <<_ACEOF
17993 #line 17993 "configure"
17994 #include "confdefs.h"
17995 #include <$ac_header>
17996 _ACEOF
17997 if { (eval echo "$as_me:17997: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17998   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17999   ac_status=$?
18000   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18001   rm -f conftest.er1
18002   cat conftest.err >&5
18003   echo "$as_me:18003: \$? = $ac_status" >&5
18004   (exit "$ac_status"); } >/dev/null; then
18005   if test -s conftest.err; then
18006     ac_cpp_err=$ac_c_preproc_warn_flag
18007   else
18008     ac_cpp_err=
18009   fi
18010 else
18011   ac_cpp_err=yes
18012 fi
18013 if test -z "$ac_cpp_err"; then
18014   eval "$as_ac_Header=yes"
18015 else
18016   echo "$as_me: failed program was:" >&5
18017   cat "conftest.$ac_ext" >&5
18018   eval "$as_ac_Header=no"
18019 fi
18020 rm -f conftest.err "conftest.$ac_ext"
18021 fi
18022 echo "$as_me:18022: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18023 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18024 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18025   cat >>confdefs.h <<EOF
18026 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18027 EOF
18028
18029 fi
18030 done
18031
18032 echo "$as_me:18032: checking for ANSI C header files" >&5
18033 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
18034 if test "${ac_cv_header_stdc+set}" = set; then
18035   echo $ECHO_N "(cached) $ECHO_C" >&6
18036 else
18037   cat >"conftest.$ac_ext" <<_ACEOF
18038 #line 18038 "configure"
18039 #include "confdefs.h"
18040 #include <stdlib.h>
18041 #include <stdarg.h>
18042 #include <string.h>
18043 #include <float.h>
18044
18045 _ACEOF
18046 if { (eval echo "$as_me:18046: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18047   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18048   ac_status=$?
18049   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18050   rm -f conftest.er1
18051   cat conftest.err >&5
18052   echo "$as_me:18052: \$? = $ac_status" >&5
18053   (exit "$ac_status"); } >/dev/null; then
18054   if test -s conftest.err; then
18055     ac_cpp_err=$ac_c_preproc_warn_flag
18056   else
18057     ac_cpp_err=
18058   fi
18059 else
18060   ac_cpp_err=yes
18061 fi
18062 if test -z "$ac_cpp_err"; then
18063   ac_cv_header_stdc=yes
18064 else
18065   echo "$as_me: failed program was:" >&5
18066   cat "conftest.$ac_ext" >&5
18067   ac_cv_header_stdc=no
18068 fi
18069 rm -f conftest.err "conftest.$ac_ext"
18070
18071 if test $ac_cv_header_stdc = yes; then
18072   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
18073   cat >"conftest.$ac_ext" <<_ACEOF
18074 #line 18074 "configure"
18075 #include "confdefs.h"
18076 #include <string.h>
18077
18078 _ACEOF
18079 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18080   $EGREP "memchr" >/dev/null 2>&1; then
18081   :
18082 else
18083   ac_cv_header_stdc=no
18084 fi
18085 rm -rf conftest*
18086
18087 fi
18088
18089 if test $ac_cv_header_stdc = yes; then
18090   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
18091   cat >"conftest.$ac_ext" <<_ACEOF
18092 #line 18092 "configure"
18093 #include "confdefs.h"
18094 #include <stdlib.h>
18095
18096 _ACEOF
18097 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18098   $EGREP "free" >/dev/null 2>&1; then
18099   :
18100 else
18101   ac_cv_header_stdc=no
18102 fi
18103 rm -rf conftest*
18104
18105 fi
18106
18107 if test $ac_cv_header_stdc = yes; then
18108   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
18109   if test "$cross_compiling" = yes; then
18110   :
18111 else
18112   cat >"conftest.$ac_ext" <<_ACEOF
18113 #line 18113 "configure"
18114 #include "confdefs.h"
18115 #include <ctype.h>
18116 #if ((' ' & 0x0FF) == 0x020)
18117 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
18118 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
18119 #else
18120 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
18121                      || ('j' <= (c) && (c) <= 'r') \
18122                      || ('s' <= (c) && (c) <= 'z'))
18123 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
18124 #endif
18125
18126 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
18127 int
18128 main (void)
18129 {
18130   int i;
18131   for (i = 0; i < 256; i++)
18132     if (XOR (islower (i), ISLOWER (i))
18133         || toupper (i) != TOUPPER (i))
18134       $ac_main_return(2);
18135   $ac_main_return (0);
18136 }
18137 _ACEOF
18138 rm -f "conftest$ac_exeext"
18139 if { (eval echo "$as_me:18139: \"$ac_link\"") >&5
18140   (eval $ac_link) 2>&5
18141   ac_status=$?
18142   echo "$as_me:18142: \$? = $ac_status" >&5
18143   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
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   :
18150 else
18151   echo "$as_me: program exited with status $ac_status" >&5
18152 echo "$as_me: failed program was:" >&5
18153 cat "conftest.$ac_ext" >&5
18154 ac_cv_header_stdc=no
18155 fi
18156 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
18157 fi
18158 fi
18159 fi
18160 echo "$as_me:18160: result: $ac_cv_header_stdc" >&5
18161 echo "${ECHO_T}$ac_cv_header_stdc" >&6
18162 if test $ac_cv_header_stdc = yes; then
18163
18164 cat >>confdefs.h <<\EOF
18165 #define STDC_HEADERS 1
18166 EOF
18167
18168 fi
18169
18170 echo "$as_me:18170: checking whether time.h and sys/time.h may both be included" >&5
18171 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
18172 if test "${ac_cv_header_time+set}" = set; then
18173   echo $ECHO_N "(cached) $ECHO_C" >&6
18174 else
18175   cat >"conftest.$ac_ext" <<_ACEOF
18176 #line 18176 "configure"
18177 #include "confdefs.h"
18178 #include <sys/types.h>
18179 #include <sys/time.h>
18180 #include <time.h>
18181
18182 int
18183 main (void)
18184 {
18185 if ((struct tm *) 0)
18186 return 0;
18187   ;
18188   return 0;
18189 }
18190 _ACEOF
18191 rm -f "conftest.$ac_objext"
18192 if { (eval echo "$as_me:18192: \"$ac_compile\"") >&5
18193   (eval $ac_compile) 2>&5
18194   ac_status=$?
18195   echo "$as_me:18195: \$? = $ac_status" >&5
18196   (exit "$ac_status"); } &&
18197          { ac_try='test -s "conftest.$ac_objext"'
18198   { (eval echo "$as_me:18198: \"$ac_try\"") >&5
18199   (eval $ac_try) 2>&5
18200   ac_status=$?
18201   echo "$as_me:18201: \$? = $ac_status" >&5
18202   (exit "$ac_status"); }; }; then
18203   ac_cv_header_time=yes
18204 else
18205   echo "$as_me: failed program was:" >&5
18206 cat "conftest.$ac_ext" >&5
18207 ac_cv_header_time=no
18208 fi
18209 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18210 fi
18211 echo "$as_me:18211: result: $ac_cv_header_time" >&5
18212 echo "${ECHO_T}$ac_cv_header_time" >&6
18213 if test $ac_cv_header_time = yes; then
18214
18215 cat >>confdefs.h <<\EOF
18216 #define TIME_WITH_SYS_TIME 1
18217 EOF
18218
18219 fi
18220
18221 for ac_header in \
18222 getopt.h \
18223 locale.h \
18224 math.h \
18225 stdarg.h \
18226 stdint.h \
18227 sys/ioctl.h \
18228 sys/select.h \
18229 sys/time.h \
18230 termios.h \
18231 unistd.h \
18232
18233 do
18234 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18235 echo "$as_me:18235: checking for $ac_header" >&5
18236 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18237 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18238   echo $ECHO_N "(cached) $ECHO_C" >&6
18239 else
18240   cat >"conftest.$ac_ext" <<_ACEOF
18241 #line 18241 "configure"
18242 #include "confdefs.h"
18243 #include <$ac_header>
18244 _ACEOF
18245 if { (eval echo "$as_me:18245: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18246   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18247   ac_status=$?
18248   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18249   rm -f conftest.er1
18250   cat conftest.err >&5
18251   echo "$as_me:18251: \$? = $ac_status" >&5
18252   (exit "$ac_status"); } >/dev/null; then
18253   if test -s conftest.err; then
18254     ac_cpp_err=$ac_c_preproc_warn_flag
18255   else
18256     ac_cpp_err=
18257   fi
18258 else
18259   ac_cpp_err=yes
18260 fi
18261 if test -z "$ac_cpp_err"; then
18262   eval "$as_ac_Header=yes"
18263 else
18264   echo "$as_me: failed program was:" >&5
18265   cat "conftest.$ac_ext" >&5
18266   eval "$as_ac_Header=no"
18267 fi
18268 rm -f conftest.err "conftest.$ac_ext"
18269 fi
18270 echo "$as_me:18270: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18271 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18272 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18273   cat >>confdefs.h <<EOF
18274 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18275 EOF
18276
18277 fi
18278 done
18279
18280 for ac_header in unistd.h getopt.h
18281 do
18282 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18283 echo "$as_me:18283: checking for $ac_header" >&5
18284 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18285 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18286   echo $ECHO_N "(cached) $ECHO_C" >&6
18287 else
18288   cat >"conftest.$ac_ext" <<_ACEOF
18289 #line 18289 "configure"
18290 #include "confdefs.h"
18291 #include <$ac_header>
18292 _ACEOF
18293 if { (eval echo "$as_me:18293: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18294   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18295   ac_status=$?
18296   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18297   rm -f conftest.er1
18298   cat conftest.err >&5
18299   echo "$as_me:18299: \$? = $ac_status" >&5
18300   (exit "$ac_status"); } >/dev/null; then
18301   if test -s conftest.err; then
18302     ac_cpp_err=$ac_c_preproc_warn_flag
18303   else
18304     ac_cpp_err=
18305   fi
18306 else
18307   ac_cpp_err=yes
18308 fi
18309 if test -z "$ac_cpp_err"; then
18310   eval "$as_ac_Header=yes"
18311 else
18312   echo "$as_me: failed program was:" >&5
18313   cat "conftest.$ac_ext" >&5
18314   eval "$as_ac_Header=no"
18315 fi
18316 rm -f conftest.err "conftest.$ac_ext"
18317 fi
18318 echo "$as_me:18318: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18319 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18320 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18321   cat >>confdefs.h <<EOF
18322 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18323 EOF
18324
18325 fi
18326 done
18327
18328 echo "$as_me:18328: checking for header declaring getopt variables" >&5
18329 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
18330 if test "${cf_cv_getopt_header+set}" = set; then
18331   echo $ECHO_N "(cached) $ECHO_C" >&6
18332 else
18333
18334 cf_cv_getopt_header=none
18335 for cf_header in stdio.h stdlib.h unistd.h getopt.h
18336 do
18337 cat >"conftest.$ac_ext" <<_ACEOF
18338 #line 18338 "configure"
18339 #include "confdefs.h"
18340
18341 #include <$cf_header>
18342 int
18343 main (void)
18344 {
18345 int x = optind; char *y = optarg; (void)x; (void)y
18346   ;
18347   return 0;
18348 }
18349 _ACEOF
18350 rm -f "conftest.$ac_objext"
18351 if { (eval echo "$as_me:18351: \"$ac_compile\"") >&5
18352   (eval $ac_compile) 2>&5
18353   ac_status=$?
18354   echo "$as_me:18354: \$? = $ac_status" >&5
18355   (exit "$ac_status"); } &&
18356          { ac_try='test -s "conftest.$ac_objext"'
18357   { (eval echo "$as_me:18357: \"$ac_try\"") >&5
18358   (eval $ac_try) 2>&5
18359   ac_status=$?
18360   echo "$as_me:18360: \$? = $ac_status" >&5
18361   (exit "$ac_status"); }; }; then
18362   cf_cv_getopt_header=$cf_header
18363  break
18364 else
18365   echo "$as_me: failed program was:" >&5
18366 cat "conftest.$ac_ext" >&5
18367 fi
18368 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18369 done
18370
18371 fi
18372 echo "$as_me:18372: result: $cf_cv_getopt_header" >&5
18373 echo "${ECHO_T}$cf_cv_getopt_header" >&6
18374 if test "$cf_cv_getopt_header" != none ; then
18375
18376 cat >>confdefs.h <<\EOF
18377 #define HAVE_GETOPT_HEADER 1
18378 EOF
18379
18380 fi
18381 if test "$cf_cv_getopt_header" = getopt.h ; then
18382
18383 cat >>confdefs.h <<\EOF
18384 #define NEED_GETOPT_H 1
18385 EOF
18386
18387 fi
18388
18389 for ac_func in \
18390 cfmakeraw \
18391 getopt \
18392 gettimeofday \
18393 snprintf \
18394 strdup \
18395 strstr \
18396 tsearch \
18397
18398 do
18399 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18400 echo "$as_me:18400: checking for $ac_func" >&5
18401 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18402 if eval "test \"\${$as_ac_var+set}\" = set"; then
18403   echo $ECHO_N "(cached) $ECHO_C" >&6
18404 else
18405   cat >"conftest.$ac_ext" <<_ACEOF
18406 #line 18406 "configure"
18407 #include "confdefs.h"
18408 #define $ac_func autoconf_temporary
18409 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18410 #undef $ac_func
18411
18412 #ifdef __cplusplus
18413 extern "C"
18414 #endif
18415
18416 /* We use char because int might match the return type of a gcc2
18417    builtin and then its argument prototype would still apply.  */
18418 char $ac_func (void);
18419
18420 int
18421 main (void)
18422 {
18423
18424 /* The GNU C library defines stubs for functions which it implements
18425     to always fail with ENOSYS.  Some functions are actually named
18426     something starting with __ and the normal name is an alias.  */
18427 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18428 #error found stub for $ac_func
18429 #endif
18430
18431         return $ac_func ();
18432   ;
18433   return 0;
18434 }
18435 _ACEOF
18436 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18437 if { (eval echo "$as_me:18437: \"$ac_link\"") >&5
18438   (eval $ac_link) 2>&5
18439   ac_status=$?
18440   echo "$as_me:18440: \$? = $ac_status" >&5
18441   (exit "$ac_status"); } &&
18442          { ac_try='test -s "conftest$ac_exeext"'
18443   { (eval echo "$as_me:18443: \"$ac_try\"") >&5
18444   (eval $ac_try) 2>&5
18445   ac_status=$?
18446   echo "$as_me:18446: \$? = $ac_status" >&5
18447   (exit "$ac_status"); }; }; then
18448   eval "$as_ac_var=yes"
18449 else
18450   echo "$as_me: failed program was:" >&5
18451 cat "conftest.$ac_ext" >&5
18452 eval "$as_ac_var=no"
18453 fi
18454 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18455 fi
18456 echo "$as_me:18456: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18457 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18458 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18459   cat >>confdefs.h <<EOF
18460 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18461 EOF
18462
18463 fi
18464 done
18465
18466 # use a compile-check to work with ncurses*-config and subdirectory includes
18467 echo "$as_me:18467: checking if we can use termcap.h" >&5
18468 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18469 if test "${cf_cv_have_termcap_h+set}" = set; then
18470   echo $ECHO_N "(cached) $ECHO_C" >&6
18471 else
18472
18473         cat >"conftest.$ac_ext" <<_ACEOF
18474 #line 18474 "configure"
18475 #include "confdefs.h"
18476
18477 #include <curses.h>
18478 #ifdef NCURSES_VERSION
18479 #undef NCURSES_VERSION
18480 #endif
18481 #include <termcap.h>
18482 #ifndef NCURSES_VERSION
18483 #error wrong header
18484 #endif
18485
18486 int
18487 main (void)
18488 {
18489 return 0;
18490   ;
18491   return 0;
18492 }
18493 _ACEOF
18494 rm -f "conftest.$ac_objext"
18495 if { (eval echo "$as_me:18495: \"$ac_compile\"") >&5
18496   (eval $ac_compile) 2>&5
18497   ac_status=$?
18498   echo "$as_me:18498: \$? = $ac_status" >&5
18499   (exit "$ac_status"); } &&
18500          { ac_try='test -s "conftest.$ac_objext"'
18501   { (eval echo "$as_me:18501: \"$ac_try\"") >&5
18502   (eval $ac_try) 2>&5
18503   ac_status=$?
18504   echo "$as_me:18504: \$? = $ac_status" >&5
18505   (exit "$ac_status"); }; }; then
18506   cf_cv_have_termcap_h=yes
18507 else
18508   echo "$as_me: failed program was:" >&5
18509 cat "conftest.$ac_ext" >&5
18510 cf_cv_have_termcap_h=no
18511 fi
18512 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18513 fi
18514 echo "$as_me:18514: result: $cf_cv_have_termcap_h" >&5
18515 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18516 if test "x$cf_cv_have_termcap_h" = xyes
18517 then
18518
18519 cat >>confdefs.h <<\EOF
18520 #define HAVE_TERMCAP_H 1
18521 EOF
18522
18523 else
18524 echo "$as_me:18524: checking if we can use ncurses/termcap.h" >&5
18525 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18526 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18527   echo $ECHO_N "(cached) $ECHO_C" >&6
18528 else
18529
18530         cat >"conftest.$ac_ext" <<_ACEOF
18531 #line 18531 "configure"
18532 #include "confdefs.h"
18533
18534 #include <ncurses/curses.h>
18535 #ifdef NCURSES_VERSION
18536 #undef NCURSES_VERSION
18537 #endif
18538 #include <ncurses/termcap.h>
18539 #ifndef NCURSES_VERSION
18540 #error wrong header
18541 #endif
18542
18543 int
18544 main (void)
18545 {
18546 return 0;
18547   ;
18548   return 0;
18549 }
18550 _ACEOF
18551 rm -f "conftest.$ac_objext"
18552 if { (eval echo "$as_me:18552: \"$ac_compile\"") >&5
18553   (eval $ac_compile) 2>&5
18554   ac_status=$?
18555   echo "$as_me:18555: \$? = $ac_status" >&5
18556   (exit "$ac_status"); } &&
18557          { ac_try='test -s "conftest.$ac_objext"'
18558   { (eval echo "$as_me:18558: \"$ac_try\"") >&5
18559   (eval $ac_try) 2>&5
18560   ac_status=$?
18561   echo "$as_me:18561: \$? = $ac_status" >&5
18562   (exit "$ac_status"); }; }; then
18563   cf_cv_have_ncurses_termcap_h=yes
18564 else
18565   echo "$as_me: failed program was:" >&5
18566 cat "conftest.$ac_ext" >&5
18567 cf_cv_have_ncurses_termcap_h=no
18568 fi
18569 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18570 fi
18571 echo "$as_me:18571: result: $cf_cv_have_ncurses_termcap_h" >&5
18572 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18573 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18574 cat >>confdefs.h <<\EOF
18575 #define HAVE_NCURSES_TERMCAP_H 1
18576 EOF
18577
18578 fi
18579
18580 if test "x$ac_cv_func_getopt" = xno; then
18581         { { echo "$as_me:18581: error: getopt is required for building programs" >&5
18582 echo "$as_me: error: getopt is required for building programs" >&2;}
18583    { (exit 1); exit 1; }; }
18584 fi
18585
18586 if test "$cf_enable_widec" = yes; then
18587
18588 for ac_func in \
18589 mblen \
18590 mbrlen \
18591 mbrtowc \
18592 mbsrtowcs \
18593 mbstowcs \
18594 mbtowc \
18595 wcsrtombs \
18596 wcstombs \
18597
18598 do
18599 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18600 echo "$as_me:18600: checking for $ac_func" >&5
18601 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18602 if eval "test \"\${$as_ac_var+set}\" = set"; then
18603   echo $ECHO_N "(cached) $ECHO_C" >&6
18604 else
18605   cat >"conftest.$ac_ext" <<_ACEOF
18606 #line 18606 "configure"
18607 #include "confdefs.h"
18608 #define $ac_func autoconf_temporary
18609 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18610 #undef $ac_func
18611
18612 #ifdef __cplusplus
18613 extern "C"
18614 #endif
18615
18616 /* We use char because int might match the return type of a gcc2
18617    builtin and then its argument prototype would still apply.  */
18618 char $ac_func (void);
18619
18620 int
18621 main (void)
18622 {
18623
18624 /* The GNU C library defines stubs for functions which it implements
18625     to always fail with ENOSYS.  Some functions are actually named
18626     something starting with __ and the normal name is an alias.  */
18627 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18628 #error found stub for $ac_func
18629 #endif
18630
18631         return $ac_func ();
18632   ;
18633   return 0;
18634 }
18635 _ACEOF
18636 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18637 if { (eval echo "$as_me:18637: \"$ac_link\"") >&5
18638   (eval $ac_link) 2>&5
18639   ac_status=$?
18640   echo "$as_me:18640: \$? = $ac_status" >&5
18641   (exit "$ac_status"); } &&
18642          { ac_try='test -s "conftest$ac_exeext"'
18643   { (eval echo "$as_me:18643: \"$ac_try\"") >&5
18644   (eval $ac_try) 2>&5
18645   ac_status=$?
18646   echo "$as_me:18646: \$? = $ac_status" >&5
18647   (exit "$ac_status"); }; }; then
18648   eval "$as_ac_var=yes"
18649 else
18650   echo "$as_me: failed program was:" >&5
18651 cat "conftest.$ac_ext" >&5
18652 eval "$as_ac_var=no"
18653 fi
18654 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18655 fi
18656 echo "$as_me:18656: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18657 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18658 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18659   cat >>confdefs.h <<EOF
18660 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18661 EOF
18662
18663 fi
18664 done
18665
18666 fi
18667
18668 echo "$as_me:18668: checking definition to turn on extended curses functions" >&5
18669 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18670 if test "${cf_cv_need_xopen_extension+set}" = set; then
18671   echo $ECHO_N "(cached) $ECHO_C" >&6
18672 else
18673
18674 cf_cv_need_xopen_extension=unknown
18675 cat >"conftest.$ac_ext" <<_ACEOF
18676 #line 18676 "configure"
18677 #include "confdefs.h"
18678
18679 #include <stdlib.h>
18680 #include <${cf_cv_ncurses_header:-curses.h}>
18681 int
18682 main (void)
18683 {
18684
18685 #if defined(NCURSES_VERSION_PATCH)
18686 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18687         make an error
18688 #endif
18689 #endif
18690 #ifdef NCURSES_WIDECHAR
18691 make an error   /* prefer to fall-through on the second checks */
18692 #endif
18693         cchar_t check;
18694         int check2 = curs_set((int)sizeof(check));
18695         long x = winnstr(stdscr, "", 0);
18696         int x1, y1;
18697         (void)check2;
18698         getbegyx(stdscr, y1, x1);
18699         (void)x;
18700         (void)y1;
18701         (void)x1;
18702
18703   ;
18704   return 0;
18705 }
18706 _ACEOF
18707 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18708 if { (eval echo "$as_me:18708: \"$ac_link\"") >&5
18709   (eval $ac_link) 2>&5
18710   ac_status=$?
18711   echo "$as_me:18711: \$? = $ac_status" >&5
18712   (exit "$ac_status"); } &&
18713          { ac_try='test -s "conftest$ac_exeext"'
18714   { (eval echo "$as_me:18714: \"$ac_try\"") >&5
18715   (eval $ac_try) 2>&5
18716   ac_status=$?
18717   echo "$as_me:18717: \$? = $ac_status" >&5
18718   (exit "$ac_status"); }; }; then
18719   cf_cv_need_xopen_extension=none
18720 else
18721   echo "$as_me: failed program was:" >&5
18722 cat "conftest.$ac_ext" >&5
18723
18724         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18725         do
18726                 cat >"conftest.$ac_ext" <<_ACEOF
18727 #line 18727 "configure"
18728 #include "confdefs.h"
18729
18730 #define $cf_try_xopen_extension 1
18731 #include <stdlib.h>
18732 #include <${cf_cv_ncurses_header:-curses.h}>
18733 int
18734 main (void)
18735 {
18736
18737                 cchar_t check;
18738                 int check2 = curs_set((int)sizeof(check));
18739                 long x = winnstr(stdscr, "", 0);
18740                 int x1, y1;
18741                 getbegyx(stdscr, y1, x1);
18742                 (void)check2;
18743                 (void)x;
18744                 (void)y1;
18745                 (void)x1;
18746
18747   ;
18748   return 0;
18749 }
18750 _ACEOF
18751 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18752 if { (eval echo "$as_me:18752: \"$ac_link\"") >&5
18753   (eval $ac_link) 2>&5
18754   ac_status=$?
18755   echo "$as_me:18755: \$? = $ac_status" >&5
18756   (exit "$ac_status"); } &&
18757          { ac_try='test -s "conftest$ac_exeext"'
18758   { (eval echo "$as_me:18758: \"$ac_try\"") >&5
18759   (eval $ac_try) 2>&5
18760   ac_status=$?
18761   echo "$as_me:18761: \$? = $ac_status" >&5
18762   (exit "$ac_status"); }; }; then
18763   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18764 else
18765   echo "$as_me: failed program was:" >&5
18766 cat "conftest.$ac_ext" >&5
18767 fi
18768 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18769         done
18770
18771 fi
18772 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18773
18774 fi
18775 echo "$as_me:18775: result: $cf_cv_need_xopen_extension" >&5
18776 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18777
18778 case "$cf_cv_need_xopen_extension" in
18779 (*_*)
18780
18781         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18782         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18783
18784         ;;
18785 esac
18786
18787 echo "$as_me:18787: checking for term.h" >&5
18788 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18789 if test "${cf_cv_term_header+set}" = set; then
18790   echo $ECHO_N "(cached) $ECHO_C" >&6
18791 else
18792
18793 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18794 # for <term.h> if we do not find the variant.
18795
18796 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18797
18798 case "${cf_cv_ncurses_header:-curses.h}" in
18799 (*/*)
18800         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18801         cf_header_list="$cf_header_item $cf_header_list"
18802         ;;
18803 esac
18804
18805 for cf_header in $cf_header_list
18806 do
18807         cat >"conftest.$ac_ext" <<_ACEOF
18808 #line 18808 "configure"
18809 #include "confdefs.h"
18810
18811 #include <${cf_cv_ncurses_header:-curses.h}>
18812 #include <${cf_header}>
18813 int
18814 main (void)
18815 {
18816 WINDOW *x; (void)x
18817   ;
18818   return 0;
18819 }
18820 _ACEOF
18821 rm -f "conftest.$ac_objext"
18822 if { (eval echo "$as_me:18822: \"$ac_compile\"") >&5
18823   (eval $ac_compile) 2>&5
18824   ac_status=$?
18825   echo "$as_me:18825: \$? = $ac_status" >&5
18826   (exit "$ac_status"); } &&
18827          { ac_try='test -s "conftest.$ac_objext"'
18828   { (eval echo "$as_me:18828: \"$ac_try\"") >&5
18829   (eval $ac_try) 2>&5
18830   ac_status=$?
18831   echo "$as_me:18831: \$? = $ac_status" >&5
18832   (exit "$ac_status"); }; }; then
18833   cf_cv_term_header=$cf_header
18834          break
18835 else
18836   echo "$as_me: failed program was:" >&5
18837 cat "conftest.$ac_ext" >&5
18838 cf_cv_term_header=no
18839 fi
18840 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18841 done
18842
18843 case "$cf_cv_term_header" in
18844 (no)
18845         # If curses is ncurses, some packagers still mess it up by trying to make
18846         # us use GNU termcap.  This handles the most common case.
18847         for cf_header in ncurses/term.h ncursesw/term.h
18848         do
18849                 cat >"conftest.$ac_ext" <<_ACEOF
18850 #line 18850 "configure"
18851 #include "confdefs.h"
18852
18853 #include <${cf_cv_ncurses_header:-curses.h}>
18854 #ifdef NCURSES_VERSION
18855 #include <${cf_header}>
18856 #else
18857 make an error
18858 #endif
18859 int
18860 main (void)
18861 {
18862 WINDOW *x; (void)x
18863   ;
18864   return 0;
18865 }
18866 _ACEOF
18867 rm -f "conftest.$ac_objext"
18868 if { (eval echo "$as_me:18868: \"$ac_compile\"") >&5
18869   (eval $ac_compile) 2>&5
18870   ac_status=$?
18871   echo "$as_me:18871: \$? = $ac_status" >&5
18872   (exit "$ac_status"); } &&
18873          { ac_try='test -s "conftest.$ac_objext"'
18874   { (eval echo "$as_me:18874: \"$ac_try\"") >&5
18875   (eval $ac_try) 2>&5
18876   ac_status=$?
18877   echo "$as_me:18877: \$? = $ac_status" >&5
18878   (exit "$ac_status"); }; }; then
18879   cf_cv_term_header=$cf_header
18880                          break
18881 else
18882   echo "$as_me: failed program was:" >&5
18883 cat "conftest.$ac_ext" >&5
18884 cf_cv_term_header=no
18885 fi
18886 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18887         done
18888         ;;
18889 esac
18890
18891 fi
18892 echo "$as_me:18892: result: $cf_cv_term_header" >&5
18893 echo "${ECHO_T}$cf_cv_term_header" >&6
18894
18895 case "$cf_cv_term_header" in
18896 (term.h)
18897
18898 cat >>confdefs.h <<\EOF
18899 #define HAVE_TERM_H 1
18900 EOF
18901
18902         ;;
18903 (ncurses/term.h)
18904
18905 cat >>confdefs.h <<\EOF
18906 #define HAVE_NCURSES_TERM_H 1
18907 EOF
18908
18909         ;;
18910 (ncursesw/term.h)
18911
18912 cat >>confdefs.h <<\EOF
18913 #define HAVE_NCURSESW_TERM_H 1
18914 EOF
18915
18916         ;;
18917 esac
18918
18919 echo "$as_me:18919: checking for unctrl.h" >&5
18920 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18921 if test "${cf_cv_unctrl_header+set}" = set; then
18922   echo $ECHO_N "(cached) $ECHO_C" >&6
18923 else
18924
18925 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18926 # for <unctrl.h> if we do not find the variant.
18927
18928 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18929
18930 case "${cf_cv_ncurses_header:-curses.h}" in
18931 (*/*)
18932         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18933         cf_header_list="$cf_header_item $cf_header_list"
18934         ;;
18935 esac
18936
18937 for cf_header in $cf_header_list
18938 do
18939         cat >"conftest.$ac_ext" <<_ACEOF
18940 #line 18940 "configure"
18941 #include "confdefs.h"
18942
18943 #include <${cf_cv_ncurses_header:-curses.h}>
18944 #include <${cf_header}>
18945 int
18946 main (void)
18947 {
18948 WINDOW *x; (void)x
18949   ;
18950   return 0;
18951 }
18952 _ACEOF
18953 rm -f "conftest.$ac_objext"
18954 if { (eval echo "$as_me:18954: \"$ac_compile\"") >&5
18955   (eval $ac_compile) 2>&5
18956   ac_status=$?
18957   echo "$as_me:18957: \$? = $ac_status" >&5
18958   (exit "$ac_status"); } &&
18959          { ac_try='test -s "conftest.$ac_objext"'
18960   { (eval echo "$as_me:18960: \"$ac_try\"") >&5
18961   (eval $ac_try) 2>&5
18962   ac_status=$?
18963   echo "$as_me:18963: \$? = $ac_status" >&5
18964   (exit "$ac_status"); }; }; then
18965   cf_cv_unctrl_header=$cf_header
18966          break
18967 else
18968   echo "$as_me: failed program was:" >&5
18969 cat "conftest.$ac_ext" >&5
18970 cf_cv_unctrl_header=no
18971 fi
18972 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18973 done
18974
18975 fi
18976 echo "$as_me:18976: result: $cf_cv_unctrl_header" >&5
18977 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18978
18979 case "$cf_cv_unctrl_header" in
18980 (no)
18981         { echo "$as_me:18981: WARNING: unctrl.h header not found" >&5
18982 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18983         ;;
18984 esac
18985
18986 case "$cf_cv_unctrl_header" in
18987 (unctrl.h)
18988
18989 cat >>confdefs.h <<\EOF
18990 #define HAVE_UNCTRL_H 1
18991 EOF
18992
18993         ;;
18994 (ncurses/unctrl.h)
18995
18996 cat >>confdefs.h <<\EOF
18997 #define HAVE_NCURSES_UNCTRL_H 1
18998 EOF
18999
19000         ;;
19001 (ncursesw/unctrl.h)
19002
19003 cat >>confdefs.h <<\EOF
19004 #define HAVE_NCURSESW_UNCTRL_H 1
19005 EOF
19006
19007         ;;
19008 esac
19009
19010 for cf_func in \
19011 alloc_pair \
19012 assume_default_colors \
19013 chgat \
19014 color_content \
19015 color_set \
19016 copywin \
19017 delscreen \
19018 dupwin \
19019 exit_curses \
19020 exit_terminfo \
19021 filter \
19022 getbegx \
19023 getcurx \
19024 getmaxx \
19025 getnstr \
19026 getparx \
19027 getwin \
19028 halfdelay \
19029 init_extended_color \
19030 mvderwin \
19031 mvvline \
19032 mvwin \
19033 mvwvline \
19034 napms \
19035 newpad \
19036 putwin \
19037 reset_color_pairs \
19038 resize_term \
19039 resizeterm \
19040 restartterm \
19041 ripoffline \
19042 scr_dump \
19043 setupterm \
19044 slk_color \
19045 slk_init \
19046 termattrs \
19047 termname \
19048 tgetent \
19049 tigetnum \
19050 tigetstr \
19051 tputs_sp \
19052 typeahead \
19053 unget_wch \
19054 use_default_colors \
19055 use_env \
19056 use_extended_names \
19057 use_screen \
19058 use_window \
19059 vid_puts \
19060 vidputs \
19061 vsscanf \
19062 vw_printw \
19063 wchgat \
19064 winsdelln \
19065 winsstr \
19066 wresize \
19067 wsyncdown \
19068 _tracef \
19069
19070 do
19071
19072 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19073
19074         echo "$as_me:19074: checking for ${cf_func}" >&5
19075 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19076
19077 echo "${as_me:-configure}:19077: testing ${cf_func} ..." 1>&5
19078
19079         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19080   echo $ECHO_N "(cached) $ECHO_C" >&6
19081 else
19082
19083                 eval cf_result='$ac_cv_func_'$cf_func
19084                 if test ".$cf_result" != ".no"; then
19085                         cat >"conftest.$ac_ext" <<_ACEOF
19086 #line 19086 "configure"
19087 #include "confdefs.h"
19088
19089 #ifdef HAVE_XCURSES
19090 #include <xcurses.h>
19091 char * XCursesProgramName = "test";
19092 #else
19093 #include <${cf_cv_ncurses_header:-curses.h}>
19094 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19095 #include <ncursesw/term.h>
19096 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19097 #include <ncurses/term.h>
19098 #elif defined(HAVE_TERM_H)
19099 #include <term.h>
19100 #endif
19101 #endif
19102
19103 int
19104 main (void)
19105 {
19106
19107 #ifndef ${cf_func}
19108 long foo = (long)(&${cf_func});
19109 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19110 if (foo + 1234L > 5678L)
19111         ${cf_cv_main_return:-return}(foo != 0);
19112 #endif
19113
19114   ;
19115   return 0;
19116 }
19117 _ACEOF
19118 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19119 if { (eval echo "$as_me:19119: \"$ac_link\"") >&5
19120   (eval $ac_link) 2>&5
19121   ac_status=$?
19122   echo "$as_me:19122: \$? = $ac_status" >&5
19123   (exit "$ac_status"); } &&
19124          { ac_try='test -s "conftest$ac_exeext"'
19125   { (eval echo "$as_me:19125: \"$ac_try\"") >&5
19126   (eval $ac_try) 2>&5
19127   ac_status=$?
19128   echo "$as_me:19128: \$? = $ac_status" >&5
19129   (exit "$ac_status"); }; }; then
19130   cf_result=yes
19131 else
19132   echo "$as_me: failed program was:" >&5
19133 cat "conftest.$ac_ext" >&5
19134 cf_result=no
19135 fi
19136 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19137                 fi
19138                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19139
19140 fi
19141
19142         # use the computed/retrieved cache-value:
19143         eval 'cf_result=$cf_cv_func_'$cf_func
19144         echo "$as_me:19144: result: $cf_result" >&5
19145 echo "${ECHO_T}$cf_result" >&6
19146         if test "$cf_result" != no; then
19147                 cat >>confdefs.h <<EOF
19148 #define HAVE_${cf_tr_func} 1
19149 EOF
19150
19151         fi
19152 done
19153
19154 for cf_func in tputs
19155 do
19156
19157 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19158
19159         echo "$as_me:19159: checking for ${cf_func}" >&5
19160 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19161
19162 echo "${as_me:-configure}:19162: testing ${cf_func} ..." 1>&5
19163
19164         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19165   echo $ECHO_N "(cached) $ECHO_C" >&6
19166 else
19167
19168                 eval cf_result='$ac_cv_func_'$cf_func
19169                 if test ".$cf_result" != ".no"; then
19170                         cat >"conftest.$ac_ext" <<_ACEOF
19171 #line 19171 "configure"
19172 #include "confdefs.h"
19173
19174 #ifdef HAVE_XCURSES
19175 #include <xcurses.h>
19176 char * XCursesProgramName = "test";
19177 #else
19178 #include <${cf_cv_ncurses_header:-curses.h}>
19179 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19180 #include <ncursesw/term.h>
19181 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19182 #include <ncurses/term.h>
19183 #elif defined(HAVE_TERM_H)
19184 #include <term.h>
19185 #endif
19186 #endif
19187
19188 int
19189 main (void)
19190 {
19191
19192 #ifndef ${cf_func}
19193 long foo = (long)(&${cf_func});
19194 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19195 if (foo + 1234L > 5678L)
19196         ${cf_cv_main_return:-return}(foo != 0);
19197 #endif
19198
19199   ;
19200   return 0;
19201 }
19202 _ACEOF
19203 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19204 if { (eval echo "$as_me:19204: \"$ac_link\"") >&5
19205   (eval $ac_link) 2>&5
19206   ac_status=$?
19207   echo "$as_me:19207: \$? = $ac_status" >&5
19208   (exit "$ac_status"); } &&
19209          { ac_try='test -s "conftest$ac_exeext"'
19210   { (eval echo "$as_me:19210: \"$ac_try\"") >&5
19211   (eval $ac_try) 2>&5
19212   ac_status=$?
19213   echo "$as_me:19213: \$? = $ac_status" >&5
19214   (exit "$ac_status"); }; }; then
19215   cf_result=yes
19216 else
19217   echo "$as_me: failed program was:" >&5
19218 cat "conftest.$ac_ext" >&5
19219 cf_result=no
19220 fi
19221 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19222                 fi
19223                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19224
19225 fi
19226
19227         # use the computed/retrieved cache-value:
19228         eval 'cf_result=$cf_cv_func_'$cf_func
19229         echo "$as_me:19229: result: $cf_result" >&5
19230 echo "${ECHO_T}$cf_result" >&6
19231         if test "$cf_result" != no; then
19232                 cat >>confdefs.h <<EOF
19233 #define HAVE_${cf_tr_func} 1
19234 EOF
19235
19236         fi
19237 done
19238
19239 if test "x$cf_cv_func_tputs" = xyes
19240 then
19241         cf_done=no
19242         for cf_arg in int char
19243         do
19244                 for cf_ret in int void
19245                 do
19246                         if test "$cf_ret" = void
19247                         then
19248                                 cf_return="/* nothing */"
19249                         else
19250                                 cf_return="return value"
19251                         fi
19252                         cat >"conftest.$ac_ext" <<_ACEOF
19253 #line 19253 "configure"
19254 #include "confdefs.h"
19255
19256 #include <${cf_cv_ncurses_header:-curses.h}>
19257 #include <$cf_cv_term_header>
19258
19259 static $cf_ret outc($cf_arg value) { $cf_return; }
19260
19261 int
19262 main (void)
19263 {
19264
19265         tputs("hello", 0, outc);
19266         ${cf_cv_main_return:-return}(0);
19267
19268   ;
19269   return 0;
19270 }
19271 _ACEOF
19272 rm -f "conftest.$ac_objext"
19273 if { (eval echo "$as_me:19273: \"$ac_compile\"") >&5
19274   (eval $ac_compile) 2>&5
19275   ac_status=$?
19276   echo "$as_me:19276: \$? = $ac_status" >&5
19277   (exit "$ac_status"); } &&
19278          { ac_try='test -s "conftest.$ac_objext"'
19279   { (eval echo "$as_me:19279: \"$ac_try\"") >&5
19280   (eval $ac_try) 2>&5
19281   ac_status=$?
19282   echo "$as_me:19282: \$? = $ac_status" >&5
19283   (exit "$ac_status"); }; }; then
19284
19285                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
19286
19287 echo "${as_me:-configure}:19287: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
19288
19289                 cat >>confdefs.h <<EOF
19290 #define TPUTS_ARG               $cf_arg
19291 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
19292 #define TPUTS_RETURN(value)     $cf_return
19293 EOF
19294                 cf_done=yes
19295                 break
19296
19297 else
19298   echo "$as_me: failed program was:" >&5
19299 cat "conftest.$ac_ext" >&5
19300 fi
19301 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19302                 done
19303                 test "$cf_done" = yes && break
19304         done
19305 fi
19306
19307 echo "$as_me:19307: checking for ncurses extended functions" >&5
19308 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
19309 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
19310   echo $ECHO_N "(cached) $ECHO_C" >&6
19311 else
19312
19313 cat >"conftest.$ac_ext" <<_ACEOF
19314 #line 19314 "configure"
19315 #include "confdefs.h"
19316
19317 #include <${cf_cv_ncurses_header:-curses.h}>
19318 int
19319 main (void)
19320 {
19321
19322 int x = NCURSES_EXT_FUNCS
19323
19324   ;
19325   return 0;
19326 }
19327 _ACEOF
19328 rm -f "conftest.$ac_objext"
19329 if { (eval echo "$as_me:19329: \"$ac_compile\"") >&5
19330   (eval $ac_compile) 2>&5
19331   ac_status=$?
19332   echo "$as_me:19332: \$? = $ac_status" >&5
19333   (exit "$ac_status"); } &&
19334          { ac_try='test -s "conftest.$ac_objext"'
19335   { (eval echo "$as_me:19335: \"$ac_try\"") >&5
19336   (eval $ac_try) 2>&5
19337   ac_status=$?
19338   echo "$as_me:19338: \$? = $ac_status" >&5
19339   (exit "$ac_status"); }; }; then
19340   cf_cv_ncurses_ext_funcs=defined
19341 else
19342   echo "$as_me: failed program was:" >&5
19343 cat "conftest.$ac_ext" >&5
19344
19345 cat >"conftest.$ac_ext" <<_ACEOF
19346 #line 19346 "configure"
19347 #include "confdefs.h"
19348
19349 #include <${cf_cv_ncurses_header:-curses.h}>
19350 int
19351 main (void)
19352 {
19353
19354         (void) assume_default_colors (0, 0);
19355         (void) curses_version ();
19356         (void) define_key (0, 0);
19357         (void) is_term_resized (0, 0);
19358         (void) key_defined (0);
19359         (void) keybound (0, 0);
19360         (void) keyok (0, 0);
19361         (void) resize_term (0, 0);
19362         (void) resizeterm (0, 0);
19363         (void) use_default_colors ();
19364         (void) use_extended_names (0);
19365         (void) wresize (0, 0, 0);
19366   ;
19367   return 0;
19368 }
19369 _ACEOF
19370 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19371 if { (eval echo "$as_me:19371: \"$ac_link\"") >&5
19372   (eval $ac_link) 2>&5
19373   ac_status=$?
19374   echo "$as_me:19374: \$? = $ac_status" >&5
19375   (exit "$ac_status"); } &&
19376          { ac_try='test -s "conftest$ac_exeext"'
19377   { (eval echo "$as_me:19377: \"$ac_try\"") >&5
19378   (eval $ac_try) 2>&5
19379   ac_status=$?
19380   echo "$as_me:19380: \$? = $ac_status" >&5
19381   (exit "$ac_status"); }; }; then
19382   cf_cv_ncurses_ext_funcs=yes
19383 else
19384   echo "$as_me: failed program was:" >&5
19385 cat "conftest.$ac_ext" >&5
19386 cf_cv_ncurses_ext_funcs=no
19387 fi
19388 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19389
19390 fi
19391 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19392
19393 fi
19394 echo "$as_me:19394: result: $cf_cv_ncurses_ext_funcs" >&5
19395 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19396 test "$cf_cv_ncurses_ext_funcs" = yes &&
19397 cat >>confdefs.h <<\EOF
19398 #define NCURSES_EXT_FUNCS 1
19399 EOF
19400
19401 if test "$cf_enable_widec" = yes
19402 then
19403         # workaround for systems with ncurses before 20111029, due to change of
19404         # feature test macro from _XPG5 to _XOPEN_SOURCE
19405         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19406         then
19407                 cf_define_xpg5=no
19408                 echo "$as_me:19408: checking if _XPG5 should be defined to enable wide-characters" >&5
19409 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19410
19411                 cat >"conftest.$ac_ext" <<_ACEOF
19412 #line 19412 "configure"
19413 #include "confdefs.h"
19414
19415 #include <${cf_cv_ncurses_header:-curses.h}>
19416 int
19417 main (void)
19418 {
19419 int x = _XPG5
19420   ;
19421   return 0;
19422 }
19423 _ACEOF
19424 rm -f "conftest.$ac_objext"
19425 if { (eval echo "$as_me:19425: \"$ac_compile\"") >&5
19426   (eval $ac_compile) 2>&5
19427   ac_status=$?
19428   echo "$as_me:19428: \$? = $ac_status" >&5
19429   (exit "$ac_status"); } &&
19430          { ac_try='test -s "conftest.$ac_objext"'
19431   { (eval echo "$as_me:19431: \"$ac_try\"") >&5
19432   (eval $ac_try) 2>&5
19433   ac_status=$?
19434   echo "$as_me:19434: \$? = $ac_status" >&5
19435   (exit "$ac_status"); }; }; then
19436   :
19437 else
19438   echo "$as_me: failed program was:" >&5
19439 cat "conftest.$ac_ext" >&5
19440 cf_save_cppflags="$CPPFLAGS"
19441                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19442                          cat >"conftest.$ac_ext" <<_ACEOF
19443 #line 19443 "configure"
19444 #include "confdefs.h"
19445
19446 #include <${cf_cv_ncurses_header:-curses.h}>
19447 int
19448 main (void)
19449 {
19450 int x = _XPG5
19451   ;
19452   return 0;
19453 }
19454 _ACEOF
19455 rm -f "conftest.$ac_objext"
19456 if { (eval echo "$as_me:19456: \"$ac_compile\"") >&5
19457   (eval $ac_compile) 2>&5
19458   ac_status=$?
19459   echo "$as_me:19459: \$? = $ac_status" >&5
19460   (exit "$ac_status"); } &&
19461          { ac_try='test -s "conftest.$ac_objext"'
19462   { (eval echo "$as_me:19462: \"$ac_try\"") >&5
19463   (eval $ac_try) 2>&5
19464   ac_status=$?
19465   echo "$as_me:19465: \$? = $ac_status" >&5
19466   (exit "$ac_status"); }; }; then
19467   cf_define_xpg5=yes
19468 else
19469   echo "$as_me: failed program was:" >&5
19470 cat "conftest.$ac_ext" >&5
19471 fi
19472 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19473                          CPPFLAGS="$cf_save_cppflags"
19474 fi
19475 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19476                 echo "$as_me:19476: result: $cf_define_xpg5" >&5
19477 echo "${ECHO_T}$cf_define_xpg5" >&6
19478
19479                 if test "$cf_define_xpg5" = yes
19480                 then
19481                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19482                 fi
19483         fi
19484
19485         echo "$as_me:19485: checking for wide-character functions" >&5
19486 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19487 if test "${cf_cv_widechar_funcs+set}" = set; then
19488   echo $ECHO_N "(cached) $ECHO_C" >&6
19489 else
19490
19491         cat >"conftest.$ac_ext" <<_ACEOF
19492 #line 19492 "configure"
19493 #include "confdefs.h"
19494
19495 #include <${cf_cv_ncurses_header:-curses.h}>
19496 int
19497 main (void)
19498 {
19499
19500                 static wchar_t src_wchar[2];
19501                 static cchar_t dst_cchar;
19502                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19503
19504   ;
19505   return 0;
19506 }
19507 _ACEOF
19508 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19509 if { (eval echo "$as_me:19509: \"$ac_link\"") >&5
19510   (eval $ac_link) 2>&5
19511   ac_status=$?
19512   echo "$as_me:19512: \$? = $ac_status" >&5
19513   (exit "$ac_status"); } &&
19514          { ac_try='test -s "conftest$ac_exeext"'
19515   { (eval echo "$as_me:19515: \"$ac_try\"") >&5
19516   (eval $ac_try) 2>&5
19517   ac_status=$?
19518   echo "$as_me:19518: \$? = $ac_status" >&5
19519   (exit "$ac_status"); }; }; then
19520   cf_cv_widechar_funcs=yes
19521 else
19522   echo "$as_me: failed program was:" >&5
19523 cat "conftest.$ac_ext" >&5
19524 cf_cv_widechar_funcs=no
19525 fi
19526 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19527
19528 fi
19529 echo "$as_me:19529: result: $cf_cv_widechar_funcs" >&5
19530 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19531         if test "$cf_cv_widechar_funcs" != no ; then
19532
19533 cat >>confdefs.h <<\EOF
19534 #define USE_WIDEC_SUPPORT 1
19535 EOF
19536
19537         else
19538                 cat >>confdefs.h <<\EOF
19539 #define USE_WIDEC_SUPPORT 0
19540 EOF
19541
19542         fi
19543 else
19544         cat >>confdefs.h <<\EOF
19545 #define USE_WIDEC_SUPPORT 0
19546 EOF
19547
19548 fi
19549
19550 echo "$as_me:19550: checking if $cf_cv_screen library uses pthreads" >&5
19551 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19552 if test "${cf_cv_use_pthreads+set}" = set; then
19553   echo $ECHO_N "(cached) $ECHO_C" >&6
19554 else
19555
19556 cat >"conftest.$ac_ext" <<_ACEOF
19557 #line 19557 "configure"
19558 #include "confdefs.h"
19559
19560 #include <${cf_cv_ncurses_header:-curses.h}>
19561 extern void _nc_init_pthreads(void);
19562
19563 int
19564 main (void)
19565 {
19566
19567         initscr();
19568         _nc_init_pthreads();
19569
19570   ;
19571   return 0;
19572 }
19573 _ACEOF
19574 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19575 if { (eval echo "$as_me:19575: \"$ac_link\"") >&5
19576   (eval $ac_link) 2>&5
19577   ac_status=$?
19578   echo "$as_me:19578: \$? = $ac_status" >&5
19579   (exit "$ac_status"); } &&
19580          { ac_try='test -s "conftest$ac_exeext"'
19581   { (eval echo "$as_me:19581: \"$ac_try\"") >&5
19582   (eval $ac_try) 2>&5
19583   ac_status=$?
19584   echo "$as_me:19584: \$? = $ac_status" >&5
19585   (exit "$ac_status"); }; }; then
19586   cf_cv_use_pthreads=yes
19587 else
19588   echo "$as_me: failed program was:" >&5
19589 cat "conftest.$ac_ext" >&5
19590 cf_cv_use_pthreads=no
19591 fi
19592 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19593
19594 fi
19595 echo "$as_me:19595: result: $cf_cv_use_pthreads" >&5
19596 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19597 test $cf_cv_use_pthreads = yes &&
19598 cat >>confdefs.h <<\EOF
19599 #define USE_PTHREADS 1
19600 EOF
19601
19602 echo "$as_me:19602: checking if sys/time.h works with sys/select.h" >&5
19603 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19604 if test "${cf_cv_sys_time_select+set}" = set; then
19605   echo $ECHO_N "(cached) $ECHO_C" >&6
19606 else
19607
19608 cat >"conftest.$ac_ext" <<_ACEOF
19609 #line 19609 "configure"
19610 #include "confdefs.h"
19611
19612 #include <sys/types.h>
19613 #ifdef HAVE_SYS_TIME_H
19614 #include <sys/time.h>
19615 #endif
19616 #ifdef HAVE_SYS_SELECT_H
19617 #include <sys/select.h>
19618 #endif
19619
19620 int
19621 main (void)
19622 {
19623
19624   ;
19625   return 0;
19626 }
19627 _ACEOF
19628 rm -f "conftest.$ac_objext"
19629 if { (eval echo "$as_me:19629: \"$ac_compile\"") >&5
19630   (eval $ac_compile) 2>&5
19631   ac_status=$?
19632   echo "$as_me:19632: \$? = $ac_status" >&5
19633   (exit "$ac_status"); } &&
19634          { ac_try='test -s "conftest.$ac_objext"'
19635   { (eval echo "$as_me:19635: \"$ac_try\"") >&5
19636   (eval $ac_try) 2>&5
19637   ac_status=$?
19638   echo "$as_me:19638: \$? = $ac_status" >&5
19639   (exit "$ac_status"); }; }; then
19640   cf_cv_sys_time_select=yes
19641 else
19642   echo "$as_me: failed program was:" >&5
19643 cat "conftest.$ac_ext" >&5
19644 cf_cv_sys_time_select=no
19645 fi
19646 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19647
19648 fi
19649
19650 echo "$as_me:19650: result: $cf_cv_sys_time_select" >&5
19651 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19652 test "$cf_cv_sys_time_select" = yes &&
19653 cat >>confdefs.h <<\EOF
19654 #define HAVE_SYS_TIME_SELECT 1
19655 EOF
19656
19657 # special check for test/ditto.c
19658
19659 echo "$as_me:19659: checking for openpty in -lutil" >&5
19660 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19661 if test "${ac_cv_lib_util_openpty+set}" = set; then
19662   echo $ECHO_N "(cached) $ECHO_C" >&6
19663 else
19664   ac_check_lib_save_LIBS=$LIBS
19665 LIBS="-lutil  $LIBS"
19666 cat >"conftest.$ac_ext" <<_ACEOF
19667 #line 19667 "configure"
19668 #include "confdefs.h"
19669
19670 /* Override any gcc2 internal prototype to avoid an error.  */
19671 #ifdef __cplusplus
19672 extern "C"
19673 #endif
19674 /* We use char because int might match the return type of a gcc2
19675    builtin and then its argument prototype would still apply.  */
19676 char openpty ();
19677 int
19678 main (void)
19679 {
19680 openpty ();
19681   ;
19682   return 0;
19683 }
19684 _ACEOF
19685 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19686 if { (eval echo "$as_me:19686: \"$ac_link\"") >&5
19687   (eval $ac_link) 2>&5
19688   ac_status=$?
19689   echo "$as_me:19689: \$? = $ac_status" >&5
19690   (exit "$ac_status"); } &&
19691          { ac_try='test -s "conftest$ac_exeext"'
19692   { (eval echo "$as_me:19692: \"$ac_try\"") >&5
19693   (eval $ac_try) 2>&5
19694   ac_status=$?
19695   echo "$as_me:19695: \$? = $ac_status" >&5
19696   (exit "$ac_status"); }; }; then
19697   ac_cv_lib_util_openpty=yes
19698 else
19699   echo "$as_me: failed program was:" >&5
19700 cat "conftest.$ac_ext" >&5
19701 ac_cv_lib_util_openpty=no
19702 fi
19703 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19704 LIBS=$ac_check_lib_save_LIBS
19705 fi
19706 echo "$as_me:19706: result: $ac_cv_lib_util_openpty" >&5
19707 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19708 if test "$ac_cv_lib_util_openpty" = yes; then
19709   cf_cv_lib_util=yes
19710 else
19711   cf_cv_lib_util=no
19712 fi
19713
19714 echo "$as_me:19714: checking for openpty header" >&5
19715 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19716 if test "${cf_cv_func_openpty+set}" = set; then
19717   echo $ECHO_N "(cached) $ECHO_C" >&6
19718 else
19719
19720         cf_save_LIBS="$LIBS"
19721         test "$cf_cv_lib_util" = yes && {
19722 cf_add_libs="$LIBS"
19723 # reverse order
19724 cf_add_0lib=
19725 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19726 # filter duplicates
19727 for cf_add_1lib in $cf_add_0lib; do
19728         for cf_add_2lib in $cf_add_libs; do
19729                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19730                         cf_add_1lib=
19731                         break
19732                 fi
19733         done
19734         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19735 done
19736 LIBS="$cf_add_libs"
19737  }
19738         for cf_header in pty.h libutil.h util.h
19739         do
19740         cat >"conftest.$ac_ext" <<_ACEOF
19741 #line 19741 "configure"
19742 #include "confdefs.h"
19743
19744 #include <$cf_header>
19745
19746 int
19747 main (void)
19748 {
19749
19750         int x = openpty((int *)0, (int *)0, (char *)0,
19751                                    (struct termios *)0, (struct winsize *)0);
19752
19753   ;
19754   return 0;
19755 }
19756 _ACEOF
19757 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19758 if { (eval echo "$as_me:19758: \"$ac_link\"") >&5
19759   (eval $ac_link) 2>&5
19760   ac_status=$?
19761   echo "$as_me:19761: \$? = $ac_status" >&5
19762   (exit "$ac_status"); } &&
19763          { ac_try='test -s "conftest$ac_exeext"'
19764   { (eval echo "$as_me:19764: \"$ac_try\"") >&5
19765   (eval $ac_try) 2>&5
19766   ac_status=$?
19767   echo "$as_me:19767: \$? = $ac_status" >&5
19768   (exit "$ac_status"); }; }; then
19769
19770                 cf_cv_func_openpty=$cf_header
19771                 break
19772
19773 else
19774   echo "$as_me: failed program was:" >&5
19775 cat "conftest.$ac_ext" >&5
19776
19777                 cf_cv_func_openpty=no
19778
19779 fi
19780 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19781         done
19782         LIBS="$cf_save_LIBS"
19783
19784 fi
19785 echo "$as_me:19785: result: $cf_cv_func_openpty" >&5
19786 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19787
19788 if test "$cf_cv_func_openpty" != no ; then
19789
19790 cat >>confdefs.h <<EOF
19791 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19792 EOF
19793
19794 cat >>confdefs.h <<\EOF
19795 #define USE_XTERM_PTY 1
19796 EOF
19797
19798         if test "x$cf_cv_lib_util" = xyes ; then
19799
19800 cf_add_libs="$TEST_LIBS"
19801 # reverse order
19802 cf_add_0lib=
19803 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19804 # filter duplicates
19805 for cf_add_1lib in $cf_add_0lib; do
19806         for cf_add_2lib in $cf_add_libs; do
19807                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19808                         cf_add_1lib=
19809                         break
19810                 fi
19811         done
19812         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19813 done
19814 TEST_LIBS="$cf_add_libs"
19815
19816         fi
19817 fi
19818
19819 echo "$as_me:19819: checking for function curses_version" >&5
19820 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19821 if test "${cf_cv_func_curses_version+set}" = set; then
19822   echo $ECHO_N "(cached) $ECHO_C" >&6
19823 else
19824
19825 if test "$cross_compiling" = yes; then
19826   cf_cv_func_curses_version=unknown
19827 else
19828   cat >"conftest.$ac_ext" <<_ACEOF
19829 #line 19829 "configure"
19830 #include "confdefs.h"
19831
19832 #include <${cf_cv_ncurses_header:-curses.h}>
19833 int main(void)
19834 {
19835         char temp[1024];
19836         sprintf(temp, "%s\\n", curses_version());
19837         ${cf_cv_main_return:-return}(0);
19838 }
19839
19840 _ACEOF
19841 rm -f "conftest$ac_exeext"
19842 if { (eval echo "$as_me:19842: \"$ac_link\"") >&5
19843   (eval $ac_link) 2>&5
19844   ac_status=$?
19845   echo "$as_me:19845: \$? = $ac_status" >&5
19846   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
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_func_curses_version=yes
19853
19854 else
19855   echo "$as_me: program exited with status $ac_status" >&5
19856 echo "$as_me: failed program was:" >&5
19857 cat "conftest.$ac_ext" >&5
19858 cf_cv_func_curses_version=no
19859
19860 fi
19861 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19862 fi
19863 rm -f core
19864 fi
19865 echo "$as_me:19865: result: $cf_cv_func_curses_version" >&5
19866 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19867 test "$cf_cv_func_curses_version" = yes &&
19868 cat >>confdefs.h <<\EOF
19869 #define HAVE_CURSES_VERSION 1
19870 EOF
19871
19872 echo "$as_me:19872: checking for alternate character set array" >&5
19873 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19874 if test "${cf_cv_curses_acs_map+set}" = set; then
19875   echo $ECHO_N "(cached) $ECHO_C" >&6
19876 else
19877
19878 cf_cv_curses_acs_map=unknown
19879 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19880 do
19881 cat >"conftest.$ac_ext" <<_ACEOF
19882 #line 19882 "configure"
19883 #include "confdefs.h"
19884
19885 #include <${cf_cv_ncurses_header:-curses.h}>
19886
19887 int
19888 main (void)
19889 {
19890
19891 ${name}['k'] = ACS_PLUS
19892
19893   ;
19894   return 0;
19895 }
19896 _ACEOF
19897 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19898 if { (eval echo "$as_me:19898: \"$ac_link\"") >&5
19899   (eval $ac_link) 2>&5
19900   ac_status=$?
19901   echo "$as_me:19901: \$? = $ac_status" >&5
19902   (exit "$ac_status"); } &&
19903          { ac_try='test -s "conftest$ac_exeext"'
19904   { (eval echo "$as_me:19904: \"$ac_try\"") >&5
19905   (eval $ac_try) 2>&5
19906   ac_status=$?
19907   echo "$as_me:19907: \$? = $ac_status" >&5
19908   (exit "$ac_status"); }; }; then
19909   cf_cv_curses_acs_map=$name; break
19910 else
19911   echo "$as_me: failed program was:" >&5
19912 cat "conftest.$ac_ext" >&5
19913 fi
19914 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19915 done
19916
19917 fi
19918 echo "$as_me:19918: result: $cf_cv_curses_acs_map" >&5
19919 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19920
19921 test "$cf_cv_curses_acs_map" != unknown &&
19922 cat >>confdefs.h <<EOF
19923 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19924 EOF
19925
19926 if test "$cf_enable_widec" = yes; then
19927
19928 echo "$as_me:19928: checking for wide alternate character set array" >&5
19929 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19930 if test "${cf_cv_curses_wacs_map+set}" = set; then
19931   echo $ECHO_N "(cached) $ECHO_C" >&6
19932 else
19933
19934         cf_cv_curses_wacs_map=unknown
19935         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19936         do
19937         cat >"conftest.$ac_ext" <<_ACEOF
19938 #line 19938 "configure"
19939 #include "confdefs.h"
19940
19941 #ifndef _XOPEN_SOURCE_EXTENDED
19942 #define _XOPEN_SOURCE_EXTENDED
19943 #endif
19944 #include <${cf_cv_ncurses_header:-curses.h}>
19945 int
19946 main (void)
19947 {
19948 void *foo = &(${name}['k']); (void)foo
19949   ;
19950   return 0;
19951 }
19952 _ACEOF
19953 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19954 if { (eval echo "$as_me:19954: \"$ac_link\"") >&5
19955   (eval $ac_link) 2>&5
19956   ac_status=$?
19957   echo "$as_me:19957: \$? = $ac_status" >&5
19958   (exit "$ac_status"); } &&
19959          { ac_try='test -s "conftest$ac_exeext"'
19960   { (eval echo "$as_me:19960: \"$ac_try\"") >&5
19961   (eval $ac_try) 2>&5
19962   ac_status=$?
19963   echo "$as_me:19963: \$? = $ac_status" >&5
19964   (exit "$ac_status"); }; }; then
19965   cf_cv_curses_wacs_map=$name
19966          break
19967 else
19968   echo "$as_me: failed program was:" >&5
19969 cat "conftest.$ac_ext" >&5
19970 fi
19971 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19972         done
19973 fi
19974 echo "$as_me:19974: result: $cf_cv_curses_wacs_map" >&5
19975 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19976
19977 test "$cf_cv_curses_wacs_map" != unknown &&
19978 cat >>confdefs.h <<EOF
19979 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19980 EOF
19981
19982 echo "$as_me:19982: checking for wide alternate character constants" >&5
19983 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19984 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19985   echo $ECHO_N "(cached) $ECHO_C" >&6
19986 else
19987
19988 cf_cv_curses_wacs_symbols=no
19989 if test "$cf_cv_curses_wacs_map" != unknown
19990 then
19991         cat >"conftest.$ac_ext" <<_ACEOF
19992 #line 19992 "configure"
19993 #include "confdefs.h"
19994
19995 #ifndef _XOPEN_SOURCE_EXTENDED
19996 #define _XOPEN_SOURCE_EXTENDED
19997 #endif
19998 #include <${cf_cv_ncurses_header:-curses.h}>
19999 int
20000 main (void)
20001 {
20002 cchar_t *foo = WACS_PLUS;
20003          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
20004   ;
20005   return 0;
20006 }
20007 _ACEOF
20008 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20009 if { (eval echo "$as_me:20009: \"$ac_link\"") >&5
20010   (eval $ac_link) 2>&5
20011   ac_status=$?
20012   echo "$as_me:20012: \$? = $ac_status" >&5
20013   (exit "$ac_status"); } &&
20014          { ac_try='test -s "conftest$ac_exeext"'
20015   { (eval echo "$as_me:20015: \"$ac_try\"") >&5
20016   (eval $ac_try) 2>&5
20017   ac_status=$?
20018   echo "$as_me:20018: \$? = $ac_status" >&5
20019   (exit "$ac_status"); }; }; then
20020   cf_cv_curses_wacs_symbols=yes
20021 else
20022   echo "$as_me: failed program was:" >&5
20023 cat "conftest.$ac_ext" >&5
20024 fi
20025 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20026 else
20027         cat >"conftest.$ac_ext" <<_ACEOF
20028 #line 20028 "configure"
20029 #include "confdefs.h"
20030
20031 #ifndef _XOPEN_SOURCE_EXTENDED
20032 #define _XOPEN_SOURCE_EXTENDED
20033 #endif
20034 #include <${cf_cv_ncurses_header:-curses.h}>
20035 int
20036 main (void)
20037 {
20038 cchar_t *foo = WACS_PLUS; (void)foo
20039   ;
20040   return 0;
20041 }
20042 _ACEOF
20043 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20044 if { (eval echo "$as_me:20044: \"$ac_link\"") >&5
20045   (eval $ac_link) 2>&5
20046   ac_status=$?
20047   echo "$as_me:20047: \$? = $ac_status" >&5
20048   (exit "$ac_status"); } &&
20049          { ac_try='test -s "conftest$ac_exeext"'
20050   { (eval echo "$as_me:20050: \"$ac_try\"") >&5
20051   (eval $ac_try) 2>&5
20052   ac_status=$?
20053   echo "$as_me:20053: \$? = $ac_status" >&5
20054   (exit "$ac_status"); }; }; then
20055   cf_cv_curses_wacs_symbols=yes
20056 else
20057   echo "$as_me: failed program was:" >&5
20058 cat "conftest.$ac_ext" >&5
20059 fi
20060 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20061 fi
20062
20063 fi
20064 echo "$as_me:20064: result: $cf_cv_curses_wacs_symbols" >&5
20065 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
20066
20067 test "$cf_cv_curses_wacs_symbols" != no &&
20068 cat >>confdefs.h <<\EOF
20069 #define CURSES_WACS_SYMBOLS 1
20070 EOF
20071
20072 fi
20073
20074 echo "$as_me:20074: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20075 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20076 cat >"conftest.$ac_ext" <<_ACEOF
20077 #line 20077 "configure"
20078 #include "confdefs.h"
20079
20080 #ifndef _XOPEN_SOURCE_EXTENDED
20081 #define _XOPEN_SOURCE_EXTENDED
20082 #endif
20083 #include <${cf_cv_ncurses_header:-curses.h}>
20084 int
20085 main (void)
20086 {
20087
20088 attr_t foo
20089
20090   ;
20091   return 0;
20092 }
20093 _ACEOF
20094 rm -f "conftest.$ac_objext"
20095 if { (eval echo "$as_me:20095: \"$ac_compile\"") >&5
20096   (eval $ac_compile) 2>&5
20097   ac_status=$?
20098   echo "$as_me:20098: \$? = $ac_status" >&5
20099   (exit "$ac_status"); } &&
20100          { ac_try='test -s "conftest.$ac_objext"'
20101   { (eval echo "$as_me:20101: \"$ac_try\"") >&5
20102   (eval $ac_try) 2>&5
20103   ac_status=$?
20104   echo "$as_me:20104: \$? = $ac_status" >&5
20105   (exit "$ac_status"); }; }; then
20106   cf_result=yes
20107 else
20108   echo "$as_me: failed program was:" >&5
20109 cat "conftest.$ac_ext" >&5
20110 cf_result=no
20111 fi
20112 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20113 echo "$as_me:20113: result: $cf_result" >&5
20114 echo "${ECHO_T}$cf_result" >&6
20115 if test "$cf_result" = yes ; then
20116
20117 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20118
20119 cat >>confdefs.h <<EOF
20120 #define $cf_result 1
20121 EOF
20122
20123 else
20124
20125 cat >>confdefs.h <<EOF
20126 #define attr_t long
20127 EOF
20128
20129 fi
20130
20131 if test "$cf_enable_widec" = yes; then
20132
20133 # This is needed on Tru64 5.0 to declare mbstate_t
20134 echo "$as_me:20134: checking if we must include wchar.h to declare mbstate_t" >&5
20135 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
20136 if test "${cf_cv_mbstate_t+set}" = set; then
20137   echo $ECHO_N "(cached) $ECHO_C" >&6
20138 else
20139
20140 cat >"conftest.$ac_ext" <<_ACEOF
20141 #line 20141 "configure"
20142 #include "confdefs.h"
20143
20144 #include <stdlib.h>
20145 #include <stdarg.h>
20146 #include <stdio.h>
20147 #ifdef HAVE_LIBUTF8_H
20148 #include <libutf8.h>
20149 #endif
20150 int
20151 main (void)
20152 {
20153 mbstate_t state
20154   ;
20155   return 0;
20156 }
20157 _ACEOF
20158 rm -f "conftest.$ac_objext"
20159 if { (eval echo "$as_me:20159: \"$ac_compile\"") >&5
20160   (eval $ac_compile) 2>&5
20161   ac_status=$?
20162   echo "$as_me:20162: \$? = $ac_status" >&5
20163   (exit "$ac_status"); } &&
20164          { ac_try='test -s "conftest.$ac_objext"'
20165   { (eval echo "$as_me:20165: \"$ac_try\"") >&5
20166   (eval $ac_try) 2>&5
20167   ac_status=$?
20168   echo "$as_me:20168: \$? = $ac_status" >&5
20169   (exit "$ac_status"); }; }; then
20170   cf_cv_mbstate_t=no
20171 else
20172   echo "$as_me: failed program was:" >&5
20173 cat "conftest.$ac_ext" >&5
20174 cat >"conftest.$ac_ext" <<_ACEOF
20175 #line 20175 "configure"
20176 #include "confdefs.h"
20177
20178 #include <stdlib.h>
20179 #include <stdarg.h>
20180 #include <stdio.h>
20181 #include <wchar.h>
20182 #ifdef HAVE_LIBUTF8_H
20183 #include <libutf8.h>
20184 #endif
20185 int
20186 main (void)
20187 {
20188 mbstate_t value
20189   ;
20190   return 0;
20191 }
20192 _ACEOF
20193 rm -f "conftest.$ac_objext"
20194 if { (eval echo "$as_me:20194: \"$ac_compile\"") >&5
20195   (eval $ac_compile) 2>&5
20196   ac_status=$?
20197   echo "$as_me:20197: \$? = $ac_status" >&5
20198   (exit "$ac_status"); } &&
20199          { ac_try='test -s "conftest.$ac_objext"'
20200   { (eval echo "$as_me:20200: \"$ac_try\"") >&5
20201   (eval $ac_try) 2>&5
20202   ac_status=$?
20203   echo "$as_me:20203: \$? = $ac_status" >&5
20204   (exit "$ac_status"); }; }; then
20205   cf_cv_mbstate_t=yes
20206 else
20207   echo "$as_me: failed program was:" >&5
20208 cat "conftest.$ac_ext" >&5
20209 cf_cv_mbstate_t=unknown
20210 fi
20211 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20212 fi
20213 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20214 fi
20215 echo "$as_me:20215: result: $cf_cv_mbstate_t" >&5
20216 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
20217
20218 if test "$cf_cv_mbstate_t" = yes ; then
20219
20220 cat >>confdefs.h <<\EOF
20221 #define NEED_WCHAR_H 1
20222 EOF
20223
20224         NEED_WCHAR_H=1
20225 fi
20226
20227 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
20228 if test "$cf_cv_mbstate_t" = unknown ; then
20229         NCURSES_MBSTATE_T=1
20230 fi
20231
20232 # if we find mbstate_t in either place, use substitution to provide a fallback.
20233 if test "$cf_cv_mbstate_t" != unknown ; then
20234         NCURSES_OK_MBSTATE_T=1
20235 fi
20236
20237 # This is needed on Tru64 5.0 to declare wchar_t
20238 echo "$as_me:20238: checking if we must include wchar.h to declare wchar_t" >&5
20239 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
20240 if test "${cf_cv_wchar_t+set}" = set; then
20241   echo $ECHO_N "(cached) $ECHO_C" >&6
20242 else
20243
20244 cat >"conftest.$ac_ext" <<_ACEOF
20245 #line 20245 "configure"
20246 #include "confdefs.h"
20247
20248 #include <stdlib.h>
20249 #include <stdarg.h>
20250 #include <stdio.h>
20251 #ifdef HAVE_LIBUTF8_H
20252 #include <libutf8.h>
20253 #endif
20254 int
20255 main (void)
20256 {
20257 wchar_t state
20258   ;
20259   return 0;
20260 }
20261 _ACEOF
20262 rm -f "conftest.$ac_objext"
20263 if { (eval echo "$as_me:20263: \"$ac_compile\"") >&5
20264   (eval $ac_compile) 2>&5
20265   ac_status=$?
20266   echo "$as_me:20266: \$? = $ac_status" >&5
20267   (exit "$ac_status"); } &&
20268          { ac_try='test -s "conftest.$ac_objext"'
20269   { (eval echo "$as_me:20269: \"$ac_try\"") >&5
20270   (eval $ac_try) 2>&5
20271   ac_status=$?
20272   echo "$as_me:20272: \$? = $ac_status" >&5
20273   (exit "$ac_status"); }; }; then
20274   cf_cv_wchar_t=no
20275 else
20276   echo "$as_me: failed program was:" >&5
20277 cat "conftest.$ac_ext" >&5
20278 cat >"conftest.$ac_ext" <<_ACEOF
20279 #line 20279 "configure"
20280 #include "confdefs.h"
20281
20282 #include <stdlib.h>
20283 #include <stdarg.h>
20284 #include <stdio.h>
20285 #include <wchar.h>
20286 #ifdef HAVE_LIBUTF8_H
20287 #include <libutf8.h>
20288 #endif
20289 int
20290 main (void)
20291 {
20292 wchar_t value
20293   ;
20294   return 0;
20295 }
20296 _ACEOF
20297 rm -f "conftest.$ac_objext"
20298 if { (eval echo "$as_me:20298: \"$ac_compile\"") >&5
20299   (eval $ac_compile) 2>&5
20300   ac_status=$?
20301   echo "$as_me:20301: \$? = $ac_status" >&5
20302   (exit "$ac_status"); } &&
20303          { ac_try='test -s "conftest.$ac_objext"'
20304   { (eval echo "$as_me:20304: \"$ac_try\"") >&5
20305   (eval $ac_try) 2>&5
20306   ac_status=$?
20307   echo "$as_me:20307: \$? = $ac_status" >&5
20308   (exit "$ac_status"); }; }; then
20309   cf_cv_wchar_t=yes
20310 else
20311   echo "$as_me: failed program was:" >&5
20312 cat "conftest.$ac_ext" >&5
20313 cf_cv_wchar_t=unknown
20314 fi
20315 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20316 fi
20317 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20318 fi
20319 echo "$as_me:20319: result: $cf_cv_wchar_t" >&5
20320 echo "${ECHO_T}$cf_cv_wchar_t" >&6
20321
20322 if test "$cf_cv_wchar_t" = yes ; then
20323
20324 cat >>confdefs.h <<\EOF
20325 #define NEED_WCHAR_H 1
20326 EOF
20327
20328         NEED_WCHAR_H=1
20329 fi
20330
20331 # if we do not find wchar_t in either place, use substitution to provide a fallback.
20332 if test "$cf_cv_wchar_t" = unknown ; then
20333         NCURSES_WCHAR_T=1
20334 fi
20335
20336 # if we find wchar_t in either place, use substitution to provide a fallback.
20337 if test "$cf_cv_wchar_t" != unknown ; then
20338         NCURSES_OK_WCHAR_T=1
20339 fi
20340
20341 # This is needed on Tru64 5.0 to declare wint_t
20342 echo "$as_me:20342: checking if we must include wchar.h to declare wint_t" >&5
20343 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
20344 if test "${cf_cv_wint_t+set}" = set; then
20345   echo $ECHO_N "(cached) $ECHO_C" >&6
20346 else
20347
20348 cat >"conftest.$ac_ext" <<_ACEOF
20349 #line 20349 "configure"
20350 #include "confdefs.h"
20351
20352 #include <stdlib.h>
20353 #include <stdarg.h>
20354 #include <stdio.h>
20355 #ifdef HAVE_LIBUTF8_H
20356 #include <libutf8.h>
20357 #endif
20358 int
20359 main (void)
20360 {
20361 wint_t state
20362   ;
20363   return 0;
20364 }
20365 _ACEOF
20366 rm -f "conftest.$ac_objext"
20367 if { (eval echo "$as_me:20367: \"$ac_compile\"") >&5
20368   (eval $ac_compile) 2>&5
20369   ac_status=$?
20370   echo "$as_me:20370: \$? = $ac_status" >&5
20371   (exit "$ac_status"); } &&
20372          { ac_try='test -s "conftest.$ac_objext"'
20373   { (eval echo "$as_me:20373: \"$ac_try\"") >&5
20374   (eval $ac_try) 2>&5
20375   ac_status=$?
20376   echo "$as_me:20376: \$? = $ac_status" >&5
20377   (exit "$ac_status"); }; }; then
20378   cf_cv_wint_t=no
20379 else
20380   echo "$as_me: failed program was:" >&5
20381 cat "conftest.$ac_ext" >&5
20382 cat >"conftest.$ac_ext" <<_ACEOF
20383 #line 20383 "configure"
20384 #include "confdefs.h"
20385
20386 #include <stdlib.h>
20387 #include <stdarg.h>
20388 #include <stdio.h>
20389 #include <wchar.h>
20390 #ifdef HAVE_LIBUTF8_H
20391 #include <libutf8.h>
20392 #endif
20393 int
20394 main (void)
20395 {
20396 wint_t value
20397   ;
20398   return 0;
20399 }
20400 _ACEOF
20401 rm -f "conftest.$ac_objext"
20402 if { (eval echo "$as_me:20402: \"$ac_compile\"") >&5
20403   (eval $ac_compile) 2>&5
20404   ac_status=$?
20405   echo "$as_me:20405: \$? = $ac_status" >&5
20406   (exit "$ac_status"); } &&
20407          { ac_try='test -s "conftest.$ac_objext"'
20408   { (eval echo "$as_me:20408: \"$ac_try\"") >&5
20409   (eval $ac_try) 2>&5
20410   ac_status=$?
20411   echo "$as_me:20411: \$? = $ac_status" >&5
20412   (exit "$ac_status"); }; }; then
20413   cf_cv_wint_t=yes
20414 else
20415   echo "$as_me: failed program was:" >&5
20416 cat "conftest.$ac_ext" >&5
20417 cf_cv_wint_t=unknown
20418 fi
20419 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20420 fi
20421 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20422 fi
20423 echo "$as_me:20423: result: $cf_cv_wint_t" >&5
20424 echo "${ECHO_T}$cf_cv_wint_t" >&6
20425
20426 if test "$cf_cv_wint_t" = yes ; then
20427
20428 cat >>confdefs.h <<\EOF
20429 #define NEED_WCHAR_H 1
20430 EOF
20431
20432         NEED_WCHAR_H=1
20433 fi
20434
20435 # if we do not find wint_t in either place, use substitution to provide a fallback.
20436 if test "$cf_cv_wint_t" = unknown ; then
20437         NCURSES_WINT_T=1
20438 fi
20439
20440 # if we find wint_t in either place, use substitution to provide a fallback.
20441 if test "$cf_cv_wint_t" != unknown ; then
20442         NCURSES_OK_WINT_T=1
20443 fi
20444
20445         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20446
20447 echo "$as_me:20447: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20448 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20449 cat >"conftest.$ac_ext" <<_ACEOF
20450 #line 20450 "configure"
20451 #include "confdefs.h"
20452
20453 #ifndef _XOPEN_SOURCE_EXTENDED
20454 #define _XOPEN_SOURCE_EXTENDED
20455 #endif
20456 #include <${cf_cv_ncurses_header:-curses.h}>
20457 int
20458 main (void)
20459 {
20460
20461 mbstate_t foo
20462
20463   ;
20464   return 0;
20465 }
20466 _ACEOF
20467 rm -f "conftest.$ac_objext"
20468 if { (eval echo "$as_me:20468: \"$ac_compile\"") >&5
20469   (eval $ac_compile) 2>&5
20470   ac_status=$?
20471   echo "$as_me:20471: \$? = $ac_status" >&5
20472   (exit "$ac_status"); } &&
20473          { ac_try='test -s "conftest.$ac_objext"'
20474   { (eval echo "$as_me:20474: \"$ac_try\"") >&5
20475   (eval $ac_try) 2>&5
20476   ac_status=$?
20477   echo "$as_me:20477: \$? = $ac_status" >&5
20478   (exit "$ac_status"); }; }; then
20479   cf_result=yes
20480 else
20481   echo "$as_me: failed program was:" >&5
20482 cat "conftest.$ac_ext" >&5
20483 cf_result=no
20484 fi
20485 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20486 echo "$as_me:20486: result: $cf_result" >&5
20487 echo "${ECHO_T}$cf_result" >&6
20488 if test "$cf_result" = yes ; then
20489
20490 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20491
20492 cat >>confdefs.h <<EOF
20493 #define $cf_result 1
20494 EOF
20495
20496 else
20497
20498 cat >>confdefs.h <<EOF
20499 #define mbstate_t long
20500 EOF
20501
20502 fi
20503
20504         fi
20505
20506         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20507
20508 echo "$as_me:20508: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20509 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20510 cat >"conftest.$ac_ext" <<_ACEOF
20511 #line 20511 "configure"
20512 #include "confdefs.h"
20513
20514 #ifndef _XOPEN_SOURCE_EXTENDED
20515 #define _XOPEN_SOURCE_EXTENDED
20516 #endif
20517 #include <${cf_cv_ncurses_header:-curses.h}>
20518 int
20519 main (void)
20520 {
20521
20522 wchar_t foo
20523
20524   ;
20525   return 0;
20526 }
20527 _ACEOF
20528 rm -f "conftest.$ac_objext"
20529 if { (eval echo "$as_me:20529: \"$ac_compile\"") >&5
20530   (eval $ac_compile) 2>&5
20531   ac_status=$?
20532   echo "$as_me:20532: \$? = $ac_status" >&5
20533   (exit "$ac_status"); } &&
20534          { ac_try='test -s "conftest.$ac_objext"'
20535   { (eval echo "$as_me:20535: \"$ac_try\"") >&5
20536   (eval $ac_try) 2>&5
20537   ac_status=$?
20538   echo "$as_me:20538: \$? = $ac_status" >&5
20539   (exit "$ac_status"); }; }; then
20540   cf_result=yes
20541 else
20542   echo "$as_me: failed program was:" >&5
20543 cat "conftest.$ac_ext" >&5
20544 cf_result=no
20545 fi
20546 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20547 echo "$as_me:20547: result: $cf_result" >&5
20548 echo "${ECHO_T}$cf_result" >&6
20549 if test "$cf_result" = yes ; then
20550
20551 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20552
20553 cat >>confdefs.h <<EOF
20554 #define $cf_result 1
20555 EOF
20556
20557 else
20558
20559 cat >>confdefs.h <<EOF
20560 #define wchar_t long
20561 EOF
20562
20563 fi
20564
20565         fi
20566
20567         if test "$NCURSES_OK_WINT_T" = 0 ; then
20568
20569 echo "$as_me:20569: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20570 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20571 cat >"conftest.$ac_ext" <<_ACEOF
20572 #line 20572 "configure"
20573 #include "confdefs.h"
20574
20575 #ifndef _XOPEN_SOURCE_EXTENDED
20576 #define _XOPEN_SOURCE_EXTENDED
20577 #endif
20578 #include <${cf_cv_ncurses_header:-curses.h}>
20579 int
20580 main (void)
20581 {
20582
20583 wint_t foo
20584
20585   ;
20586   return 0;
20587 }
20588 _ACEOF
20589 rm -f "conftest.$ac_objext"
20590 if { (eval echo "$as_me:20590: \"$ac_compile\"") >&5
20591   (eval $ac_compile) 2>&5
20592   ac_status=$?
20593   echo "$as_me:20593: \$? = $ac_status" >&5
20594   (exit "$ac_status"); } &&
20595          { ac_try='test -s "conftest.$ac_objext"'
20596   { (eval echo "$as_me:20596: \"$ac_try\"") >&5
20597   (eval $ac_try) 2>&5
20598   ac_status=$?
20599   echo "$as_me:20599: \$? = $ac_status" >&5
20600   (exit "$ac_status"); }; }; then
20601   cf_result=yes
20602 else
20603   echo "$as_me: failed program was:" >&5
20604 cat "conftest.$ac_ext" >&5
20605 cf_result=no
20606 fi
20607 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20608 echo "$as_me:20608: result: $cf_result" >&5
20609 echo "${ECHO_T}$cf_result" >&6
20610 if test "$cf_result" = yes ; then
20611
20612 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20613
20614 cat >>confdefs.h <<EOF
20615 #define $cf_result 1
20616 EOF
20617
20618 else
20619
20620 cat >>confdefs.h <<EOF
20621 #define wint_t long
20622 EOF
20623
20624 fi
20625
20626         fi
20627 fi
20628
20629 for cf_data in \
20630 TABSIZE \
20631 curscr \
20632 ospeed \
20633 boolnames \
20634 boolfnames \
20635 ttytype
20636 do
20637 echo "$as_me:20637: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20638 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20639
20640 cat >"conftest.$ac_ext" <<_ACEOF
20641 #line 20641 "configure"
20642 #include "confdefs.h"
20643
20644 #ifdef HAVE_XCURSES
20645 #include <xcurses.h>
20646 char * XCursesProgramName = "test";
20647 #else
20648 #include <${cf_cv_ncurses_header:-curses.h}>
20649 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20650 #include <ncursesw/term.h>
20651 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20652 #include <ncurses/term.h>
20653 #elif defined(HAVE_TERM_H)
20654 #include <term.h>
20655 #endif
20656 #endif
20657
20658 int
20659 main (void)
20660 {
20661
20662 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20663         const void *foo = (const void *)($cf_data);
20664 #else
20665         const void *foo = &($cf_data);
20666 #endif
20667         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20668
20669   ;
20670   return 0;
20671 }
20672 _ACEOF
20673 rm -f "conftest.$ac_objext"
20674 if { (eval echo "$as_me:20674: \"$ac_compile\"") >&5
20675   (eval $ac_compile) 2>&5
20676   ac_status=$?
20677   echo "$as_me:20677: \$? = $ac_status" >&5
20678   (exit "$ac_status"); } &&
20679          { ac_try='test -s "conftest.$ac_objext"'
20680   { (eval echo "$as_me:20680: \"$ac_try\"") >&5
20681   (eval $ac_try) 2>&5
20682   ac_status=$?
20683   echo "$as_me:20683: \$? = $ac_status" >&5
20684   (exit "$ac_status"); }; }; then
20685   cf_result=yes
20686
20687 else
20688   echo "$as_me: failed program was:" >&5
20689 cat "conftest.$ac_ext" >&5
20690 cf_result=no
20691 fi
20692 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20693 echo "$as_me:20693: result: $cf_result" >&5
20694 echo "${ECHO_T}$cf_result" >&6
20695
20696 if test "$cf_result" = yes ; then
20697
20698 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20699
20700         cat >>confdefs.h <<EOF
20701 #define $cf_result 1
20702 EOF
20703
20704 else
20705         echo "$as_me:20705: checking for data $cf_data in library" >&5
20706 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20707         # BSD linkers insist on making weak linkage, but resolve at runtime.
20708         if test "$cross_compiling" = yes; then
20709
20710         # cross-compiling
20711         cat >"conftest.$ac_ext" <<_ACEOF
20712 #line 20712 "configure"
20713 #include "confdefs.h"
20714
20715 #ifdef HAVE_XCURSES
20716 #include <xcurses.h>
20717 char * XCursesProgramName = "test";
20718 #else
20719 #include <${cf_cv_ncurses_header:-curses.h}>
20720 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20721 #include <ncursesw/term.h>
20722 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20723 #include <ncurses/term.h>
20724 #elif defined(HAVE_TERM_H)
20725 #include <term.h>
20726 #endif
20727 #endif
20728
20729 extern char $cf_data;
20730 int
20731 main (void)
20732 {
20733
20734         do {
20735
20736 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20737         const void *foo = (const void *)($cf_data);
20738 #else
20739         const void *foo = &($cf_data);
20740 #endif
20741         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20742
20743                 ${cf_cv_main_return:-return}(foo == 0);
20744         } while (0)
20745
20746   ;
20747   return 0;
20748 }
20749 _ACEOF
20750 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20751 if { (eval echo "$as_me:20751: \"$ac_link\"") >&5
20752   (eval $ac_link) 2>&5
20753   ac_status=$?
20754   echo "$as_me:20754: \$? = $ac_status" >&5
20755   (exit "$ac_status"); } &&
20756          { ac_try='test -s "conftest$ac_exeext"'
20757   { (eval echo "$as_me:20757: \"$ac_try\"") >&5
20758   (eval $ac_try) 2>&5
20759   ac_status=$?
20760   echo "$as_me:20760: \$? = $ac_status" >&5
20761   (exit "$ac_status"); }; }; then
20762   cf_result=yes
20763 else
20764   echo "$as_me: failed program was:" >&5
20765 cat "conftest.$ac_ext" >&5
20766 cf_result=no
20767 fi
20768 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20769
20770 else
20771   cat >"conftest.$ac_ext" <<_ACEOF
20772 #line 20772 "configure"
20773 #include "confdefs.h"
20774
20775 #ifdef HAVE_XCURSES
20776 #include <xcurses.h>
20777 char * XCursesProgramName = "test";
20778 #else
20779 #include <${cf_cv_ncurses_header:-curses.h}>
20780 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20781 #include <ncursesw/term.h>
20782 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20783 #include <ncurses/term.h>
20784 #elif defined(HAVE_TERM_H)
20785 #include <term.h>
20786 #endif
20787 #endif
20788
20789 extern char $cf_data;
20790 int main(void)
20791 {
20792
20793 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20794         const void *foo = (const void *)($cf_data);
20795 #else
20796         const void *foo = &($cf_data);
20797 #endif
20798         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20799
20800         ${cf_cv_main_return:-return}(foo == 0);
20801 }
20802 _ACEOF
20803 rm -f "conftest$ac_exeext"
20804 if { (eval echo "$as_me:20804: \"$ac_link\"") >&5
20805   (eval $ac_link) 2>&5
20806   ac_status=$?
20807   echo "$as_me:20807: \$? = $ac_status" >&5
20808   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20809   { (eval echo "$as_me:20809: \"$ac_try\"") >&5
20810   (eval $ac_try) 2>&5
20811   ac_status=$?
20812   echo "$as_me:20812: \$? = $ac_status" >&5
20813   (exit "$ac_status"); }; }; then
20814   cf_result=yes
20815
20816 else
20817   echo "$as_me: program exited with status $ac_status" >&5
20818 echo "$as_me: failed program was:" >&5
20819 cat "conftest.$ac_ext" >&5
20820 cf_result=no
20821 fi
20822 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20823 fi
20824         echo "$as_me:20824: result: $cf_result" >&5
20825 echo "${ECHO_T}$cf_result" >&6
20826         if test "$cf_result" = yes ; then
20827
20828 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20829
20830                 cat >>confdefs.h <<EOF
20831 #define $cf_result 1
20832 EOF
20833
20834                 # do not exit loop here, since we prefer system's declarations
20835         fi
20836 fi
20837 done
20838
20839 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20840 then
20841         echo "$as_me:20841: checking for X" >&5
20842 echo $ECHO_N "checking for X... $ECHO_C" >&6
20843
20844 # Check whether --with-x or --without-x was given.
20845 if test "${with_x+set}" = set; then
20846   withval="$with_x"
20847
20848 fi;
20849 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20850 if test "x$with_x" = xno; then
20851   # The user explicitly disabled X.
20852   have_x=disabled
20853 else
20854   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20855     # Both variables are already set.
20856     have_x=yes
20857   else
20858     if test "${ac_cv_have_x+set}" = set; then
20859   echo $ECHO_N "(cached) $ECHO_C" >&6
20860 else
20861   # One or both of the vars are not set, and there is no cached value.
20862 ac_x_includes=no ac_x_libraries=no
20863 rm -fr conftest.dir
20864 if mkdir conftest.dir; then
20865   cd conftest.dir
20866   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20867   cat >Imakefile <<'EOF'
20868 acfindx:
20869         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20870 EOF
20871   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20872     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20873     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20874     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20875     for ac_extension in a so sl dylib dll; do
20876       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20877          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20878         ac_im_usrlibdir=$ac_im_libdir; break
20879       fi
20880     done
20881     # Screen out bogus values from the imake configuration.  They are
20882     # bogus both because they are the default anyway, and because
20883     # using them would break gcc on systems where it needs fixed includes.
20884     case $ac_im_incroot in
20885         /usr/include) ;;
20886         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20887     esac
20888     case $ac_im_usrlibdir in
20889         /usr/lib | /lib) ;;
20890         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20891     esac
20892   fi
20893   cd ..
20894   rm -fr conftest.dir
20895 fi
20896
20897 # Standard set of common directories for X headers.
20898 # Check X11 before X11Rn because it is often a symlink to the current release.
20899 ac_x_header_dirs='
20900 /usr/X11/include
20901 /usr/X11R7/include
20902 /usr/X11R6/include
20903 /usr/X11R5/include
20904 /usr/X11R4/include
20905
20906 /opt/local/include
20907 /opt/X11/include
20908
20909 /usr/include/X11
20910 /usr/include/X11R7
20911 /usr/include/X11R6
20912 /usr/include/X11R5
20913 /usr/include/X11R4
20914
20915 /usr/local/X11/include
20916 /usr/local/X11R7/include
20917 /usr/local/X11R6/include
20918 /usr/local/X11R5/include
20919 /usr/local/X11R4/include
20920
20921 /usr/local/include/X11
20922 /usr/local/include/X11R7
20923 /usr/local/include/X11R6
20924 /usr/local/include/X11R5
20925 /usr/local/include/X11R4
20926
20927 /usr/X386/include
20928 /usr/x386/include
20929 /usr/XFree86/include/X11
20930
20931 /usr/include
20932 /usr/local/include
20933 /usr/unsupported/include
20934 /usr/athena/include
20935 /usr/local/x11r5/include
20936 /usr/lpp/Xamples/include
20937
20938 /usr/openwin/include
20939 /usr/openwin/share/include'
20940
20941 if test "$ac_x_includes" = no; then
20942   # Guess where to find include files, by looking for Intrinsic.h.
20943   # First, try using that file with no special directory specified.
20944   cat >"conftest.$ac_ext" <<_ACEOF
20945 #line 20945 "configure"
20946 #include "confdefs.h"
20947 #include <X11/Intrinsic.h>
20948 _ACEOF
20949 if { (eval echo "$as_me:20949: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20950   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20951   ac_status=$?
20952   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20953   rm -f conftest.er1
20954   cat conftest.err >&5
20955   echo "$as_me:20955: \$? = $ac_status" >&5
20956   (exit "$ac_status"); } >/dev/null; then
20957   if test -s conftest.err; then
20958     ac_cpp_err=$ac_c_preproc_warn_flag
20959   else
20960     ac_cpp_err=
20961   fi
20962 else
20963   ac_cpp_err=yes
20964 fi
20965 if test -z "$ac_cpp_err"; then
20966   # We can compile using X headers with no special include directory.
20967 ac_x_includes=
20968 else
20969   echo "$as_me: failed program was:" >&5
20970   cat "conftest.$ac_ext" >&5
20971   for ac_dir in $ac_x_header_dirs; do
20972   if test -r "$ac_dir/X11/Intrinsic.h"; then
20973     ac_x_includes=$ac_dir
20974     break
20975   fi
20976 done
20977 fi
20978 rm -f conftest.err "conftest.$ac_ext"
20979 fi # $ac_x_includes = no
20980
20981 if test "$ac_x_libraries" = no; then
20982   # Check for the libraries.
20983   # See if we find them without any special options.
20984   # Don't add to $LIBS permanently.
20985   ac_save_LIBS=$LIBS
20986   LIBS="-lXt $LIBS"
20987   cat >"conftest.$ac_ext" <<_ACEOF
20988 #line 20988 "configure"
20989 #include "confdefs.h"
20990 #include <X11/Intrinsic.h>
20991 int
20992 main (void)
20993 {
20994 XtMalloc (0)
20995   ;
20996   return 0;
20997 }
20998 _ACEOF
20999 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21000 if { (eval echo "$as_me:21000: \"$ac_link\"") >&5
21001   (eval $ac_link) 2>&5
21002   ac_status=$?
21003   echo "$as_me:21003: \$? = $ac_status" >&5
21004   (exit "$ac_status"); } &&
21005          { ac_try='test -s "conftest$ac_exeext"'
21006   { (eval echo "$as_me:21006: \"$ac_try\"") >&5
21007   (eval $ac_try) 2>&5
21008   ac_status=$?
21009   echo "$as_me:21009: \$? = $ac_status" >&5
21010   (exit "$ac_status"); }; }; then
21011   LIBS=$ac_save_LIBS
21012 # We can link X programs with no special library path.
21013 ac_x_libraries=
21014 else
21015   echo "$as_me: failed program was:" >&5
21016 cat "conftest.$ac_ext" >&5
21017 LIBS=$ac_save_LIBS
21018 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
21019 do
21020   # Don't even attempt the hair of trying to link an X program!
21021   for ac_extension in a so sl dylib dll; do
21022     if test -r "$ac_dir/libXt.$ac_extension"; then
21023       ac_x_libraries=$ac_dir
21024       break 2
21025     fi
21026   done
21027 done
21028 fi
21029 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21030 fi # $ac_x_libraries = no
21031
21032 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
21033   # Didn't find X anywhere.  Cache the known absence of X.
21034   ac_cv_have_x="have_x=no"
21035 else
21036   # Record where we found X for the cache.
21037   ac_cv_have_x="have_x=yes \
21038                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
21039 fi
21040 fi
21041
21042   fi
21043   eval "$ac_cv_have_x"
21044 fi # $with_x != no
21045
21046 if test "$have_x" != yes; then
21047   echo "$as_me:21047: result: $have_x" >&5
21048 echo "${ECHO_T}$have_x" >&6
21049   no_x=yes
21050 else
21051   # If each of the values was on the command line, it overrides each guess.
21052   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
21053   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
21054   # Update the cache value to reflect the command line values.
21055   ac_cv_have_x="have_x=yes \
21056                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
21057   echo "$as_me:21057: result: libraries $x_libraries, headers $x_includes" >&5
21058 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
21059 fi
21060
21061         if test "$no_x" = yes; then
21062   # Not all programs may use this symbol, but it does not hurt to define it.
21063
21064 cat >>confdefs.h <<\EOF
21065 #define X_DISPLAY_MISSING 1
21066 EOF
21067
21068   X_CFLAGS=
21069   X_PRE_LIBS=
21070   X_LIBS=
21071   X_EXTRA_LIBS=
21072 else
21073   if test -n "$x_includes"; then
21074     X_CFLAGS="$X_CFLAGS -I$x_includes"
21075   fi
21076
21077   # It would also be nice to do this for all -L options, not just this one.
21078   if test -n "$x_libraries"; then
21079     X_LIBS="$X_LIBS -L$x_libraries"
21080     # For Solaris; some versions of Sun CC require a space after -R and
21081     # others require no space.  Words are not sufficient . . . .
21082     case `(uname -sr) 2>/dev/null` in
21083     "SunOS 5"*)
21084       echo "$as_me:21084: checking whether -R must be followed by a space" >&5
21085 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
21086       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
21087       cat >"conftest.$ac_ext" <<_ACEOF
21088 #line 21088 "configure"
21089 #include "confdefs.h"
21090
21091 int
21092 main (void)
21093 {
21094
21095   ;
21096   return 0;
21097 }
21098 _ACEOF
21099 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21100 if { (eval echo "$as_me:21100: \"$ac_link\"") >&5
21101   (eval $ac_link) 2>&5
21102   ac_status=$?
21103   echo "$as_me:21103: \$? = $ac_status" >&5
21104   (exit "$ac_status"); } &&
21105          { ac_try='test -s "conftest$ac_exeext"'
21106   { (eval echo "$as_me:21106: \"$ac_try\"") >&5
21107   (eval $ac_try) 2>&5
21108   ac_status=$?
21109   echo "$as_me:21109: \$? = $ac_status" >&5
21110   (exit "$ac_status"); }; }; then
21111   ac_R_nospace=yes
21112 else
21113   echo "$as_me: failed program was:" >&5
21114 cat "conftest.$ac_ext" >&5
21115 ac_R_nospace=no
21116 fi
21117 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21118       if test $ac_R_nospace = yes; then
21119         echo "$as_me:21119: result: no" >&5
21120 echo "${ECHO_T}no" >&6
21121         X_LIBS="$X_LIBS -R$x_libraries"
21122       else
21123         LIBS="$ac_xsave_LIBS -R $x_libraries"
21124         cat >"conftest.$ac_ext" <<_ACEOF
21125 #line 21125 "configure"
21126 #include "confdefs.h"
21127
21128 int
21129 main (void)
21130 {
21131
21132   ;
21133   return 0;
21134 }
21135 _ACEOF
21136 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21137 if { (eval echo "$as_me:21137: \"$ac_link\"") >&5
21138   (eval $ac_link) 2>&5
21139   ac_status=$?
21140   echo "$as_me:21140: \$? = $ac_status" >&5
21141   (exit "$ac_status"); } &&
21142          { ac_try='test -s "conftest$ac_exeext"'
21143   { (eval echo "$as_me:21143: \"$ac_try\"") >&5
21144   (eval $ac_try) 2>&5
21145   ac_status=$?
21146   echo "$as_me:21146: \$? = $ac_status" >&5
21147   (exit "$ac_status"); }; }; then
21148   ac_R_space=yes
21149 else
21150   echo "$as_me: failed program was:" >&5
21151 cat "conftest.$ac_ext" >&5
21152 ac_R_space=no
21153 fi
21154 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21155         if test $ac_R_space = yes; then
21156           echo "$as_me:21156: result: yes" >&5
21157 echo "${ECHO_T}yes" >&6
21158           X_LIBS="$X_LIBS -R $x_libraries"
21159         else
21160           echo "$as_me:21160: result: neither works" >&5
21161 echo "${ECHO_T}neither works" >&6
21162         fi
21163       fi
21164       LIBS=$ac_xsave_LIBS
21165     esac
21166   fi
21167
21168   # Check for system-dependent libraries X programs must link with.
21169   # Do this before checking for the system-independent R6 libraries
21170   # (-lICE), since we may need -lsocket or whatever for X linking.
21171
21172   if test "$ISC" = yes; then
21173     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
21174   else
21175     # Martyn Johnson says this is needed for Ultrix, if the X
21176     # libraries were built with DECnet support.  And Karl Berry says
21177     # the Alpha needs dnet_stub (dnet does not exist).
21178     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
21179     cat >"conftest.$ac_ext" <<_ACEOF
21180 #line 21180 "configure"
21181 #include "confdefs.h"
21182
21183 /* Override any gcc2 internal prototype to avoid an error.  */
21184 #ifdef __cplusplus
21185 extern "C"
21186 #endif
21187 /* We use char because int might match the return type of a gcc2
21188    builtin and then its argument prototype would still apply.  */
21189 char XOpenDisplay ();
21190 int
21191 main (void)
21192 {
21193 XOpenDisplay ();
21194   ;
21195   return 0;
21196 }
21197 _ACEOF
21198 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21199 if { (eval echo "$as_me:21199: \"$ac_link\"") >&5
21200   (eval $ac_link) 2>&5
21201   ac_status=$?
21202   echo "$as_me:21202: \$? = $ac_status" >&5
21203   (exit "$ac_status"); } &&
21204          { ac_try='test -s "conftest$ac_exeext"'
21205   { (eval echo "$as_me:21205: \"$ac_try\"") >&5
21206   (eval $ac_try) 2>&5
21207   ac_status=$?
21208   echo "$as_me:21208: \$? = $ac_status" >&5
21209   (exit "$ac_status"); }; }; then
21210   :
21211 else
21212   echo "$as_me: failed program was:" >&5
21213 cat "conftest.$ac_ext" >&5
21214 echo "$as_me:21214: checking for dnet_ntoa in -ldnet" >&5
21215 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
21216 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
21217   echo $ECHO_N "(cached) $ECHO_C" >&6
21218 else
21219   ac_check_lib_save_LIBS=$LIBS
21220 LIBS="-ldnet  $LIBS"
21221 cat >"conftest.$ac_ext" <<_ACEOF
21222 #line 21222 "configure"
21223 #include "confdefs.h"
21224
21225 /* Override any gcc2 internal prototype to avoid an error.  */
21226 #ifdef __cplusplus
21227 extern "C"
21228 #endif
21229 /* We use char because int might match the return type of a gcc2
21230    builtin and then its argument prototype would still apply.  */
21231 char dnet_ntoa ();
21232 int
21233 main (void)
21234 {
21235 dnet_ntoa ();
21236   ;
21237   return 0;
21238 }
21239 _ACEOF
21240 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21241 if { (eval echo "$as_me:21241: \"$ac_link\"") >&5
21242   (eval $ac_link) 2>&5
21243   ac_status=$?
21244   echo "$as_me:21244: \$? = $ac_status" >&5
21245   (exit "$ac_status"); } &&
21246          { ac_try='test -s "conftest$ac_exeext"'
21247   { (eval echo "$as_me:21247: \"$ac_try\"") >&5
21248   (eval $ac_try) 2>&5
21249   ac_status=$?
21250   echo "$as_me:21250: \$? = $ac_status" >&5
21251   (exit "$ac_status"); }; }; then
21252   ac_cv_lib_dnet_dnet_ntoa=yes
21253 else
21254   echo "$as_me: failed program was:" >&5
21255 cat "conftest.$ac_ext" >&5
21256 ac_cv_lib_dnet_dnet_ntoa=no
21257 fi
21258 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21259 LIBS=$ac_check_lib_save_LIBS
21260 fi
21261 echo "$as_me:21261: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
21262 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
21263 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
21264   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
21265 fi
21266
21267     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
21268       echo "$as_me:21268: checking for dnet_ntoa in -ldnet_stub" >&5
21269 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
21270 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
21271   echo $ECHO_N "(cached) $ECHO_C" >&6
21272 else
21273   ac_check_lib_save_LIBS=$LIBS
21274 LIBS="-ldnet_stub  $LIBS"
21275 cat >"conftest.$ac_ext" <<_ACEOF
21276 #line 21276 "configure"
21277 #include "confdefs.h"
21278
21279 /* Override any gcc2 internal prototype to avoid an error.  */
21280 #ifdef __cplusplus
21281 extern "C"
21282 #endif
21283 /* We use char because int might match the return type of a gcc2
21284    builtin and then its argument prototype would still apply.  */
21285 char dnet_ntoa ();
21286 int
21287 main (void)
21288 {
21289 dnet_ntoa ();
21290   ;
21291   return 0;
21292 }
21293 _ACEOF
21294 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21295 if { (eval echo "$as_me:21295: \"$ac_link\"") >&5
21296   (eval $ac_link) 2>&5
21297   ac_status=$?
21298   echo "$as_me:21298: \$? = $ac_status" >&5
21299   (exit "$ac_status"); } &&
21300          { ac_try='test -s "conftest$ac_exeext"'
21301   { (eval echo "$as_me:21301: \"$ac_try\"") >&5
21302   (eval $ac_try) 2>&5
21303   ac_status=$?
21304   echo "$as_me:21304: \$? = $ac_status" >&5
21305   (exit "$ac_status"); }; }; then
21306   ac_cv_lib_dnet_stub_dnet_ntoa=yes
21307 else
21308   echo "$as_me: failed program was:" >&5
21309 cat "conftest.$ac_ext" >&5
21310 ac_cv_lib_dnet_stub_dnet_ntoa=no
21311 fi
21312 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21313 LIBS=$ac_check_lib_save_LIBS
21314 fi
21315 echo "$as_me:21315: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
21316 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
21317 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
21318   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
21319 fi
21320
21321     fi
21322 fi
21323 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21324     LIBS="$ac_xsave_LIBS"
21325
21326     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
21327     # to get the SysV transport functions.
21328     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
21329     # needs -lnsl.
21330     # The nsl library prevents programs from opening the X display
21331     # on Irix 5.2, according to T.E. Dickey.
21332     # The functions gethostbyname, getservbyname, and inet_addr are
21333     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
21334     echo "$as_me:21334: checking for gethostbyname" >&5
21335 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
21336 if test "${ac_cv_func_gethostbyname+set}" = set; then
21337   echo $ECHO_N "(cached) $ECHO_C" >&6
21338 else
21339   cat >"conftest.$ac_ext" <<_ACEOF
21340 #line 21340 "configure"
21341 #include "confdefs.h"
21342 #define gethostbyname autoconf_temporary
21343 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21344 #undef gethostbyname
21345
21346 #ifdef __cplusplus
21347 extern "C"
21348 #endif
21349
21350 /* We use char because int might match the return type of a gcc2
21351    builtin and then its argument prototype would still apply.  */
21352 char gethostbyname (void);
21353
21354 int
21355 main (void)
21356 {
21357
21358 /* The GNU C library defines stubs for functions which it implements
21359     to always fail with ENOSYS.  Some functions are actually named
21360     something starting with __ and the normal name is an alias.  */
21361 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21362 #error found stub for gethostbyname
21363 #endif
21364
21365         return gethostbyname ();
21366   ;
21367   return 0;
21368 }
21369 _ACEOF
21370 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21371 if { (eval echo "$as_me:21371: \"$ac_link\"") >&5
21372   (eval $ac_link) 2>&5
21373   ac_status=$?
21374   echo "$as_me:21374: \$? = $ac_status" >&5
21375   (exit "$ac_status"); } &&
21376          { ac_try='test -s "conftest$ac_exeext"'
21377   { (eval echo "$as_me:21377: \"$ac_try\"") >&5
21378   (eval $ac_try) 2>&5
21379   ac_status=$?
21380   echo "$as_me:21380: \$? = $ac_status" >&5
21381   (exit "$ac_status"); }; }; then
21382   ac_cv_func_gethostbyname=yes
21383 else
21384   echo "$as_me: failed program was:" >&5
21385 cat "conftest.$ac_ext" >&5
21386 ac_cv_func_gethostbyname=no
21387 fi
21388 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21389 fi
21390 echo "$as_me:21390: result: $ac_cv_func_gethostbyname" >&5
21391 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21392
21393     if test $ac_cv_func_gethostbyname = no; then
21394       echo "$as_me:21394: checking for gethostbyname in -lnsl" >&5
21395 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21396 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21397   echo $ECHO_N "(cached) $ECHO_C" >&6
21398 else
21399   ac_check_lib_save_LIBS=$LIBS
21400 LIBS="-lnsl  $LIBS"
21401 cat >"conftest.$ac_ext" <<_ACEOF
21402 #line 21402 "configure"
21403 #include "confdefs.h"
21404
21405 /* Override any gcc2 internal prototype to avoid an error.  */
21406 #ifdef __cplusplus
21407 extern "C"
21408 #endif
21409 /* We use char because int might match the return type of a gcc2
21410    builtin and then its argument prototype would still apply.  */
21411 char gethostbyname ();
21412 int
21413 main (void)
21414 {
21415 gethostbyname ();
21416   ;
21417   return 0;
21418 }
21419 _ACEOF
21420 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21421 if { (eval echo "$as_me:21421: \"$ac_link\"") >&5
21422   (eval $ac_link) 2>&5
21423   ac_status=$?
21424   echo "$as_me:21424: \$? = $ac_status" >&5
21425   (exit "$ac_status"); } &&
21426          { ac_try='test -s "conftest$ac_exeext"'
21427   { (eval echo "$as_me:21427: \"$ac_try\"") >&5
21428   (eval $ac_try) 2>&5
21429   ac_status=$?
21430   echo "$as_me:21430: \$? = $ac_status" >&5
21431   (exit "$ac_status"); }; }; then
21432   ac_cv_lib_nsl_gethostbyname=yes
21433 else
21434   echo "$as_me: failed program was:" >&5
21435 cat "conftest.$ac_ext" >&5
21436 ac_cv_lib_nsl_gethostbyname=no
21437 fi
21438 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21439 LIBS=$ac_check_lib_save_LIBS
21440 fi
21441 echo "$as_me:21441: result: $ac_cv_lib_nsl_gethostbyname" >&5
21442 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21443 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21444   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21445 fi
21446
21447       if test $ac_cv_lib_nsl_gethostbyname = no; then
21448         echo "$as_me:21448: checking for gethostbyname in -lbsd" >&5
21449 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21450 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21451   echo $ECHO_N "(cached) $ECHO_C" >&6
21452 else
21453   ac_check_lib_save_LIBS=$LIBS
21454 LIBS="-lbsd  $LIBS"
21455 cat >"conftest.$ac_ext" <<_ACEOF
21456 #line 21456 "configure"
21457 #include "confdefs.h"
21458
21459 /* Override any gcc2 internal prototype to avoid an error.  */
21460 #ifdef __cplusplus
21461 extern "C"
21462 #endif
21463 /* We use char because int might match the return type of a gcc2
21464    builtin and then its argument prototype would still apply.  */
21465 char gethostbyname ();
21466 int
21467 main (void)
21468 {
21469 gethostbyname ();
21470   ;
21471   return 0;
21472 }
21473 _ACEOF
21474 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21475 if { (eval echo "$as_me:21475: \"$ac_link\"") >&5
21476   (eval $ac_link) 2>&5
21477   ac_status=$?
21478   echo "$as_me:21478: \$? = $ac_status" >&5
21479   (exit "$ac_status"); } &&
21480          { ac_try='test -s "conftest$ac_exeext"'
21481   { (eval echo "$as_me:21481: \"$ac_try\"") >&5
21482   (eval $ac_try) 2>&5
21483   ac_status=$?
21484   echo "$as_me:21484: \$? = $ac_status" >&5
21485   (exit "$ac_status"); }; }; then
21486   ac_cv_lib_bsd_gethostbyname=yes
21487 else
21488   echo "$as_me: failed program was:" >&5
21489 cat "conftest.$ac_ext" >&5
21490 ac_cv_lib_bsd_gethostbyname=no
21491 fi
21492 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21493 LIBS=$ac_check_lib_save_LIBS
21494 fi
21495 echo "$as_me:21495: result: $ac_cv_lib_bsd_gethostbyname" >&5
21496 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21497 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21498   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21499 fi
21500
21501       fi
21502     fi
21503
21504     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21505     # socket/setsockopt and other routines are undefined under SCO ODT
21506     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21507     # on later versions), says Simon Leinen: it contains gethostby*
21508     # variants that don't use the nameserver (or something).  -lsocket
21509     # must be given before -lnsl if both are needed.  We assume that
21510     # if connect needs -lnsl, so does gethostbyname.
21511     echo "$as_me:21511: checking for connect" >&5
21512 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21513 if test "${ac_cv_func_connect+set}" = set; then
21514   echo $ECHO_N "(cached) $ECHO_C" >&6
21515 else
21516   cat >"conftest.$ac_ext" <<_ACEOF
21517 #line 21517 "configure"
21518 #include "confdefs.h"
21519 #define connect autoconf_temporary
21520 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21521 #undef connect
21522
21523 #ifdef __cplusplus
21524 extern "C"
21525 #endif
21526
21527 /* We use char because int might match the return type of a gcc2
21528    builtin and then its argument prototype would still apply.  */
21529 char connect (void);
21530
21531 int
21532 main (void)
21533 {
21534
21535 /* The GNU C library defines stubs for functions which it implements
21536     to always fail with ENOSYS.  Some functions are actually named
21537     something starting with __ and the normal name is an alias.  */
21538 #if defined (__stub_connect) || defined (__stub___connect)
21539 #error found stub for connect
21540 #endif
21541
21542         return connect ();
21543   ;
21544   return 0;
21545 }
21546 _ACEOF
21547 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21548 if { (eval echo "$as_me:21548: \"$ac_link\"") >&5
21549   (eval $ac_link) 2>&5
21550   ac_status=$?
21551   echo "$as_me:21551: \$? = $ac_status" >&5
21552   (exit "$ac_status"); } &&
21553          { ac_try='test -s "conftest$ac_exeext"'
21554   { (eval echo "$as_me:21554: \"$ac_try\"") >&5
21555   (eval $ac_try) 2>&5
21556   ac_status=$?
21557   echo "$as_me:21557: \$? = $ac_status" >&5
21558   (exit "$ac_status"); }; }; then
21559   ac_cv_func_connect=yes
21560 else
21561   echo "$as_me: failed program was:" >&5
21562 cat "conftest.$ac_ext" >&5
21563 ac_cv_func_connect=no
21564 fi
21565 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21566 fi
21567 echo "$as_me:21567: result: $ac_cv_func_connect" >&5
21568 echo "${ECHO_T}$ac_cv_func_connect" >&6
21569
21570     if test $ac_cv_func_connect = no; then
21571       echo "$as_me:21571: checking for connect in -lsocket" >&5
21572 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21573 if test "${ac_cv_lib_socket_connect+set}" = set; then
21574   echo $ECHO_N "(cached) $ECHO_C" >&6
21575 else
21576   ac_check_lib_save_LIBS=$LIBS
21577 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21578 cat >"conftest.$ac_ext" <<_ACEOF
21579 #line 21579 "configure"
21580 #include "confdefs.h"
21581
21582 /* Override any gcc2 internal prototype to avoid an error.  */
21583 #ifdef __cplusplus
21584 extern "C"
21585 #endif
21586 /* We use char because int might match the return type of a gcc2
21587    builtin and then its argument prototype would still apply.  */
21588 char connect ();
21589 int
21590 main (void)
21591 {
21592 connect ();
21593   ;
21594   return 0;
21595 }
21596 _ACEOF
21597 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21598 if { (eval echo "$as_me:21598: \"$ac_link\"") >&5
21599   (eval $ac_link) 2>&5
21600   ac_status=$?
21601   echo "$as_me:21601: \$? = $ac_status" >&5
21602   (exit "$ac_status"); } &&
21603          { ac_try='test -s "conftest$ac_exeext"'
21604   { (eval echo "$as_me:21604: \"$ac_try\"") >&5
21605   (eval $ac_try) 2>&5
21606   ac_status=$?
21607   echo "$as_me:21607: \$? = $ac_status" >&5
21608   (exit "$ac_status"); }; }; then
21609   ac_cv_lib_socket_connect=yes
21610 else
21611   echo "$as_me: failed program was:" >&5
21612 cat "conftest.$ac_ext" >&5
21613 ac_cv_lib_socket_connect=no
21614 fi
21615 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21616 LIBS=$ac_check_lib_save_LIBS
21617 fi
21618 echo "$as_me:21618: result: $ac_cv_lib_socket_connect" >&5
21619 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21620 if test "$ac_cv_lib_socket_connect" = yes; then
21621   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21622 fi
21623
21624     fi
21625
21626     # Guillermo Gomez says -lposix is necessary on A/UX.
21627     echo "$as_me:21627: checking for remove" >&5
21628 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21629 if test "${ac_cv_func_remove+set}" = set; then
21630   echo $ECHO_N "(cached) $ECHO_C" >&6
21631 else
21632   cat >"conftest.$ac_ext" <<_ACEOF
21633 #line 21633 "configure"
21634 #include "confdefs.h"
21635 #define remove autoconf_temporary
21636 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21637 #undef remove
21638
21639 #ifdef __cplusplus
21640 extern "C"
21641 #endif
21642
21643 /* We use char because int might match the return type of a gcc2
21644    builtin and then its argument prototype would still apply.  */
21645 char remove (void);
21646
21647 int
21648 main (void)
21649 {
21650
21651 /* The GNU C library defines stubs for functions which it implements
21652     to always fail with ENOSYS.  Some functions are actually named
21653     something starting with __ and the normal name is an alias.  */
21654 #if defined (__stub_remove) || defined (__stub___remove)
21655 #error found stub for remove
21656 #endif
21657
21658         return remove ();
21659   ;
21660   return 0;
21661 }
21662 _ACEOF
21663 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21664 if { (eval echo "$as_me:21664: \"$ac_link\"") >&5
21665   (eval $ac_link) 2>&5
21666   ac_status=$?
21667   echo "$as_me:21667: \$? = $ac_status" >&5
21668   (exit "$ac_status"); } &&
21669          { ac_try='test -s "conftest$ac_exeext"'
21670   { (eval echo "$as_me:21670: \"$ac_try\"") >&5
21671   (eval $ac_try) 2>&5
21672   ac_status=$?
21673   echo "$as_me:21673: \$? = $ac_status" >&5
21674   (exit "$ac_status"); }; }; then
21675   ac_cv_func_remove=yes
21676 else
21677   echo "$as_me: failed program was:" >&5
21678 cat "conftest.$ac_ext" >&5
21679 ac_cv_func_remove=no
21680 fi
21681 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21682 fi
21683 echo "$as_me:21683: result: $ac_cv_func_remove" >&5
21684 echo "${ECHO_T}$ac_cv_func_remove" >&6
21685
21686     if test $ac_cv_func_remove = no; then
21687       echo "$as_me:21687: checking for remove in -lposix" >&5
21688 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21689 if test "${ac_cv_lib_posix_remove+set}" = set; then
21690   echo $ECHO_N "(cached) $ECHO_C" >&6
21691 else
21692   ac_check_lib_save_LIBS=$LIBS
21693 LIBS="-lposix  $LIBS"
21694 cat >"conftest.$ac_ext" <<_ACEOF
21695 #line 21695 "configure"
21696 #include "confdefs.h"
21697
21698 /* Override any gcc2 internal prototype to avoid an error.  */
21699 #ifdef __cplusplus
21700 extern "C"
21701 #endif
21702 /* We use char because int might match the return type of a gcc2
21703    builtin and then its argument prototype would still apply.  */
21704 char remove ();
21705 int
21706 main (void)
21707 {
21708 remove ();
21709   ;
21710   return 0;
21711 }
21712 _ACEOF
21713 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21714 if { (eval echo "$as_me:21714: \"$ac_link\"") >&5
21715   (eval $ac_link) 2>&5
21716   ac_status=$?
21717   echo "$as_me:21717: \$? = $ac_status" >&5
21718   (exit "$ac_status"); } &&
21719          { ac_try='test -s "conftest$ac_exeext"'
21720   { (eval echo "$as_me:21720: \"$ac_try\"") >&5
21721   (eval $ac_try) 2>&5
21722   ac_status=$?
21723   echo "$as_me:21723: \$? = $ac_status" >&5
21724   (exit "$ac_status"); }; }; then
21725   ac_cv_lib_posix_remove=yes
21726 else
21727   echo "$as_me: failed program was:" >&5
21728 cat "conftest.$ac_ext" >&5
21729 ac_cv_lib_posix_remove=no
21730 fi
21731 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21732 LIBS=$ac_check_lib_save_LIBS
21733 fi
21734 echo "$as_me:21734: result: $ac_cv_lib_posix_remove" >&5
21735 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21736 if test "$ac_cv_lib_posix_remove" = yes; then
21737   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21738 fi
21739
21740     fi
21741
21742     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21743     echo "$as_me:21743: checking for shmat" >&5
21744 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21745 if test "${ac_cv_func_shmat+set}" = set; then
21746   echo $ECHO_N "(cached) $ECHO_C" >&6
21747 else
21748   cat >"conftest.$ac_ext" <<_ACEOF
21749 #line 21749 "configure"
21750 #include "confdefs.h"
21751 #define shmat autoconf_temporary
21752 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21753 #undef shmat
21754
21755 #ifdef __cplusplus
21756 extern "C"
21757 #endif
21758
21759 /* We use char because int might match the return type of a gcc2
21760    builtin and then its argument prototype would still apply.  */
21761 char shmat (void);
21762
21763 int
21764 main (void)
21765 {
21766
21767 /* The GNU C library defines stubs for functions which it implements
21768     to always fail with ENOSYS.  Some functions are actually named
21769     something starting with __ and the normal name is an alias.  */
21770 #if defined (__stub_shmat) || defined (__stub___shmat)
21771 #error found stub for shmat
21772 #endif
21773
21774         return shmat ();
21775   ;
21776   return 0;
21777 }
21778 _ACEOF
21779 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21780 if { (eval echo "$as_me:21780: \"$ac_link\"") >&5
21781   (eval $ac_link) 2>&5
21782   ac_status=$?
21783   echo "$as_me:21783: \$? = $ac_status" >&5
21784   (exit "$ac_status"); } &&
21785          { ac_try='test -s "conftest$ac_exeext"'
21786   { (eval echo "$as_me:21786: \"$ac_try\"") >&5
21787   (eval $ac_try) 2>&5
21788   ac_status=$?
21789   echo "$as_me:21789: \$? = $ac_status" >&5
21790   (exit "$ac_status"); }; }; then
21791   ac_cv_func_shmat=yes
21792 else
21793   echo "$as_me: failed program was:" >&5
21794 cat "conftest.$ac_ext" >&5
21795 ac_cv_func_shmat=no
21796 fi
21797 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21798 fi
21799 echo "$as_me:21799: result: $ac_cv_func_shmat" >&5
21800 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21801
21802     if test $ac_cv_func_shmat = no; then
21803       echo "$as_me:21803: checking for shmat in -lipc" >&5
21804 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21805 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21806   echo $ECHO_N "(cached) $ECHO_C" >&6
21807 else
21808   ac_check_lib_save_LIBS=$LIBS
21809 LIBS="-lipc  $LIBS"
21810 cat >"conftest.$ac_ext" <<_ACEOF
21811 #line 21811 "configure"
21812 #include "confdefs.h"
21813
21814 /* Override any gcc2 internal prototype to avoid an error.  */
21815 #ifdef __cplusplus
21816 extern "C"
21817 #endif
21818 /* We use char because int might match the return type of a gcc2
21819    builtin and then its argument prototype would still apply.  */
21820 char shmat ();
21821 int
21822 main (void)
21823 {
21824 shmat ();
21825   ;
21826   return 0;
21827 }
21828 _ACEOF
21829 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21830 if { (eval echo "$as_me:21830: \"$ac_link\"") >&5
21831   (eval $ac_link) 2>&5
21832   ac_status=$?
21833   echo "$as_me:21833: \$? = $ac_status" >&5
21834   (exit "$ac_status"); } &&
21835          { ac_try='test -s "conftest$ac_exeext"'
21836   { (eval echo "$as_me:21836: \"$ac_try\"") >&5
21837   (eval $ac_try) 2>&5
21838   ac_status=$?
21839   echo "$as_me:21839: \$? = $ac_status" >&5
21840   (exit "$ac_status"); }; }; then
21841   ac_cv_lib_ipc_shmat=yes
21842 else
21843   echo "$as_me: failed program was:" >&5
21844 cat "conftest.$ac_ext" >&5
21845 ac_cv_lib_ipc_shmat=no
21846 fi
21847 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21848 LIBS=$ac_check_lib_save_LIBS
21849 fi
21850 echo "$as_me:21850: result: $ac_cv_lib_ipc_shmat" >&5
21851 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21852 if test "$ac_cv_lib_ipc_shmat" = yes; then
21853   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21854 fi
21855
21856     fi
21857   fi
21858
21859   # Check for libraries that X11R6 Xt/Xaw programs need.
21860   ac_save_LDFLAGS=$LDFLAGS
21861   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21862   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21863   # check for ICE first), but we must link in the order -lSM -lICE or
21864   # we get undefined symbols.  So assume we have SM if we have ICE.
21865   # These have to be linked with before -lX11, unlike the other
21866   # libraries we check for below, so use a different variable.
21867   # John Interrante, Karl Berry
21868   echo "$as_me:21868: checking for IceConnectionNumber in -lICE" >&5
21869 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21870 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21871   echo $ECHO_N "(cached) $ECHO_C" >&6
21872 else
21873   ac_check_lib_save_LIBS=$LIBS
21874 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21875 cat >"conftest.$ac_ext" <<_ACEOF
21876 #line 21876 "configure"
21877 #include "confdefs.h"
21878
21879 /* Override any gcc2 internal prototype to avoid an error.  */
21880 #ifdef __cplusplus
21881 extern "C"
21882 #endif
21883 /* We use char because int might match the return type of a gcc2
21884    builtin and then its argument prototype would still apply.  */
21885 char IceConnectionNumber ();
21886 int
21887 main (void)
21888 {
21889 IceConnectionNumber ();
21890   ;
21891   return 0;
21892 }
21893 _ACEOF
21894 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21895 if { (eval echo "$as_me:21895: \"$ac_link\"") >&5
21896   (eval $ac_link) 2>&5
21897   ac_status=$?
21898   echo "$as_me:21898: \$? = $ac_status" >&5
21899   (exit "$ac_status"); } &&
21900          { ac_try='test -s "conftest$ac_exeext"'
21901   { (eval echo "$as_me:21901: \"$ac_try\"") >&5
21902   (eval $ac_try) 2>&5
21903   ac_status=$?
21904   echo "$as_me:21904: \$? = $ac_status" >&5
21905   (exit "$ac_status"); }; }; then
21906   ac_cv_lib_ICE_IceConnectionNumber=yes
21907 else
21908   echo "$as_me: failed program was:" >&5
21909 cat "conftest.$ac_ext" >&5
21910 ac_cv_lib_ICE_IceConnectionNumber=no
21911 fi
21912 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21913 LIBS=$ac_check_lib_save_LIBS
21914 fi
21915 echo "$as_me:21915: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21916 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21917 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21918   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21919 fi
21920
21921   LDFLAGS=$ac_save_LDFLAGS
21922
21923 fi
21924
21925 fi
21926
21927 if test "$GCC" = yes || test "$GXX" = yes
21928 then
21929
21930 if test "$GCC" = yes || test "$GXX" = yes
21931 then
21932         case $CFLAGS in
21933         (*-Werror=*)
21934                 cf_temp_flags=
21935                 for cf_temp_scan in $CFLAGS
21936                 do
21937                         case "x$cf_temp_scan" in
21938                         (x-Werror=format*)
21939
21940         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21941         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21942
21943                                 ;;
21944                         (x-Werror=*)
21945
21946         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21947         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21948
21949                                 ;;
21950                         (*)
21951
21952         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21953         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21954
21955                                 ;;
21956                         esac
21957                 done
21958                 if test "x$CFLAGS" != "x$cf_temp_flags"
21959                 then
21960                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21961
21962 echo "${as_me:-configure}:21962: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21963
21964                         CFLAGS="$cf_temp_flags"
21965                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21966
21967 echo "${as_me:-configure}:21967: testing ... fixed $CFLAGS ..." 1>&5
21968
21969                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21970
21971 echo "${as_me:-configure}:21971: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21972
21973                 fi
21974                 ;;
21975         esac
21976 fi
21977
21978 if test "$GCC" = yes || test "$GXX" = yes
21979 then
21980         case $CPPFLAGS in
21981         (*-Werror=*)
21982                 cf_temp_flags=
21983                 for cf_temp_scan in $CPPFLAGS
21984                 do
21985                         case "x$cf_temp_scan" in
21986                         (x-Werror=format*)
21987
21988         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21989         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21990
21991                                 ;;
21992                         (x-Werror=*)
21993
21994         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21995         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21996
21997                                 ;;
21998                         (*)
21999
22000         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22001         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22002
22003                                 ;;
22004                         esac
22005                 done
22006                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
22007                 then
22008                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
22009
22010 echo "${as_me:-configure}:22010: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
22011
22012                         CPPFLAGS="$cf_temp_flags"
22013                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
22014
22015 echo "${as_me:-configure}:22015: testing ... fixed $CPPFLAGS ..." 1>&5
22016
22017                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22018
22019 echo "${as_me:-configure}:22019: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22020
22021                 fi
22022                 ;;
22023         esac
22024 fi
22025
22026 if test "$GCC" = yes || test "$GXX" = yes
22027 then
22028         case $LDFLAGS in
22029         (*-Werror=*)
22030                 cf_temp_flags=
22031                 for cf_temp_scan in $LDFLAGS
22032                 do
22033                         case "x$cf_temp_scan" in
22034                         (x-Werror=format*)
22035
22036         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22037         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22038
22039                                 ;;
22040                         (x-Werror=*)
22041
22042         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22043         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22044
22045                                 ;;
22046                         (*)
22047
22048         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22049         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22050
22051                                 ;;
22052                         esac
22053                 done
22054                 if test "x$LDFLAGS" != "x$cf_temp_flags"
22055                 then
22056                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
22057
22058 echo "${as_me:-configure}:22058: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
22059
22060                         LDFLAGS="$cf_temp_flags"
22061                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
22062
22063 echo "${as_me:-configure}:22063: testing ... fixed $LDFLAGS ..." 1>&5
22064
22065                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22066
22067 echo "${as_me:-configure}:22067: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22068
22069                 fi
22070                 ;;
22071         esac
22072 fi
22073
22074 echo "$as_me:22074: checking if you want to turn on gcc warnings" >&5
22075 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
22076
22077 # Check whether --enable-warnings or --disable-warnings was given.
22078 if test "${enable_warnings+set}" = set; then
22079   enableval="$enable_warnings"
22080   test "$enableval" != yes && enableval=no
22081         if test "$enableval" != "no" ; then
22082     enable_warnings=yes
22083         else
22084                 enable_warnings=no
22085         fi
22086 else
22087   enableval=no
22088         enable_warnings=no
22089
22090 fi;
22091 echo "$as_me:22091: result: $enable_warnings" >&5
22092 echo "${ECHO_T}$enable_warnings" >&6
22093 if test "$enable_warnings" = "yes"
22094 then
22095
22096 if test "$GCC" = yes || test "$GXX" = yes
22097 then
22098 cat > conftest.i <<EOF
22099 #ifndef GCC_PRINTF
22100 #define GCC_PRINTF 0
22101 #endif
22102 #ifndef GCC_SCANF
22103 #define GCC_SCANF 0
22104 #endif
22105 #ifndef GCC_NORETURN
22106 #define GCC_NORETURN /* nothing */
22107 #endif
22108 #ifndef GCC_UNUSED
22109 #define GCC_UNUSED /* nothing */
22110 #endif
22111 EOF
22112 if test "$GCC" = yes
22113 then
22114         { echo "$as_me:22114: checking for $CC __attribute__ directives..." >&5
22115 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
22116 cat > "conftest.$ac_ext" <<EOF
22117 #line 22117 "${as_me:-configure}"
22118 #include "confdefs.h"
22119 #include "conftest.h"
22120 #include "conftest.i"
22121 #if     GCC_PRINTF
22122 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
22123 #else
22124 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
22125 #endif
22126 #if     GCC_SCANF
22127 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
22128 #else
22129 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
22130 #endif
22131 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
22132 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
22133 extern GCC_NORETURN void foo(void);
22134 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
22135 EOF
22136         cf_printf_attribute=no
22137         cf_scanf_attribute=no
22138         for cf_attribute in scanf printf unused noreturn
22139         do
22140
22141 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
22142
22143                 cf_directive="__attribute__(($cf_attribute))"
22144                 echo "checking for $CC $cf_directive" 1>&5
22145
22146                 case "$cf_attribute" in
22147                 (printf)
22148                         cf_printf_attribute=yes
22149                         cat >conftest.h <<EOF
22150 #define GCC_$cf_ATTRIBUTE 1
22151 EOF
22152                         ;;
22153                 (scanf)
22154                         cf_scanf_attribute=yes
22155                         cat >conftest.h <<EOF
22156 #define GCC_$cf_ATTRIBUTE 1
22157 EOF
22158                         ;;
22159                 (*)
22160                         cat >conftest.h <<EOF
22161 #define GCC_$cf_ATTRIBUTE $cf_directive
22162 EOF
22163                         ;;
22164                 esac
22165
22166                 if { (eval echo "$as_me:22166: \"$ac_compile\"") >&5
22167   (eval $ac_compile) 2>&5
22168   ac_status=$?
22169   echo "$as_me:22169: \$? = $ac_status" >&5
22170   (exit "$ac_status"); }; then
22171                         test -n "$verbose" && echo "$as_me:22171: result: ... $cf_attribute" >&5
22172 echo "${ECHO_T}... $cf_attribute" >&6
22173                         cat conftest.h >>confdefs.h
22174                         case "$cf_attribute" in
22175                         (noreturn)
22176
22177 cat >>confdefs.h <<EOF
22178 #define GCC_NORETURN $cf_directive
22179 EOF
22180
22181                                 ;;
22182                         (printf)
22183                                 cf_value='/* nothing */'
22184                                 if test "$cf_printf_attribute" != no ; then
22185                                         cf_value='__attribute__((format(printf,fmt,var)))'
22186
22187 cat >>confdefs.h <<\EOF
22188 #define GCC_PRINTF 1
22189 EOF
22190
22191                                 fi
22192
22193 cat >>confdefs.h <<EOF
22194 #define GCC_PRINTFLIKE(fmt,var) $cf_value
22195 EOF
22196
22197                                 ;;
22198                         (scanf)
22199                                 cf_value='/* nothing */'
22200                                 if test "$cf_scanf_attribute" != no ; then
22201                                         cf_value='__attribute__((format(scanf,fmt,var)))'
22202
22203 cat >>confdefs.h <<\EOF
22204 #define GCC_SCANF 1
22205 EOF
22206
22207                                 fi
22208
22209 cat >>confdefs.h <<EOF
22210 #define GCC_SCANFLIKE(fmt,var) $cf_value
22211 EOF
22212
22213                                 ;;
22214                         (unused)
22215
22216 cat >>confdefs.h <<EOF
22217 #define GCC_UNUSED $cf_directive
22218 EOF
22219
22220                                 ;;
22221                         esac
22222                 fi
22223         done
22224 else
22225         ${FGREP-fgrep} define conftest.i >>confdefs.h
22226 fi
22227 rm -rf ./conftest*
22228 fi
22229
22230 if test "x$have_x" = xyes; then
22231
22232 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
22233 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
22234 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
22235 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
22236 for cf_X_CFLAGS in $X_CFLAGS
22237 do
22238         case "x$cf_X_CFLAGS" in
22239         x-[IUD]*)
22240                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
22241                 ;;
22242         *)
22243                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
22244                 ;;
22245         esac
22246 done
22247
22248 cat >"conftest.$ac_ext" <<_ACEOF
22249 #line 22249 "configure"
22250 #include "confdefs.h"
22251
22252 #include <stdlib.h>
22253 #include <X11/Intrinsic.h>
22254
22255 int
22256 main (void)
22257 {
22258 String foo = malloc(1); free((void*)foo)
22259   ;
22260   return 0;
22261 }
22262 _ACEOF
22263 rm -f "conftest.$ac_objext"
22264 if { (eval echo "$as_me:22264: \"$ac_compile\"") >&5
22265   (eval $ac_compile) 2>&5
22266   ac_status=$?
22267   echo "$as_me:22267: \$? = $ac_status" >&5
22268   (exit "$ac_status"); } &&
22269          { ac_try='test -s "conftest.$ac_objext"'
22270   { (eval echo "$as_me:22270: \"$ac_try\"") >&5
22271   (eval $ac_try) 2>&5
22272   ac_status=$?
22273   echo "$as_me:22273: \$? = $ac_status" >&5
22274   (exit "$ac_status"); }; }; then
22275
22276 echo "$as_me:22276: checking for X11/Xt const-feature" >&5
22277 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
22278 if test "${cf_cv_const_x_string+set}" = set; then
22279   echo $ECHO_N "(cached) $ECHO_C" >&6
22280 else
22281
22282         cat >"conftest.$ac_ext" <<_ACEOF
22283 #line 22283 "configure"
22284 #include "confdefs.h"
22285
22286 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
22287 #undef  XTSTRINGDEFINES /* X11R5 and later */
22288 #include <stdlib.h>
22289 #include <X11/Intrinsic.h>
22290
22291 int
22292 main (void)
22293 {
22294 String foo = malloc(1); *foo = 0
22295   ;
22296   return 0;
22297 }
22298 _ACEOF
22299 rm -f "conftest.$ac_objext"
22300 if { (eval echo "$as_me:22300: \"$ac_compile\"") >&5
22301   (eval $ac_compile) 2>&5
22302   ac_status=$?
22303   echo "$as_me:22303: \$? = $ac_status" >&5
22304   (exit "$ac_status"); } &&
22305          { ac_try='test -s "conftest.$ac_objext"'
22306   { (eval echo "$as_me:22306: \"$ac_try\"") >&5
22307   (eval $ac_try) 2>&5
22308   ac_status=$?
22309   echo "$as_me:22309: \$? = $ac_status" >&5
22310   (exit "$ac_status"); }; }; then
22311
22312                         cf_cv_const_x_string=no
22313
22314 else
22315   echo "$as_me: failed program was:" >&5
22316 cat "conftest.$ac_ext" >&5
22317
22318                         cf_cv_const_x_string=yes
22319
22320 fi
22321 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22322
22323 fi
22324 echo "$as_me:22324: result: $cf_cv_const_x_string" >&5
22325 echo "${ECHO_T}$cf_cv_const_x_string" >&6
22326
22327 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
22328 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
22329 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
22330
22331 case "$cf_cv_const_x_string" in
22332 (no)
22333
22334         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22335         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
22336
22337         ;;
22338 (*)
22339
22340         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22341         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
22342
22343         ;;
22344 esac
22345
22346 else
22347   echo "$as_me: failed program was:" >&5
22348 cat "conftest.$ac_ext" >&5
22349 fi
22350 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22351  fi
22352 cat > "conftest.$ac_ext" <<EOF
22353 #line 22353 "${as_me:-configure}"
22354 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
22355 EOF
22356 if test "$INTEL_COMPILER" = yes
22357 then
22358 # The "-wdXXX" options suppress warnings:
22359 # remark #1419: external declaration in primary source file
22360 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
22361 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
22362 # remark #193: zero used for undefined preprocessing identifier
22363 # remark #593: variable "curs_sb_left_arrow" was set but never used
22364 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
22365 # remark #869: parameter "tw" was never referenced
22366 # remark #981: operands are evaluated in unspecified order
22367 # warning #279: controlling expression is constant
22368
22369         { echo "$as_me:22369: checking for $CC warning options..." >&5
22370 echo "$as_me: checking for $CC warning options..." >&6;}
22371         cf_save_CFLAGS="$CFLAGS"
22372         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
22373         for cf_opt in \
22374                 wd1419 \
22375                 wd1683 \
22376                 wd1684 \
22377                 wd193 \
22378                 wd593 \
22379                 wd279 \
22380                 wd810 \
22381                 wd869 \
22382                 wd981
22383         do
22384                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22385                 if { (eval echo "$as_me:22385: \"$ac_compile\"") >&5
22386   (eval $ac_compile) 2>&5
22387   ac_status=$?
22388   echo "$as_me:22388: \$? = $ac_status" >&5
22389   (exit "$ac_status"); }; then
22390                         test -n "$verbose" && echo "$as_me:22390: result: ... -$cf_opt" >&5
22391 echo "${ECHO_T}... -$cf_opt" >&6
22392                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22393                 fi
22394         done
22395         CFLAGS="$cf_save_CFLAGS"
22396 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22397 then
22398         { echo "$as_me:22398: checking for $CC warning options..." >&5
22399 echo "$as_me: checking for $CC warning options..." >&6;}
22400         cf_save_CFLAGS="$CFLAGS"
22401         cf_warn_CONST=""
22402         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22403         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22404         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22405         for cf_opt in W Wall \
22406                 Wbad-function-cast \
22407                 Wcast-align \
22408                 Wcast-qual \
22409                 Wdeclaration-after-statement \
22410                 Wextra \
22411                 Winline \
22412                 Wmissing-declarations \
22413                 Wmissing-prototypes \
22414                 Wnested-externs \
22415                 Wpointer-arith \
22416                 Wshadow \
22417                 Wstrict-prototypes \
22418                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22419         do
22420                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22421                 if { (eval echo "$as_me:22421: \"$ac_compile\"") >&5
22422   (eval $ac_compile) 2>&5
22423   ac_status=$?
22424   echo "$as_me:22424: \$? = $ac_status" >&5
22425   (exit "$ac_status"); }; then
22426                         test -n "$verbose" && echo "$as_me:22426: result: ... -$cf_opt" >&5
22427 echo "${ECHO_T}... -$cf_opt" >&6
22428                         case "$cf_opt" in
22429                         (Winline)
22430                                 case "$GCC_VERSION" in
22431                                 ([34].*)
22432                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22433
22434 echo "${as_me:-configure}:22434: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22435
22436                                         continue;;
22437                                 esac
22438                                 ;;
22439                         (Wpointer-arith)
22440                                 case "$GCC_VERSION" in
22441                                 ([12].*)
22442                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22443
22444 echo "${as_me:-configure}:22444: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22445
22446                                         continue;;
22447                                 esac
22448                                 ;;
22449                         esac
22450                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22451                 fi
22452         done
22453         CFLAGS="$cf_save_CFLAGS"
22454 fi
22455 rm -rf ./conftest*
22456
22457 fi
22458
22459 fi
22460
22461 echo "$as_me:22461: checking if you want to use dmalloc for testing" >&5
22462 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22463
22464 # Check whether --with-dmalloc or --without-dmalloc was given.
22465 if test "${with_dmalloc+set}" = set; then
22466   withval="$with_dmalloc"
22467   case "x$withval" in
22468         (x|xno) ;;
22469         (*)
22470                 : "${with_cflags:=-g}"
22471                 : "${enable_leaks:=no}"
22472                 with_dmalloc=yes
22473
22474 cat >>confdefs.h <<EOF
22475 #define USE_DMALLOC 1
22476 EOF
22477
22478                 ;;
22479         esac
22480 else
22481   with_dmalloc=
22482 fi;
22483 echo "$as_me:22483: result: ${with_dmalloc:-no}" >&5
22484 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22485
22486 case ".$with_cflags" in
22487 (.*-g*)
22488         case .$CFLAGS in
22489         (.*-g*)
22490                 ;;
22491         (*)
22492
22493 cf_fix_cppflags=no
22494 cf_new_cflags=
22495 cf_new_cppflags=
22496 cf_new_extra_cppflags=
22497
22498 for cf_add_cflags in -g
22499 do
22500 case "$cf_fix_cppflags" in
22501 (no)
22502         case "$cf_add_cflags" in
22503         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22504                 case "$cf_add_cflags" in
22505                 (-D*)
22506                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22507
22508                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22509                                 && test -z "${cf_tst_cflags}" \
22510                                 && cf_fix_cppflags=yes
22511
22512                         if test "$cf_fix_cppflags" = yes ; then
22513
22514         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22515         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22516
22517                                 continue
22518                         elif test "${cf_tst_cflags}" = "\"'" ; then
22519
22520         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22521         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22522
22523                                 continue
22524                         fi
22525                         ;;
22526                 esac
22527                 case "$CPPFLAGS" in
22528                 (*$cf_add_cflags)
22529                         ;;
22530                 (*)
22531                         case "$cf_add_cflags" in
22532                         (-D*)
22533                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22534
22535 CPPFLAGS=`echo "$CPPFLAGS" | \
22536         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22537                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22538
22539                                 ;;
22540                         esac
22541
22542         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22543         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22544
22545                         ;;
22546                 esac
22547                 ;;
22548         (*)
22549
22550         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22551         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22552
22553                 ;;
22554         esac
22555         ;;
22556 (yes)
22557
22558         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22559         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22560
22561         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22562
22563         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22564                 && test -z "${cf_tst_cflags}" \
22565                 && cf_fix_cppflags=no
22566         ;;
22567 esac
22568 done
22569
22570 if test -n "$cf_new_cflags" ; then
22571
22572         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22573         CFLAGS="${CFLAGS}$cf_new_cflags"
22574
22575 fi
22576
22577 if test -n "$cf_new_cppflags" ; then
22578
22579         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22580         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22581
22582 fi
22583
22584 if test -n "$cf_new_extra_cppflags" ; then
22585
22586         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22587         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22588
22589 fi
22590
22591                 ;;
22592         esac
22593         ;;
22594 esac
22595
22596 if test "$with_dmalloc" = yes ; then
22597         echo "$as_me:22597: checking for dmalloc.h" >&5
22598 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22599 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22600   echo $ECHO_N "(cached) $ECHO_C" >&6
22601 else
22602   cat >"conftest.$ac_ext" <<_ACEOF
22603 #line 22603 "configure"
22604 #include "confdefs.h"
22605 #include <dmalloc.h>
22606 _ACEOF
22607 if { (eval echo "$as_me:22607: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22608   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22609   ac_status=$?
22610   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22611   rm -f conftest.er1
22612   cat conftest.err >&5
22613   echo "$as_me:22613: \$? = $ac_status" >&5
22614   (exit "$ac_status"); } >/dev/null; then
22615   if test -s conftest.err; then
22616     ac_cpp_err=$ac_c_preproc_warn_flag
22617   else
22618     ac_cpp_err=
22619   fi
22620 else
22621   ac_cpp_err=yes
22622 fi
22623 if test -z "$ac_cpp_err"; then
22624   ac_cv_header_dmalloc_h=yes
22625 else
22626   echo "$as_me: failed program was:" >&5
22627   cat "conftest.$ac_ext" >&5
22628   ac_cv_header_dmalloc_h=no
22629 fi
22630 rm -f conftest.err "conftest.$ac_ext"
22631 fi
22632 echo "$as_me:22632: result: $ac_cv_header_dmalloc_h" >&5
22633 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22634 if test "$ac_cv_header_dmalloc_h" = yes; then
22635
22636 echo "$as_me:22636: checking for dmalloc_debug in -ldmalloc" >&5
22637 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22638 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22639   echo $ECHO_N "(cached) $ECHO_C" >&6
22640 else
22641   ac_check_lib_save_LIBS=$LIBS
22642 LIBS="-ldmalloc  $LIBS"
22643 cat >"conftest.$ac_ext" <<_ACEOF
22644 #line 22644 "configure"
22645 #include "confdefs.h"
22646
22647 /* Override any gcc2 internal prototype to avoid an error.  */
22648 #ifdef __cplusplus
22649 extern "C"
22650 #endif
22651 /* We use char because int might match the return type of a gcc2
22652    builtin and then its argument prototype would still apply.  */
22653 char dmalloc_debug ();
22654 int
22655 main (void)
22656 {
22657 dmalloc_debug ();
22658   ;
22659   return 0;
22660 }
22661 _ACEOF
22662 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22663 if { (eval echo "$as_me:22663: \"$ac_link\"") >&5
22664   (eval $ac_link) 2>&5
22665   ac_status=$?
22666   echo "$as_me:22666: \$? = $ac_status" >&5
22667   (exit "$ac_status"); } &&
22668          { ac_try='test -s "conftest$ac_exeext"'
22669   { (eval echo "$as_me:22669: \"$ac_try\"") >&5
22670   (eval $ac_try) 2>&5
22671   ac_status=$?
22672   echo "$as_me:22672: \$? = $ac_status" >&5
22673   (exit "$ac_status"); }; }; then
22674   ac_cv_lib_dmalloc_dmalloc_debug=yes
22675 else
22676   echo "$as_me: failed program was:" >&5
22677 cat "conftest.$ac_ext" >&5
22678 ac_cv_lib_dmalloc_dmalloc_debug=no
22679 fi
22680 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22681 LIBS=$ac_check_lib_save_LIBS
22682 fi
22683 echo "$as_me:22683: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22684 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22685 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22686   cat >>confdefs.h <<EOF
22687 #define HAVE_LIBDMALLOC 1
22688 EOF
22689
22690   LIBS="-ldmalloc $LIBS"
22691
22692 fi
22693
22694 fi
22695
22696 fi
22697
22698 echo "$as_me:22698: checking if you want to use dbmalloc for testing" >&5
22699 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22700
22701 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22702 if test "${with_dbmalloc+set}" = set; then
22703   withval="$with_dbmalloc"
22704   case "x$withval" in
22705         (x|xno) ;;
22706         (*)
22707                 : "${with_cflags:=-g}"
22708                 : "${enable_leaks:=no}"
22709                 with_dbmalloc=yes
22710
22711 cat >>confdefs.h <<EOF
22712 #define USE_DBMALLOC 1
22713 EOF
22714
22715                 ;;
22716         esac
22717 else
22718   with_dbmalloc=
22719 fi;
22720 echo "$as_me:22720: result: ${with_dbmalloc:-no}" >&5
22721 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22722
22723 case ".$with_cflags" in
22724 (.*-g*)
22725         case .$CFLAGS in
22726         (.*-g*)
22727                 ;;
22728         (*)
22729
22730 cf_fix_cppflags=no
22731 cf_new_cflags=
22732 cf_new_cppflags=
22733 cf_new_extra_cppflags=
22734
22735 for cf_add_cflags in -g
22736 do
22737 case "$cf_fix_cppflags" in
22738 (no)
22739         case "$cf_add_cflags" in
22740         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22741                 case "$cf_add_cflags" in
22742                 (-D*)
22743                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22744
22745                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22746                                 && test -z "${cf_tst_cflags}" \
22747                                 && cf_fix_cppflags=yes
22748
22749                         if test "$cf_fix_cppflags" = yes ; then
22750
22751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22753
22754                                 continue
22755                         elif test "${cf_tst_cflags}" = "\"'" ; then
22756
22757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22759
22760                                 continue
22761                         fi
22762                         ;;
22763                 esac
22764                 case "$CPPFLAGS" in
22765                 (*$cf_add_cflags)
22766                         ;;
22767                 (*)
22768                         case "$cf_add_cflags" in
22769                         (-D*)
22770                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22771
22772 CPPFLAGS=`echo "$CPPFLAGS" | \
22773         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22774                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22775
22776                                 ;;
22777                         esac
22778
22779         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22780         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22781
22782                         ;;
22783                 esac
22784                 ;;
22785         (*)
22786
22787         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22788         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22789
22790                 ;;
22791         esac
22792         ;;
22793 (yes)
22794
22795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22797
22798         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22799
22800         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22801                 && test -z "${cf_tst_cflags}" \
22802                 && cf_fix_cppflags=no
22803         ;;
22804 esac
22805 done
22806
22807 if test -n "$cf_new_cflags" ; then
22808
22809         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22810         CFLAGS="${CFLAGS}$cf_new_cflags"
22811
22812 fi
22813
22814 if test -n "$cf_new_cppflags" ; then
22815
22816         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22817         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22818
22819 fi
22820
22821 if test -n "$cf_new_extra_cppflags" ; then
22822
22823         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22824         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22825
22826 fi
22827
22828                 ;;
22829         esac
22830         ;;
22831 esac
22832
22833 if test "$with_dbmalloc" = yes ; then
22834         echo "$as_me:22834: checking for dbmalloc.h" >&5
22835 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22836 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22837   echo $ECHO_N "(cached) $ECHO_C" >&6
22838 else
22839   cat >"conftest.$ac_ext" <<_ACEOF
22840 #line 22840 "configure"
22841 #include "confdefs.h"
22842 #include <dbmalloc.h>
22843 _ACEOF
22844 if { (eval echo "$as_me:22844: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22845   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22846   ac_status=$?
22847   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22848   rm -f conftest.er1
22849   cat conftest.err >&5
22850   echo "$as_me:22850: \$? = $ac_status" >&5
22851   (exit "$ac_status"); } >/dev/null; then
22852   if test -s conftest.err; then
22853     ac_cpp_err=$ac_c_preproc_warn_flag
22854   else
22855     ac_cpp_err=
22856   fi
22857 else
22858   ac_cpp_err=yes
22859 fi
22860 if test -z "$ac_cpp_err"; then
22861   ac_cv_header_dbmalloc_h=yes
22862 else
22863   echo "$as_me: failed program was:" >&5
22864   cat "conftest.$ac_ext" >&5
22865   ac_cv_header_dbmalloc_h=no
22866 fi
22867 rm -f conftest.err "conftest.$ac_ext"
22868 fi
22869 echo "$as_me:22869: result: $ac_cv_header_dbmalloc_h" >&5
22870 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22871 if test "$ac_cv_header_dbmalloc_h" = yes; then
22872
22873 echo "$as_me:22873: checking for debug_malloc in -ldbmalloc" >&5
22874 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22875 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22876   echo $ECHO_N "(cached) $ECHO_C" >&6
22877 else
22878   ac_check_lib_save_LIBS=$LIBS
22879 LIBS="-ldbmalloc  $LIBS"
22880 cat >"conftest.$ac_ext" <<_ACEOF
22881 #line 22881 "configure"
22882 #include "confdefs.h"
22883
22884 /* Override any gcc2 internal prototype to avoid an error.  */
22885 #ifdef __cplusplus
22886 extern "C"
22887 #endif
22888 /* We use char because int might match the return type of a gcc2
22889    builtin and then its argument prototype would still apply.  */
22890 char debug_malloc ();
22891 int
22892 main (void)
22893 {
22894 debug_malloc ();
22895   ;
22896   return 0;
22897 }
22898 _ACEOF
22899 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22900 if { (eval echo "$as_me:22900: \"$ac_link\"") >&5
22901   (eval $ac_link) 2>&5
22902   ac_status=$?
22903   echo "$as_me:22903: \$? = $ac_status" >&5
22904   (exit "$ac_status"); } &&
22905          { ac_try='test -s "conftest$ac_exeext"'
22906   { (eval echo "$as_me:22906: \"$ac_try\"") >&5
22907   (eval $ac_try) 2>&5
22908   ac_status=$?
22909   echo "$as_me:22909: \$? = $ac_status" >&5
22910   (exit "$ac_status"); }; }; then
22911   ac_cv_lib_dbmalloc_debug_malloc=yes
22912 else
22913   echo "$as_me: failed program was:" >&5
22914 cat "conftest.$ac_ext" >&5
22915 ac_cv_lib_dbmalloc_debug_malloc=no
22916 fi
22917 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22918 LIBS=$ac_check_lib_save_LIBS
22919 fi
22920 echo "$as_me:22920: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22921 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22922 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22923   cat >>confdefs.h <<EOF
22924 #define HAVE_LIBDBMALLOC 1
22925 EOF
22926
22927   LIBS="-ldbmalloc $LIBS"
22928
22929 fi
22930
22931 fi
22932
22933 fi
22934
22935 echo "$as_me:22935: checking if you want to use valgrind for testing" >&5
22936 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22937
22938 # Check whether --with-valgrind or --without-valgrind was given.
22939 if test "${with_valgrind+set}" = set; then
22940   withval="$with_valgrind"
22941   case "x$withval" in
22942         (x|xno) ;;
22943         (*)
22944                 : "${with_cflags:=-g}"
22945                 : "${enable_leaks:=no}"
22946                 with_valgrind=yes
22947
22948 cat >>confdefs.h <<EOF
22949 #define USE_VALGRIND 1
22950 EOF
22951
22952                 ;;
22953         esac
22954 else
22955   with_valgrind=
22956 fi;
22957 echo "$as_me:22957: result: ${with_valgrind:-no}" >&5
22958 echo "${ECHO_T}${with_valgrind:-no}" >&6
22959
22960 case ".$with_cflags" in
22961 (.*-g*)
22962         case .$CFLAGS in
22963         (.*-g*)
22964                 ;;
22965         (*)
22966
22967 cf_fix_cppflags=no
22968 cf_new_cflags=
22969 cf_new_cppflags=
22970 cf_new_extra_cppflags=
22971
22972 for cf_add_cflags in -g
22973 do
22974 case "$cf_fix_cppflags" in
22975 (no)
22976         case "$cf_add_cflags" in
22977         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22978                 case "$cf_add_cflags" in
22979                 (-D*)
22980                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22981
22982                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22983                                 && test -z "${cf_tst_cflags}" \
22984                                 && cf_fix_cppflags=yes
22985
22986                         if test "$cf_fix_cppflags" = yes ; then
22987
22988         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22989         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22990
22991                                 continue
22992                         elif test "${cf_tst_cflags}" = "\"'" ; then
22993
22994         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22995         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22996
22997                                 continue
22998                         fi
22999                         ;;
23000                 esac
23001                 case "$CPPFLAGS" in
23002                 (*$cf_add_cflags)
23003                         ;;
23004                 (*)
23005                         case "$cf_add_cflags" in
23006                         (-D*)
23007                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
23008
23009 CPPFLAGS=`echo "$CPPFLAGS" | \
23010         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
23011                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
23012
23013                                 ;;
23014                         esac
23015
23016         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
23017         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
23018
23019                         ;;
23020                 esac
23021                 ;;
23022         (*)
23023
23024         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
23025         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
23026
23027                 ;;
23028         esac
23029         ;;
23030 (yes)
23031
23032         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23033         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23034
23035         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
23036
23037         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23038                 && test -z "${cf_tst_cflags}" \
23039                 && cf_fix_cppflags=no
23040         ;;
23041 esac
23042 done
23043
23044 if test -n "$cf_new_cflags" ; then
23045
23046         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23047         CFLAGS="${CFLAGS}$cf_new_cflags"
23048
23049 fi
23050
23051 if test -n "$cf_new_cppflags" ; then
23052
23053         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23054         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23055
23056 fi
23057
23058 if test -n "$cf_new_extra_cppflags" ; then
23059
23060         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23061         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23062
23063 fi
23064
23065                 ;;
23066         esac
23067         ;;
23068 esac
23069
23070 echo "$as_me:23070: checking if you want to perform memory-leak testing" >&5
23071 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
23072
23073 # Check whether --enable-leaks or --disable-leaks was given.
23074 if test "${enable_leaks+set}" = set; then
23075   enableval="$enable_leaks"
23076   enable_leaks=$enableval
23077 else
23078   enable_leaks=yes
23079 fi;
23080 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
23081 echo "$as_me:23081: result: $with_no_leaks" >&5
23082 echo "${ECHO_T}$with_no_leaks" >&6
23083
23084 if test "$enable_leaks" = no ; then
23085
23086 cat >>confdefs.h <<\EOF
23087 #define NO_LEAKS 1
23088 EOF
23089
23090 cat >>confdefs.h <<\EOF
23091 #define YY_NO_LEAKS 1
23092 EOF
23093
23094 fi
23095
23096 LD_RPATH_OPT=
23097 if test "x$cf_cv_enable_rpath" != xno
23098 then
23099         echo "$as_me:23099: checking for an rpath option" >&5
23100 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
23101         case "$cf_cv_system_name" in
23102         (irix*)
23103                 if test "$GCC" = yes; then
23104                         LD_RPATH_OPT="-Wl,-rpath,"
23105                 else
23106                         LD_RPATH_OPT="-rpath "
23107                 fi
23108                 ;;
23109         (linux*|gnu*|k*bsd*-gnu|freebsd*)
23110                 LD_RPATH_OPT="-Wl,-rpath,"
23111                 ;;
23112         (openbsd[2-9].*|mirbsd*)
23113                 LD_RPATH_OPT="-Wl,-rpath,"
23114                 ;;
23115         (dragonfly*)
23116                 LD_RPATH_OPT="-rpath "
23117                 ;;
23118         (netbsd*)
23119                 LD_RPATH_OPT="-Wl,-rpath,"
23120                 ;;
23121         (osf*|mls+*)
23122                 LD_RPATH_OPT="-rpath "
23123                 ;;
23124         (solaris2*)
23125                 LD_RPATH_OPT="-R"
23126                 ;;
23127         (*)
23128                 ;;
23129         esac
23130         echo "$as_me:23130: result: $LD_RPATH_OPT" >&5
23131 echo "${ECHO_T}$LD_RPATH_OPT" >&6
23132
23133         case "x$LD_RPATH_OPT" in
23134         (x-R*)
23135                 echo "$as_me:23135: checking if we need a space after rpath option" >&5
23136 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
23137                 cf_save_LIBS="$LIBS"
23138
23139 cf_add_libs="$LIBS"
23140 # reverse order
23141 cf_add_0lib=
23142 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
23143 # filter duplicates
23144 for cf_add_1lib in $cf_add_0lib; do
23145         for cf_add_2lib in $cf_add_libs; do
23146                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
23147                         cf_add_1lib=
23148                         break
23149                 fi
23150         done
23151         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
23152 done
23153 LIBS="$cf_add_libs"
23154
23155                 cat >"conftest.$ac_ext" <<_ACEOF
23156 #line 23156 "configure"
23157 #include "confdefs.h"
23158
23159 int
23160 main (void)
23161 {
23162
23163   ;
23164   return 0;
23165 }
23166 _ACEOF
23167 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23168 if { (eval echo "$as_me:23168: \"$ac_link\"") >&5
23169   (eval $ac_link) 2>&5
23170   ac_status=$?
23171   echo "$as_me:23171: \$? = $ac_status" >&5
23172   (exit "$ac_status"); } &&
23173          { ac_try='test -s "conftest$ac_exeext"'
23174   { (eval echo "$as_me:23174: \"$ac_try\"") >&5
23175   (eval $ac_try) 2>&5
23176   ac_status=$?
23177   echo "$as_me:23177: \$? = $ac_status" >&5
23178   (exit "$ac_status"); }; }; then
23179   cf_rpath_space=no
23180 else
23181   echo "$as_me: failed program was:" >&5
23182 cat "conftest.$ac_ext" >&5
23183 cf_rpath_space=yes
23184 fi
23185 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23186                 LIBS="$cf_save_LIBS"
23187                 echo "$as_me:23187: result: $cf_rpath_space" >&5
23188 echo "${ECHO_T}$cf_rpath_space" >&6
23189                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
23190                 ;;
23191         esac
23192 fi
23193
23194 echo "$as_me:23194: checking if rpath-hack should be disabled" >&5
23195 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
23196
23197 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
23198 if test "${enable_rpath_hack+set}" = set; then
23199   enableval="$enable_rpath_hack"
23200   test "$enableval" != no && enableval=yes
23201         if test "$enableval" != "yes" ; then
23202     enable_rpath_hack=no
23203         else
23204                 enable_rpath_hack=yes
23205         fi
23206 else
23207   enableval=yes
23208         enable_rpath_hack=yes
23209
23210 fi;
23211 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
23212 echo "$as_me:23212: result: $cf_disable_rpath_hack" >&5
23213 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
23214
23215 if test "$enable_rpath_hack" = yes ; then
23216
23217 echo "$as_me:23217: checking for updated LDFLAGS" >&5
23218 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
23219 if test -n "$LD_RPATH_OPT" ; then
23220         echo "$as_me:23220: result: maybe" >&5
23221 echo "${ECHO_T}maybe" >&6
23222
23223         for ac_prog in ldd
23224 do
23225   # Extract the first word of "$ac_prog", so it can be a program name with args.
23226 set dummy $ac_prog; ac_word=$2
23227 echo "$as_me:23227: checking for $ac_word" >&5
23228 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23229 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
23230   echo $ECHO_N "(cached) $ECHO_C" >&6
23231 else
23232   if test -n "$cf_ldd_prog"; then
23233   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
23234 else
23235   ac_save_IFS=$IFS; IFS=$ac_path_separator
23236 ac_dummy="$PATH"
23237 for ac_dir in $ac_dummy; do
23238   IFS=$ac_save_IFS
23239   test -z "$ac_dir" && ac_dir=.
23240   $as_executable_p "$ac_dir/$ac_word" || continue
23241 ac_cv_prog_cf_ldd_prog="$ac_prog"
23242 echo "$as_me:23242: found $ac_dir/$ac_word" >&5
23243 break
23244 done
23245
23246 fi
23247 fi
23248 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
23249 if test -n "$cf_ldd_prog"; then
23250   echo "$as_me:23250: result: $cf_ldd_prog" >&5
23251 echo "${ECHO_T}$cf_ldd_prog" >&6
23252 else
23253   echo "$as_me:23253: result: no" >&5
23254 echo "${ECHO_T}no" >&6
23255 fi
23256
23257   test -n "$cf_ldd_prog" && break
23258 done
23259 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
23260
23261         cf_rpath_list="/usr/lib /lib"
23262         if test "$cf_ldd_prog" != no
23263         then
23264                 cf_rpath_oops=
23265
23266 cat >"conftest.$ac_ext" <<_ACEOF
23267 #line 23267 "configure"
23268 #include "confdefs.h"
23269 #include <stdio.h>
23270 int
23271 main (void)
23272 {
23273 printf("Hello");
23274   ;
23275   return 0;
23276 }
23277 _ACEOF
23278 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23279 if { (eval echo "$as_me:23279: \"$ac_link\"") >&5
23280   (eval $ac_link) 2>&5
23281   ac_status=$?
23282   echo "$as_me:23282: \$? = $ac_status" >&5
23283   (exit "$ac_status"); } &&
23284          { ac_try='test -s "conftest$ac_exeext"'
23285   { (eval echo "$as_me:23285: \"$ac_try\"") >&5
23286   (eval $ac_try) 2>&5
23287   ac_status=$?
23288   echo "$as_me:23288: \$? = $ac_status" >&5
23289   (exit "$ac_status"); }; }; then
23290   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
23291                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
23292 else
23293   echo "$as_me: failed program was:" >&5
23294 cat "conftest.$ac_ext" >&5
23295 fi
23296 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23297
23298                 # If we passed the link-test, but get a "not found" on a given library,
23299                 # this could be due to inept reconfiguration of gcc to make it only
23300                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
23301                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
23302                 # /usr/local libraries.
23303                 if test -n "$cf_rpath_oops"
23304                 then
23305                         for cf_rpath_src in $cf_rpath_oops
23306                         do
23307                                 for cf_rpath_dir in \
23308                                         /usr/local \
23309                                         /usr/pkg \
23310                                         /opt/sfw
23311                                 do
23312                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
23313                                         then
23314                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
23315
23316 echo "${as_me:-configure}:23316: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
23317
23318                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
23319                                                 break
23320                                         fi
23321                                 done
23322                         done
23323                 fi
23324         fi
23325
23326         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23327
23328 echo "${as_me:-configure}:23328: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23329
23330 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
23331
23332 echo "${as_me:-configure}:23332: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
23333
23334 cf_rpath_dst=
23335 for cf_rpath_src in $LDFLAGS
23336 do
23337         case "$cf_rpath_src" in
23338         (-L*)
23339
23340                 # check if this refers to a directory which we will ignore
23341                 cf_rpath_skip=no
23342                 if test -n "$cf_rpath_list"
23343                 then
23344                         for cf_rpath_item in $cf_rpath_list
23345                         do
23346                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23347                                 then
23348                                         cf_rpath_skip=yes
23349                                         break
23350                                 fi
23351                         done
23352                 fi
23353
23354                 if test "$cf_rpath_skip" = no
23355                 then
23356                         # transform the option
23357                         if test "$LD_RPATH_OPT" = "-R " ; then
23358                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23359                         else
23360                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23361                         fi
23362
23363                         # if we have not already added this, add it now
23364                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23365                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23366                         then
23367                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23368
23369 echo "${as_me:-configure}:23369: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23370
23371                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23372                         fi
23373                 fi
23374                 ;;
23375         esac
23376         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23377 done
23378 LDFLAGS=$cf_rpath_dst
23379
23380 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
23381
23382 echo "${as_me:-configure}:23382: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
23383
23384 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23385
23386 echo "${as_me:-configure}:23386: testing ...checking LIBS $LIBS ..." 1>&5
23387
23388 cf_rpath_dst=
23389 for cf_rpath_src in $LIBS
23390 do
23391         case "$cf_rpath_src" in
23392         (-L*)
23393
23394                 # check if this refers to a directory which we will ignore
23395                 cf_rpath_skip=no
23396                 if test -n "$cf_rpath_list"
23397                 then
23398                         for cf_rpath_item in $cf_rpath_list
23399                         do
23400                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23401                                 then
23402                                         cf_rpath_skip=yes
23403                                         break
23404                                 fi
23405                         done
23406                 fi
23407
23408                 if test "$cf_rpath_skip" = no
23409                 then
23410                         # transform the option
23411                         if test "$LD_RPATH_OPT" = "-R " ; then
23412                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23413                         else
23414                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23415                         fi
23416
23417                         # if we have not already added this, add it now
23418                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23419                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23420                         then
23421                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23422
23423 echo "${as_me:-configure}:23423: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23424
23425                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23426                         fi
23427                 fi
23428                 ;;
23429         esac
23430         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23431 done
23432 LIBS=$cf_rpath_dst
23433
23434 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23435
23436 echo "${as_me:-configure}:23436: testing ...checked LIBS $LIBS ..." 1>&5
23437
23438         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23439
23440 echo "${as_me:-configure}:23440: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23441
23442 else
23443         echo "$as_me:23443: result: no" >&5
23444 echo "${ECHO_T}no" >&6
23445 fi
23446
23447 fi
23448
23449 TEST_ARGS="$LIBS"
23450 LIBS=
23451
23452 ac_config_files="$ac_config_files Makefile"
23453 ac_config_commands="$ac_config_commands default"
23454 cat >confcache <<\_ACEOF
23455 # This file is a shell script that caches the results of configure
23456 # tests run on this system so they can be shared between configure
23457 # scripts and configure runs, see configure's option --config-cache.
23458 # It is not useful on other systems.  If it contains results you don't
23459 # want to keep, you may remove or edit it.
23460 #
23461 # config.status only pays attention to the cache file if you give it
23462 # the --recheck option to rerun configure.
23463 #
23464 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23465 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23466 # following values.
23467
23468 _ACEOF
23469
23470 # The following way of writing the cache mishandles newlines in values,
23471 # but we know of no workaround that is simple, portable, and efficient.
23472 # So, don't put newlines in cache variables' values.
23473 # Ultrix sh set writes to stderr and can't be redirected directly,
23474 # and sets the high bit in the cache file unless we assign to the vars.
23475 {
23476   (set) 2>&1 |
23477     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23478     *ac_space=\ *)
23479       # `set' does not quote correctly, so add quotes (double-quote
23480       # substitution turns \\\\ into \\, and sed turns \\ into \).
23481       sed -n \
23482         "s/'/'\\\\''/g;
23483           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23484       ;;
23485     *)
23486       # `set' quotes correctly as required by POSIX, so do not add quotes.
23487       sed -n \
23488         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23489       ;;
23490     esac;
23491 } |
23492   sed '
23493      t clear
23494      : clear
23495      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23496      t end
23497      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23498      : end' >>confcache
23499 if cmp -s $cache_file confcache; then :; else
23500   if test -w $cache_file; then
23501     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23502     cat confcache >$cache_file
23503   else
23504     echo "not updating unwritable cache $cache_file"
23505   fi
23506 fi
23507 rm -f confcache
23508
23509 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23510 # Let make expand exec_prefix.
23511 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23512
23513 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23514 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23515 # trailing colons and then remove the whole line if VPATH becomes empty
23516 # (actually we leave an empty line to preserve line numbers).
23517 if test "x$srcdir" = x.; then
23518   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23519 s/:*\$(srcdir):*/:/;
23520 s/:*\${srcdir}:*/:/;
23521 s/:*@srcdir@:*/:/;
23522 s/^\([^=]*=[    ]*\):*/\1/;
23523 s/:*$//;
23524 s/^[^=]*=[      ]*$//;
23525 }'
23526 fi
23527
23528 DEFS=-DHAVE_CONFIG_H
23529
23530 : "${CONFIG_STATUS=./config.status}"
23531 ac_clean_files_save=$ac_clean_files
23532 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23533 { echo "$as_me:23533: creating $CONFIG_STATUS" >&5
23534 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23535 cat >"$CONFIG_STATUS" <<_ACEOF
23536 #! $SHELL
23537 # Generated automatically by configure.
23538 # Run this file to recreate the current configuration.
23539 # Compiler output produced by configure, useful for debugging
23540 # configure, is in config.log if it exists.
23541
23542 debug=false
23543 SHELL=\${CONFIG_SHELL-$SHELL}
23544 ac_cs_invocation="\$0 \$@"
23545
23546 CLICOLOR_FORCE= GREP_OPTIONS=
23547 unset CLICOLOR_FORCE GREP_OPTIONS
23548 _ACEOF
23549
23550 cat >>"$CONFIG_STATUS" <<\_ACEOF
23551 # Be Bourne compatible
23552 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23553   emulate sh
23554   NULLCMD=:
23555 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23556   set -o posix
23557 fi
23558
23559 # Name of the executable.
23560 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23561
23562 if expr a : '\(a\)' >/dev/null 2>&1; then
23563   as_expr=expr
23564 else
23565   as_expr=false
23566 fi
23567
23568 rm -f conf$$ conf$$.exe conf$$.file
23569 echo >conf$$.file
23570 if ln -s conf$$.file conf$$ 2>/dev/null; then
23571   # We could just check for DJGPP; but this test a) works b) is more generic
23572   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23573   if test -f conf$$.exe; then
23574     # Don't use ln at all; we don't have any links
23575     as_ln_s='cp -p'
23576   else
23577     as_ln_s='ln -s'
23578   fi
23579 elif ln conf$$.file conf$$ 2>/dev/null; then
23580   as_ln_s=ln
23581 else
23582   as_ln_s='cp -p'
23583 fi
23584 rm -f conf$$ conf$$.exe conf$$.file
23585
23586 as_executable_p="test -f"
23587
23588 # Support unset when possible.
23589 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23590   as_unset="unset"
23591 else
23592   as_unset="false"
23593 fi
23594
23595 # NLS nuisances.
23596 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23597 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23598 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23599 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23600 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23601 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23602 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23603 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23604
23605 # IFS
23606 # We need space, tab and new line, in precisely that order.
23607 as_nl='
23608 '
23609 IFS="   $as_nl"
23610
23611 # CDPATH.
23612 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23613
23614 exec 6>&1
23615
23616 _ACEOF
23617
23618 # Files that config.status was made for.
23619 if test -n "$ac_config_files"; then
23620   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23621 fi
23622
23623 if test -n "$ac_config_headers"; then
23624   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23625 fi
23626
23627 if test -n "$ac_config_links"; then
23628   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23629 fi
23630
23631 if test -n "$ac_config_commands"; then
23632   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23633 fi
23634
23635 cat >>"$CONFIG_STATUS" <<\EOF
23636
23637 ac_cs_usage="\
23638 \`$as_me' instantiates files from templates according to the
23639 current configuration.
23640
23641 Usage: $0 [OPTIONS] [FILE]...
23642
23643   -h, --help       print this help, then exit
23644   -V, --version    print version number, then exit
23645   -d, --debug      don't remove temporary files
23646       --recheck    update $as_me by reconfiguring in the same conditions
23647   --file=FILE[:TEMPLATE]
23648                    instantiate the configuration file FILE
23649   --header=FILE[:TEMPLATE]
23650                    instantiate the configuration header FILE
23651
23652 Configuration files:
23653 $config_files
23654
23655 Configuration headers:
23656 $config_headers
23657
23658 Configuration commands:
23659 $config_commands
23660
23661 Report bugs to <dickey@invisible-island.net>."
23662 EOF
23663
23664 cat >>"$CONFIG_STATUS" <<EOF
23665 ac_cs_version="\\
23666 config.status
23667 configured by $0, generated by GNU Autoconf 2.52.20210509,
23668   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23669
23670 Copyright 2003-2020,2021        Thomas E. Dickey
23671 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23672 Free Software Foundation, Inc.
23673 This config.status script is free software; the Free Software Foundation
23674 gives unlimited permission to copy, distribute and modify it."
23675 srcdir="$srcdir"
23676 INSTALL="$INSTALL"
23677 EOF
23678
23679 cat >>"$CONFIG_STATUS" <<\EOF
23680 # If no file are specified by the user, then we need to provide default
23681 # value.  By we need to know if files were specified by the user.
23682 ac_need_defaults=:
23683 while test $# != 0
23684 do
23685   case $1 in
23686   --*=*)
23687     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23688     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23689     shift
23690     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23691     shift
23692     ;;
23693   -*);;
23694   *) # This is not an option, so the user has probably given explicit
23695      # arguments.
23696      ac_need_defaults=false;;
23697   esac
23698
23699   case $1 in
23700   # Handling of the options.
23701 EOF
23702 cat >>"$CONFIG_STATUS" <<EOF
23703   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23704     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23705     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23706 EOF
23707 cat >>"$CONFIG_STATUS" <<\EOF
23708   --version | --vers* | -V )
23709     echo "$ac_cs_version"; exit 0 ;;
23710   --he | --h)
23711     # Conflict between --help and --header
23712     { { echo "$as_me:23712: error: ambiguous option: $1
23713 Try \`$0 --help' for more information." >&5
23714 echo "$as_me: error: ambiguous option: $1
23715 Try \`$0 --help' for more information." >&2;}
23716    { (exit 1); exit 1; }; };;
23717   --help | --hel | -h )
23718     echo "$ac_cs_usage"; exit 0 ;;
23719   --debug | --d* | -d )
23720     debug=: ;;
23721   --file | --fil | --fi | --f )
23722     shift
23723     CONFIG_FILES="$CONFIG_FILES $1"
23724     ac_need_defaults=false;;
23725   --header | --heade | --head | --hea )
23726     shift
23727     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23728     ac_need_defaults=false;;
23729
23730   # This is an error.
23731   -*) { { echo "$as_me:23731: error: unrecognized option: $1
23732 Try \`$0 --help' for more information." >&5
23733 echo "$as_me: error: unrecognized option: $1
23734 Try \`$0 --help' for more information." >&2;}
23735    { (exit 1); exit 1; }; } ;;
23736
23737   *) ac_config_targets="$ac_config_targets $1" ;;
23738
23739   esac
23740   shift
23741 done
23742
23743 exec 5>>config.log
23744 cat >&5 << _ACEOF
23745
23746 ## ----------------------- ##
23747 ## Running config.status.  ##
23748 ## ----------------------- ##
23749
23750 This file was extended by $as_me 2.52.20210509, executed with
23751   CONFIG_FILES    = $CONFIG_FILES
23752   CONFIG_HEADERS  = $CONFIG_HEADERS
23753   CONFIG_LINKS    = $CONFIG_LINKS
23754   CONFIG_COMMANDS = $CONFIG_COMMANDS
23755   > "$ac_cs_invocation"
23756 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23757
23758 _ACEOF
23759 EOF
23760
23761 cat >>"$CONFIG_STATUS" <<EOF
23762 #
23763 # INIT-COMMANDS section.
23764 #
23765
23766 AWK="$AWK"
23767 ECHO_CC="$ECHO_CC"
23768 ECHO_LD="$ECHO_LD"
23769 SHOW_CC="$SHOW_LD"
23770
23771 EOF
23772
23773 cat >>"$CONFIG_STATUS" <<\EOF
23774 for ac_config_target in $ac_config_targets
23775 do
23776   case "$ac_config_target" in
23777   # Handling of arguments.
23778   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23779   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23780   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23781   *) { { echo "$as_me:23781: error: invalid argument: $ac_config_target" >&5
23782 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23783    { (exit 1); exit 1; }; };;
23784   esac
23785 done
23786
23787 # If the user did not use the arguments to specify the items to instantiate,
23788 # then the envvar interface is used.  Set only those that are not.
23789 # We use the long form for the default assignment because of an extremely
23790 # bizarre bug on SunOS 4.1.3.
23791 if "$ac_need_defaults"; then
23792   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23793   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23794   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23795 fi
23796
23797 # Create a temporary directory, and hook for its removal unless debugging.
23798 $debug ||
23799 {
23800   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23801   trap '{ (exit 1); exit 1; }' 1 2 13 15
23802 }
23803
23804 # Create a (secure) tmp directory for tmp files.
23805 : ${TMPDIR=/tmp}
23806 {
23807   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23808   test -n "$tmp" && test -d "$tmp"
23809 }  ||
23810 {
23811   tmp=$TMPDIR/cs$$-$RANDOM
23812   (umask 077 && mkdir $tmp)
23813 } ||
23814 {
23815    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23816    { (exit 1); exit 1; }
23817 }
23818
23819 EOF
23820
23821 cat >>"$CONFIG_STATUS" <<EOF
23822
23823 #
23824 # CONFIG_FILES section.
23825 #
23826
23827 # No need to generate the scripts if there are no CONFIG_FILES.
23828 # This happens for instance when ./config.status config.h
23829 if test -n "\$CONFIG_FILES"; then
23830   # Protect against being on the right side of a sed subst in config.status.
23831   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23832    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23833 s,@SHELL@,$SHELL,;t t
23834 s,@exec_prefix@,$exec_prefix,;t t
23835 s,@prefix@,$prefix,;t t
23836 s,@program_transform_name@,$program_transform_name,;t t
23837 s,@bindir@,$bindir,;t t
23838 s,@sbindir@,$sbindir,;t t
23839 s,@libexecdir@,$libexecdir,;t t
23840 s,@datarootdir@,$datarootdir,;t t
23841 s,@datadir@,$datadir,;t t
23842 s,@sysconfdir@,$sysconfdir,;t t
23843 s,@sharedstatedir@,$sharedstatedir,;t t
23844 s,@localstatedir@,$localstatedir,;t t
23845 s,@runstatedir@,$runstatedir,;t t
23846 s,@libdir@,$libdir,;t t
23847 s,@includedir@,$includedir,;t t
23848 s,@oldincludedir@,$oldincludedir,;t t
23849 s,@infodir@,$infodir,;t t
23850 s,@mandir@,$mandir,;t t
23851 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23852 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23853 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23854 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23855 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23856 s,@build_alias@,$build_alias,;t t
23857 s,@host_alias@,$host_alias,;t t
23858 s,@target_alias@,$target_alias,;t t
23859 s,@ECHO_C@,$ECHO_C,;t t
23860 s,@ECHO_N@,$ECHO_N,;t t
23861 s,@ECHO_T@,$ECHO_T,;t t
23862 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23863 s,@DEFS@,$DEFS,;t t
23864 s,@LIBS@,$LIBS,;t t
23865 s,@build@,$build,;t t
23866 s,@build_cpu@,$build_cpu,;t t
23867 s,@build_vendor@,$build_vendor,;t t
23868 s,@build_os@,$build_os,;t t
23869 s,@host@,$host,;t t
23870 s,@host_cpu@,$host_cpu,;t t
23871 s,@host_vendor@,$host_vendor,;t t
23872 s,@host_os@,$host_os,;t t
23873 s,@SET_MAKE@,$SET_MAKE,;t t
23874 s,@CC@,$CC,;t t
23875 s,@CFLAGS@,$CFLAGS,;t t
23876 s,@LDFLAGS@,$LDFLAGS,;t t
23877 s,@CPPFLAGS@,$CPPFLAGS,;t t
23878 s,@ac_ct_CC@,$ac_ct_CC,;t t
23879 s,@EXEEXT@,$EXEEXT,;t t
23880 s,@OBJEXT@,$OBJEXT,;t t
23881 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23882 s,@CPP@,$CPP,;t t
23883 s,@GREP@,$GREP,;t t
23884 s,@EGREP@,$EGREP,;t t
23885 s,@AWK@,$AWK,;t t
23886 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23887 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23888 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23889 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23890 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23891 s,@LINT@,$LINT,;t t
23892 s,@LINT_OPTS@,$LINT_OPTS,;t t
23893 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
23894 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
23895 s,@CTAGS@,$CTAGS,;t t
23896 s,@ETAGS@,$ETAGS,;t t
23897 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23898 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23899 s,@MATH_LIB@,$MATH_LIB,;t t
23900 s,@top_builddir@,$top_builddir,;t t
23901 s,@CC_G_OPT@,$CC_G_OPT,;t t
23902 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23903 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23904 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23905 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23906 s,@LD@,$LD,;t t
23907 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23908 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23909 s,@LD_MODEL@,$LD_MODEL,;t t
23910 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23911 s,@LIBTOOL@,$LIBTOOL,;t t
23912 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23913 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23914 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23915 s,@LIB_LINK@,$LIB_LINK,;t t
23916 s,@LINK_TESTS@,$LINK_TESTS,;t t
23917 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23918 s,@PACKAGE@,$PACKAGE,;t t
23919 s,@PTHREAD@,$PTHREAD,;t t
23920 s,@TEST_ARGS@,$TEST_ARGS,;t t
23921 s,@TEST_DEPS@,$TEST_DEPS,;t t
23922 s,@TEST_LIBS@,$TEST_LIBS,;t t
23923 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23924 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23925 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23926 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23927 s,@includesubdir@,$includesubdir,;t t
23928 s,@FGREP@,$FGREP,;t t
23929 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23930 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
23931 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23932 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23933 s,@ECHO_LT@,$ECHO_LT,;t t
23934 s,@ECHO_LD@,$ECHO_LD,;t t
23935 s,@RULE_CC@,$RULE_CC,;t t
23936 s,@SHOW_CC@,$SHOW_CC,;t t
23937 s,@ECHO_CC@,$ECHO_CC,;t t
23938 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23939 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23940 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23941 s,@X_CFLAGS@,$X_CFLAGS,;t t
23942 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23943 s,@X_LIBS@,$X_LIBS,;t t
23944 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23945 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23946 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23947 s,@RGB_PATH@,$RGB_PATH,;t t
23948 s,@no_x11_rgb@,$no_x11_rgb,;t t
23949 s,@FORM_NAME@,$FORM_NAME,;t t
23950 s,@MENU_NAME@,$MENU_NAME,;t t
23951 s,@PANEL_NAME@,$PANEL_NAME,;t t
23952 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23953 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23954 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23955 CEOF
23956
23957 EOF
23958
23959   cat >>"$CONFIG_STATUS" <<\EOF
23960   # Split the substitutions into bite-sized pieces for seds with
23961   # small command number limits, like on Digital OSF/1 and HP-UX.
23962   ac_max_sed_lines=48
23963   ac_sed_frag=1 # Number of current file.
23964   ac_beg=1 # First line for current file.
23965   ac_end=$ac_max_sed_lines # Line after last line for current file.
23966   ac_more_lines=:
23967   ac_sed_cmds=
23968   while "$ac_more_lines"; do
23969     if test "$ac_beg" -gt 1; then
23970       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23971     else
23972       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23973     fi
23974     if test ! -s $tmp/subs.frag; then
23975       ac_more_lines=false
23976     else
23977       # The purpose of the label and of the branching condition is to
23978       # speed up the sed processing (if there are no `@' at all, there
23979       # is no need to browse any of the substitutions).
23980       # These are the two extra sed commands mentioned above.
23981       (echo ':t
23982   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23983       # It is possible to make a multiline substitution using escaped newlines.
23984       # Ensure that we do not split the substitution between script fragments.
23985       ac_BEG=$ac_end
23986       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23987       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23988       if test -s $tmp/subs.next; then
23989         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23990         if test ! -s $tmp/subs.edit; then
23991           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23992           if test ! -s $tmp/subs.edit; then
23993             if test "$ac_beg" -gt 1; then
23994               ac_end=`expr "$ac_end" - 1`
23995               continue
23996             fi
23997           fi
23998         fi
23999       fi
24000
24001       if test -z "$ac_sed_cmds"; then
24002         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
24003       else
24004         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
24005       fi
24006       ac_sed_frag=`expr "$ac_sed_frag" + 1`
24007       ac_beg=$ac_end
24008       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
24009     fi
24010   done
24011   if test -z "$ac_sed_cmds"; then
24012     ac_sed_cmds=cat
24013   fi
24014 fi # test -n "$CONFIG_FILES"
24015
24016 EOF
24017 cat >>"$CONFIG_STATUS" <<\EOF
24018 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
24019   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24020   case "$ac_file" in
24021   - | *:- | *:-:* ) # input from stdin
24022         cat >$tmp/stdin
24023         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24024         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24025   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24026         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24027   * )   ac_file_in=$ac_file.in ;;
24028   esac
24029
24030   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
24031   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24032          X"$ac_file" : 'X\(//\)[^/]' \| \
24033          X"$ac_file" : 'X\(//\)$' \| \
24034          X"$ac_file" : 'X\(/\)' \| \
24035          .     : '\(.\)' 2>/dev/null ||
24036 echo X"$ac_file" |
24037     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24038           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24039           /^X\(\/\/\)$/{ s//\1/; q; }
24040           /^X\(\/\).*/{ s//\1/; q; }
24041           s/.*/./; q'`
24042   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24043     { case "$ac_dir" in
24044   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24045   *)                      as_incr_dir=.;;
24046 esac
24047 as_dummy="$ac_dir"
24048 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24049   case $as_mkdir_dir in
24050     # Skip DOS drivespec
24051     ?:) as_incr_dir=$as_mkdir_dir ;;
24052     *)
24053       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24054       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24055     ;;
24056   esac
24057 done; }
24058
24059     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
24060     # A "../" for each directory in $ac_dir_suffix.
24061     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
24062   else
24063     ac_dir_suffix= ac_dots=
24064   fi
24065
24066   case "$srcdir" in
24067   .)  ac_srcdir=.
24068       if test -z "$ac_dots"; then
24069          ac_top_srcdir=.
24070       else
24071          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
24072       fi ;;
24073   [\\/]* | ?:[\\/]* )
24074       ac_srcdir="$srcdir$ac_dir_suffix";
24075       ac_top_srcdir="$srcdir" ;;
24076   *) # Relative path.
24077     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
24078     ac_top_srcdir="$ac_dots$srcdir" ;;
24079   esac
24080
24081   case $INSTALL in
24082   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
24083   *) ac_INSTALL=$ac_dots$INSTALL ;;
24084   esac
24085
24086   if test x"$ac_file" != x-; then
24087     { echo "$as_me:24087: creating $ac_file" >&5
24088 echo "$as_me: creating $ac_file" >&6;}
24089     rm -f "$ac_file"
24090   fi
24091   # Let's still pretend it is `configure' which instantiates (i.e., don't
24092   # use $as_me), people would be surprised to read:
24093   #    /* config.h.  Generated automatically by config.status.  */
24094   configure_input="Generated automatically from `echo $ac_file_in |
24095                                                  sed 's,.*/,,'` by configure."
24096
24097   # First look for the input files in the build tree, otherwise in the
24098   # src tree.
24099   ac_file_inputs=`IFS=:
24100     for f in $ac_file_in; do
24101       case $f in
24102       -) echo $tmp/stdin ;;
24103       [\\/$]*)
24104          # Absolute (can't be DOS-style, as IFS=:)
24105          test -f "$f" || { { echo "$as_me:24105: error: cannot find input file: $f" >&5
24106 echo "$as_me: error: cannot find input file: $f" >&2;}
24107    { (exit 1); exit 1; }; }
24108          echo $f;;
24109       *) # Relative
24110          if test -f "$f"; then
24111            # Build tree
24112            echo $f
24113          elif test -f "$srcdir/$f"; then
24114            # Source tree
24115            echo "$srcdir/$f"
24116          else
24117            # /dev/null tree
24118            { { echo "$as_me:24118: error: cannot find input file: $f" >&5
24119 echo "$as_me: error: cannot find input file: $f" >&2;}
24120    { (exit 1); exit 1; }; }
24121          fi;;
24122       esac
24123     done` || { (exit 1); exit 1; }
24124 EOF
24125 cat >>"$CONFIG_STATUS" <<\EOF
24126   ac_warn_datarootdir=no
24127   if test x"$ac_file" != x-; then
24128     for ac_item in $ac_file_inputs
24129     do
24130       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
24131       if test -n "$ac_seen"; then
24132         ac_used=`grep '@datarootdir@' "$ac_item"`
24133         if test -z "$ac_used"; then
24134           { echo "$as_me:24134: WARNING: datarootdir was used implicitly but not set:
24135 $ac_seen" >&5
24136 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
24137 $ac_seen" >&2;}
24138           ac_warn_datarootdir=yes
24139         fi
24140       fi
24141       ac_seen=`grep '${datarootdir}' "$ac_item"`
24142       if test -n "$ac_seen"; then
24143         { echo "$as_me:24143: WARNING: datarootdir was used explicitly but not set:
24144 $ac_seen" >&5
24145 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
24146 $ac_seen" >&2;}
24147         ac_warn_datarootdir=yes
24148       fi
24149     done
24150   fi
24151
24152 if test "x$ac_warn_datarootdir" = xyes; then
24153   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
24154 fi
24155
24156 EOF
24157 cat >>"$CONFIG_STATUS" <<EOF
24158   sed "$ac_vpsub
24159 $extrasub
24160 EOF
24161 cat >>"$CONFIG_STATUS" <<\EOF
24162 :t
24163 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
24164 s,@configure_input@,$configure_input,;t t
24165 s,@srcdir@,$ac_srcdir,;t t
24166 s,@top_srcdir@,$ac_top_srcdir,;t t
24167 s,@INSTALL@,$ac_INSTALL,;t t
24168 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
24169   rm -f $tmp/stdin
24170   if test x"$ac_file" != x-; then
24171     cp "$tmp/out" "$ac_file"
24172
24173     for ac_name in prefix exec_prefix datarootdir
24174     do
24175         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
24176         if test -n "$ac_seen"; then
24177             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
24178             if test -z "$ac_init"; then
24179               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
24180               { echo "$as_me:24180: WARNING: Variable $ac_name is used but was not set:
24181 $ac_seen" >&5
24182 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
24183 $ac_seen" >&2;}
24184             fi
24185         fi
24186     done
24187     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
24188     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
24189     if test -s $tmp/out; then
24190       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
24191       { echo "$as_me:24191: WARNING: Some variables may not be substituted:
24192 $ac_seen" >&5
24193 echo "$as_me: WARNING: Some variables may not be substituted:
24194 $ac_seen" >&2;}
24195     fi
24196   else
24197     cat $tmp/out
24198   fi
24199   rm -f $tmp/out
24200
24201 done
24202 EOF
24203 cat >>"$CONFIG_STATUS" <<\EOF
24204
24205 #
24206 # CONFIG_HEADER section.
24207 #
24208
24209 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24210 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24211 #
24212 # ac_d sets the value in "#define NAME VALUE" lines.
24213 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24214 ac_dB='[        ].*$,\1#\2'
24215 ac_dC=' '
24216 ac_dD=',;t'
24217 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24218 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24219 ac_iB='\([      ]\),\1#\2define\3'
24220 ac_iC=' '
24221 ac_iD='\4,;t'
24222 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24223 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24224 ac_uB='$,\1#\2define\3'
24225 ac_uC=' '
24226 ac_uD=',;t'
24227
24228 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
24229   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24230   case "$ac_file" in
24231   - | *:- | *:-:* ) # input from stdin
24232         cat >$tmp/stdin
24233         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24234         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24235   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24236         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24237   * )   ac_file_in=$ac_file.in ;;
24238   esac
24239
24240   test x"$ac_file" != x- && { echo "$as_me:24240: creating $ac_file" >&5
24241 echo "$as_me: creating $ac_file" >&6;}
24242
24243   # First look for the input files in the build tree, otherwise in the
24244   # src tree.
24245   ac_file_inputs=`IFS=:
24246     for f in $ac_file_in; do
24247       case $f in
24248       -) echo $tmp/stdin ;;
24249       [\\/$]*)
24250          # Absolute (can't be DOS-style, as IFS=:)
24251          test -f "$f" || { { echo "$as_me:24251: error: cannot find input file: $f" >&5
24252 echo "$as_me: error: cannot find input file: $f" >&2;}
24253    { (exit 1); exit 1; }; }
24254          echo $f;;
24255       *) # Relative
24256          if test -f "$f"; then
24257            # Build tree
24258            echo $f
24259          elif test -f "$srcdir/$f"; then
24260            # Source tree
24261            echo "$srcdir/$f"
24262          else
24263            # /dev/null tree
24264            { { echo "$as_me:24264: error: cannot find input file: $f" >&5
24265 echo "$as_me: error: cannot find input file: $f" >&2;}
24266    { (exit 1); exit 1; }; }
24267          fi;;
24268       esac
24269     done` || { (exit 1); exit 1; }
24270   # Remove the trailing spaces.
24271   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
24272
24273 EOF
24274
24275 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
24276 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
24277 # be either 'cat' or 'sort'.
24278 cat confdefs.h | uniq >conftest.vals
24279
24280 # Break up conftest.vals because some shells have a limit on
24281 # the size of here documents, and old seds have small limits too.
24282
24283 rm -f conftest.tail
24284 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
24285 while grep . conftest.vals >/dev/null
24286 do
24287   # Write chunks of a limited-size here document to conftest.frag.
24288   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
24289   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
24290   echo 'CEOF' >> "$CONFIG_STATUS"
24291   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
24292   rm -f conftest.vals
24293   mv conftest.tail conftest.vals
24294 done
24295 rm -f conftest.vals
24296
24297 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
24298 # marker @DEFS@.
24299 echo '  cat >> conftest.edit <<CEOF
24300 /@DEFS@/r conftest.frag
24301 /@DEFS@/d
24302 CEOF
24303 sed -f conftest.edit $tmp/in > $tmp/out
24304 rm -f $tmp/in
24305 mv $tmp/out $tmp/in
24306 rm -f conftest.edit conftest.frag
24307 ' >> "$CONFIG_STATUS"
24308
24309 cat >>"$CONFIG_STATUS" <<\EOF
24310   # Let's still pretend it is `configure' which instantiates (i.e., don't
24311   # use $as_me), people would be surprised to read:
24312   #    /* config.h.  Generated automatically by config.status.  */
24313   if test x"$ac_file" = x-; then
24314     echo "/* Generated automatically by configure.  */" >$tmp/config.h
24315   else
24316     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
24317   fi
24318   cat $tmp/in >>$tmp/config.h
24319   rm -f $tmp/in
24320   if test x"$ac_file" != x-; then
24321     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
24322       { echo "$as_me:24322: $ac_file is unchanged" >&5
24323 echo "$as_me: $ac_file is unchanged" >&6;}
24324     else
24325       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24326          X"$ac_file" : 'X\(//\)[^/]' \| \
24327          X"$ac_file" : 'X\(//\)$' \| \
24328          X"$ac_file" : 'X\(/\)' \| \
24329          .     : '\(.\)' 2>/dev/null ||
24330 echo X"$ac_file" |
24331     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24332           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24333           /^X\(\/\/\)$/{ s//\1/; q; }
24334           /^X\(\/\).*/{ s//\1/; q; }
24335           s/.*/./; q'`
24336       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24337         { case "$ac_dir" in
24338   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24339   *)                      as_incr_dir=.;;
24340 esac
24341 as_dummy="$ac_dir"
24342 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24343   case $as_mkdir_dir in
24344     # Skip DOS drivespec
24345     ?:) as_incr_dir=$as_mkdir_dir ;;
24346     *)
24347       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24348       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24349     ;;
24350   esac
24351 done; }
24352
24353       fi
24354       rm -f "$ac_file"
24355       mv "$tmp/config.h" "$ac_file"
24356     fi
24357   else
24358     cat $tmp/config.h
24359     rm -f $tmp/config.h
24360   fi
24361 done
24362 EOF
24363 cat >>"$CONFIG_STATUS" <<\EOF
24364 #
24365 # CONFIG_COMMANDS section.
24366 #
24367 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
24368   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
24369   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
24370
24371   case "$ac_dest" in
24372     default )
24373
24374 for cf_dir in .
24375 do
24376         if test ! -d "$srcdir/$cf_dir" ; then
24377                 continue
24378         elif test -f "$srcdir/$cf_dir/programs" ; then
24379                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
24380         fi
24381 done
24382
24383         cat >>Makefile <<TEST_EOF
24384
24385 # These rules are generated so we do not rely on suffix rules, which do not
24386 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24387 # some, and the '\$x' confuses others).
24388 TEST_EOF
24389
24390 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24391 for N in $LIST
24392 do
24393         cat >>Makefile <<TEST_EOF
24394
24395 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24396         \$(srcdir)/test.priv.h \\
24397         ncurses_cfg.h
24398         $SHOW_CC
24399         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24400 TEST_EOF
24401 done
24402
24403 if test -f ../config.guess && test -f ../config.sub
24404 then
24405         cat >>Makefile <<TEST_EOF
24406
24407 # if we used CF_INHERIT for getting these files, we can remove them
24408 distclean::
24409         rm -f config.guess config.sub
24410 TEST_EOF
24411 fi
24412  ;;
24413   esac
24414 done
24415 EOF
24416
24417 cat >>"$CONFIG_STATUS" <<\EOF
24418
24419 { (exit 0); exit 0; }
24420 EOF
24421 chmod +x "$CONFIG_STATUS"
24422 ac_clean_files=$ac_clean_files_save
24423
24424 # configure is writing to config.log, and then calls config.status.
24425 # config.status does its own redirection, appending to config.log.
24426 # Unfortunately, on DOS this fails, as config.log is still kept open
24427 # by configure, so config.status won't be able to write to it; its
24428 # output is simply discarded.  So we exec the FD to /dev/null,
24429 # effectively closing config.log, so it can be properly (re)opened and
24430 # appended to by config.status.  When coming back to configure, we
24431 # need to make the FD available again.
24432 if test "$no_create" != yes; then
24433   ac_cs_success=:
24434   exec 5>/dev/null
24435   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24436   exec 5>>config.log
24437   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24438   # would make configure fail if this is the last instruction.
24439   "$ac_cs_success" || { (exit 1); exit 1; }
24440 fi
24441