]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.4 - patch 20230128
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20230114.
4 #
5 # Copyright 2003-2022,2023      Thomas E. Dickey
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr="expr"
37 else
38   as_expr="false"
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s='ln'
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset="unset"
64 else
65   as_unset="false"
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS=
101 MAKEFLAGS=
102 SHELL=${CONFIG_SHELL-/bin/sh}
103
104 # Maximum number of lines to put in a shell here document.
105 # This variable seems obsolete.  It should probably be removed, and
106 # only ac_max_sed_lines should be used.
107 : "${ac_max_here_lines=38}"
108
109 ac_unique_file="ncurses.c"
110
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-2022,2023        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.20230114.  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 (char **p, int i)
2069 {
2070   return p[i];
2071 }
2072 static char *f (char * (*g) (char **, int), char **p, ...)
2073 {
2074   char *s;
2075   va_list v;
2076   va_start (v,p);
2077   s = g (p, va_arg (v,int));
2078   va_end (v);
2079   return s;
2080 }
2081 int test (int i, double x);
2082 struct s1 {int (*f) (int a);};
2083 struct s2 {int (*f) (double a);};
2084 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2085 int argc;
2086 char **argv;
2087 int
2088 main (void)
2089 {
2090 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2091   ;
2092   return 0;
2093 }
2094 _ACEOF
2095 # Don't try gcc -ansi; that turns off useful extensions and
2096 # breaks some systems' header files.
2097 # AIX                   -qlanglvl=ansi
2098 # Ultrix and OSF/1      -std1
2099 # HP-UX 10.20 and later -Ae
2100 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2101 # SVR4                  -Xc -D__EXTENSIONS__
2102 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2103 do
2104   CC="$ac_save_CC $ac_arg"
2105   rm -f "conftest.$ac_objext"
2106 if { (eval echo "$as_me:2106: \"$ac_compile\"") >&5
2107   (eval $ac_compile) 2>&5
2108   ac_status=$?
2109   echo "$as_me:2109: \$? = $ac_status" >&5
2110   (exit "$ac_status"); } &&
2111          { ac_try='test -s "conftest.$ac_objext"'
2112   { (eval echo "$as_me:2112: \"$ac_try\"") >&5
2113   (eval $ac_try) 2>&5
2114   ac_status=$?
2115   echo "$as_me:2115: \$? = $ac_status" >&5
2116   (exit "$ac_status"); }; }; then
2117   ac_cv_prog_cc_stdc=$ac_arg
2118 break
2119 else
2120   echo "$as_me: failed program was:" >&5
2121 cat "conftest.$ac_ext" >&5
2122 fi
2123 rm -f "conftest.$ac_objext"
2124 done
2125 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2126 CC=$ac_save_CC
2127
2128 fi
2129
2130 case "x$ac_cv_prog_cc_stdc" in
2131   x|xno)
2132     echo "$as_me:2132: result: none needed" >&5
2133 echo "${ECHO_T}none needed" >&6 ;;
2134   *)
2135     echo "$as_me:2135: result: $ac_cv_prog_cc_stdc" >&5
2136 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2137     CC="$CC $ac_cv_prog_cc_stdc" ;;
2138 esac
2139
2140 # This should have been defined by AC_PROG_CC
2141 : "${CC:=cc}"
2142
2143 echo "$as_me:2143: checking \$CFLAGS variable" >&5
2144 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2145 case "x$CFLAGS" in
2146 (*-[IUD]*)
2147         echo "$as_me:2147: result: broken" >&5
2148 echo "${ECHO_T}broken" >&6
2149         { echo "$as_me:2149: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2150 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2151         cf_flags="$CFLAGS"
2152         CFLAGS=
2153         for cf_arg in $cf_flags
2154         do
2155
2156 cf_fix_cppflags=no
2157 cf_new_cflags=
2158 cf_new_cppflags=
2159 cf_new_extra_cppflags=
2160
2161 for cf_add_cflags in $cf_arg
2162 do
2163 case "$cf_fix_cppflags" in
2164 (no)
2165         case "$cf_add_cflags" in
2166         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2167                 case "$cf_add_cflags" in
2168                 (-D*)
2169                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2170
2171                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2172                                 && test -z "${cf_tst_cflags}" \
2173                                 && cf_fix_cppflags=yes
2174
2175                         if test "$cf_fix_cppflags" = yes ; then
2176
2177         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2178         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2179
2180                                 continue
2181                         elif test "${cf_tst_cflags}" = "\"'" ; then
2182
2183         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2184         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2185
2186                                 continue
2187                         fi
2188                         ;;
2189                 esac
2190                 case "$CPPFLAGS" in
2191                 (*$cf_add_cflags)
2192                         ;;
2193                 (*)
2194                         case "$cf_add_cflags" in
2195                         (-D*)
2196                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2197
2198 CPPFLAGS=`echo "$CPPFLAGS" | \
2199         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2200                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2201
2202                                 ;;
2203                         esac
2204
2205         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2206         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2207
2208                         ;;
2209                 esac
2210                 ;;
2211         (*)
2212
2213         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2214         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2215
2216                 ;;
2217         esac
2218         ;;
2219 (yes)
2220
2221         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2222         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2223
2224         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2225
2226         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2227                 && test -z "${cf_tst_cflags}" \
2228                 && cf_fix_cppflags=no
2229         ;;
2230 esac
2231 done
2232
2233 if test -n "$cf_new_cflags" ; then
2234
2235         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2236         CFLAGS="${CFLAGS}$cf_new_cflags"
2237
2238 fi
2239
2240 if test -n "$cf_new_cppflags" ; then
2241
2242         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2243         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2244
2245 fi
2246
2247 if test -n "$cf_new_extra_cppflags" ; then
2248
2249         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2250         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2251
2252 fi
2253
2254         done
2255         ;;
2256 (*)
2257         echo "$as_me:2257: result: ok" >&5
2258 echo "${ECHO_T}ok" >&6
2259         ;;
2260 esac
2261
2262 echo "$as_me:2262: checking \$CC variable" >&5
2263 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2264 case "$CC" in
2265 (*[\ \  ]-*)
2266         echo "$as_me:2266: result: broken" >&5
2267 echo "${ECHO_T}broken" >&6
2268         { echo "$as_me:2268: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2269 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2270         # humor him...
2271         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2272         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2273         CC="$cf_prog"
2274         for cf_arg in $cf_flags
2275         do
2276                 case "x$cf_arg" in
2277                 (x-[IUDfgOW]*)
2278
2279 cf_fix_cppflags=no
2280 cf_new_cflags=
2281 cf_new_cppflags=
2282 cf_new_extra_cppflags=
2283
2284 for cf_add_cflags in $cf_arg
2285 do
2286 case "$cf_fix_cppflags" in
2287 (no)
2288         case "$cf_add_cflags" in
2289         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2290                 case "$cf_add_cflags" in
2291                 (-D*)
2292                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2293
2294                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2295                                 && test -z "${cf_tst_cflags}" \
2296                                 && cf_fix_cppflags=yes
2297
2298                         if test "$cf_fix_cppflags" = yes ; then
2299
2300         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2301         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2302
2303                                 continue
2304                         elif test "${cf_tst_cflags}" = "\"'" ; then
2305
2306         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2307         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2308
2309                                 continue
2310                         fi
2311                         ;;
2312                 esac
2313                 case "$CPPFLAGS" in
2314                 (*$cf_add_cflags)
2315                         ;;
2316                 (*)
2317                         case "$cf_add_cflags" in
2318                         (-D*)
2319                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2320
2321 CPPFLAGS=`echo "$CPPFLAGS" | \
2322         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2323                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2324
2325                                 ;;
2326                         esac
2327
2328         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2329         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2330
2331                         ;;
2332                 esac
2333                 ;;
2334         (*)
2335
2336         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2337         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2338
2339                 ;;
2340         esac
2341         ;;
2342 (yes)
2343
2344         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2345         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2346
2347         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2348
2349         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2350                 && test -z "${cf_tst_cflags}" \
2351                 && cf_fix_cppflags=no
2352         ;;
2353 esac
2354 done
2355
2356 if test -n "$cf_new_cflags" ; then
2357
2358         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2359         CFLAGS="${CFLAGS}$cf_new_cflags"
2360
2361 fi
2362
2363 if test -n "$cf_new_cppflags" ; then
2364
2365         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2366         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2367
2368 fi
2369
2370 if test -n "$cf_new_extra_cppflags" ; then
2371
2372         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2373         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2374
2375 fi
2376
2377                         ;;
2378                 (*)
2379                         CC="$CC $cf_arg"
2380                         ;;
2381                 esac
2382         done
2383         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2384
2385 echo "${as_me:-configure}:2385: testing resulting CC: '$CC' ..." 1>&5
2386
2387         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2388
2389 echo "${as_me:-configure}:2389: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2390
2391         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2392
2393 echo "${as_me:-configure}:2393: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2394
2395         ;;
2396 (*)
2397         echo "$as_me:2397: result: ok" >&5
2398 echo "${ECHO_T}ok" >&6
2399         ;;
2400 esac
2401
2402 echo "$as_me:2402: checking for inline" >&5
2403 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2404 if test "${ac_cv_c_inline+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   ac_cv_c_inline=no
2408 for ac_kw in inline __inline__ __inline; do
2409   cat >"conftest.$ac_ext" <<_ACEOF
2410 #line 2410 "configure"
2411 #include "confdefs.h"
2412 #ifndef __cplusplus
2413 static $ac_kw int static_foo () {return 0; }
2414 $ac_kw int foo () {return 0; }
2415 #endif
2416
2417 _ACEOF
2418 rm -f "conftest.$ac_objext"
2419 if { (eval echo "$as_me:2419: \"$ac_compile\"") >&5
2420   (eval $ac_compile) 2>&5
2421   ac_status=$?
2422   echo "$as_me:2422: \$? = $ac_status" >&5
2423   (exit "$ac_status"); } &&
2424          { ac_try='test -s "conftest.$ac_objext"'
2425   { (eval echo "$as_me:2425: \"$ac_try\"") >&5
2426   (eval $ac_try) 2>&5
2427   ac_status=$?
2428   echo "$as_me:2428: \$? = $ac_status" >&5
2429   (exit "$ac_status"); }; }; then
2430   ac_cv_c_inline=$ac_kw; break
2431 else
2432   echo "$as_me: failed program was:" >&5
2433 cat "conftest.$ac_ext" >&5
2434 fi
2435 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2436 done
2437
2438 fi
2439 echo "$as_me:2439: result: $ac_cv_c_inline" >&5
2440 echo "${ECHO_T}$ac_cv_c_inline" >&6
2441 case $ac_cv_c_inline in
2442   inline | yes) ;;
2443   no)
2444 cat >>confdefs.h <<\EOF
2445 #define inline
2446 EOF
2447  ;;
2448   *)  cat >>confdefs.h <<EOF
2449 #define inline $ac_cv_c_inline
2450 EOF
2451  ;;
2452 esac
2453
2454 for ac_prog in ggrep grep
2455 do
2456   # Extract the first word of "$ac_prog", so it can be a program name with args.
2457 set dummy $ac_prog; ac_word=$2
2458 echo "$as_me:2458: checking for $ac_word" >&5
2459 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2460 if test "${ac_cv_prog_GREP+set}" = set; then
2461   echo $ECHO_N "(cached) $ECHO_C" >&6
2462 else
2463   if test -n "$GREP"; then
2464   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2465 else
2466   ac_save_IFS=$IFS; IFS=$ac_path_separator
2467 ac_dummy="$PATH"
2468 for ac_dir in $ac_dummy; do
2469   IFS=$ac_save_IFS
2470   test -z "$ac_dir" && ac_dir=.
2471   $as_executable_p "$ac_dir/$ac_word" || continue
2472 ac_cv_prog_GREP="$ac_prog"
2473 echo "$as_me:2473: found $ac_dir/$ac_word" >&5
2474 break
2475 done
2476
2477 fi
2478 fi
2479 GREP=$ac_cv_prog_GREP
2480 if test -n "$GREP"; then
2481   echo "$as_me:2481: result: $GREP" >&5
2482 echo "${ECHO_T}$GREP" >&6
2483 else
2484   echo "$as_me:2484: result: no" >&5
2485 echo "${ECHO_T}no" >&6
2486 fi
2487
2488   test -n "$GREP" && break
2489 done
2490 test -n "$GREP" || GREP=": "
2491
2492 echo "$as_me:2492: checking for egrep" >&5
2493 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2494 if test "${ac_cv_path_EGREP+set}" = set; then
2495   echo $ECHO_N "(cached) $ECHO_C" >&6
2496 else
2497   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2498    then ac_cv_path_EGREP="$GREP -E"
2499    else
2500      for ac_prog in gegrep egrep
2501 do
2502   # Extract the first word of "$ac_prog", so it can be a program name with args.
2503 set dummy $ac_prog; ac_word=$2
2504 echo "$as_me:2504: checking for $ac_word" >&5
2505 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2506 if test "${ac_cv_path_EGREP+set}" = set; then
2507   echo $ECHO_N "(cached) $ECHO_C" >&6
2508 else
2509   case $EGREP in
2510   [\\/]* | ?:[\\/]*)
2511   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2512   ;;
2513   *)
2514   ac_save_IFS=$IFS; IFS=$ac_path_separator
2515 ac_dummy="$PATH"
2516 for ac_dir in $ac_dummy; do
2517   IFS=$ac_save_IFS
2518   test -z "$ac_dir" && ac_dir=.
2519   if $as_executable_p "$ac_dir/$ac_word"; then
2520    ac_cv_path_EGREP="$ac_dir/$ac_word"
2521    echo "$as_me:2521: found $ac_dir/$ac_word" >&5
2522    break
2523 fi
2524 done
2525
2526   ;;
2527 esac
2528 fi
2529 EGREP=$ac_cv_path_EGREP
2530
2531 if test -n "$EGREP"; then
2532   echo "$as_me:2532: result: $EGREP" >&5
2533 echo "${ECHO_T}$EGREP" >&6
2534 else
2535   echo "$as_me:2535: result: no" >&5
2536 echo "${ECHO_T}no" >&6
2537 fi
2538
2539   test -n "$EGREP" && break
2540 done
2541 test -n "$EGREP" || EGREP=": "
2542
2543      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2543: error: cannot find workable egrep" >&5
2544 echo "$as_me: error: cannot find workable egrep" >&2;}
2545    { (exit 1); exit 1; }; }
2546    fi
2547 fi
2548 echo "$as_me:2548: result: $ac_cv_path_EGREP" >&5
2549 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2550  EGREP="$ac_cv_path_EGREP"
2551
2552 ac_ext=c
2553 ac_cpp='$CPP $CPPFLAGS'
2554 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2555 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2556 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2557 ac_main_return="return"
2558 echo "$as_me:2558: checking how to run the C preprocessor" >&5
2559 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2560 # On Suns, sometimes $CPP names a directory.
2561 if test -n "$CPP" && test -d "$CPP"; then
2562   CPP=
2563 fi
2564 if test -z "$CPP"; then
2565   if test "${ac_cv_prog_CPP+set}" = set; then
2566   echo $ECHO_N "(cached) $ECHO_C" >&6
2567 else
2568       # Double quotes because CPP needs to be expanded
2569     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2570     do
2571       ac_preproc_ok=false
2572 for ac_c_preproc_warn_flag in '' yes
2573 do
2574   # Use a header file that comes with gcc, so configuring glibc
2575   # with a fresh cross-compiler works.
2576   # On the NeXT, cc -E runs the code through the compiler's parser,
2577   # not just through cpp. "Syntax error" is here to catch this case.
2578   cat >"conftest.$ac_ext" <<_ACEOF
2579 #line 2579 "configure"
2580 #include "confdefs.h"
2581 #include <assert.h>
2582                      Syntax error
2583 _ACEOF
2584 if { (eval echo "$as_me:2584: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2585   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2586   ac_status=$?
2587   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2588   rm -f conftest.er1
2589   cat conftest.err >&5
2590   echo "$as_me:2590: \$? = $ac_status" >&5
2591   (exit "$ac_status"); } >/dev/null; then
2592   if test -s conftest.err; then
2593     ac_cpp_err=$ac_c_preproc_warn_flag
2594   else
2595     ac_cpp_err=
2596   fi
2597 else
2598   ac_cpp_err=yes
2599 fi
2600 if test -z "$ac_cpp_err"; then
2601   :
2602 else
2603   echo "$as_me: failed program was:" >&5
2604   cat "conftest.$ac_ext" >&5
2605   # Broken: fails on valid input.
2606 continue
2607 fi
2608 rm -f conftest.err "conftest.$ac_ext"
2609
2610   # OK, works on sane cases.  Now check whether non-existent headers
2611   # can be detected and how.
2612   cat >"conftest.$ac_ext" <<_ACEOF
2613 #line 2613 "configure"
2614 #include "confdefs.h"
2615 #include <ac_nonexistent.h>
2616 _ACEOF
2617 if { (eval echo "$as_me:2617: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2618   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2619   ac_status=$?
2620   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2621   rm -f conftest.er1
2622   cat conftest.err >&5
2623   echo "$as_me:2623: \$? = $ac_status" >&5
2624   (exit "$ac_status"); } >/dev/null; then
2625   if test -s conftest.err; then
2626     ac_cpp_err=$ac_c_preproc_warn_flag
2627   else
2628     ac_cpp_err=
2629   fi
2630 else
2631   ac_cpp_err=yes
2632 fi
2633 if test -z "$ac_cpp_err"; then
2634   # Broken: success on invalid input.
2635 continue
2636 else
2637   echo "$as_me: failed program was:" >&5
2638   cat "conftest.$ac_ext" >&5
2639   # Passes both tests.
2640 ac_preproc_ok=:
2641 break
2642 fi
2643 rm -f conftest.err "conftest.$ac_ext"
2644
2645 done
2646 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2647 rm -f conftest.err "conftest.$ac_ext"
2648 if $ac_preproc_ok; then
2649   break
2650 fi
2651
2652     done
2653     ac_cv_prog_CPP=$CPP
2654
2655 fi
2656   CPP=$ac_cv_prog_CPP
2657 else
2658   ac_cv_prog_CPP=$CPP
2659 fi
2660 echo "$as_me:2660: result: $CPP" >&5
2661 echo "${ECHO_T}$CPP" >&6
2662 ac_preproc_ok=false
2663 for ac_c_preproc_warn_flag in '' yes
2664 do
2665   # Use a header file that comes with gcc, so configuring glibc
2666   # with a fresh cross-compiler works.
2667   # On the NeXT, cc -E runs the code through the compiler's parser,
2668   # not just through cpp. "Syntax error" is here to catch this case.
2669   cat >"conftest.$ac_ext" <<_ACEOF
2670 #line 2670 "configure"
2671 #include "confdefs.h"
2672 #include <assert.h>
2673                      Syntax error
2674 _ACEOF
2675 if { (eval echo "$as_me:2675: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2676   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2677   ac_status=$?
2678   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2679   rm -f conftest.er1
2680   cat conftest.err >&5
2681   echo "$as_me:2681: \$? = $ac_status" >&5
2682   (exit "$ac_status"); } >/dev/null; then
2683   if test -s conftest.err; then
2684     ac_cpp_err=$ac_c_preproc_warn_flag
2685   else
2686     ac_cpp_err=
2687   fi
2688 else
2689   ac_cpp_err=yes
2690 fi
2691 if test -z "$ac_cpp_err"; then
2692   :
2693 else
2694   echo "$as_me: failed program was:" >&5
2695   cat "conftest.$ac_ext" >&5
2696   # Broken: fails on valid input.
2697 continue
2698 fi
2699 rm -f conftest.err "conftest.$ac_ext"
2700
2701   # OK, works on sane cases.  Now check whether non-existent headers
2702   # can be detected and how.
2703   cat >"conftest.$ac_ext" <<_ACEOF
2704 #line 2704 "configure"
2705 #include "confdefs.h"
2706 #include <ac_nonexistent.h>
2707 _ACEOF
2708 if { (eval echo "$as_me:2708: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2709   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2710   ac_status=$?
2711   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2712   rm -f conftest.er1
2713   cat conftest.err >&5
2714   echo "$as_me:2714: \$? = $ac_status" >&5
2715   (exit "$ac_status"); } >/dev/null; then
2716   if test -s conftest.err; then
2717     ac_cpp_err=$ac_c_preproc_warn_flag
2718   else
2719     ac_cpp_err=
2720   fi
2721 else
2722   ac_cpp_err=yes
2723 fi
2724 if test -z "$ac_cpp_err"; then
2725   # Broken: success on invalid input.
2726 continue
2727 else
2728   echo "$as_me: failed program was:" >&5
2729   cat "conftest.$ac_ext" >&5
2730   # Passes both tests.
2731 ac_preproc_ok=:
2732 break
2733 fi
2734 rm -f conftest.err "conftest.$ac_ext"
2735
2736 done
2737 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2738 rm -f conftest.err "conftest.$ac_ext"
2739 if $ac_preproc_ok; then
2740   :
2741 else
2742   { { echo "$as_me:2742: error: C preprocessor \"$CPP\" fails sanity check" >&5
2743 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2744    { (exit 1); exit 1; }; }
2745 fi
2746
2747 ac_ext=c
2748 ac_cpp='$CPP $CPPFLAGS'
2749 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2750 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2751 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2752 ac_main_return="return"
2753
2754 for ac_prog in mawk gawk nawk awk
2755 do
2756   # Extract the first word of "$ac_prog", so it can be a program name with args.
2757 set dummy $ac_prog; ac_word=$2
2758 echo "$as_me:2758: checking for $ac_word" >&5
2759 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2760 if test "${ac_cv_prog_AWK+set}" = set; then
2761   echo $ECHO_N "(cached) $ECHO_C" >&6
2762 else
2763   if test -n "$AWK"; then
2764   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2765 else
2766   ac_save_IFS=$IFS; IFS=$ac_path_separator
2767 ac_dummy="$PATH"
2768 for ac_dir in $ac_dummy; do
2769   IFS=$ac_save_IFS
2770   test -z "$ac_dir" && ac_dir=.
2771   $as_executable_p "$ac_dir/$ac_word" || continue
2772 ac_cv_prog_AWK="$ac_prog"
2773 echo "$as_me:2773: found $ac_dir/$ac_word" >&5
2774 break
2775 done
2776
2777 fi
2778 fi
2779 AWK=$ac_cv_prog_AWK
2780 if test -n "$AWK"; then
2781   echo "$as_me:2781: result: $AWK" >&5
2782 echo "${ECHO_T}$AWK" >&6
2783 else
2784   echo "$as_me:2784: result: no" >&5
2785 echo "${ECHO_T}no" >&6
2786 fi
2787
2788   test -n "$AWK" && break
2789 done
2790
2791 # Find a good install program.  We prefer a C program (faster),
2792 # so one script is as good as another.  But avoid the broken or
2793 # incompatible versions:
2794 # SysV /etc/install, /usr/sbin/install
2795 # SunOS /usr/etc/install
2796 # IRIX /sbin/install
2797 # AIX /bin/install
2798 # AmigaOS /C/install, which installs bootblocks on floppy discs
2799 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2800 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2801 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2802 # ./install, which can be erroneously created by make from ./install.sh.
2803 echo "$as_me:2803: checking for a BSD compatible install" >&5
2804 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2805 if test -z "$INSTALL"; then
2806 if test "${ac_cv_path_install+set}" = set; then
2807   echo $ECHO_N "(cached) $ECHO_C" >&6
2808 else
2809     ac_save_IFS=$IFS; IFS=$ac_path_separator
2810   for ac_dir in $PATH; do
2811     IFS=$ac_save_IFS
2812     # Account for people who put trailing slashes in PATH elements.
2813     case $ac_dir/ in
2814     / | ./ | .// | /cC/* \
2815     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2816     | /usr/ucb/* ) ;;
2817     *)
2818       # OSF1 and SCO ODT 3.0 have their own names for install.
2819       # Don't use installbsd from OSF since it installs stuff as root
2820       # by default.
2821       for ac_prog in ginstall scoinst install; do
2822         if $as_executable_p "$ac_dir/$ac_prog"; then
2823           if test $ac_prog = install &&
2824             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2825             # AIX install.  It has an incompatible calling convention.
2826             :
2827           elif test $ac_prog = install &&
2828             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2829             # program-specific install script used by HP pwplus--don't use.
2830             :
2831           else
2832             ac_cv_path_install="$ac_dir/$ac_prog -c"
2833             break 2
2834           fi
2835         fi
2836       done
2837       ;;
2838     esac
2839   done
2840
2841 fi
2842   if test "${ac_cv_path_install+set}" = set; then
2843     INSTALL=$ac_cv_path_install
2844   else
2845     # As a last resort, use the slow shell script.  We don't cache a
2846     # path for INSTALL within a source directory, because that will
2847     # break other packages using the cache if that directory is
2848     # removed, or if the path is relative.
2849     INSTALL=$ac_install_sh
2850   fi
2851 fi
2852 echo "$as_me:2852: result: $INSTALL" >&5
2853 echo "${ECHO_T}$INSTALL" >&6
2854
2855 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2856 # It thinks the first close brace ends the variable substitution.
2857 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2858
2859 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2860
2861 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2862
2863 case $INSTALL in
2864 (/*)
2865         ;;
2866 (*)
2867         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2868         test -z "$cf_dir" && cf_dir=.
2869         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2870         ;;
2871 esac
2872
2873 echo "$as_me:2873: checking if you want to install stripped executables" >&5
2874 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2875
2876 # Check whether --enable-stripping or --disable-stripping was given.
2877 if test "${enable_stripping+set}" = set; then
2878   enableval="$enable_stripping"
2879   test "$enableval" != no && enableval=yes
2880         if test "$enableval" != "yes" ; then
2881     enable_stripping=no
2882         else
2883                 enable_stripping=yes
2884         fi
2885 else
2886   enableval=yes
2887         enable_stripping=yes
2888
2889 fi;
2890 echo "$as_me:2890: result: $enable_stripping" >&5
2891 echo "${ECHO_T}$enable_stripping" >&6
2892
2893 if test "$enable_stripping" = yes
2894 then
2895         INSTALL_OPT_S="-s"
2896 else
2897         INSTALL_OPT_S=
2898 fi
2899
2900 : "${INSTALL:=install}"
2901 echo "$as_me:2901: checking if install accepts -p option" >&5
2902 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2903 if test "${cf_cv_install_p+set}" = set; then
2904   echo $ECHO_N "(cached) $ECHO_C" >&6
2905 else
2906
2907         rm -rf ./conftest*
2908         date >conftest.in
2909         mkdir conftest.out
2910         sleep 3
2911         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2912         then
2913                 if test -f conftest.out/conftest.in
2914                 then
2915                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2916                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2917                         if test -s conftest.err
2918                         then
2919                                 cf_cv_install_p=no
2920                         else
2921                                 cf_cv_install_p=yes
2922                         fi
2923                 else
2924                         cf_cv_install_p=no
2925                 fi
2926         else
2927                 cf_cv_install_p=no
2928         fi
2929         rm -rf ./conftest*
2930
2931 fi
2932 echo "$as_me:2932: result: $cf_cv_install_p" >&5
2933 echo "${ECHO_T}$cf_cv_install_p" >&6
2934
2935 echo "$as_me:2935: checking if install needs to be told about ownership" >&5
2936 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2937 case `$ac_config_guess` in
2938 (*minix)
2939         with_install_o=yes
2940         ;;
2941 (*)
2942         with_install_o=no
2943         ;;
2944 esac
2945
2946 echo "$as_me:2946: result: $with_install_o" >&5
2947 echo "${ECHO_T}$with_install_o" >&6
2948 if test "x$with_install_o" = xyes
2949 then
2950         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'`"
2951 else
2952         INSTALL_OPT_O=
2953 fi
2954
2955 for ac_prog in lint cppcheck splint
2956 do
2957   # Extract the first word of "$ac_prog", so it can be a program name with args.
2958 set dummy $ac_prog; ac_word=$2
2959 echo "$as_me:2959: checking for $ac_word" >&5
2960 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2961 if test "${ac_cv_prog_LINT+set}" = set; then
2962   echo $ECHO_N "(cached) $ECHO_C" >&6
2963 else
2964   if test -n "$LINT"; then
2965   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2966 else
2967   ac_save_IFS=$IFS; IFS=$ac_path_separator
2968 ac_dummy="$PATH"
2969 for ac_dir in $ac_dummy; do
2970   IFS=$ac_save_IFS
2971   test -z "$ac_dir" && ac_dir=.
2972   $as_executable_p "$ac_dir/$ac_word" || continue
2973 ac_cv_prog_LINT="$ac_prog"
2974 echo "$as_me:2974: found $ac_dir/$ac_word" >&5
2975 break
2976 done
2977
2978 fi
2979 fi
2980 LINT=$ac_cv_prog_LINT
2981 if test -n "$LINT"; then
2982   echo "$as_me:2982: result: $LINT" >&5
2983 echo "${ECHO_T}$LINT" >&6
2984 else
2985   echo "$as_me:2985: result: no" >&5
2986 echo "${ECHO_T}no" >&6
2987 fi
2988
2989   test -n "$LINT" && break
2990 done
2991
2992 case "x$LINT" in
2993 (xcppcheck|x*/cppcheck)
2994         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2995         ;;
2996 esac
2997
2998 echo "$as_me:2998: checking for \".PHONY\" make-support" >&5
2999 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3000 if test "${cf_cv_make_PHONY+set}" = set; then
3001   echo $ECHO_N "(cached) $ECHO_C" >&6
3002 else
3003
3004         rm -rf conftest*
3005         (
3006                 mkdir conftest || exit 1
3007                 cd conftest
3008                 cat >makefile <<'CF_EOF'
3009 .PHONY: always
3010 DATA=0
3011 always: always.out
3012         @echo "** making $@ $(DATA)"
3013 once: once.out
3014         @echo "** making $@ $(DATA)"
3015 always.out:
3016         @echo "** making $@ $(DATA)"
3017         echo $(DATA) > $@
3018 once.out:
3019         @echo "** making $@ $(DATA)"
3020         echo $(DATA) > $@
3021 CF_EOF
3022                 for cf_data in 1 2 3
3023                 do
3024                         ${MAKE:-make} always DATA=$cf_data
3025                         ${MAKE:-make} once   DATA=$cf_data
3026                         ${MAKE:-make} -t always once
3027                         if test -f always ; then
3028                                 echo "no (case 1)" > ../conftest.tmp
3029                         elif test ! -f always.out ; then
3030                                 echo "no (case 2)" > ../conftest.tmp
3031                         elif test ! -f once.out ; then
3032                                 echo "no (case 3)" > ../conftest.tmp
3033                         elif ! cmp -s always.out once.out ; then
3034                                 echo "no (case 4)" > ../conftest.tmp
3035                                 diff always.out once.out
3036                         else
3037                                 cf_check="`cat always.out`"
3038                                 if test "x$cf_check" != "x$cf_data" ; then
3039                                         echo "no (case 5)" > ../conftest.tmp
3040                                 else
3041                                         echo yes > ../conftest.tmp
3042                                         rm -f ./*.out
3043                                         continue
3044                                 fi
3045                         fi
3046                         break
3047                 done
3048         ) >&5 2>&1
3049         cf_cv_make_PHONY="`cat conftest.tmp`"
3050         rm -rf conftest*
3051
3052 fi
3053 echo "$as_me:3053: result: $cf_cv_make_PHONY" >&5
3054 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3055 MAKE_NO_PHONY="#"
3056 MAKE_PHONY="#"
3057 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3058 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3059
3060 echo "$as_me:3060: checking if filesystem supports mixed-case filenames" >&5
3061 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3062 if test "${cf_cv_mixedcase+set}" = set; then
3063   echo $ECHO_N "(cached) $ECHO_C" >&6
3064 else
3065
3066 if test "$cross_compiling" = yes ; then
3067         case "$target_alias" in
3068         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3069                 cf_cv_mixedcase=no
3070                 ;;
3071         (*)
3072                 cf_cv_mixedcase=yes
3073                 ;;
3074         esac
3075 else
3076         rm -f conftest CONFTEST
3077         echo test >conftest
3078         if test -f CONFTEST ; then
3079                 cf_cv_mixedcase=no
3080         else
3081                 cf_cv_mixedcase=yes
3082         fi
3083         rm -f conftest CONFTEST
3084 fi
3085
3086 fi
3087 echo "$as_me:3087: result: $cf_cv_mixedcase" >&5
3088 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3089 test "$cf_cv_mixedcase" = yes &&
3090 cat >>confdefs.h <<\EOF
3091 #define MIXEDCASE_FILENAMES 1
3092 EOF
3093
3094 for ac_prog in exctags ctags
3095 do
3096   # Extract the first word of "$ac_prog", so it can be a program name with args.
3097 set dummy $ac_prog; ac_word=$2
3098 echo "$as_me:3098: checking for $ac_word" >&5
3099 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3100 if test "${ac_cv_prog_CTAGS+set}" = set; then
3101   echo $ECHO_N "(cached) $ECHO_C" >&6
3102 else
3103   if test -n "$CTAGS"; then
3104   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3105 else
3106   ac_save_IFS=$IFS; IFS=$ac_path_separator
3107 ac_dummy="$PATH"
3108 for ac_dir in $ac_dummy; do
3109   IFS=$ac_save_IFS
3110   test -z "$ac_dir" && ac_dir=.
3111   $as_executable_p "$ac_dir/$ac_word" || continue
3112 ac_cv_prog_CTAGS="$ac_prog"
3113 echo "$as_me:3113: found $ac_dir/$ac_word" >&5
3114 break
3115 done
3116
3117 fi
3118 fi
3119 CTAGS=$ac_cv_prog_CTAGS
3120 if test -n "$CTAGS"; then
3121   echo "$as_me:3121: result: $CTAGS" >&5
3122 echo "${ECHO_T}$CTAGS" >&6
3123 else
3124   echo "$as_me:3124: result: no" >&5
3125 echo "${ECHO_T}no" >&6
3126 fi
3127
3128   test -n "$CTAGS" && break
3129 done
3130
3131 for ac_prog in exetags etags
3132 do
3133   # Extract the first word of "$ac_prog", so it can be a program name with args.
3134 set dummy $ac_prog; ac_word=$2
3135 echo "$as_me:3135: checking for $ac_word" >&5
3136 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3137 if test "${ac_cv_prog_ETAGS+set}" = set; then
3138   echo $ECHO_N "(cached) $ECHO_C" >&6
3139 else
3140   if test -n "$ETAGS"; then
3141   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3142 else
3143   ac_save_IFS=$IFS; IFS=$ac_path_separator
3144 ac_dummy="$PATH"
3145 for ac_dir in $ac_dummy; do
3146   IFS=$ac_save_IFS
3147   test -z "$ac_dir" && ac_dir=.
3148   $as_executable_p "$ac_dir/$ac_word" || continue
3149 ac_cv_prog_ETAGS="$ac_prog"
3150 echo "$as_me:3150: found $ac_dir/$ac_word" >&5
3151 break
3152 done
3153
3154 fi
3155 fi
3156 ETAGS=$ac_cv_prog_ETAGS
3157 if test -n "$ETAGS"; then
3158   echo "$as_me:3158: result: $ETAGS" >&5
3159 echo "${ECHO_T}$ETAGS" >&6
3160 else
3161   echo "$as_me:3161: result: no" >&5
3162 echo "${ECHO_T}no" >&6
3163 fi
3164
3165   test -n "$ETAGS" && break
3166 done
3167
3168 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3169 set dummy ${CTAGS:-ctags}; ac_word=$2
3170 echo "$as_me:3170: checking for $ac_word" >&5
3171 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3172 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3173   echo $ECHO_N "(cached) $ECHO_C" >&6
3174 else
3175   if test -n "$MAKE_LOWER_TAGS"; then
3176   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3177 else
3178   ac_save_IFS=$IFS; IFS=$ac_path_separator
3179 ac_dummy="$PATH"
3180 for ac_dir in $ac_dummy; do
3181   IFS=$ac_save_IFS
3182   test -z "$ac_dir" && ac_dir=.
3183   $as_executable_p "$ac_dir/$ac_word" || continue
3184 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3185 echo "$as_me:3185: found $ac_dir/$ac_word" >&5
3186 break
3187 done
3188
3189   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3190 fi
3191 fi
3192 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3193 if test -n "$MAKE_LOWER_TAGS"; then
3194   echo "$as_me:3194: result: $MAKE_LOWER_TAGS" >&5
3195 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3196 else
3197   echo "$as_me:3197: result: no" >&5
3198 echo "${ECHO_T}no" >&6
3199 fi
3200
3201 if test "$cf_cv_mixedcase" = yes ; then
3202         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3203 set dummy ${ETAGS:-etags}; ac_word=$2
3204 echo "$as_me:3204: checking for $ac_word" >&5
3205 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3206 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3207   echo $ECHO_N "(cached) $ECHO_C" >&6
3208 else
3209   if test -n "$MAKE_UPPER_TAGS"; then
3210   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3211 else
3212   ac_save_IFS=$IFS; IFS=$ac_path_separator
3213 ac_dummy="$PATH"
3214 for ac_dir in $ac_dummy; do
3215   IFS=$ac_save_IFS
3216   test -z "$ac_dir" && ac_dir=.
3217   $as_executable_p "$ac_dir/$ac_word" || continue
3218 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3219 echo "$as_me:3219: found $ac_dir/$ac_word" >&5
3220 break
3221 done
3222
3223   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3224 fi
3225 fi
3226 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3227 if test -n "$MAKE_UPPER_TAGS"; then
3228   echo "$as_me:3228: result: $MAKE_UPPER_TAGS" >&5
3229 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3230 else
3231   echo "$as_me:3231: result: no" >&5
3232 echo "${ECHO_T}no" >&6
3233 fi
3234
3235 else
3236         MAKE_UPPER_TAGS=no
3237 fi
3238
3239 if test "$MAKE_UPPER_TAGS" = yes ; then
3240         MAKE_UPPER_TAGS=
3241 else
3242         MAKE_UPPER_TAGS="#"
3243 fi
3244
3245 if test "$MAKE_LOWER_TAGS" = yes ; then
3246         MAKE_LOWER_TAGS=
3247 else
3248         MAKE_LOWER_TAGS="#"
3249 fi
3250
3251 echo "$as_me:3251: checking if -lm needed for math functions" >&5
3252 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3253 if test "${cf_cv_need_libm+set}" = set; then
3254   echo $ECHO_N "(cached) $ECHO_C" >&6
3255 else
3256
3257         cat >"conftest.$ac_ext" <<_ACEOF
3258 #line 3258 "configure"
3259 #include "confdefs.h"
3260
3261                 #include <stdio.h>
3262                 #include <stdlib.h>
3263                 #include <math.h>
3264
3265 int
3266 main (void)
3267 {
3268 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3269   ;
3270   return 0;
3271 }
3272 _ACEOF
3273 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3274 if { (eval echo "$as_me:3274: \"$ac_link\"") >&5
3275   (eval $ac_link) 2>&5
3276   ac_status=$?
3277   echo "$as_me:3277: \$? = $ac_status" >&5
3278   (exit "$ac_status"); } &&
3279          { ac_try='test -s "conftest$ac_exeext"'
3280   { (eval echo "$as_me:3280: \"$ac_try\"") >&5
3281   (eval $ac_try) 2>&5
3282   ac_status=$?
3283   echo "$as_me:3283: \$? = $ac_status" >&5
3284   (exit "$ac_status"); }; }; then
3285   cf_cv_need_libm=no
3286 else
3287   echo "$as_me: failed program was:" >&5
3288 cat "conftest.$ac_ext" >&5
3289 cf_cv_need_libm=yes
3290 fi
3291 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3292 fi
3293 echo "$as_me:3293: result: $cf_cv_need_libm" >&5
3294 echo "${ECHO_T}$cf_cv_need_libm" >&6
3295
3296 if test "$cf_cv_need_libm" = yes
3297 then
3298
3299         cf_save_LIBS="$LIBS"
3300         LIBS="$LIBS -lm"
3301         echo "$as_me:3301: checking if -lm is available for math functions" >&5
3302 echo $ECHO_N "checking if -lm is available for math functions... $ECHO_C" >&6
3303 if test "${cf_cv_have_libm+set}" = set; then
3304   echo $ECHO_N "(cached) $ECHO_C" >&6
3305 else
3306
3307         cat >"conftest.$ac_ext" <<_ACEOF
3308 #line 3308 "configure"
3309 #include "confdefs.h"
3310
3311                 #include <stdio.h>
3312                 #include <stdlib.h>
3313                 #include <math.h>
3314
3315 int
3316 main (void)
3317 {
3318 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3319   ;
3320   return 0;
3321 }
3322 _ACEOF
3323 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3324 if { (eval echo "$as_me:3324: \"$ac_link\"") >&5
3325   (eval $ac_link) 2>&5
3326   ac_status=$?
3327   echo "$as_me:3327: \$? = $ac_status" >&5
3328   (exit "$ac_status"); } &&
3329          { ac_try='test -s "conftest$ac_exeext"'
3330   { (eval echo "$as_me:3330: \"$ac_try\"") >&5
3331   (eval $ac_try) 2>&5
3332   ac_status=$?
3333   echo "$as_me:3333: \$? = $ac_status" >&5
3334   (exit "$ac_status"); }; }; then
3335   cf_cv_have_libm=yes
3336 else
3337   echo "$as_me: failed program was:" >&5
3338 cat "conftest.$ac_ext" >&5
3339 cf_cv_have_libm=no
3340 fi
3341 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3342 fi
3343 echo "$as_me:3343: result: $cf_cv_have_libm" >&5
3344 echo "${ECHO_T}$cf_cv_have_libm" >&6
3345         LIBS="$cf_save_LIBS"
3346
3347         if test "$cf_cv_have_libm" = yes
3348         then
3349                 MATH_LIB=-lm
3350         fi
3351 else
3352         cf_cv_have_libm=yes
3353 fi
3354
3355 if test "$cf_cv_have_libm" = yes
3356 then
3357
3358 cat >>confdefs.h <<\EOF
3359 #define HAVE_MATH_FUNCS 1
3360 EOF
3361
3362 fi
3363
3364 top_builddir=`pwd`
3365
3366 CC_G_OPT="-g"
3367 CC_SHARED_OPTS=unknown
3368 CPPFLAGS="$CPPFLAGS"
3369 DFT_DEP_SUFFIX=""
3370 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3371 DFT_UPR_MODEL="NORMAL"
3372 LD="ld"
3373 LDFLAGS_SHARED=""
3374 LDFLAGS_STATIC=""
3375 LD_MODEL=""
3376 LD_SHARED_OPTS=""
3377 LIBTOOL=""
3378 LIBTOOL_OPTS=""
3379 LIB_CLEAN=""
3380 LIB_COMPILE=""
3381 LIB_LINK='${CC}'
3382 LINK_TESTS=""
3383 LOCAL_LDFLAGS=""
3384 PACKAGE="ncurses-examples"
3385 PTHREAD="-lm"
3386 TEST_ARGS=""
3387 TEST_DEPS=""
3388 TEST_LIBS=""
3389 TINFO_LDFLAGS=''
3390 TINFO_LIBS='$(LIBS_CURSES)'
3391 cf_cv_abi_version=""
3392 cf_cv_rel_version=""
3393 includesubdir=""
3394
3395 cf_cv_screen=curses
3396 cf_cv_libtype=
3397
3398 echo "$as_me:3398: checking for fgrep" >&5
3399 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3400 if test "${ac_cv_path_FGREP+set}" = set; then
3401   echo $ECHO_N "(cached) $ECHO_C" >&6
3402 else
3403   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3404    then ac_cv_path_FGREP="$GREP -F"
3405    else
3406      for ac_prog in gfgrep fgrep
3407 do
3408   # Extract the first word of "$ac_prog", so it can be a program name with args.
3409 set dummy $ac_prog; ac_word=$2
3410 echo "$as_me:3410: checking for $ac_word" >&5
3411 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3412 if test "${ac_cv_path_FGREP+set}" = set; then
3413   echo $ECHO_N "(cached) $ECHO_C" >&6
3414 else
3415   case $FGREP in
3416   [\\/]* | ?:[\\/]*)
3417   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3418   ;;
3419   *)
3420   ac_save_IFS=$IFS; IFS=$ac_path_separator
3421 ac_dummy="$PATH"
3422 for ac_dir in $ac_dummy; do
3423   IFS=$ac_save_IFS
3424   test -z "$ac_dir" && ac_dir=.
3425   if $as_executable_p "$ac_dir/$ac_word"; then
3426    ac_cv_path_FGREP="$ac_dir/$ac_word"
3427    echo "$as_me:3427: found $ac_dir/$ac_word" >&5
3428    break
3429 fi
3430 done
3431
3432   ;;
3433 esac
3434 fi
3435 FGREP=$ac_cv_path_FGREP
3436
3437 if test -n "$FGREP"; then
3438   echo "$as_me:3438: result: $FGREP" >&5
3439 echo "${ECHO_T}$FGREP" >&6
3440 else
3441   echo "$as_me:3441: result: no" >&5
3442 echo "${ECHO_T}no" >&6
3443 fi
3444
3445   test -n "$FGREP" && break
3446 done
3447 test -n "$FGREP" || FGREP=": "
3448
3449      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3449: error: cannot find workable fgrep" >&5
3450 echo "$as_me: error: cannot find workable fgrep" >&2;}
3451    { (exit 1); exit 1; }; }
3452    fi
3453 fi
3454 echo "$as_me:3454: result: $ac_cv_path_FGREP" >&5
3455 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3456  FGREP="$ac_cv_path_FGREP"
3457
3458 echo "$as_me:3458: checking if you want to use C11 _Noreturn feature" >&5
3459 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3460
3461 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3462 if test "${enable_stdnoreturn+set}" = set; then
3463   enableval="$enable_stdnoreturn"
3464   test "$enableval" != yes && enableval=no
3465         if test "$enableval" != "no" ; then
3466     enable_stdnoreturn=yes
3467         else
3468                 enable_stdnoreturn=no
3469         fi
3470 else
3471   enableval=no
3472         enable_stdnoreturn=no
3473
3474 fi;
3475 echo "$as_me:3475: result: $enable_stdnoreturn" >&5
3476 echo "${ECHO_T}$enable_stdnoreturn" >&6
3477
3478 if test $enable_stdnoreturn = yes; then
3479 echo "$as_me:3479: checking for C11 _Noreturn feature" >&5
3480 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3481 if test "${cf_cv_c11_noreturn+set}" = set; then
3482   echo $ECHO_N "(cached) $ECHO_C" >&6
3483 else
3484   cat >"conftest.$ac_ext" <<_ACEOF
3485 #line 3485 "configure"
3486 #include "confdefs.h"
3487
3488 #include <stdio.h>
3489 #include <stdlib.h>
3490 #include <stdnoreturn.h>
3491 static _Noreturn void giveup(void) { exit(0); }
3492
3493 int
3494 main (void)
3495 {
3496 if (feof(stdin)) giveup()
3497   ;
3498   return 0;
3499 }
3500 _ACEOF
3501 rm -f "conftest.$ac_objext"
3502 if { (eval echo "$as_me:3502: \"$ac_compile\"") >&5
3503   (eval $ac_compile) 2>&5
3504   ac_status=$?
3505   echo "$as_me:3505: \$? = $ac_status" >&5
3506   (exit "$ac_status"); } &&
3507          { ac_try='test -s "conftest.$ac_objext"'
3508   { (eval echo "$as_me:3508: \"$ac_try\"") >&5
3509   (eval $ac_try) 2>&5
3510   ac_status=$?
3511   echo "$as_me:3511: \$? = $ac_status" >&5
3512   (exit "$ac_status"); }; }; then
3513   cf_cv_c11_noreturn=yes
3514 else
3515   echo "$as_me: failed program was:" >&5
3516 cat "conftest.$ac_ext" >&5
3517 cf_cv_c11_noreturn=no
3518 fi
3519 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3520
3521 fi
3522 echo "$as_me:3522: result: $cf_cv_c11_noreturn" >&5
3523 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3524 else
3525         cf_cv_c11_noreturn=no,
3526 fi
3527
3528 if test "$cf_cv_c11_noreturn" = yes; then
3529
3530 cat >>confdefs.h <<\EOF
3531 #define HAVE_STDNORETURN_H 1
3532 EOF
3533
3534 cat >>confdefs.h <<EOF
3535 #define STDC_NORETURN _Noreturn
3536 EOF
3537
3538         HAVE_STDNORETURN_H=1
3539 else
3540         HAVE_STDNORETURN_H=0
3541 fi
3542
3543 if test "$GCC" = yes || test "$GXX" = yes
3544 then
3545 cat > conftest.i <<EOF
3546 #ifndef GCC_PRINTF
3547 #define GCC_PRINTF 0
3548 #endif
3549 #ifndef GCC_SCANF
3550 #define GCC_SCANF 0
3551 #endif
3552 #ifndef GCC_NORETURN
3553 #define GCC_NORETURN /* nothing */
3554 #endif
3555 #ifndef GCC_UNUSED
3556 #define GCC_UNUSED /* nothing */
3557 #endif
3558 EOF
3559 if test "$GCC" = yes
3560 then
3561         { echo "$as_me:3561: checking for $CC __attribute__ directives..." >&5
3562 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3563 cat > "conftest.$ac_ext" <<EOF
3564 #line 3564 "${as_me:-configure}"
3565 #include <stdio.h>
3566 #include "confdefs.h"
3567 #include "conftest.h"
3568 #include "conftest.i"
3569 #if     GCC_PRINTF
3570 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3571 #else
3572 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3573 #endif
3574 #if     GCC_SCANF
3575 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3576 #else
3577 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3578 #endif
3579 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3580 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3581 extern GCC_NORETURN void foo(void);
3582 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3583 EOF
3584         cf_printf_attribute=no
3585         cf_scanf_attribute=no
3586         for cf_attribute in scanf printf unused noreturn
3587         do
3588
3589 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3590
3591                 cf_directive="__attribute__(($cf_attribute))"
3592                 echo "checking for $CC $cf_directive" 1>&5
3593
3594                 case "$cf_attribute" in
3595                 (printf)
3596                         cf_printf_attribute=yes
3597                         cat >conftest.h <<EOF
3598 #define GCC_$cf_ATTRIBUTE 1
3599 EOF
3600                         ;;
3601                 (scanf)
3602                         cf_scanf_attribute=yes
3603                         cat >conftest.h <<EOF
3604 #define GCC_$cf_ATTRIBUTE 1
3605 EOF
3606                         ;;
3607                 (*)
3608                         cat >conftest.h <<EOF
3609 #define GCC_$cf_ATTRIBUTE $cf_directive
3610 EOF
3611                         ;;
3612                 esac
3613
3614                 if { (eval echo "$as_me:3614: \"$ac_compile\"") >&5
3615   (eval $ac_compile) 2>&5
3616   ac_status=$?
3617   echo "$as_me:3617: \$? = $ac_status" >&5
3618   (exit "$ac_status"); }; then
3619                         test -n "$verbose" && echo "$as_me:3619: result: ... $cf_attribute" >&5
3620 echo "${ECHO_T}... $cf_attribute" >&6
3621                         cat conftest.h >>confdefs.h
3622                         case "$cf_attribute" in
3623                         (noreturn)
3624
3625 cat >>confdefs.h <<EOF
3626 #define GCC_NORETURN $cf_directive
3627 EOF
3628
3629                                 ;;
3630                         (printf)
3631                                 cf_value='/* nothing */'
3632                                 if test "$cf_printf_attribute" != no ; then
3633                                         cf_value='__attribute__((format(printf,fmt,var)))'
3634
3635 cat >>confdefs.h <<\EOF
3636 #define GCC_PRINTF 1
3637 EOF
3638
3639                                 fi
3640
3641 cat >>confdefs.h <<EOF
3642 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3643 EOF
3644
3645                                 ;;
3646                         (scanf)
3647                                 cf_value='/* nothing */'
3648                                 if test "$cf_scanf_attribute" != no ; then
3649                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3650
3651 cat >>confdefs.h <<\EOF
3652 #define GCC_SCANF 1
3653 EOF
3654
3655                                 fi
3656
3657 cat >>confdefs.h <<EOF
3658 #define GCC_SCANFLIKE(fmt,var) $cf_value
3659 EOF
3660
3661                                 ;;
3662                         (unused)
3663
3664 cat >>confdefs.h <<EOF
3665 #define GCC_UNUSED $cf_directive
3666 EOF
3667
3668                                 ;;
3669                         esac
3670                 fi
3671         done
3672 else
3673         ${FGREP-fgrep} define conftest.i >>confdefs.h
3674 fi
3675 rm -rf ./conftest*
3676 fi
3677
3678 echo "$as_me:3678: checking if you want to work around bogus compiler/loader warnings" >&5
3679 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3680
3681 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3682 if test "${enable_string_hacks+set}" = set; then
3683   enableval="$enable_string_hacks"
3684   enable_string_hacks=$enableval
3685 else
3686   enable_string_hacks=no
3687 fi;
3688 echo "$as_me:3688: result: $enable_string_hacks" >&5
3689 echo "${ECHO_T}$enable_string_hacks" >&6
3690
3691 if test "x$enable_string_hacks" = "xyes"; then
3692
3693 cat >>confdefs.h <<\EOF
3694 #define USE_STRING_HACKS 1
3695 EOF
3696
3697         { echo "$as_me:3697: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3698 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3699         echo "$as_me:3699: checking for strlcat" >&5
3700 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3701 if test "${ac_cv_func_strlcat+set}" = set; then
3702   echo $ECHO_N "(cached) $ECHO_C" >&6
3703 else
3704   cat >"conftest.$ac_ext" <<_ACEOF
3705 #line 3705 "configure"
3706 #include "confdefs.h"
3707 #define strlcat autoconf_temporary
3708 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3709 #undef strlcat
3710
3711 #ifdef __cplusplus
3712 extern "C"
3713 #endif
3714
3715 /* We use char because int might match the return type of a gcc2
3716    builtin and then its argument prototype would still apply.  */
3717 char strlcat (void);
3718
3719 int
3720 main (void)
3721 {
3722
3723 /* The GNU C library defines stubs for functions which it implements
3724     to always fail with ENOSYS.  Some functions are actually named
3725     something starting with __ and the normal name is an alias.  */
3726 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3727 #error found stub for strlcat
3728 #endif
3729
3730         return strlcat ();
3731   ;
3732   return 0;
3733 }
3734 _ACEOF
3735 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3736 if { (eval echo "$as_me:3736: \"$ac_link\"") >&5
3737   (eval $ac_link) 2>&5
3738   ac_status=$?
3739   echo "$as_me:3739: \$? = $ac_status" >&5
3740   (exit "$ac_status"); } &&
3741          { ac_try='test -s "conftest$ac_exeext"'
3742   { (eval echo "$as_me:3742: \"$ac_try\"") >&5
3743   (eval $ac_try) 2>&5
3744   ac_status=$?
3745   echo "$as_me:3745: \$? = $ac_status" >&5
3746   (exit "$ac_status"); }; }; then
3747   ac_cv_func_strlcat=yes
3748 else
3749   echo "$as_me: failed program was:" >&5
3750 cat "conftest.$ac_ext" >&5
3751 ac_cv_func_strlcat=no
3752 fi
3753 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3754 fi
3755 echo "$as_me:3755: result: $ac_cv_func_strlcat" >&5
3756 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3757 if test "$ac_cv_func_strlcat" = yes; then
3758
3759 cat >>confdefs.h <<\EOF
3760 #define HAVE_STRLCAT 1
3761 EOF
3762
3763 else
3764
3765                 echo "$as_me:3765: checking for strlcat in -lbsd" >&5
3766 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3767 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3768   echo $ECHO_N "(cached) $ECHO_C" >&6
3769 else
3770   ac_check_lib_save_LIBS=$LIBS
3771 LIBS="-lbsd  $LIBS"
3772 cat >"conftest.$ac_ext" <<_ACEOF
3773 #line 3773 "configure"
3774 #include "confdefs.h"
3775
3776 /* Override any gcc2 internal prototype to avoid an error.  */
3777 #ifdef __cplusplus
3778 extern "C"
3779 #endif
3780 /* We use char because int might match the return type of a gcc2
3781    builtin and then its argument prototype would still apply.  */
3782 char strlcat ();
3783 int
3784 main (void)
3785 {
3786 strlcat ();
3787   ;
3788   return 0;
3789 }
3790 _ACEOF
3791 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3792 if { (eval echo "$as_me:3792: \"$ac_link\"") >&5
3793   (eval $ac_link) 2>&5
3794   ac_status=$?
3795   echo "$as_me:3795: \$? = $ac_status" >&5
3796   (exit "$ac_status"); } &&
3797          { ac_try='test -s "conftest$ac_exeext"'
3798   { (eval echo "$as_me:3798: \"$ac_try\"") >&5
3799   (eval $ac_try) 2>&5
3800   ac_status=$?
3801   echo "$as_me:3801: \$? = $ac_status" >&5
3802   (exit "$ac_status"); }; }; then
3803   ac_cv_lib_bsd_strlcat=yes
3804 else
3805   echo "$as_me: failed program was:" >&5
3806 cat "conftest.$ac_ext" >&5
3807 ac_cv_lib_bsd_strlcat=no
3808 fi
3809 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3810 LIBS=$ac_check_lib_save_LIBS
3811 fi
3812 echo "$as_me:3812: result: $ac_cv_lib_bsd_strlcat" >&5
3813 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3814 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3815
3816 cf_add_libs="$LIBS"
3817 # reverse order
3818 cf_add_0lib=
3819 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3820 # filter duplicates
3821 for cf_add_1lib in $cf_add_0lib; do
3822         for cf_add_2lib in $cf_add_libs; do
3823                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3824                         cf_add_1lib=
3825                         break
3826                 fi
3827         done
3828         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3829 done
3830 LIBS="$cf_add_libs"
3831
3832 for ac_header in bsd/string.h
3833 do
3834 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3835 echo "$as_me:3835: checking for $ac_header" >&5
3836 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3837 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3838   echo $ECHO_N "(cached) $ECHO_C" >&6
3839 else
3840   cat >"conftest.$ac_ext" <<_ACEOF
3841 #line 3841 "configure"
3842 #include "confdefs.h"
3843 #include <$ac_header>
3844 _ACEOF
3845 if { (eval echo "$as_me:3845: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3846   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3847   ac_status=$?
3848   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3849   rm -f conftest.er1
3850   cat conftest.err >&5
3851   echo "$as_me:3851: \$? = $ac_status" >&5
3852   (exit "$ac_status"); } >/dev/null; then
3853   if test -s conftest.err; then
3854     ac_cpp_err=$ac_c_preproc_warn_flag
3855   else
3856     ac_cpp_err=
3857   fi
3858 else
3859   ac_cpp_err=yes
3860 fi
3861 if test -z "$ac_cpp_err"; then
3862   eval "$as_ac_Header=yes"
3863 else
3864   echo "$as_me: failed program was:" >&5
3865   cat "conftest.$ac_ext" >&5
3866   eval "$as_ac_Header=no"
3867 fi
3868 rm -f conftest.err "conftest.$ac_ext"
3869 fi
3870 echo "$as_me:3870: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3871 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3872 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3873   cat >>confdefs.h <<EOF
3874 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3875 EOF
3876
3877 fi
3878 done
3879
3880 cat >>confdefs.h <<\EOF
3881 #define HAVE_STRLCAT 1
3882 EOF
3883
3884 fi
3885
3886 fi
3887
3888 for ac_func in strlcpy snprintf
3889 do
3890 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3891 echo "$as_me:3891: checking for $ac_func" >&5
3892 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3893 if eval "test \"\${$as_ac_var+set}\" = set"; then
3894   echo $ECHO_N "(cached) $ECHO_C" >&6
3895 else
3896   cat >"conftest.$ac_ext" <<_ACEOF
3897 #line 3897 "configure"
3898 #include "confdefs.h"
3899 #define $ac_func autoconf_temporary
3900 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3901 #undef $ac_func
3902
3903 #ifdef __cplusplus
3904 extern "C"
3905 #endif
3906
3907 /* We use char because int might match the return type of a gcc2
3908    builtin and then its argument prototype would still apply.  */
3909 char $ac_func (void);
3910
3911 int
3912 main (void)
3913 {
3914
3915 /* The GNU C library defines stubs for functions which it implements
3916     to always fail with ENOSYS.  Some functions are actually named
3917     something starting with __ and the normal name is an alias.  */
3918 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3919 #error found stub for $ac_func
3920 #endif
3921
3922         return $ac_func ();
3923   ;
3924   return 0;
3925 }
3926 _ACEOF
3927 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3928 if { (eval echo "$as_me:3928: \"$ac_link\"") >&5
3929   (eval $ac_link) 2>&5
3930   ac_status=$?
3931   echo "$as_me:3931: \$? = $ac_status" >&5
3932   (exit "$ac_status"); } &&
3933          { ac_try='test -s "conftest$ac_exeext"'
3934   { (eval echo "$as_me:3934: \"$ac_try\"") >&5
3935   (eval $ac_try) 2>&5
3936   ac_status=$?
3937   echo "$as_me:3937: \$? = $ac_status" >&5
3938   (exit "$ac_status"); }; }; then
3939   eval "$as_ac_var=yes"
3940 else
3941   echo "$as_me: failed program was:" >&5
3942 cat "conftest.$ac_ext" >&5
3943 eval "$as_ac_var=no"
3944 fi
3945 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3946 fi
3947 echo "$as_me:3947: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3948 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3949 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3950   cat >>confdefs.h <<EOF
3951 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3952 EOF
3953
3954 fi
3955 done
3956
3957 fi
3958
3959 echo "$as_me:3959: checking if the POSIX test-macros are already defined" >&5
3960 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3961 if test "${cf_cv_posix_visible+set}" = set; then
3962   echo $ECHO_N "(cached) $ECHO_C" >&6
3963 else
3964
3965 cat >"conftest.$ac_ext" <<_ACEOF
3966 #line 3966 "configure"
3967 #include "confdefs.h"
3968 #include <stdio.h>
3969 int
3970 main (void)
3971 {
3972
3973 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3974         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3975         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3976         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3977 #error conflicting symbols found
3978 #endif
3979
3980   ;
3981   return 0;
3982 }
3983 _ACEOF
3984 rm -f "conftest.$ac_objext"
3985 if { (eval echo "$as_me:3985: \"$ac_compile\"") >&5
3986   (eval $ac_compile) 2>&5
3987   ac_status=$?
3988   echo "$as_me:3988: \$? = $ac_status" >&5
3989   (exit "$ac_status"); } &&
3990          { ac_try='test -s "conftest.$ac_objext"'
3991   { (eval echo "$as_me:3991: \"$ac_try\"") >&5
3992   (eval $ac_try) 2>&5
3993   ac_status=$?
3994   echo "$as_me:3994: \$? = $ac_status" >&5
3995   (exit "$ac_status"); }; }; then
3996   cf_cv_posix_visible=no
3997 else
3998   echo "$as_me: failed program was:" >&5
3999 cat "conftest.$ac_ext" >&5
4000 cf_cv_posix_visible=yes
4001 fi
4002 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4003
4004 fi
4005 echo "$as_me:4005: result: $cf_cv_posix_visible" >&5
4006 echo "${ECHO_T}$cf_cv_posix_visible" >&6
4007
4008 if test "$cf_cv_posix_visible" = no; then
4009
4010 cf_XOPEN_SOURCE=600
4011 cf_POSIX_C_SOURCE=199506L
4012 cf_xopen_source=
4013
4014 case "$host_os" in
4015 (aix[4-7]*)
4016         cf_xopen_source="-D_ALL_SOURCE"
4017         ;;
4018 (msys)
4019         cf_XOPEN_SOURCE=600
4020         ;;
4021 (darwin[0-8].*)
4022         cf_xopen_source="-D_APPLE_C_SOURCE"
4023         ;;
4024 (darwin*)
4025         cf_xopen_source="-D_DARWIN_C_SOURCE"
4026         cf_XOPEN_SOURCE=
4027         ;;
4028 (freebsd*|dragonfly*|midnightbsd*)
4029         # 5.x headers associate
4030         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
4031         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
4032         cf_POSIX_C_SOURCE=200112L
4033         cf_XOPEN_SOURCE=600
4034         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4035         ;;
4036 (hpux11*)
4037         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
4038         ;;
4039 (hpux*)
4040         cf_xopen_source="-D_HPUX_SOURCE"
4041         ;;
4042 (irix[56].*)
4043         cf_xopen_source="-D_SGI_SOURCE"
4044         cf_XOPEN_SOURCE=
4045         ;;
4046 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
4047
4048 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
4049
4050 echo "$as_me:4050: checking if this is the GNU C library" >&5
4051 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
4052 if test "${cf_cv_gnu_library+set}" = set; then
4053   echo $ECHO_N "(cached) $ECHO_C" >&6
4054 else
4055
4056 cat >"conftest.$ac_ext" <<_ACEOF
4057 #line 4057 "configure"
4058 #include "confdefs.h"
4059 #include <sys/types.h>
4060 int
4061 main (void)
4062 {
4063
4064         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
4065                 return 0;
4066         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
4067                 return 0;
4068         #else
4069         #       error not GNU C library
4070         #endif
4071   ;
4072   return 0;
4073 }
4074 _ACEOF
4075 rm -f "conftest.$ac_objext"
4076 if { (eval echo "$as_me:4076: \"$ac_compile\"") >&5
4077   (eval $ac_compile) 2>&5
4078   ac_status=$?
4079   echo "$as_me:4079: \$? = $ac_status" >&5
4080   (exit "$ac_status"); } &&
4081          { ac_try='test -s "conftest.$ac_objext"'
4082   { (eval echo "$as_me:4082: \"$ac_try\"") >&5
4083   (eval $ac_try) 2>&5
4084   ac_status=$?
4085   echo "$as_me:4085: \$? = $ac_status" >&5
4086   (exit "$ac_status"); }; }; then
4087   cf_cv_gnu_library=yes
4088 else
4089   echo "$as_me: failed program was:" >&5
4090 cat "conftest.$ac_ext" >&5
4091 cf_cv_gnu_library=no
4092 fi
4093 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4094
4095 fi
4096 echo "$as_me:4096: result: $cf_cv_gnu_library" >&5
4097 echo "${ECHO_T}$cf_cv_gnu_library" >&6
4098
4099 if test x$cf_cv_gnu_library = xyes; then
4100
4101         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
4102         # was changed to help a little.  newlib incorporated the change about 4
4103         # years later.
4104         echo "$as_me:4104: checking if _DEFAULT_SOURCE can be used as a basis" >&5
4105 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
4106 if test "${cf_cv_gnu_library_219+set}" = set; then
4107   echo $ECHO_N "(cached) $ECHO_C" >&6
4108 else
4109
4110                 cf_save="$CPPFLAGS"
4111
4112         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4113         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4114
4115                 cat >"conftest.$ac_ext" <<_ACEOF
4116 #line 4116 "configure"
4117 #include "confdefs.h"
4118 #include <sys/types.h>
4119 int
4120 main (void)
4121 {
4122
4123                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
4124                                 return 0;
4125                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4126                                 return 0;
4127                         #else
4128                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4129                         #endif
4130   ;
4131   return 0;
4132 }
4133 _ACEOF
4134 rm -f "conftest.$ac_objext"
4135 if { (eval echo "$as_me:4135: \"$ac_compile\"") >&5
4136   (eval $ac_compile) 2>&5
4137   ac_status=$?
4138   echo "$as_me:4138: \$? = $ac_status" >&5
4139   (exit "$ac_status"); } &&
4140          { ac_try='test -s "conftest.$ac_objext"'
4141   { (eval echo "$as_me:4141: \"$ac_try\"") >&5
4142   (eval $ac_try) 2>&5
4143   ac_status=$?
4144   echo "$as_me:4144: \$? = $ac_status" >&5
4145   (exit "$ac_status"); }; }; then
4146   cf_cv_gnu_library_219=yes
4147 else
4148   echo "$as_me: failed program was:" >&5
4149 cat "conftest.$ac_ext" >&5
4150 cf_cv_gnu_library_219=no
4151 fi
4152 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4153                 CPPFLAGS="$cf_save"
4154
4155 fi
4156 echo "$as_me:4156: result: $cf_cv_gnu_library_219" >&5
4157 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4158
4159         if test "x$cf_cv_gnu_library_219" = xyes; then
4160                 cf_save="$CPPFLAGS"
4161                 echo "$as_me:4161: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4162 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4163 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4164   echo $ECHO_N "(cached) $ECHO_C" >&6
4165 else
4166
4167 cf_fix_cppflags=no
4168 cf_new_cflags=
4169 cf_new_cppflags=
4170 cf_new_extra_cppflags=
4171
4172 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4173 do
4174 case "$cf_fix_cppflags" in
4175 (no)
4176         case "$cf_add_cflags" in
4177         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4178                 case "$cf_add_cflags" in
4179                 (-D*)
4180                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4181
4182                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4183                                 && test -z "${cf_tst_cflags}" \
4184                                 && cf_fix_cppflags=yes
4185
4186                         if test "$cf_fix_cppflags" = yes ; then
4187
4188         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4189         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4190
4191                                 continue
4192                         elif test "${cf_tst_cflags}" = "\"'" ; then
4193
4194         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4195         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4196
4197                                 continue
4198                         fi
4199                         ;;
4200                 esac
4201                 case "$CPPFLAGS" in
4202                 (*$cf_add_cflags)
4203                         ;;
4204                 (*)
4205                         case "$cf_add_cflags" in
4206                         (-D*)
4207                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4208
4209 CPPFLAGS=`echo "$CPPFLAGS" | \
4210         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4211                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4212
4213                                 ;;
4214                         esac
4215
4216         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4217         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4218
4219                         ;;
4220                 esac
4221                 ;;
4222         (*)
4223
4224         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4225         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4226
4227                 ;;
4228         esac
4229         ;;
4230 (yes)
4231
4232         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4233         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4234
4235         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4236
4237         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4238                 && test -z "${cf_tst_cflags}" \
4239                 && cf_fix_cppflags=no
4240         ;;
4241 esac
4242 done
4243
4244 if test -n "$cf_new_cflags" ; then
4245
4246         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4247         CFLAGS="${CFLAGS}$cf_new_cflags"
4248
4249 fi
4250
4251 if test -n "$cf_new_cppflags" ; then
4252
4253         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4254         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4255
4256 fi
4257
4258 if test -n "$cf_new_extra_cppflags" ; then
4259
4260         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4261         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4262
4263 fi
4264
4265                         cat >"conftest.$ac_ext" <<_ACEOF
4266 #line 4266 "configure"
4267 #include "confdefs.h"
4268
4269                                 #include <limits.h>
4270                                 #include <sys/types.h>
4271
4272 int
4273 main (void)
4274 {
4275
4276                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4277                                         return 0;
4278                                 #else
4279                                 #       error GNU C library is too old
4280                                 #endif
4281   ;
4282   return 0;
4283 }
4284 _ACEOF
4285 rm -f "conftest.$ac_objext"
4286 if { (eval echo "$as_me:4286: \"$ac_compile\"") >&5
4287   (eval $ac_compile) 2>&5
4288   ac_status=$?
4289   echo "$as_me:4289: \$? = $ac_status" >&5
4290   (exit "$ac_status"); } &&
4291          { ac_try='test -s "conftest.$ac_objext"'
4292   { (eval echo "$as_me:4292: \"$ac_try\"") >&5
4293   (eval $ac_try) 2>&5
4294   ac_status=$?
4295   echo "$as_me:4295: \$? = $ac_status" >&5
4296   (exit "$ac_status"); }; }; then
4297   cf_cv_gnu_dftsrc_219=yes
4298 else
4299   echo "$as_me: failed program was:" >&5
4300 cat "conftest.$ac_ext" >&5
4301 cf_cv_gnu_dftsrc_219=no
4302 fi
4303 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4304
4305 fi
4306 echo "$as_me:4306: result: $cf_cv_gnu_dftsrc_219" >&5
4307 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4308                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4309         else
4310                 cf_cv_gnu_dftsrc_219=maybe
4311         fi
4312
4313         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4314
4315                 echo "$as_me:4315: checking if we must define _GNU_SOURCE" >&5
4316 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4317 if test "${cf_cv_gnu_source+set}" = set; then
4318   echo $ECHO_N "(cached) $ECHO_C" >&6
4319 else
4320
4321                 cat >"conftest.$ac_ext" <<_ACEOF
4322 #line 4322 "configure"
4323 #include "confdefs.h"
4324 #include <sys/types.h>
4325 int
4326 main (void)
4327 {
4328
4329                         #ifndef _XOPEN_SOURCE
4330                         #error  expected _XOPEN_SOURCE to be defined
4331                         #endif
4332   ;
4333   return 0;
4334 }
4335 _ACEOF
4336 rm -f "conftest.$ac_objext"
4337 if { (eval echo "$as_me:4337: \"$ac_compile\"") >&5
4338   (eval $ac_compile) 2>&5
4339   ac_status=$?
4340   echo "$as_me:4340: \$? = $ac_status" >&5
4341   (exit "$ac_status"); } &&
4342          { ac_try='test -s "conftest.$ac_objext"'
4343   { (eval echo "$as_me:4343: \"$ac_try\"") >&5
4344   (eval $ac_try) 2>&5
4345   ac_status=$?
4346   echo "$as_me:4346: \$? = $ac_status" >&5
4347   (exit "$ac_status"); }; }; then
4348   cf_cv_gnu_source=no
4349 else
4350   echo "$as_me: failed program was:" >&5
4351 cat "conftest.$ac_ext" >&5
4352 cf_save="$CPPFLAGS"
4353
4354 cf_fix_cppflags=no
4355 cf_new_cflags=
4356 cf_new_cppflags=
4357 cf_new_extra_cppflags=
4358
4359 for cf_add_cflags in -D_GNU_SOURCE
4360 do
4361 case "$cf_fix_cppflags" in
4362 (no)
4363         case "$cf_add_cflags" in
4364         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4365                 case "$cf_add_cflags" in
4366                 (-D*)
4367                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4368
4369                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4370                                 && test -z "${cf_tst_cflags}" \
4371                                 && cf_fix_cppflags=yes
4372
4373                         if test "$cf_fix_cppflags" = yes ; then
4374
4375         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4376         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4377
4378                                 continue
4379                         elif test "${cf_tst_cflags}" = "\"'" ; then
4380
4381         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4382         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4383
4384                                 continue
4385                         fi
4386                         ;;
4387                 esac
4388                 case "$CPPFLAGS" in
4389                 (*$cf_add_cflags)
4390                         ;;
4391                 (*)
4392                         case "$cf_add_cflags" in
4393                         (-D*)
4394                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4395
4396 CPPFLAGS=`echo "$CPPFLAGS" | \
4397         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4398                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4399
4400                                 ;;
4401                         esac
4402
4403         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4404         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4405
4406                         ;;
4407                 esac
4408                 ;;
4409         (*)
4410
4411         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4412         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4413
4414                 ;;
4415         esac
4416         ;;
4417 (yes)
4418
4419         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4420         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4421
4422         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4423
4424         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4425                 && test -z "${cf_tst_cflags}" \
4426                 && cf_fix_cppflags=no
4427         ;;
4428 esac
4429 done
4430
4431 if test -n "$cf_new_cflags" ; then
4432
4433         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4434         CFLAGS="${CFLAGS}$cf_new_cflags"
4435
4436 fi
4437
4438 if test -n "$cf_new_cppflags" ; then
4439
4440         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4441         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4442
4443 fi
4444
4445 if test -n "$cf_new_extra_cppflags" ; then
4446
4447         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4448         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4449
4450 fi
4451
4452                          cat >"conftest.$ac_ext" <<_ACEOF
4453 #line 4453 "configure"
4454 #include "confdefs.h"
4455 #include <sys/types.h>
4456 int
4457 main (void)
4458 {
4459
4460                                 #ifdef _XOPEN_SOURCE
4461                                 #error  expected _XOPEN_SOURCE to be undefined
4462                                 #endif
4463   ;
4464   return 0;
4465 }
4466 _ACEOF
4467 rm -f "conftest.$ac_objext"
4468 if { (eval echo "$as_me:4468: \"$ac_compile\"") >&5
4469   (eval $ac_compile) 2>&5
4470   ac_status=$?
4471   echo "$as_me:4471: \$? = $ac_status" >&5
4472   (exit "$ac_status"); } &&
4473          { ac_try='test -s "conftest.$ac_objext"'
4474   { (eval echo "$as_me:4474: \"$ac_try\"") >&5
4475   (eval $ac_try) 2>&5
4476   ac_status=$?
4477   echo "$as_me:4477: \$? = $ac_status" >&5
4478   (exit "$ac_status"); }; }; then
4479   cf_cv_gnu_source=no
4480 else
4481   echo "$as_me: failed program was:" >&5
4482 cat "conftest.$ac_ext" >&5
4483 cf_cv_gnu_source=yes
4484 fi
4485 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4486                         CPPFLAGS="$cf_save"
4487
4488 fi
4489 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4490
4491 fi
4492 echo "$as_me:4492: result: $cf_cv_gnu_source" >&5
4493 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4494
4495                 if test "$cf_cv_gnu_source" = yes
4496                 then
4497                 echo "$as_me:4497: checking if we should also define _DEFAULT_SOURCE" >&5
4498 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4499 if test "${cf_cv_default_source+set}" = set; then
4500   echo $ECHO_N "(cached) $ECHO_C" >&6
4501 else
4502
4503         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4504         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4505
4506                         cat >"conftest.$ac_ext" <<_ACEOF
4507 #line 4507 "configure"
4508 #include "confdefs.h"
4509 #include <sys/types.h>
4510 int
4511 main (void)
4512 {
4513
4514                                 #ifdef _DEFAULT_SOURCE
4515                                 #error  expected _DEFAULT_SOURCE to be undefined
4516                                 #endif
4517   ;
4518   return 0;
4519 }
4520 _ACEOF
4521 rm -f "conftest.$ac_objext"
4522 if { (eval echo "$as_me:4522: \"$ac_compile\"") >&5
4523   (eval $ac_compile) 2>&5
4524   ac_status=$?
4525   echo "$as_me:4525: \$? = $ac_status" >&5
4526   (exit "$ac_status"); } &&
4527          { ac_try='test -s "conftest.$ac_objext"'
4528   { (eval echo "$as_me:4528: \"$ac_try\"") >&5
4529   (eval $ac_try) 2>&5
4530   ac_status=$?
4531   echo "$as_me:4531: \$? = $ac_status" >&5
4532   (exit "$ac_status"); }; }; then
4533   cf_cv_default_source=no
4534 else
4535   echo "$as_me: failed program was:" >&5
4536 cat "conftest.$ac_ext" >&5
4537 cf_cv_default_source=yes
4538 fi
4539 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4540
4541 fi
4542 echo "$as_me:4542: result: $cf_cv_default_source" >&5
4543 echo "${ECHO_T}$cf_cv_default_source" >&6
4544                         if test "$cf_cv_default_source" = yes
4545                         then
4546
4547         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4548         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4549
4550                         fi
4551                 fi
4552         fi
4553
4554 fi
4555
4556         ;;
4557 (minix*)
4558         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4559         ;;
4560 (mirbsd*)
4561         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4562         cf_XOPEN_SOURCE=
4563
4564 if test "$cf_cv_posix_visible" = no; then
4565
4566 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4567
4568 cf_save_CFLAGS="$CFLAGS"
4569 cf_save_CPPFLAGS="$CPPFLAGS"
4570
4571 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4572         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4573                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4574
4575 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4576         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4577                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4578
4579 echo "$as_me:4579: checking if we should define _POSIX_C_SOURCE" >&5
4580 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4581 if test "${cf_cv_posix_c_source+set}" = set; then
4582   echo $ECHO_N "(cached) $ECHO_C" >&6
4583 else
4584
4585 echo "${as_me:-configure}:4585: testing if the symbol is already defined go no further ..." 1>&5
4586
4587         cat >"conftest.$ac_ext" <<_ACEOF
4588 #line 4588 "configure"
4589 #include "confdefs.h"
4590 #include <sys/types.h>
4591 int
4592 main (void)
4593 {
4594
4595 #ifndef _POSIX_C_SOURCE
4596 make an error
4597 #endif
4598   ;
4599   return 0;
4600 }
4601 _ACEOF
4602 rm -f "conftest.$ac_objext"
4603 if { (eval echo "$as_me:4603: \"$ac_compile\"") >&5
4604   (eval $ac_compile) 2>&5
4605   ac_status=$?
4606   echo "$as_me:4606: \$? = $ac_status" >&5
4607   (exit "$ac_status"); } &&
4608          { ac_try='test -s "conftest.$ac_objext"'
4609   { (eval echo "$as_me:4609: \"$ac_try\"") >&5
4610   (eval $ac_try) 2>&5
4611   ac_status=$?
4612   echo "$as_me:4612: \$? = $ac_status" >&5
4613   (exit "$ac_status"); }; }; then
4614   cf_cv_posix_c_source=no
4615 else
4616   echo "$as_me: failed program was:" >&5
4617 cat "conftest.$ac_ext" >&5
4618 cf_want_posix_source=no
4619          case .$cf_POSIX_C_SOURCE in
4620          (.[12]??*)
4621                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4622                 ;;
4623          (.2)
4624                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4625                 cf_want_posix_source=yes
4626                 ;;
4627          (.*)
4628                 cf_want_posix_source=yes
4629                 ;;
4630          esac
4631          if test "$cf_want_posix_source" = yes ; then
4632                 cat >"conftest.$ac_ext" <<_ACEOF
4633 #line 4633 "configure"
4634 #include "confdefs.h"
4635 #include <sys/types.h>
4636 int
4637 main (void)
4638 {
4639
4640 #ifdef _POSIX_SOURCE
4641 make an error
4642 #endif
4643   ;
4644   return 0;
4645 }
4646 _ACEOF
4647 rm -f "conftest.$ac_objext"
4648 if { (eval echo "$as_me:4648: \"$ac_compile\"") >&5
4649   (eval $ac_compile) 2>&5
4650   ac_status=$?
4651   echo "$as_me:4651: \$? = $ac_status" >&5
4652   (exit "$ac_status"); } &&
4653          { ac_try='test -s "conftest.$ac_objext"'
4654   { (eval echo "$as_me:4654: \"$ac_try\"") >&5
4655   (eval $ac_try) 2>&5
4656   ac_status=$?
4657   echo "$as_me:4657: \$? = $ac_status" >&5
4658   (exit "$ac_status"); }; }; then
4659   :
4660 else
4661   echo "$as_me: failed program was:" >&5
4662 cat "conftest.$ac_ext" >&5
4663 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4664 fi
4665 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4666          fi
4667
4668 echo "${as_me:-configure}:4668: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4669
4670          CFLAGS="$cf_trim_CFLAGS"
4671          CPPFLAGS="$cf_trim_CPPFLAGS"
4672
4673         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4674         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4675
4676 echo "${as_me:-configure}:4676: testing if the second compile does not leave our definition intact error ..." 1>&5
4677
4678          cat >"conftest.$ac_ext" <<_ACEOF
4679 #line 4679 "configure"
4680 #include "confdefs.h"
4681 #include <sys/types.h>
4682 int
4683 main (void)
4684 {
4685
4686 #ifndef _POSIX_C_SOURCE
4687 make an error
4688 #endif
4689   ;
4690   return 0;
4691 }
4692 _ACEOF
4693 rm -f "conftest.$ac_objext"
4694 if { (eval echo "$as_me:4694: \"$ac_compile\"") >&5
4695   (eval $ac_compile) 2>&5
4696   ac_status=$?
4697   echo "$as_me:4697: \$? = $ac_status" >&5
4698   (exit "$ac_status"); } &&
4699          { ac_try='test -s "conftest.$ac_objext"'
4700   { (eval echo "$as_me:4700: \"$ac_try\"") >&5
4701   (eval $ac_try) 2>&5
4702   ac_status=$?
4703   echo "$as_me:4703: \$? = $ac_status" >&5
4704   (exit "$ac_status"); }; }; then
4705   :
4706 else
4707   echo "$as_me: failed program was:" >&5
4708 cat "conftest.$ac_ext" >&5
4709 cf_cv_posix_c_source=no
4710 fi
4711 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4712          CFLAGS="$cf_save_CFLAGS"
4713          CPPFLAGS="$cf_save_CPPFLAGS"
4714
4715 fi
4716 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4717
4718 fi
4719 echo "$as_me:4719: result: $cf_cv_posix_c_source" >&5
4720 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4721
4722 if test "$cf_cv_posix_c_source" != no ; then
4723         CFLAGS="$cf_trim_CFLAGS"
4724         CPPFLAGS="$cf_trim_CPPFLAGS"
4725
4726 cf_fix_cppflags=no
4727 cf_new_cflags=
4728 cf_new_cppflags=
4729 cf_new_extra_cppflags=
4730
4731 for cf_add_cflags in $cf_cv_posix_c_source
4732 do
4733 case "$cf_fix_cppflags" in
4734 (no)
4735         case "$cf_add_cflags" in
4736         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4737                 case "$cf_add_cflags" in
4738                 (-D*)
4739                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4740
4741                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4742                                 && test -z "${cf_tst_cflags}" \
4743                                 && cf_fix_cppflags=yes
4744
4745                         if test "$cf_fix_cppflags" = yes ; then
4746
4747         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4748         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4749
4750                                 continue
4751                         elif test "${cf_tst_cflags}" = "\"'" ; then
4752
4753         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4754         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4755
4756                                 continue
4757                         fi
4758                         ;;
4759                 esac
4760                 case "$CPPFLAGS" in
4761                 (*$cf_add_cflags)
4762                         ;;
4763                 (*)
4764                         case "$cf_add_cflags" in
4765                         (-D*)
4766                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4767
4768 CPPFLAGS=`echo "$CPPFLAGS" | \
4769         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4770                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4771
4772                                 ;;
4773                         esac
4774
4775         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4776         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4777
4778                         ;;
4779                 esac
4780                 ;;
4781         (*)
4782
4783         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4784         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4785
4786                 ;;
4787         esac
4788         ;;
4789 (yes)
4790
4791         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4792         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4793
4794         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4795
4796         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4797                 && test -z "${cf_tst_cflags}" \
4798                 && cf_fix_cppflags=no
4799         ;;
4800 esac
4801 done
4802
4803 if test -n "$cf_new_cflags" ; then
4804
4805         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4806         CFLAGS="${CFLAGS}$cf_new_cflags"
4807
4808 fi
4809
4810 if test -n "$cf_new_cppflags" ; then
4811
4812         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4813         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4814
4815 fi
4816
4817 if test -n "$cf_new_extra_cppflags" ; then
4818
4819         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4820         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4821
4822 fi
4823
4824 fi
4825
4826 fi # cf_cv_posix_visible
4827
4828         ;;
4829 (netbsd*)
4830         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4831         ;;
4832 (openbsd[6-9]*)
4833         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
4834         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
4835         # Abusing the conformance level is a workaround.
4836         { echo "$as_me:4836: WARNING: this system does not provide usable locale support" >&5
4837 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
4838         cf_xopen_source="-D_BSD_SOURCE"
4839         cf_XOPEN_SOURCE=700
4840         ;;
4841 (openbsd[4-5]*)
4842         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4843         cf_xopen_source="-D_BSD_SOURCE"
4844         cf_XOPEN_SOURCE=600
4845         ;;
4846 (openbsd*)
4847         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4848         ;;
4849 (osf[45]*)
4850         cf_xopen_source="-D_OSF_SOURCE"
4851         ;;
4852 (nto-qnx*)
4853         cf_xopen_source="-D_QNX_SOURCE"
4854         ;;
4855 (sco*)
4856         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4857         ;;
4858 (solaris2.*)
4859         cf_xopen_source="-D__EXTENSIONS__"
4860         cf_cv_xopen_source=broken
4861         ;;
4862 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4863         cf_XOPEN_SOURCE=
4864         cf_POSIX_C_SOURCE=
4865         ;;
4866 (*)
4867
4868 echo "$as_me:4868: checking if we should define _XOPEN_SOURCE" >&5
4869 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4870 if test "${cf_cv_xopen_source+set}" = set; then
4871   echo $ECHO_N "(cached) $ECHO_C" >&6
4872 else
4873
4874         cat >"conftest.$ac_ext" <<_ACEOF
4875 #line 4875 "configure"
4876 #include "confdefs.h"
4877
4878 #include <stdlib.h>
4879 #include <string.h>
4880 #include <sys/types.h>
4881
4882 int
4883 main (void)
4884 {
4885
4886 #ifndef _XOPEN_SOURCE
4887 make an error
4888 #endif
4889
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 #ifndef _XOPEN_SOURCE
4928 make an error
4929 #endif
4930
4931   ;
4932   return 0;
4933 }
4934 _ACEOF
4935 rm -f "conftest.$ac_objext"
4936 if { (eval echo "$as_me:4936: \"$ac_compile\"") >&5
4937   (eval $ac_compile) 2>&5
4938   ac_status=$?
4939   echo "$as_me:4939: \$? = $ac_status" >&5
4940   (exit "$ac_status"); } &&
4941          { ac_try='test -s "conftest.$ac_objext"'
4942   { (eval echo "$as_me:4942: \"$ac_try\"") >&5
4943   (eval $ac_try) 2>&5
4944   ac_status=$?
4945   echo "$as_me:4945: \$? = $ac_status" >&5
4946   (exit "$ac_status"); }; }; then
4947   cf_cv_xopen_source=no
4948 else
4949   echo "$as_me: failed program was:" >&5
4950 cat "conftest.$ac_ext" >&5
4951 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4952 fi
4953 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4954                 CPPFLAGS="$cf_save"
4955
4956 fi
4957 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4958
4959 fi
4960 echo "$as_me:4960: result: $cf_cv_xopen_source" >&5
4961 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4962
4963 if test "$cf_cv_xopen_source" != no ; then
4964
4965 CFLAGS=`echo "$CFLAGS" | \
4966         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4967                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4968
4969 CPPFLAGS=`echo "$CPPFLAGS" | \
4970         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4971                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4972
4973         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4974
4975 for cf_add_cflags in $cf_temp_xopen_source
4976 do
4977         case "x$cf_add_cflags" in
4978         (x-[DU]*)
4979
4980 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4981 while true
4982 do
4983         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'`
4984         test "$CFLAGS" != "$cf_old_cflag" || break
4985
4986         CFLAGS="$cf_old_cflag"
4987 done
4988
4989 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4990 while true
4991 do
4992         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'`
4993         test "$CPPFLAGS" != "$cf_old_cflag" || break
4994
4995         CPPFLAGS="$cf_old_cflag"
4996 done
4997
4998                 ;;
4999         esac
5000
5001 cf_fix_cppflags=no
5002 cf_new_cflags=
5003 cf_new_cppflags=
5004 cf_new_extra_cppflags=
5005
5006 for cf_add_cflags in $cf_add_cflags
5007 do
5008 case "$cf_fix_cppflags" in
5009 (no)
5010         case "$cf_add_cflags" in
5011         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5012                 case "$cf_add_cflags" in
5013                 (-D*)
5014                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5015
5016                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5017                                 && test -z "${cf_tst_cflags}" \
5018                                 && cf_fix_cppflags=yes
5019
5020                         if test "$cf_fix_cppflags" = yes ; then
5021
5022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5024
5025                                 continue
5026                         elif test "${cf_tst_cflags}" = "\"'" ; then
5027
5028         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5029         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5030
5031                                 continue
5032                         fi
5033                         ;;
5034                 esac
5035                 case "$CPPFLAGS" in
5036                 (*$cf_add_cflags)
5037                         ;;
5038                 (*)
5039                         case "$cf_add_cflags" in
5040                         (-D*)
5041                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5042
5043 CPPFLAGS=`echo "$CPPFLAGS" | \
5044         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5045                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5046
5047                                 ;;
5048                         esac
5049
5050         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5051         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5052
5053                         ;;
5054                 esac
5055                 ;;
5056         (*)
5057
5058         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5059         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5060
5061                 ;;
5062         esac
5063         ;;
5064 (yes)
5065
5066         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5067         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5068
5069         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5070
5071         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5072                 && test -z "${cf_tst_cflags}" \
5073                 && cf_fix_cppflags=no
5074         ;;
5075 esac
5076 done
5077
5078 if test -n "$cf_new_cflags" ; then
5079
5080         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5081         CFLAGS="${CFLAGS}$cf_new_cflags"
5082
5083 fi
5084
5085 if test -n "$cf_new_cppflags" ; then
5086
5087         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5088         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5089
5090 fi
5091
5092 if test -n "$cf_new_extra_cppflags" ; then
5093
5094         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5095         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5096
5097 fi
5098
5099 done
5100
5101 fi
5102
5103         cf_save_xopen_cppflags="$CPPFLAGS"
5104
5105 if test "$cf_cv_posix_visible" = no; then
5106
5107 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
5108
5109 cf_save_CFLAGS="$CFLAGS"
5110 cf_save_CPPFLAGS="$CPPFLAGS"
5111
5112 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
5113         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5114                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5115
5116 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
5117         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
5118                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
5119
5120 echo "$as_me:5120: checking if we should define _POSIX_C_SOURCE" >&5
5121 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
5122 if test "${cf_cv_posix_c_source+set}" = set; then
5123   echo $ECHO_N "(cached) $ECHO_C" >&6
5124 else
5125
5126 echo "${as_me:-configure}:5126: testing if the symbol is already defined go no further ..." 1>&5
5127
5128         cat >"conftest.$ac_ext" <<_ACEOF
5129 #line 5129 "configure"
5130 #include "confdefs.h"
5131 #include <sys/types.h>
5132 int
5133 main (void)
5134 {
5135
5136 #ifndef _POSIX_C_SOURCE
5137 make an error
5138 #endif
5139   ;
5140   return 0;
5141 }
5142 _ACEOF
5143 rm -f "conftest.$ac_objext"
5144 if { (eval echo "$as_me:5144: \"$ac_compile\"") >&5
5145   (eval $ac_compile) 2>&5
5146   ac_status=$?
5147   echo "$as_me:5147: \$? = $ac_status" >&5
5148   (exit "$ac_status"); } &&
5149          { ac_try='test -s "conftest.$ac_objext"'
5150   { (eval echo "$as_me:5150: \"$ac_try\"") >&5
5151   (eval $ac_try) 2>&5
5152   ac_status=$?
5153   echo "$as_me:5153: \$? = $ac_status" >&5
5154   (exit "$ac_status"); }; }; then
5155   cf_cv_posix_c_source=no
5156 else
5157   echo "$as_me: failed program was:" >&5
5158 cat "conftest.$ac_ext" >&5
5159 cf_want_posix_source=no
5160          case .$cf_POSIX_C_SOURCE in
5161          (.[12]??*)
5162                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5163                 ;;
5164          (.2)
5165                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5166                 cf_want_posix_source=yes
5167                 ;;
5168          (.*)
5169                 cf_want_posix_source=yes
5170                 ;;
5171          esac
5172          if test "$cf_want_posix_source" = yes ; then
5173                 cat >"conftest.$ac_ext" <<_ACEOF
5174 #line 5174 "configure"
5175 #include "confdefs.h"
5176 #include <sys/types.h>
5177 int
5178 main (void)
5179 {
5180
5181 #ifdef _POSIX_SOURCE
5182 make an error
5183 #endif
5184   ;
5185   return 0;
5186 }
5187 _ACEOF
5188 rm -f "conftest.$ac_objext"
5189 if { (eval echo "$as_me:5189: \"$ac_compile\"") >&5
5190   (eval $ac_compile) 2>&5
5191   ac_status=$?
5192   echo "$as_me:5192: \$? = $ac_status" >&5
5193   (exit "$ac_status"); } &&
5194          { ac_try='test -s "conftest.$ac_objext"'
5195   { (eval echo "$as_me:5195: \"$ac_try\"") >&5
5196   (eval $ac_try) 2>&5
5197   ac_status=$?
5198   echo "$as_me:5198: \$? = $ac_status" >&5
5199   (exit "$ac_status"); }; }; then
5200   :
5201 else
5202   echo "$as_me: failed program was:" >&5
5203 cat "conftest.$ac_ext" >&5
5204 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5205 fi
5206 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5207          fi
5208
5209 echo "${as_me:-configure}:5209: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5210
5211          CFLAGS="$cf_trim_CFLAGS"
5212          CPPFLAGS="$cf_trim_CPPFLAGS"
5213
5214         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5215         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5216
5217 echo "${as_me:-configure}:5217: testing if the second compile does not leave our definition intact error ..." 1>&5
5218
5219          cat >"conftest.$ac_ext" <<_ACEOF
5220 #line 5220 "configure"
5221 #include "confdefs.h"
5222 #include <sys/types.h>
5223 int
5224 main (void)
5225 {
5226
5227 #ifndef _POSIX_C_SOURCE
5228 make an error
5229 #endif
5230   ;
5231   return 0;
5232 }
5233 _ACEOF
5234 rm -f "conftest.$ac_objext"
5235 if { (eval echo "$as_me:5235: \"$ac_compile\"") >&5
5236   (eval $ac_compile) 2>&5
5237   ac_status=$?
5238   echo "$as_me:5238: \$? = $ac_status" >&5
5239   (exit "$ac_status"); } &&
5240          { ac_try='test -s "conftest.$ac_objext"'
5241   { (eval echo "$as_me:5241: \"$ac_try\"") >&5
5242   (eval $ac_try) 2>&5
5243   ac_status=$?
5244   echo "$as_me:5244: \$? = $ac_status" >&5
5245   (exit "$ac_status"); }; }; then
5246   :
5247 else
5248   echo "$as_me: failed program was:" >&5
5249 cat "conftest.$ac_ext" >&5
5250 cf_cv_posix_c_source=no
5251 fi
5252 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5253          CFLAGS="$cf_save_CFLAGS"
5254          CPPFLAGS="$cf_save_CPPFLAGS"
5255
5256 fi
5257 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5258
5259 fi
5260 echo "$as_me:5260: result: $cf_cv_posix_c_source" >&5
5261 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5262
5263 if test "$cf_cv_posix_c_source" != no ; then
5264         CFLAGS="$cf_trim_CFLAGS"
5265         CPPFLAGS="$cf_trim_CPPFLAGS"
5266
5267 cf_fix_cppflags=no
5268 cf_new_cflags=
5269 cf_new_cppflags=
5270 cf_new_extra_cppflags=
5271
5272 for cf_add_cflags in $cf_cv_posix_c_source
5273 do
5274 case "$cf_fix_cppflags" in
5275 (no)
5276         case "$cf_add_cflags" in
5277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5278                 case "$cf_add_cflags" in
5279                 (-D*)
5280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5281
5282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5283                                 && test -z "${cf_tst_cflags}" \
5284                                 && cf_fix_cppflags=yes
5285
5286                         if test "$cf_fix_cppflags" = yes ; then
5287
5288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5290
5291                                 continue
5292                         elif test "${cf_tst_cflags}" = "\"'" ; then
5293
5294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5296
5297                                 continue
5298                         fi
5299                         ;;
5300                 esac
5301                 case "$CPPFLAGS" in
5302                 (*$cf_add_cflags)
5303                         ;;
5304                 (*)
5305                         case "$cf_add_cflags" in
5306                         (-D*)
5307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5308
5309 CPPFLAGS=`echo "$CPPFLAGS" | \
5310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5312
5313                                 ;;
5314                         esac
5315
5316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5318
5319                         ;;
5320                 esac
5321                 ;;
5322         (*)
5323
5324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5326
5327                 ;;
5328         esac
5329         ;;
5330 (yes)
5331
5332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5334
5335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5336
5337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5338                 && test -z "${cf_tst_cflags}" \
5339                 && cf_fix_cppflags=no
5340         ;;
5341 esac
5342 done
5343
5344 if test -n "$cf_new_cflags" ; then
5345
5346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5347         CFLAGS="${CFLAGS}$cf_new_cflags"
5348
5349 fi
5350
5351 if test -n "$cf_new_cppflags" ; then
5352
5353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5355
5356 fi
5357
5358 if test -n "$cf_new_extra_cppflags" ; then
5359
5360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5362
5363 fi
5364
5365 fi
5366
5367 fi # cf_cv_posix_visible
5368
5369         # Some of these niche implementations use copy/paste, double-check...
5370         if test "$cf_cv_xopen_source" != no ; then
5371                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE inteferes" 1>&6
5372
5373 echo "${as_me:-configure}:5373: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5
5374
5375                 cat >"conftest.$ac_ext" <<_ACEOF
5376 #line 5376 "configure"
5377 #include "confdefs.h"
5378
5379 #include <stdlib.h>
5380 #include <string.h>
5381 #include <sys/types.h>
5382
5383 int
5384 main (void)
5385 {
5386
5387 #ifndef _XOPEN_SOURCE
5388 make an error
5389 #endif
5390
5391   ;
5392   return 0;
5393 }
5394 _ACEOF
5395 rm -f "conftest.$ac_objext"
5396 if { (eval echo "$as_me:5396: \"$ac_compile\"") >&5
5397   (eval $ac_compile) 2>&5
5398   ac_status=$?
5399   echo "$as_me:5399: \$? = $ac_status" >&5
5400   (exit "$ac_status"); } &&
5401          { ac_try='test -s "conftest.$ac_objext"'
5402   { (eval echo "$as_me:5402: \"$ac_try\"") >&5
5403   (eval $ac_try) 2>&5
5404   ac_status=$?
5405   echo "$as_me:5405: \$? = $ac_status" >&5
5406   (exit "$ac_status"); }; }; then
5407   :
5408 else
5409   echo "$as_me: failed program was:" >&5
5410 cat "conftest.$ac_ext" >&5
5411
5412                         { echo "$as_me:5412: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
5413 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
5414                         CPPFLAGS="$cf_save_xopen_cppflags"
5415 fi
5416 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5417         fi
5418         ;;
5419 esac
5420
5421 if test -n "$cf_xopen_source" ; then
5422
5423 for cf_add_cflags in $cf_xopen_source
5424 do
5425         case "x$cf_add_cflags" in
5426         (x-[DU]*)
5427
5428 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5429 while true
5430 do
5431         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'`
5432         test "$CFLAGS" != "$cf_old_cflag" || break
5433         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
5434
5435 echo "${as_me:-configure}:5435: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
5436
5437         CFLAGS="$cf_old_cflag"
5438 done
5439
5440 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5441 while true
5442 do
5443         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'`
5444         test "$CPPFLAGS" != "$cf_old_cflag" || break
5445         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
5446
5447 echo "${as_me:-configure}:5447: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
5448
5449         CPPFLAGS="$cf_old_cflag"
5450 done
5451
5452                 ;;
5453         esac
5454
5455 cf_fix_cppflags=no
5456 cf_new_cflags=
5457 cf_new_cppflags=
5458 cf_new_extra_cppflags=
5459
5460 for cf_add_cflags in $cf_add_cflags
5461 do
5462 case "$cf_fix_cppflags" in
5463 (no)
5464         case "$cf_add_cflags" in
5465         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5466                 case "$cf_add_cflags" in
5467                 (-D*)
5468                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5469
5470                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5471                                 && test -z "${cf_tst_cflags}" \
5472                                 && cf_fix_cppflags=yes
5473
5474                         if test "$cf_fix_cppflags" = yes ; then
5475
5476         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5477         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5478
5479                                 continue
5480                         elif test "${cf_tst_cflags}" = "\"'" ; then
5481
5482         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5483         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5484
5485                                 continue
5486                         fi
5487                         ;;
5488                 esac
5489                 case "$CPPFLAGS" in
5490                 (*$cf_add_cflags)
5491                         ;;
5492                 (*)
5493                         case "$cf_add_cflags" in
5494                         (-D*)
5495                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5496
5497 CPPFLAGS=`echo "$CPPFLAGS" | \
5498         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5499                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5500
5501                                 ;;
5502                         esac
5503
5504         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5505         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5506
5507                         ;;
5508                 esac
5509                 ;;
5510         (*)
5511
5512         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5513         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5514
5515                 ;;
5516         esac
5517         ;;
5518 (yes)
5519
5520         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5521         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5522
5523         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5524
5525         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5526                 && test -z "${cf_tst_cflags}" \
5527                 && cf_fix_cppflags=no
5528         ;;
5529 esac
5530 done
5531
5532 if test -n "$cf_new_cflags" ; then
5533         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5534
5535 echo "${as_me:-configure}:5535: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5536
5537         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5538         CFLAGS="${CFLAGS}$cf_new_cflags"
5539
5540 fi
5541
5542 if test -n "$cf_new_cppflags" ; then
5543         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5544
5545 echo "${as_me:-configure}:5545: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5546
5547         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5548         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5549
5550 fi
5551
5552 if test -n "$cf_new_extra_cppflags" ; then
5553         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5554
5555 echo "${as_me:-configure}:5555: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5556
5557         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5558         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5559
5560 fi
5561
5562 done
5563
5564 fi
5565
5566 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5567         echo "$as_me:5567: checking if _XOPEN_SOURCE really is set" >&5
5568 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5569         cat >"conftest.$ac_ext" <<_ACEOF
5570 #line 5570 "configure"
5571 #include "confdefs.h"
5572 #include <stdlib.h>
5573 int
5574 main (void)
5575 {
5576
5577 #ifndef _XOPEN_SOURCE
5578 make an error
5579 #endif
5580   ;
5581   return 0;
5582 }
5583 _ACEOF
5584 rm -f "conftest.$ac_objext"
5585 if { (eval echo "$as_me:5585: \"$ac_compile\"") >&5
5586   (eval $ac_compile) 2>&5
5587   ac_status=$?
5588   echo "$as_me:5588: \$? = $ac_status" >&5
5589   (exit "$ac_status"); } &&
5590          { ac_try='test -s "conftest.$ac_objext"'
5591   { (eval echo "$as_me:5591: \"$ac_try\"") >&5
5592   (eval $ac_try) 2>&5
5593   ac_status=$?
5594   echo "$as_me:5594: \$? = $ac_status" >&5
5595   (exit "$ac_status"); }; }; then
5596   cf_XOPEN_SOURCE_set=yes
5597 else
5598   echo "$as_me: failed program was:" >&5
5599 cat "conftest.$ac_ext" >&5
5600 cf_XOPEN_SOURCE_set=no
5601 fi
5602 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5603         echo "$as_me:5603: result: $cf_XOPEN_SOURCE_set" >&5
5604 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5605         if test "$cf_XOPEN_SOURCE_set" = yes
5606         then
5607                 cat >"conftest.$ac_ext" <<_ACEOF
5608 #line 5608 "configure"
5609 #include "confdefs.h"
5610 #include <stdlib.h>
5611 int
5612 main (void)
5613 {
5614
5615 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5616 make an error
5617 #endif
5618   ;
5619   return 0;
5620 }
5621 _ACEOF
5622 rm -f "conftest.$ac_objext"
5623 if { (eval echo "$as_me:5623: \"$ac_compile\"") >&5
5624   (eval $ac_compile) 2>&5
5625   ac_status=$?
5626   echo "$as_me:5626: \$? = $ac_status" >&5
5627   (exit "$ac_status"); } &&
5628          { ac_try='test -s "conftest.$ac_objext"'
5629   { (eval echo "$as_me:5629: \"$ac_try\"") >&5
5630   (eval $ac_try) 2>&5
5631   ac_status=$?
5632   echo "$as_me:5632: \$? = $ac_status" >&5
5633   (exit "$ac_status"); }; }; then
5634   cf_XOPEN_SOURCE_set_ok=yes
5635 else
5636   echo "$as_me: failed program was:" >&5
5637 cat "conftest.$ac_ext" >&5
5638 cf_XOPEN_SOURCE_set_ok=no
5639 fi
5640 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5641                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5642                 then
5643                         { echo "$as_me:5643: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5644 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5645                 fi
5646         else
5647
5648 echo "$as_me:5648: checking if we should define _XOPEN_SOURCE" >&5
5649 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5650 if test "${cf_cv_xopen_source+set}" = set; then
5651   echo $ECHO_N "(cached) $ECHO_C" >&6
5652 else
5653
5654         cat >"conftest.$ac_ext" <<_ACEOF
5655 #line 5655 "configure"
5656 #include "confdefs.h"
5657
5658 #include <stdlib.h>
5659 #include <string.h>
5660 #include <sys/types.h>
5661
5662 int
5663 main (void)
5664 {
5665
5666 #ifndef _XOPEN_SOURCE
5667 make an error
5668 #endif
5669
5670   ;
5671   return 0;
5672 }
5673 _ACEOF
5674 rm -f "conftest.$ac_objext"
5675 if { (eval echo "$as_me:5675: \"$ac_compile\"") >&5
5676   (eval $ac_compile) 2>&5
5677   ac_status=$?
5678   echo "$as_me:5678: \$? = $ac_status" >&5
5679   (exit "$ac_status"); } &&
5680          { ac_try='test -s "conftest.$ac_objext"'
5681   { (eval echo "$as_me:5681: \"$ac_try\"") >&5
5682   (eval $ac_try) 2>&5
5683   ac_status=$?
5684   echo "$as_me:5684: \$? = $ac_status" >&5
5685   (exit "$ac_status"); }; }; then
5686   cf_cv_xopen_source=no
5687 else
5688   echo "$as_me: failed program was:" >&5
5689 cat "conftest.$ac_ext" >&5
5690 cf_save="$CPPFLAGS"
5691
5692         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5693         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5694
5695          cat >"conftest.$ac_ext" <<_ACEOF
5696 #line 5696 "configure"
5697 #include "confdefs.h"
5698
5699 #include <stdlib.h>
5700 #include <string.h>
5701 #include <sys/types.h>
5702
5703 int
5704 main (void)
5705 {
5706
5707 #ifndef _XOPEN_SOURCE
5708 make an error
5709 #endif
5710
5711   ;
5712   return 0;
5713 }
5714 _ACEOF
5715 rm -f "conftest.$ac_objext"
5716 if { (eval echo "$as_me:5716: \"$ac_compile\"") >&5
5717   (eval $ac_compile) 2>&5
5718   ac_status=$?
5719   echo "$as_me:5719: \$? = $ac_status" >&5
5720   (exit "$ac_status"); } &&
5721          { ac_try='test -s "conftest.$ac_objext"'
5722   { (eval echo "$as_me:5722: \"$ac_try\"") >&5
5723   (eval $ac_try) 2>&5
5724   ac_status=$?
5725   echo "$as_me:5725: \$? = $ac_status" >&5
5726   (exit "$ac_status"); }; }; then
5727   cf_cv_xopen_source=no
5728 else
5729   echo "$as_me: failed program was:" >&5
5730 cat "conftest.$ac_ext" >&5
5731 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5732 fi
5733 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5734                 CPPFLAGS="$cf_save"
5735
5736 fi
5737 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5738
5739 fi
5740 echo "$as_me:5740: result: $cf_cv_xopen_source" >&5
5741 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5742
5743 if test "$cf_cv_xopen_source" != no ; then
5744
5745 CFLAGS=`echo "$CFLAGS" | \
5746         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5747                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5748
5749 CPPFLAGS=`echo "$CPPFLAGS" | \
5750         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5751                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5752
5753         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5754
5755 for cf_add_cflags in $cf_temp_xopen_source
5756 do
5757         case "x$cf_add_cflags" in
5758         (x-[DU]*)
5759
5760 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5761 while true
5762 do
5763         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'`
5764         test "$CFLAGS" != "$cf_old_cflag" || break
5765
5766         CFLAGS="$cf_old_cflag"
5767 done
5768
5769 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5770 while true
5771 do
5772         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'`
5773         test "$CPPFLAGS" != "$cf_old_cflag" || break
5774
5775         CPPFLAGS="$cf_old_cflag"
5776 done
5777
5778                 ;;
5779         esac
5780
5781 cf_fix_cppflags=no
5782 cf_new_cflags=
5783 cf_new_cppflags=
5784 cf_new_extra_cppflags=
5785
5786 for cf_add_cflags in $cf_add_cflags
5787 do
5788 case "$cf_fix_cppflags" in
5789 (no)
5790         case "$cf_add_cflags" in
5791         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5792                 case "$cf_add_cflags" in
5793                 (-D*)
5794                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5795
5796                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5797                                 && test -z "${cf_tst_cflags}" \
5798                                 && cf_fix_cppflags=yes
5799
5800                         if test "$cf_fix_cppflags" = yes ; then
5801
5802         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5803         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5804
5805                                 continue
5806                         elif test "${cf_tst_cflags}" = "\"'" ; then
5807
5808         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5809         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5810
5811                                 continue
5812                         fi
5813                         ;;
5814                 esac
5815                 case "$CPPFLAGS" in
5816                 (*$cf_add_cflags)
5817                         ;;
5818                 (*)
5819                         case "$cf_add_cflags" in
5820                         (-D*)
5821                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5822
5823 CPPFLAGS=`echo "$CPPFLAGS" | \
5824         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5825                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5826
5827                                 ;;
5828                         esac
5829
5830         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5831         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5832
5833                         ;;
5834                 esac
5835                 ;;
5836         (*)
5837
5838         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5839         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5840
5841                 ;;
5842         esac
5843         ;;
5844 (yes)
5845
5846         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5847         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5848
5849         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5850
5851         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5852                 && test -z "${cf_tst_cflags}" \
5853                 && cf_fix_cppflags=no
5854         ;;
5855 esac
5856 done
5857
5858 if test -n "$cf_new_cflags" ; then
5859
5860         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5861         CFLAGS="${CFLAGS}$cf_new_cflags"
5862
5863 fi
5864
5865 if test -n "$cf_new_cppflags" ; then
5866
5867         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5868         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5869
5870 fi
5871
5872 if test -n "$cf_new_extra_cppflags" ; then
5873
5874         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5875         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5876
5877 fi
5878
5879 done
5880
5881 fi
5882
5883         fi
5884 fi
5885 fi # cf_cv_posix_visible
5886
5887 echo "$as_me:5887: checking for signal global datatype" >&5
5888 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5889 if test "${cf_cv_sig_atomic_t+set}" = set; then
5890   echo $ECHO_N "(cached) $ECHO_C" >&6
5891 else
5892
5893         for cf_type in \
5894                 "volatile sig_atomic_t" \
5895                 "sig_atomic_t" \
5896                 "int"
5897         do
5898         cat >"conftest.$ac_ext" <<_ACEOF
5899 #line 5899 "configure"
5900 #include "confdefs.h"
5901
5902 #include <sys/types.h>
5903 #include <signal.h>
5904 #include <stdio.h>
5905
5906 extern $cf_type x;
5907 $cf_type x;
5908 static void handler(int sig)
5909 {
5910         (void)sig;
5911         x = 5;
5912 }
5913 int
5914 main (void)
5915 {
5916 signal(SIGINT, handler);
5917                  x = 1
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_sig_atomic_t=$cf_type
5935 else
5936   echo "$as_me: failed program was:" >&5
5937 cat "conftest.$ac_ext" >&5
5938 cf_cv_sig_atomic_t=no
5939 fi
5940 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5941                 test "$cf_cv_sig_atomic_t" != no && break
5942         done
5943
5944 fi
5945
5946 echo "$as_me:5946: result: $cf_cv_sig_atomic_t" >&5
5947 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5948 test "$cf_cv_sig_atomic_t" != no &&
5949 cat >>confdefs.h <<EOF
5950 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5951 EOF
5952
5953 # Work around breakage on OS X
5954
5955 echo "$as_me:5955: checking if SIGWINCH is defined" >&5
5956 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5957 if test "${cf_cv_define_sigwinch+set}" = set; then
5958   echo $ECHO_N "(cached) $ECHO_C" >&6
5959 else
5960
5961         cat >"conftest.$ac_ext" <<_ACEOF
5962 #line 5962 "configure"
5963 #include "confdefs.h"
5964
5965 #include <sys/types.h>
5966 #include <sys/signal.h>
5967
5968 int
5969 main (void)
5970 {
5971 int x = SIGWINCH; (void)x
5972   ;
5973   return 0;
5974 }
5975 _ACEOF
5976 rm -f "conftest.$ac_objext"
5977 if { (eval echo "$as_me:5977: \"$ac_compile\"") >&5
5978   (eval $ac_compile) 2>&5
5979   ac_status=$?
5980   echo "$as_me:5980: \$? = $ac_status" >&5
5981   (exit "$ac_status"); } &&
5982          { ac_try='test -s "conftest.$ac_objext"'
5983   { (eval echo "$as_me:5983: \"$ac_try\"") >&5
5984   (eval $ac_try) 2>&5
5985   ac_status=$?
5986   echo "$as_me:5986: \$? = $ac_status" >&5
5987   (exit "$ac_status"); }; }; then
5988   cf_cv_define_sigwinch=yes
5989 else
5990   echo "$as_me: failed program was:" >&5
5991 cat "conftest.$ac_ext" >&5
5992 cat >"conftest.$ac_ext" <<_ACEOF
5993 #line 5993 "configure"
5994 #include "confdefs.h"
5995
5996 #undef _XOPEN_SOURCE
5997 #undef _POSIX_SOURCE
5998 #undef _POSIX_C_SOURCE
5999 #include <sys/types.h>
6000 #include <sys/signal.h>
6001
6002 int
6003 main (void)
6004 {
6005 int x = SIGWINCH; (void)x
6006   ;
6007   return 0;
6008 }
6009 _ACEOF
6010 rm -f "conftest.$ac_objext"
6011 if { (eval echo "$as_me:6011: \"$ac_compile\"") >&5
6012   (eval $ac_compile) 2>&5
6013   ac_status=$?
6014   echo "$as_me:6014: \$? = $ac_status" >&5
6015   (exit "$ac_status"); } &&
6016          { ac_try='test -s "conftest.$ac_objext"'
6017   { (eval echo "$as_me:6017: \"$ac_try\"") >&5
6018   (eval $ac_try) 2>&5
6019   ac_status=$?
6020   echo "$as_me:6020: \$? = $ac_status" >&5
6021   (exit "$ac_status"); }; }; then
6022   cf_cv_define_sigwinch=maybe
6023 else
6024   echo "$as_me: failed program was:" >&5
6025 cat "conftest.$ac_ext" >&5
6026 cf_cv_define_sigwinch=no
6027 fi
6028 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6029
6030 fi
6031 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6032
6033 fi
6034 echo "$as_me:6034: result: $cf_cv_define_sigwinch" >&5
6035 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
6036
6037 if test "$cf_cv_define_sigwinch" = maybe ; then
6038 echo "$as_me:6038: checking for actual SIGWINCH definition" >&5
6039 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
6040 if test "${cf_cv_fixup_sigwinch+set}" = set; then
6041   echo $ECHO_N "(cached) $ECHO_C" >&6
6042 else
6043
6044 cf_cv_fixup_sigwinch=unknown
6045 cf_sigwinch=32
6046 while test "$cf_sigwinch" != 1
6047 do
6048         cat >"conftest.$ac_ext" <<_ACEOF
6049 #line 6049 "configure"
6050 #include "confdefs.h"
6051
6052 #undef _XOPEN_SOURCE
6053 #undef _POSIX_SOURCE
6054 #undef _POSIX_C_SOURCE
6055 #include <sys/types.h>
6056 #include <sys/signal.h>
6057
6058 int
6059 main (void)
6060 {
6061
6062 #if SIGWINCH != $cf_sigwinch
6063 make an error
6064 #endif
6065 int x = SIGWINCH; (void)x
6066   ;
6067   return 0;
6068 }
6069 _ACEOF
6070 rm -f "conftest.$ac_objext"
6071 if { (eval echo "$as_me:6071: \"$ac_compile\"") >&5
6072   (eval $ac_compile) 2>&5
6073   ac_status=$?
6074   echo "$as_me:6074: \$? = $ac_status" >&5
6075   (exit "$ac_status"); } &&
6076          { ac_try='test -s "conftest.$ac_objext"'
6077   { (eval echo "$as_me:6077: \"$ac_try\"") >&5
6078   (eval $ac_try) 2>&5
6079   ac_status=$?
6080   echo "$as_me:6080: \$? = $ac_status" >&5
6081   (exit "$ac_status"); }; }; then
6082   cf_cv_fixup_sigwinch=$cf_sigwinch
6083          break
6084 else
6085   echo "$as_me: failed program was:" >&5
6086 cat "conftest.$ac_ext" >&5
6087 fi
6088 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6089
6090 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
6091 done
6092
6093 fi
6094 echo "$as_me:6094: result: $cf_cv_fixup_sigwinch" >&5
6095 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
6096
6097         if test "$cf_cv_fixup_sigwinch" != unknown ; then
6098                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
6099         fi
6100 fi
6101
6102 # Checks for CODESET support.
6103
6104 echo "$as_me:6104: checking for nl_langinfo and CODESET" >&5
6105 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
6106 if test "${am_cv_langinfo_codeset+set}" = set; then
6107   echo $ECHO_N "(cached) $ECHO_C" >&6
6108 else
6109   cat >"conftest.$ac_ext" <<_ACEOF
6110 #line 6110 "configure"
6111 #include "confdefs.h"
6112
6113 $ac_includes_default
6114 #include <langinfo.h>
6115 int
6116 main (void)
6117 {
6118 char* cs = nl_langinfo(CODESET); (void)cs
6119   ;
6120   return 0;
6121 }
6122 _ACEOF
6123 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6124 if { (eval echo "$as_me:6124: \"$ac_link\"") >&5
6125   (eval $ac_link) 2>&5
6126   ac_status=$?
6127   echo "$as_me:6127: \$? = $ac_status" >&5
6128   (exit "$ac_status"); } &&
6129          { ac_try='test -s "conftest$ac_exeext"'
6130   { (eval echo "$as_me:6130: \"$ac_try\"") >&5
6131   (eval $ac_try) 2>&5
6132   ac_status=$?
6133   echo "$as_me:6133: \$? = $ac_status" >&5
6134   (exit "$ac_status"); }; }; then
6135   am_cv_langinfo_codeset=yes
6136 else
6137   echo "$as_me: failed program was:" >&5
6138 cat "conftest.$ac_ext" >&5
6139 am_cv_langinfo_codeset=no
6140 fi
6141 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6142
6143 fi
6144 echo "$as_me:6144: result: $am_cv_langinfo_codeset" >&5
6145 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
6146         if test "$am_cv_langinfo_codeset" = yes; then
6147
6148 cat >>confdefs.h <<\EOF
6149 #define HAVE_LANGINFO_CODESET 1
6150 EOF
6151
6152         fi
6153
6154 echo "$as_me:6154: checking if you want to use pkg-config" >&5
6155 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
6156
6157 # Check whether --with-pkg-config or --without-pkg-config was given.
6158 if test "${with_pkg_config+set}" = set; then
6159   withval="$with_pkg_config"
6160   cf_pkg_config=$withval
6161 else
6162   cf_pkg_config=yes
6163 fi;
6164 echo "$as_me:6164: result: $cf_pkg_config" >&5
6165 echo "${ECHO_T}$cf_pkg_config" >&6
6166
6167 case "$cf_pkg_config" in
6168 (no)
6169         PKG_CONFIG=none
6170         ;;
6171 (yes)
6172
6173 if test -n "$ac_tool_prefix"; then
6174   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
6175 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
6176 echo "$as_me:6176: checking for $ac_word" >&5
6177 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6178 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
6179   echo $ECHO_N "(cached) $ECHO_C" >&6
6180 else
6181   case $PKG_CONFIG in
6182   [\\/]* | ?:[\\/]*)
6183   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
6184   ;;
6185   *)
6186   ac_save_IFS=$IFS; IFS=$ac_path_separator
6187 ac_dummy="$PATH"
6188 for ac_dir in $ac_dummy; do
6189   IFS=$ac_save_IFS
6190   test -z "$ac_dir" && ac_dir=.
6191   if $as_executable_p "$ac_dir/$ac_word"; then
6192    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
6193    echo "$as_me:6193: found $ac_dir/$ac_word" >&5
6194    break
6195 fi
6196 done
6197
6198   ;;
6199 esac
6200 fi
6201 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
6202
6203 if test -n "$PKG_CONFIG"; then
6204   echo "$as_me:6204: result: $PKG_CONFIG" >&5
6205 echo "${ECHO_T}$PKG_CONFIG" >&6
6206 else
6207   echo "$as_me:6207: result: no" >&5
6208 echo "${ECHO_T}no" >&6
6209 fi
6210
6211 fi
6212 if test -z "$ac_cv_path_PKG_CONFIG"; then
6213   ac_pt_PKG_CONFIG=$PKG_CONFIG
6214   # Extract the first word of "pkg-config", so it can be a program name with args.
6215 set dummy pkg-config; ac_word=$2
6216 echo "$as_me:6216: checking for $ac_word" >&5
6217 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6218 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
6219   echo $ECHO_N "(cached) $ECHO_C" >&6
6220 else
6221   case $ac_pt_PKG_CONFIG in
6222   [\\/]* | ?:[\\/]*)
6223   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
6224   ;;
6225   *)
6226   ac_save_IFS=$IFS; IFS=$ac_path_separator
6227 ac_dummy="$PATH"
6228 for ac_dir in $ac_dummy; do
6229   IFS=$ac_save_IFS
6230   test -z "$ac_dir" && ac_dir=.
6231   if $as_executable_p "$ac_dir/$ac_word"; then
6232    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
6233    echo "$as_me:6233: found $ac_dir/$ac_word" >&5
6234    break
6235 fi
6236 done
6237
6238   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
6239   ;;
6240 esac
6241 fi
6242 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6243
6244 if test -n "$ac_pt_PKG_CONFIG"; then
6245   echo "$as_me:6245: result: $ac_pt_PKG_CONFIG" >&5
6246 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
6247 else
6248   echo "$as_me:6248: result: no" >&5
6249 echo "${ECHO_T}no" >&6
6250 fi
6251
6252   PKG_CONFIG=$ac_pt_PKG_CONFIG
6253 else
6254   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
6255 fi
6256
6257         ;;
6258 (*)
6259         PKG_CONFIG=$withval
6260         ;;
6261 esac
6262
6263 test -z "$PKG_CONFIG" && PKG_CONFIG=none
6264 if test "$PKG_CONFIG" != none ; then
6265
6266 if test "x$prefix" != xNONE; then
6267         cf_path_syntax="$prefix"
6268 else
6269         cf_path_syntax="$ac_default_prefix"
6270 fi
6271
6272 case ".$PKG_CONFIG" in
6273 (.\$\(*\)*|.\'*\'*)
6274         ;;
6275 (..|./*|.\\*)
6276         ;;
6277 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6278         ;;
6279 (.\$\{*prefix\}*|.\$\{*dir\}*)
6280         eval PKG_CONFIG="$PKG_CONFIG"
6281         case ".$PKG_CONFIG" in
6282         (.NONE/*)
6283                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6284                 ;;
6285         esac
6286         ;;
6287 (.no|.NONE/*)
6288         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6289         ;;
6290 (*)
6291         { { echo "$as_me:6291: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6292 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6293    { (exit 1); exit 1; }; }
6294         ;;
6295 esac
6296
6297 elif test "x$cf_pkg_config" != xno ; then
6298         { echo "$as_me:6298: WARNING: pkg-config is not installed" >&5
6299 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6300 fi
6301
6302 echo "$as_me:6302: checking if you want to see long compiling messages" >&5
6303 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6304
6305 # Check whether --enable-echo or --disable-echo was given.
6306 if test "${enable_echo+set}" = set; then
6307   enableval="$enable_echo"
6308   test "$enableval" != no && enableval=yes
6309         if test "$enableval" != "yes" ; then
6310
6311         ECHO_LT='--silent'
6312         ECHO_LD='@echo linking $@;'
6313         RULE_CC='@echo compiling $<'
6314         SHOW_CC='@echo compiling $@'
6315         ECHO_CC='@'
6316
6317         else
6318
6319         ECHO_LT=''
6320         ECHO_LD=''
6321         RULE_CC=''
6322         SHOW_CC=''
6323         ECHO_CC=''
6324
6325         fi
6326 else
6327   enableval=yes
6328
6329         ECHO_LT=''
6330         ECHO_LD=''
6331         RULE_CC=''
6332         SHOW_CC=''
6333         ECHO_CC=''
6334
6335 fi;
6336 echo "$as_me:6336: result: $enableval" >&5
6337 echo "${ECHO_T}$enableval" >&6
6338
6339 echo "$as_me:6339: checking for ncurses wrap-prefix" >&5
6340 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6341
6342 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6343 if test "${with_ncurses_wrap_prefix+set}" = set; then
6344   withval="$with_ncurses_wrap_prefix"
6345   NCURSES_WRAP_PREFIX=$withval
6346 else
6347   NCURSES_WRAP_PREFIX=_nc_
6348 fi;
6349 echo "$as_me:6349: result: $NCURSES_WRAP_PREFIX" >&5
6350 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6351
6352 echo "$as_me:6352: checking if you want to check for wide-character functions" >&5
6353 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6354
6355 # Check whether --enable-widec or --disable-widec was given.
6356 if test "${enable_widec+set}" = set; then
6357   enableval="$enable_widec"
6358   test "$enableval" != no && enableval=yes
6359         if test "$enableval" != "yes" ; then
6360     cf_enable_widec=no
6361         else
6362                 cf_enable_widec=yes
6363         fi
6364 else
6365   enableval=yes
6366         cf_enable_widec=yes
6367
6368 fi;
6369 echo "$as_me:6369: result: $cf_enable_widec" >&5
6370 echo "${ECHO_T}$cf_enable_widec" >&6
6371
6372 echo "$as_me:6372: checking for specific curses-directory" >&5
6373 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6374
6375 # Check whether --with-curses-dir or --without-curses-dir was given.
6376 if test "${with_curses_dir+set}" = set; then
6377   withval="$with_curses_dir"
6378   cf_cv_curses_dir=$withval
6379 else
6380   cf_cv_curses_dir=no
6381 fi;
6382 echo "$as_me:6382: result: $cf_cv_curses_dir" >&5
6383 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6384
6385 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6386 then
6387
6388 if test "x$prefix" != xNONE; then
6389         cf_path_syntax="$prefix"
6390 else
6391         cf_path_syntax="$ac_default_prefix"
6392 fi
6393
6394 case ".$withval" in
6395 (.\$\(*\)*|.\'*\'*)
6396         ;;
6397 (..|./*|.\\*)
6398         ;;
6399 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6400         ;;
6401 (.\$\{*prefix\}*|.\$\{*dir\}*)
6402         eval withval="$withval"
6403         case ".$withval" in
6404         (.NONE/*)
6405                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6406                 ;;
6407         esac
6408         ;;
6409 (.no|.NONE/*)
6410         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6411         ;;
6412 (*)
6413         { { echo "$as_me:6413: error: expected a pathname, not \"$withval\"" >&5
6414 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6415    { (exit 1); exit 1; }; }
6416         ;;
6417 esac
6418
6419         if test -d "$cf_cv_curses_dir"
6420         then
6421
6422 if test -n "$cf_cv_curses_dir/include" ; then
6423   for cf_add_incdir in $cf_cv_curses_dir/include
6424   do
6425         while test "$cf_add_incdir" != /usr/include
6426         do
6427           if test -d "$cf_add_incdir"
6428           then
6429                 cf_have_incdir=no
6430                 if test -n "$CFLAGS$CPPFLAGS" ; then
6431                   # a loop is needed to ensure we can add subdirs of existing dirs
6432                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6433                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6434                           cf_have_incdir=yes; break
6435                         fi
6436                   done
6437                 fi
6438
6439                 if test "$cf_have_incdir" = no ; then
6440                   if test "$cf_add_incdir" = /usr/local/include ; then
6441                         if test "$GCC" = yes
6442                         then
6443                           cf_save_CPPFLAGS=$CPPFLAGS
6444
6445         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6446         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6447
6448                           cat >"conftest.$ac_ext" <<_ACEOF
6449 #line 6449 "configure"
6450 #include "confdefs.h"
6451 #include <stdio.h>
6452 int
6453 main (void)
6454 {
6455 printf("Hello")
6456   ;
6457   return 0;
6458 }
6459 _ACEOF
6460 rm -f "conftest.$ac_objext"
6461 if { (eval echo "$as_me:6461: \"$ac_compile\"") >&5
6462   (eval $ac_compile) 2>&5
6463   ac_status=$?
6464   echo "$as_me:6464: \$? = $ac_status" >&5
6465   (exit "$ac_status"); } &&
6466          { ac_try='test -s "conftest.$ac_objext"'
6467   { (eval echo "$as_me:6467: \"$ac_try\"") >&5
6468   (eval $ac_try) 2>&5
6469   ac_status=$?
6470   echo "$as_me:6470: \$? = $ac_status" >&5
6471   (exit "$ac_status"); }; }; then
6472   :
6473 else
6474   echo "$as_me: failed program was:" >&5
6475 cat "conftest.$ac_ext" >&5
6476 cf_have_incdir=yes
6477 fi
6478 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6479                           CPPFLAGS=$cf_save_CPPFLAGS
6480                         fi
6481                   fi
6482                 fi
6483
6484                 if test "$cf_have_incdir" = no ; then
6485                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6486
6487 echo "${as_me:-configure}:6487: testing adding $cf_add_incdir to include-path ..." 1>&5
6488
6489                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6490
6491                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6492                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6493                   cf_add_incdir="$cf_top_incdir"
6494                 else
6495                   break
6496                 fi
6497           else
6498                 break
6499           fi
6500         done
6501   done
6502 fi
6503
6504 if test -n "$cf_cv_curses_dir/lib" ; then
6505         for cf_add_libdir in $cf_cv_curses_dir/lib
6506         do
6507                 if test "$cf_add_libdir" = /usr/lib ; then
6508                         :
6509                 elif test -d "$cf_add_libdir"
6510                 then
6511                         cf_have_libdir=no
6512                         if test -n "$LDFLAGS$LIBS" ; then
6513                                 # a loop is needed to ensure we can add subdirs of existing dirs
6514                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6515                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6516                                                 cf_have_libdir=yes; break
6517                                         fi
6518                                 done
6519                         fi
6520                         if test "$cf_have_libdir" = no ; then
6521                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6522
6523 echo "${as_me:-configure}:6523: testing adding $cf_add_libdir to library-path ..." 1>&5
6524
6525                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6526                         fi
6527                 fi
6528         done
6529 fi
6530
6531         fi
6532 fi
6533
6534 cf_cv_screen=curses
6535
6536 echo "$as_me:6536: checking for specified curses library type" >&5
6537 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6538
6539 # Check whether --with-screen or --without-screen was given.
6540 if test "${with_screen+set}" = set; then
6541   withval="$with_screen"
6542   cf_cv_screen=$withval
6543 else
6544
6545 # Check whether --with-ncursesw or --without-ncursesw was given.
6546 if test "${with_ncursesw+set}" = set; then
6547   withval="$with_ncursesw"
6548   cf_cv_screen=ncursesw
6549 else
6550
6551 # Check whether --with-ncurses or --without-ncurses was given.
6552 if test "${with_ncurses+set}" = set; then
6553   withval="$with_ncurses"
6554   cf_cv_screen=ncurses
6555 else
6556
6557 # Check whether --with-pdcurses or --without-pdcurses was given.
6558 if test "${with_pdcurses+set}" = set; then
6559   withval="$with_pdcurses"
6560   cf_cv_screen=pdcurses
6561 else
6562
6563 # Check whether --with-curses-colr or --without-curses-colr was given.
6564 if test "${with_curses_colr+set}" = set; then
6565   withval="$with_curses_colr"
6566   cf_cv_screen=curses_colr
6567 else
6568
6569 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6570 if test "${with_curses_5lib+set}" = set; then
6571   withval="$with_curses_5lib"
6572   cf_cv_screen=curses_5lib
6573 fi;
6574 fi;
6575 fi;
6576 fi;
6577 fi;
6578 fi;
6579
6580 echo "$as_me:6580: result: $cf_cv_screen" >&5
6581 echo "${ECHO_T}$cf_cv_screen" >&6
6582
6583 case $cf_cv_screen in
6584 (curses|curses_*)
6585
6586 echo "$as_me:6586: checking for extra include directories" >&5
6587 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6588 if test "${cf_cv_curses_incdir+set}" = set; then
6589   echo $ECHO_N "(cached) $ECHO_C" >&6
6590 else
6591
6592 cf_cv_curses_incdir=no
6593 case "$host_os" in
6594 (hpux10.*)
6595         if test "x$cf_cv_screen" = "xcurses_colr"
6596         then
6597                 test -d /usr/include/curses_colr && \
6598                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6599         fi
6600         ;;
6601 (sunos3*|sunos4*)
6602         if test "x$cf_cv_screen" = "xcurses_5lib"
6603         then
6604                 test -d /usr/5lib && \
6605                 test -d /usr/5include && \
6606                 cf_cv_curses_incdir="-I/usr/5include"
6607         fi
6608         ;;
6609 esac
6610
6611 fi
6612 echo "$as_me:6612: result: $cf_cv_curses_incdir" >&5
6613 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6614 if test "$cf_cv_curses_incdir" != no
6615 then
6616
6617         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6618         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6619
6620 fi
6621
6622 echo "$as_me:6622: checking if we have identified curses headers" >&5
6623 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6624 if test "${cf_cv_ncurses_header+set}" = set; then
6625   echo $ECHO_N "(cached) $ECHO_C" >&6
6626 else
6627
6628 cf_cv_ncurses_header=none
6629 for cf_header in \
6630         ncurses.h  \
6631         curses.h  ncurses/ncurses.h ncurses/curses.h
6632 do
6633 cat >"conftest.$ac_ext" <<_ACEOF
6634 #line 6634 "configure"
6635 #include "confdefs.h"
6636 #include <${cf_header}>
6637 int
6638 main (void)
6639 {
6640 initscr(); endwin()
6641   ;
6642   return 0;
6643 }
6644 _ACEOF
6645 rm -f "conftest.$ac_objext"
6646 if { (eval echo "$as_me:6646: \"$ac_compile\"") >&5
6647   (eval $ac_compile) 2>&5
6648   ac_status=$?
6649   echo "$as_me:6649: \$? = $ac_status" >&5
6650   (exit "$ac_status"); } &&
6651          { ac_try='test -s "conftest.$ac_objext"'
6652   { (eval echo "$as_me:6652: \"$ac_try\"") >&5
6653   (eval $ac_try) 2>&5
6654   ac_status=$?
6655   echo "$as_me:6655: \$? = $ac_status" >&5
6656   (exit "$ac_status"); }; }; then
6657   cf_cv_ncurses_header=$cf_header; break
6658 else
6659   echo "$as_me: failed program was:" >&5
6660 cat "conftest.$ac_ext" >&5
6661 fi
6662 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6663 done
6664
6665 fi
6666 echo "$as_me:6666: result: $cf_cv_ncurses_header" >&5
6667 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6668
6669 if test "$cf_cv_ncurses_header" = none ; then
6670         { { echo "$as_me:6670: error: No curses header-files found" >&5
6671 echo "$as_me: error: No curses header-files found" >&2;}
6672    { (exit 1); exit 1; }; }
6673 fi
6674
6675 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6676
6677 for ac_header in $cf_cv_ncurses_header
6678 do
6679 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6680 echo "$as_me:6680: checking for $ac_header" >&5
6681 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6682 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6683   echo $ECHO_N "(cached) $ECHO_C" >&6
6684 else
6685   cat >"conftest.$ac_ext" <<_ACEOF
6686 #line 6686 "configure"
6687 #include "confdefs.h"
6688 #include <$ac_header>
6689 _ACEOF
6690 if { (eval echo "$as_me:6690: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6691   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6692   ac_status=$?
6693   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6694   rm -f conftest.er1
6695   cat conftest.err >&5
6696   echo "$as_me:6696: \$? = $ac_status" >&5
6697   (exit "$ac_status"); } >/dev/null; then
6698   if test -s conftest.err; then
6699     ac_cpp_err=$ac_c_preproc_warn_flag
6700   else
6701     ac_cpp_err=
6702   fi
6703 else
6704   ac_cpp_err=yes
6705 fi
6706 if test -z "$ac_cpp_err"; then
6707   eval "$as_ac_Header=yes"
6708 else
6709   echo "$as_me: failed program was:" >&5
6710   cat "conftest.$ac_ext" >&5
6711   eval "$as_ac_Header=no"
6712 fi
6713 rm -f conftest.err "conftest.$ac_ext"
6714 fi
6715 echo "$as_me:6715: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6716 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6717 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6718   cat >>confdefs.h <<EOF
6719 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6720 EOF
6721
6722 fi
6723 done
6724
6725 echo "$as_me:6725: checking for terminfo header" >&5
6726 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6727 if test "${cf_cv_term_header+set}" = set; then
6728   echo $ECHO_N "(cached) $ECHO_C" >&6
6729 else
6730
6731 case "${cf_cv_ncurses_header}" in
6732 (*/ncurses.h|*/ncursesw.h)
6733         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6734         ;;
6735 (*)
6736         cf_term_header=term.h
6737         ;;
6738 esac
6739
6740 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6741 do
6742 cat >"conftest.$ac_ext" <<_ACEOF
6743 #line 6743 "configure"
6744 #include "confdefs.h"
6745 #include <stdio.h>
6746 #include <${cf_cv_ncurses_header:-curses.h}>
6747 #include <$cf_test>
6748
6749 int
6750 main (void)
6751 {
6752 int x = auto_left_margin; (void)x
6753   ;
6754   return 0;
6755 }
6756 _ACEOF
6757 rm -f "conftest.$ac_objext"
6758 if { (eval echo "$as_me:6758: \"$ac_compile\"") >&5
6759   (eval $ac_compile) 2>&5
6760   ac_status=$?
6761   echo "$as_me:6761: \$? = $ac_status" >&5
6762   (exit "$ac_status"); } &&
6763          { ac_try='test -s "conftest.$ac_objext"'
6764   { (eval echo "$as_me:6764: \"$ac_try\"") >&5
6765   (eval $ac_try) 2>&5
6766   ac_status=$?
6767   echo "$as_me:6767: \$? = $ac_status" >&5
6768   (exit "$ac_status"); }; }; then
6769
6770         cf_cv_term_header="$cf_test"
6771 else
6772   echo "$as_me: failed program was:" >&5
6773 cat "conftest.$ac_ext" >&5
6774
6775         cf_cv_term_header=unknown
6776
6777 fi
6778 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6779         test "$cf_cv_term_header" != unknown && break
6780 done
6781
6782 fi
6783 echo "$as_me:6783: result: $cf_cv_term_header" >&5
6784 echo "${ECHO_T}$cf_cv_term_header" >&6
6785
6786 # Set definitions to allow ifdef'ing to accommodate subdirectories
6787
6788 case "$cf_cv_term_header" in
6789 (*term.h)
6790
6791 cat >>confdefs.h <<\EOF
6792 #define HAVE_TERM_H 1
6793 EOF
6794
6795         ;;
6796 esac
6797
6798 case "$cf_cv_term_header" in
6799 (ncurses/term.h)
6800
6801 cat >>confdefs.h <<\EOF
6802 #define HAVE_NCURSES_TERM_H 1
6803 EOF
6804
6805         ;;
6806 (ncursesw/term.h)
6807
6808 cat >>confdefs.h <<\EOF
6809 #define HAVE_NCURSESW_TERM_H 1
6810 EOF
6811
6812         ;;
6813 esac
6814
6815 echo "$as_me:6815: checking for ncurses version" >&5
6816 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6817 if test "${cf_cv_ncurses_version+set}" = set; then
6818   echo $ECHO_N "(cached) $ECHO_C" >&6
6819 else
6820
6821         cf_cv_ncurses_version=no
6822         cf_tempfile=out$$
6823         rm -f "$cf_tempfile"
6824         if test "$cross_compiling" = yes; then
6825
6826         # This will not work if the preprocessor splits the line after the
6827         # Autoconf token.  The 'unproto' program does that.
6828         cat > "conftest.$ac_ext" <<EOF
6829 #include <${cf_cv_ncurses_header:-curses.h}>
6830 #undef Autoconf
6831 #ifdef NCURSES_VERSION
6832 Autoconf NCURSES_VERSION
6833 #else
6834 #ifdef __NCURSES_H
6835 Autoconf "old"
6836 #endif
6837 ;
6838 #endif
6839 EOF
6840         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6841         { (eval echo "$as_me:6841: \"$cf_try\"") >&5
6842   (eval $cf_try) 2>&5
6843   ac_status=$?
6844   echo "$as_me:6844: \$? = $ac_status" >&5
6845   (exit "$ac_status"); }
6846         if test -f conftest.out ; then
6847                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6848                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6849                 rm -f conftest.out
6850         fi
6851
6852 else
6853   cat >"conftest.$ac_ext" <<_ACEOF
6854 #line 6854 "configure"
6855 #include "confdefs.h"
6856
6857 $ac_includes_default
6858
6859 #include <${cf_cv_ncurses_header:-curses.h}>
6860
6861 int main(void)
6862 {
6863         FILE *fp = fopen("$cf_tempfile", "w");
6864 #ifdef NCURSES_VERSION
6865 # ifdef NCURSES_VERSION_PATCH
6866         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6867 # else
6868         fprintf(fp, "%s\\n", NCURSES_VERSION);
6869 # endif
6870 #else
6871 # ifdef __NCURSES_H
6872         fprintf(fp, "old\\n");
6873 # else
6874         make an error
6875 # endif
6876 #endif
6877         ${cf_cv_main_return:-return}(0);
6878 }
6879 _ACEOF
6880 rm -f "conftest$ac_exeext"
6881 if { (eval echo "$as_me:6881: \"$ac_link\"") >&5
6882   (eval $ac_link) 2>&5
6883   ac_status=$?
6884   echo "$as_me:6884: \$? = $ac_status" >&5
6885   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6886   { (eval echo "$as_me:6886: \"$ac_try\"") >&5
6887   (eval $ac_try) 2>&5
6888   ac_status=$?
6889   echo "$as_me:6889: \$? = $ac_status" >&5
6890   (exit "$ac_status"); }; }; then
6891
6892         cf_cv_ncurses_version=`cat $cf_tempfile`
6893 else
6894   echo "$as_me: program exited with status $ac_status" >&5
6895 echo "$as_me: failed program was:" >&5
6896 cat "conftest.$ac_ext" >&5
6897 fi
6898 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6899 fi
6900         rm -f "$cf_tempfile"
6901
6902 fi
6903 echo "$as_me:6903: result: $cf_cv_ncurses_version" >&5
6904 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6905 test "$cf_cv_ncurses_version" = no ||
6906 cat >>confdefs.h <<\EOF
6907 #define NCURSES 1
6908 EOF
6909
6910 echo "$as_me:6910: checking if we have identified curses libraries" >&5
6911 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6912 cat >"conftest.$ac_ext" <<_ACEOF
6913 #line 6913 "configure"
6914 #include "confdefs.h"
6915 #include <${cf_cv_ncurses_header:-curses.h}>
6916 int
6917 main (void)
6918 {
6919 initscr(); endwin()
6920   ;
6921   return 0;
6922 }
6923 _ACEOF
6924 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6925 if { (eval echo "$as_me:6925: \"$ac_link\"") >&5
6926   (eval $ac_link) 2>&5
6927   ac_status=$?
6928   echo "$as_me:6928: \$? = $ac_status" >&5
6929   (exit "$ac_status"); } &&
6930          { ac_try='test -s "conftest$ac_exeext"'
6931   { (eval echo "$as_me:6931: \"$ac_try\"") >&5
6932   (eval $ac_try) 2>&5
6933   ac_status=$?
6934   echo "$as_me:6934: \$? = $ac_status" >&5
6935   (exit "$ac_status"); }; }; then
6936   cf_result=yes
6937 else
6938   echo "$as_me: failed program was:" >&5
6939 cat "conftest.$ac_ext" >&5
6940 cf_result=no
6941 fi
6942 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6943 echo "$as_me:6943: result: $cf_result" >&5
6944 echo "${ECHO_T}$cf_result" >&6
6945
6946 if test "$cf_result" = no ; then
6947 case "$host_os" in
6948 (freebsd*)
6949         echo "$as_me:6949: checking for tgoto in -lmytinfo" >&5
6950 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6951 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6952   echo $ECHO_N "(cached) $ECHO_C" >&6
6953 else
6954   ac_check_lib_save_LIBS=$LIBS
6955 LIBS="-lmytinfo  $LIBS"
6956 cat >"conftest.$ac_ext" <<_ACEOF
6957 #line 6957 "configure"
6958 #include "confdefs.h"
6959
6960 /* Override any gcc2 internal prototype to avoid an error.  */
6961 #ifdef __cplusplus
6962 extern "C"
6963 #endif
6964 /* We use char because int might match the return type of a gcc2
6965    builtin and then its argument prototype would still apply.  */
6966 char tgoto ();
6967 int
6968 main (void)
6969 {
6970 tgoto ();
6971   ;
6972   return 0;
6973 }
6974 _ACEOF
6975 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6976 if { (eval echo "$as_me:6976: \"$ac_link\"") >&5
6977   (eval $ac_link) 2>&5
6978   ac_status=$?
6979   echo "$as_me:6979: \$? = $ac_status" >&5
6980   (exit "$ac_status"); } &&
6981          { ac_try='test -s "conftest$ac_exeext"'
6982   { (eval echo "$as_me:6982: \"$ac_try\"") >&5
6983   (eval $ac_try) 2>&5
6984   ac_status=$?
6985   echo "$as_me:6985: \$? = $ac_status" >&5
6986   (exit "$ac_status"); }; }; then
6987   ac_cv_lib_mytinfo_tgoto=yes
6988 else
6989   echo "$as_me: failed program was:" >&5
6990 cat "conftest.$ac_ext" >&5
6991 ac_cv_lib_mytinfo_tgoto=no
6992 fi
6993 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6994 LIBS=$ac_check_lib_save_LIBS
6995 fi
6996 echo "$as_me:6996: result: $ac_cv_lib_mytinfo_tgoto" >&5
6997 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6998 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6999
7000 cf_add_libs="$LIBS"
7001 # reverse order
7002 cf_add_0lib=
7003 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7004 # filter duplicates
7005 for cf_add_1lib in $cf_add_0lib; do
7006         for cf_add_2lib in $cf_add_libs; do
7007                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7008                         cf_add_1lib=
7009                         break
7010                 fi
7011         done
7012         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7013 done
7014 LIBS="$cf_add_libs"
7015
7016 fi
7017
7018         ;;
7019 (hpux10.*)
7020         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
7021         # next (1998), and xcurses "newer" (2000).  There is no header file for
7022         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
7023         # term.h) for cur_colr
7024         if test "x$cf_cv_screen" = "xcurses_colr"
7025         then
7026                 echo "$as_me:7026: checking for initscr in -lcur_colr" >&5
7027 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
7028 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
7029   echo $ECHO_N "(cached) $ECHO_C" >&6
7030 else
7031   ac_check_lib_save_LIBS=$LIBS
7032 LIBS="-lcur_colr  $LIBS"
7033 cat >"conftest.$ac_ext" <<_ACEOF
7034 #line 7034 "configure"
7035 #include "confdefs.h"
7036
7037 /* Override any gcc2 internal prototype to avoid an error.  */
7038 #ifdef __cplusplus
7039 extern "C"
7040 #endif
7041 /* We use char because int might match the return type of a gcc2
7042    builtin and then its argument prototype would still apply.  */
7043 char initscr ();
7044 int
7045 main (void)
7046 {
7047 initscr ();
7048   ;
7049   return 0;
7050 }
7051 _ACEOF
7052 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7053 if { (eval echo "$as_me:7053: \"$ac_link\"") >&5
7054   (eval $ac_link) 2>&5
7055   ac_status=$?
7056   echo "$as_me:7056: \$? = $ac_status" >&5
7057   (exit "$ac_status"); } &&
7058          { ac_try='test -s "conftest$ac_exeext"'
7059   { (eval echo "$as_me:7059: \"$ac_try\"") >&5
7060   (eval $ac_try) 2>&5
7061   ac_status=$?
7062   echo "$as_me:7062: \$? = $ac_status" >&5
7063   (exit "$ac_status"); }; }; then
7064   ac_cv_lib_cur_colr_initscr=yes
7065 else
7066   echo "$as_me: failed program was:" >&5
7067 cat "conftest.$ac_ext" >&5
7068 ac_cv_lib_cur_colr_initscr=no
7069 fi
7070 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7071 LIBS=$ac_check_lib_save_LIBS
7072 fi
7073 echo "$as_me:7073: result: $ac_cv_lib_cur_colr_initscr" >&5
7074 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
7075 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
7076
7077 cf_add_libs="$LIBS"
7078 # reverse order
7079 cf_add_0lib=
7080 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7081 # filter duplicates
7082 for cf_add_1lib in $cf_add_0lib; do
7083         for cf_add_2lib in $cf_add_libs; do
7084                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7085                         cf_add_1lib=
7086                         break
7087                 fi
7088         done
7089         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7090 done
7091 LIBS="$cf_add_libs"
7092
7093                         ac_cv_func_initscr=yes
7094
7095 else
7096
7097                 echo "$as_me:7097: checking for initscr in -lHcurses" >&5
7098 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
7099 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
7100   echo $ECHO_N "(cached) $ECHO_C" >&6
7101 else
7102   ac_check_lib_save_LIBS=$LIBS
7103 LIBS="-lHcurses  $LIBS"
7104 cat >"conftest.$ac_ext" <<_ACEOF
7105 #line 7105 "configure"
7106 #include "confdefs.h"
7107
7108 /* Override any gcc2 internal prototype to avoid an error.  */
7109 #ifdef __cplusplus
7110 extern "C"
7111 #endif
7112 /* We use char because int might match the return type of a gcc2
7113    builtin and then its argument prototype would still apply.  */
7114 char initscr ();
7115 int
7116 main (void)
7117 {
7118 initscr ();
7119   ;
7120   return 0;
7121 }
7122 _ACEOF
7123 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7124 if { (eval echo "$as_me:7124: \"$ac_link\"") >&5
7125   (eval $ac_link) 2>&5
7126   ac_status=$?
7127   echo "$as_me:7127: \$? = $ac_status" >&5
7128   (exit "$ac_status"); } &&
7129          { ac_try='test -s "conftest$ac_exeext"'
7130   { (eval echo "$as_me:7130: \"$ac_try\"") >&5
7131   (eval $ac_try) 2>&5
7132   ac_status=$?
7133   echo "$as_me:7133: \$? = $ac_status" >&5
7134   (exit "$ac_status"); }; }; then
7135   ac_cv_lib_Hcurses_initscr=yes
7136 else
7137   echo "$as_me: failed program was:" >&5
7138 cat "conftest.$ac_ext" >&5
7139 ac_cv_lib_Hcurses_initscr=no
7140 fi
7141 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7142 LIBS=$ac_check_lib_save_LIBS
7143 fi
7144 echo "$as_me:7144: result: $ac_cv_lib_Hcurses_initscr" >&5
7145 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
7146 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
7147
7148                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
7149
7150 cf_add_libs="$LIBS"
7151 # reverse order
7152 cf_add_0lib=
7153 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7154 # filter duplicates
7155 for cf_add_1lib in $cf_add_0lib; do
7156         for cf_add_2lib in $cf_add_libs; do
7157                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7158                         cf_add_1lib=
7159                         break
7160                 fi
7161         done
7162         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7163 done
7164 LIBS="$cf_add_libs"
7165
7166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7167         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
7168
7169                         ac_cv_func_initscr=yes
7170
7171 fi
7172
7173 fi
7174
7175         fi
7176         ;;
7177 (linux*)
7178         case `arch 2>/dev/null` in
7179         (x86_64)
7180                 if test -d /lib64
7181                 then
7182
7183 if test -n "/lib64" ; then
7184         for cf_add_libdir in /lib64
7185         do
7186                 if test "$cf_add_libdir" = /usr/lib ; then
7187                         :
7188                 elif test -d "$cf_add_libdir"
7189                 then
7190                         cf_have_libdir=no
7191                         if test -n "$LDFLAGS$LIBS" ; then
7192                                 # a loop is needed to ensure we can add subdirs of existing dirs
7193                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7194                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7195                                                 cf_have_libdir=yes; break
7196                                         fi
7197                                 done
7198                         fi
7199                         if test "$cf_have_libdir" = no ; then
7200                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7201
7202 echo "${as_me:-configure}:7202: testing adding $cf_add_libdir to library-path ..." 1>&5
7203
7204                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7205                         fi
7206                 fi
7207         done
7208 fi
7209
7210                 else
7211
7212 if test -n "/lib" ; then
7213         for cf_add_libdir in /lib
7214         do
7215                 if test "$cf_add_libdir" = /usr/lib ; then
7216                         :
7217                 elif test -d "$cf_add_libdir"
7218                 then
7219                         cf_have_libdir=no
7220                         if test -n "$LDFLAGS$LIBS" ; then
7221                                 # a loop is needed to ensure we can add subdirs of existing dirs
7222                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7223                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7224                                                 cf_have_libdir=yes; break
7225                                         fi
7226                                 done
7227                         fi
7228                         if test "$cf_have_libdir" = no ; then
7229                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7230
7231 echo "${as_me:-configure}:7231: testing adding $cf_add_libdir to library-path ..." 1>&5
7232
7233                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7234                         fi
7235                 fi
7236         done
7237 fi
7238
7239                 fi
7240                 ;;
7241         (*)
7242
7243 if test -n "/lib" ; then
7244         for cf_add_libdir in /lib
7245         do
7246                 if test "$cf_add_libdir" = /usr/lib ; then
7247                         :
7248                 elif test -d "$cf_add_libdir"
7249                 then
7250                         cf_have_libdir=no
7251                         if test -n "$LDFLAGS$LIBS" ; then
7252                                 # a loop is needed to ensure we can add subdirs of existing dirs
7253                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7254                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7255                                                 cf_have_libdir=yes; break
7256                                         fi
7257                                 done
7258                         fi
7259                         if test "$cf_have_libdir" = no ; then
7260                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7261
7262 echo "${as_me:-configure}:7262: testing adding $cf_add_libdir to library-path ..." 1>&5
7263
7264                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7265                         fi
7266                 fi
7267         done
7268 fi
7269
7270                 ;;
7271         esac
7272         ;;
7273 (sunos3*|sunos4*)
7274         if test "x$cf_cv_screen" = "xcurses_5lib"
7275         then
7276                 if test -d /usr/5lib ; then
7277
7278 if test -n "/usr/5lib" ; then
7279         for cf_add_libdir in /usr/5lib
7280         do
7281                 if test "$cf_add_libdir" = /usr/lib ; then
7282                         :
7283                 elif test -d "$cf_add_libdir"
7284                 then
7285                         cf_have_libdir=no
7286                         if test -n "$LDFLAGS$LIBS" ; then
7287                                 # a loop is needed to ensure we can add subdirs of existing dirs
7288                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7289                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7290                                                 cf_have_libdir=yes; break
7291                                         fi
7292                                 done
7293                         fi
7294                         if test "$cf_have_libdir" = no ; then
7295                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7296
7297 echo "${as_me:-configure}:7297: testing adding $cf_add_libdir to library-path ..." 1>&5
7298
7299                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7300                         fi
7301                 fi
7302         done
7303 fi
7304
7305 cf_add_libs="$LIBS"
7306 # reverse order
7307 cf_add_0lib=
7308 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7309 # filter duplicates
7310 for cf_add_1lib in $cf_add_0lib; do
7311         for cf_add_2lib in $cf_add_libs; do
7312                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7313                         cf_add_1lib=
7314                         break
7315                 fi
7316         done
7317         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7318 done
7319 LIBS="$cf_add_libs"
7320
7321                 fi
7322         fi
7323         ac_cv_func_initscr=yes
7324         ;;
7325 esac
7326
7327 if test ".$ac_cv_func_initscr" != .yes ; then
7328         cf_save_LIBS="$LIBS"
7329
7330         if test ".${cf_cv_ncurses_version:-no}" != .no
7331         then
7332                 cf_check_list="ncurses curses cursesX"
7333         else
7334                 cf_check_list="cursesX curses ncurses"
7335         fi
7336
7337         # Check for library containing tgoto.  Do this before curses library
7338         # because it may be needed to link the test-case for initscr.
7339         if test "x$cf_term_lib" = x
7340         then
7341                 echo "$as_me:7341: checking for tgoto" >&5
7342 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7343 if test "${ac_cv_func_tgoto+set}" = set; then
7344   echo $ECHO_N "(cached) $ECHO_C" >&6
7345 else
7346   cat >"conftest.$ac_ext" <<_ACEOF
7347 #line 7347 "configure"
7348 #include "confdefs.h"
7349 #define tgoto autoconf_temporary
7350 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7351 #undef tgoto
7352
7353 #ifdef __cplusplus
7354 extern "C"
7355 #endif
7356
7357 /* We use char because int might match the return type of a gcc2
7358    builtin and then its argument prototype would still apply.  */
7359 char tgoto (void);
7360
7361 int
7362 main (void)
7363 {
7364
7365 /* The GNU C library defines stubs for functions which it implements
7366     to always fail with ENOSYS.  Some functions are actually named
7367     something starting with __ and the normal name is an alias.  */
7368 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7369 #error found stub for tgoto
7370 #endif
7371
7372         return tgoto ();
7373   ;
7374   return 0;
7375 }
7376 _ACEOF
7377 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7378 if { (eval echo "$as_me:7378: \"$ac_link\"") >&5
7379   (eval $ac_link) 2>&5
7380   ac_status=$?
7381   echo "$as_me:7381: \$? = $ac_status" >&5
7382   (exit "$ac_status"); } &&
7383          { ac_try='test -s "conftest$ac_exeext"'
7384   { (eval echo "$as_me:7384: \"$ac_try\"") >&5
7385   (eval $ac_try) 2>&5
7386   ac_status=$?
7387   echo "$as_me:7387: \$? = $ac_status" >&5
7388   (exit "$ac_status"); }; }; then
7389   ac_cv_func_tgoto=yes
7390 else
7391   echo "$as_me: failed program was:" >&5
7392 cat "conftest.$ac_ext" >&5
7393 ac_cv_func_tgoto=no
7394 fi
7395 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7396 fi
7397 echo "$as_me:7397: result: $ac_cv_func_tgoto" >&5
7398 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7399 if test "$ac_cv_func_tgoto" = yes; then
7400   cf_term_lib=predefined
7401 else
7402
7403                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7404                         do
7405                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7406 echo "$as_me:7406: checking for tgoto in -l$cf_term_lib" >&5
7407 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7408 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7409   echo $ECHO_N "(cached) $ECHO_C" >&6
7410 else
7411   ac_check_lib_save_LIBS=$LIBS
7412 LIBS="-l$cf_term_lib  $LIBS"
7413 cat >"conftest.$ac_ext" <<_ACEOF
7414 #line 7414 "configure"
7415 #include "confdefs.h"
7416
7417 /* Override any gcc2 internal prototype to avoid an error.  */
7418 #ifdef __cplusplus
7419 extern "C"
7420 #endif
7421 /* We use char because int might match the return type of a gcc2
7422    builtin and then its argument prototype would still apply.  */
7423 char tgoto ();
7424 int
7425 main (void)
7426 {
7427 tgoto ();
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   eval "$as_ac_Lib=yes"
7445 else
7446   echo "$as_me: failed program was:" >&5
7447 cat "conftest.$ac_ext" >&5
7448 eval "$as_ac_Lib=no"
7449 fi
7450 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7451 LIBS=$ac_check_lib_save_LIBS
7452 fi
7453 echo "$as_me:7453: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7454 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7455 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7456
7457                                         : "${cf_nculib_root:=$cf_term_lib}"
7458                                         break
7459
7460 fi
7461
7462                         done
7463
7464 fi
7465
7466         fi
7467
7468         # Check for library containing initscr
7469         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7470         if test "x$cf_curs_lib" = x
7471         then
7472                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7473                 do
7474                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7475                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7476                                 echo "$as_me:7476: checking if we can link with $cf_curs_lib library" >&5
7477 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7478                                 cat >"conftest.$ac_ext" <<_ACEOF
7479 #line 7479 "configure"
7480 #include "confdefs.h"
7481 #include <${cf_cv_ncurses_header:-curses.h}>
7482 int
7483 main (void)
7484 {
7485 initscr()
7486   ;
7487   return 0;
7488 }
7489 _ACEOF
7490 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7491 if { (eval echo "$as_me:7491: \"$ac_link\"") >&5
7492   (eval $ac_link) 2>&5
7493   ac_status=$?
7494   echo "$as_me:7494: \$? = $ac_status" >&5
7495   (exit "$ac_status"); } &&
7496          { ac_try='test -s "conftest$ac_exeext"'
7497   { (eval echo "$as_me:7497: \"$ac_try\"") >&5
7498   (eval $ac_try) 2>&5
7499   ac_status=$?
7500   echo "$as_me:7500: \$? = $ac_status" >&5
7501   (exit "$ac_status"); }; }; then
7502   cf_result=yes
7503 else
7504   echo "$as_me: failed program was:" >&5
7505 cat "conftest.$ac_ext" >&5
7506 cf_result=no
7507 fi
7508 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7509                                 echo "$as_me:7509: result: $cf_result" >&5
7510 echo "${ECHO_T}$cf_result" >&6
7511                                 test "$cf_result" = yes && break
7512                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7513                                 cf_result=no
7514                         elif test "$cf_term_lib" != predefined ; then
7515                                 echo "$as_me:7515: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7516 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7517                                 cat >"conftest.$ac_ext" <<_ACEOF
7518 #line 7518 "configure"
7519 #include "confdefs.h"
7520 #include <${cf_cv_ncurses_header:-curses.h}>
7521 int
7522 main (void)
7523 {
7524 initscr(); endwin();
7525   ;
7526   return 0;
7527 }
7528 _ACEOF
7529 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7530 if { (eval echo "$as_me:7530: \"$ac_link\"") >&5
7531   (eval $ac_link) 2>&5
7532   ac_status=$?
7533   echo "$as_me:7533: \$? = $ac_status" >&5
7534   (exit "$ac_status"); } &&
7535          { ac_try='test -s "conftest$ac_exeext"'
7536   { (eval echo "$as_me:7536: \"$ac_try\"") >&5
7537   (eval $ac_try) 2>&5
7538   ac_status=$?
7539   echo "$as_me:7539: \$? = $ac_status" >&5
7540   (exit "$ac_status"); }; }; then
7541   cf_result=no
7542 else
7543   echo "$as_me: failed program was:" >&5
7544 cat "conftest.$ac_ext" >&5
7545
7546                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7547                                         cat >"conftest.$ac_ext" <<_ACEOF
7548 #line 7548 "configure"
7549 #include "confdefs.h"
7550 #include <${cf_cv_ncurses_header:-curses.h}>
7551 int
7552 main (void)
7553 {
7554 initscr()
7555   ;
7556   return 0;
7557 }
7558 _ACEOF
7559 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7560 if { (eval echo "$as_me:7560: \"$ac_link\"") >&5
7561   (eval $ac_link) 2>&5
7562   ac_status=$?
7563   echo "$as_me:7563: \$? = $ac_status" >&5
7564   (exit "$ac_status"); } &&
7565          { ac_try='test -s "conftest$ac_exeext"'
7566   { (eval echo "$as_me:7566: \"$ac_try\"") >&5
7567   (eval $ac_try) 2>&5
7568   ac_status=$?
7569   echo "$as_me:7569: \$? = $ac_status" >&5
7570   (exit "$ac_status"); }; }; then
7571   cf_result=yes
7572 else
7573   echo "$as_me: failed program was:" >&5
7574 cat "conftest.$ac_ext" >&5
7575 cf_result=error
7576 fi
7577 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7578
7579 fi
7580 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7581                                 echo "$as_me:7581: result: $cf_result" >&5
7582 echo "${ECHO_T}$cf_result" >&6
7583                                 test "$cf_result" != error && break
7584                         fi
7585                 done
7586         fi
7587         test "$cf_curs_lib" = unknown && { { echo "$as_me:7587: error: no curses library found" >&5
7588 echo "$as_me: error: no curses library found" >&2;}
7589    { (exit 1); exit 1; }; }
7590 fi
7591 fi
7592
7593         ;;
7594 (ncursesw*)
7595
7596 for ac_header in wchar.h
7597 do
7598 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7599 echo "$as_me:7599: checking for $ac_header" >&5
7600 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7601 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7602   echo $ECHO_N "(cached) $ECHO_C" >&6
7603 else
7604   cat >"conftest.$ac_ext" <<_ACEOF
7605 #line 7605 "configure"
7606 #include "confdefs.h"
7607 #include <$ac_header>
7608 _ACEOF
7609 if { (eval echo "$as_me:7609: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7610   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7611   ac_status=$?
7612   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7613   rm -f conftest.er1
7614   cat conftest.err >&5
7615   echo "$as_me:7615: \$? = $ac_status" >&5
7616   (exit "$ac_status"); } >/dev/null; then
7617   if test -s conftest.err; then
7618     ac_cpp_err=$ac_c_preproc_warn_flag
7619   else
7620     ac_cpp_err=
7621   fi
7622 else
7623   ac_cpp_err=yes
7624 fi
7625 if test -z "$ac_cpp_err"; then
7626   eval "$as_ac_Header=yes"
7627 else
7628   echo "$as_me: failed program was:" >&5
7629   cat "conftest.$ac_ext" >&5
7630   eval "$as_ac_Header=no"
7631 fi
7632 rm -f conftest.err "conftest.$ac_ext"
7633 fi
7634 echo "$as_me:7634: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7635 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7636 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7637   cat >>confdefs.h <<EOF
7638 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7639 EOF
7640
7641 fi
7642 done
7643
7644 echo "$as_me:7644: checking for multibyte character support" >&5
7645 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7646 if test "${cf_cv_utf8_lib+set}" = set; then
7647   echo $ECHO_N "(cached) $ECHO_C" >&6
7648 else
7649
7650         cf_save_LIBS="$LIBS"
7651         cat >"conftest.$ac_ext" <<_ACEOF
7652 #line 7652 "configure"
7653 #include "confdefs.h"
7654
7655 $ac_includes_default
7656 #ifdef HAVE_WCHAR_H
7657 #include <wchar.h>
7658 #endif
7659
7660 int
7661 main (void)
7662 {
7663 putwc(0,0);
7664   ;
7665   return 0;
7666 }
7667 _ACEOF
7668 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7669 if { (eval echo "$as_me:7669: \"$ac_link\"") >&5
7670   (eval $ac_link) 2>&5
7671   ac_status=$?
7672   echo "$as_me:7672: \$? = $ac_status" >&5
7673   (exit "$ac_status"); } &&
7674          { ac_try='test -s "conftest$ac_exeext"'
7675   { (eval echo "$as_me:7675: \"$ac_try\"") >&5
7676   (eval $ac_try) 2>&5
7677   ac_status=$?
7678   echo "$as_me:7678: \$? = $ac_status" >&5
7679   (exit "$ac_status"); }; }; then
7680   cf_cv_utf8_lib=yes
7681 else
7682   echo "$as_me: failed program was:" >&5
7683 cat "conftest.$ac_ext" >&5
7684
7685 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7686 # will be set on completion of the AC_TRY_LINK below.
7687 cf_cv_header_path_utf8=
7688 cf_cv_library_path_utf8=
7689
7690 echo "${as_me:-configure}:7690: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7691
7692 cf_save_LIBS="$LIBS"
7693
7694 cat >"conftest.$ac_ext" <<_ACEOF
7695 #line 7695 "configure"
7696 #include "confdefs.h"
7697
7698 #include <libutf8.h>
7699 int
7700 main (void)
7701 {
7702 putwc(0,0);
7703   ;
7704   return 0;
7705 }
7706 _ACEOF
7707 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7708 if { (eval echo "$as_me:7708: \"$ac_link\"") >&5
7709   (eval $ac_link) 2>&5
7710   ac_status=$?
7711   echo "$as_me:7711: \$? = $ac_status" >&5
7712   (exit "$ac_status"); } &&
7713          { ac_try='test -s "conftest$ac_exeext"'
7714   { (eval echo "$as_me:7714: \"$ac_try\"") >&5
7715   (eval $ac_try) 2>&5
7716   ac_status=$?
7717   echo "$as_me:7717: \$? = $ac_status" >&5
7718   (exit "$ac_status"); }; }; then
7719
7720         cf_cv_find_linkage_utf8=yes
7721         cf_cv_header_path_utf8=/usr/include
7722         cf_cv_library_path_utf8=/usr/lib
7723
7724 else
7725   echo "$as_me: failed program was:" >&5
7726 cat "conftest.$ac_ext" >&5
7727
7728 LIBS="-lutf8  $cf_save_LIBS"
7729
7730 cat >"conftest.$ac_ext" <<_ACEOF
7731 #line 7731 "configure"
7732 #include "confdefs.h"
7733
7734 #include <libutf8.h>
7735 int
7736 main (void)
7737 {
7738 putwc(0,0);
7739   ;
7740   return 0;
7741 }
7742 _ACEOF
7743 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7744 if { (eval echo "$as_me:7744: \"$ac_link\"") >&5
7745   (eval $ac_link) 2>&5
7746   ac_status=$?
7747   echo "$as_me:7747: \$? = $ac_status" >&5
7748   (exit "$ac_status"); } &&
7749          { ac_try='test -s "conftest$ac_exeext"'
7750   { (eval echo "$as_me:7750: \"$ac_try\"") >&5
7751   (eval $ac_try) 2>&5
7752   ac_status=$?
7753   echo "$as_me:7753: \$? = $ac_status" >&5
7754   (exit "$ac_status"); }; }; then
7755
7756         cf_cv_find_linkage_utf8=yes
7757         cf_cv_header_path_utf8=/usr/include
7758         cf_cv_library_path_utf8=/usr/lib
7759         cf_cv_library_file_utf8="-lutf8"
7760
7761 else
7762   echo "$as_me: failed program was:" >&5
7763 cat "conftest.$ac_ext" >&5
7764
7765         cf_cv_find_linkage_utf8=no
7766         LIBS="$cf_save_LIBS"
7767
7768         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7769
7770 echo "${as_me:-configure}:7770: testing find linkage for utf8 library ..." 1>&5
7771
7772 echo "${as_me:-configure}:7772: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7773
7774         cf_save_CPPFLAGS="$CPPFLAGS"
7775         cf_test_CPPFLAGS="$CPPFLAGS"
7776
7777 cf_search=
7778
7779 # collect the current set of include-directories from compiler flags
7780 cf_header_path_list=""
7781 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7782         for cf_header_path in $CPPFLAGS $CFLAGS
7783         do
7784                 case "$cf_header_path" in
7785                 (-I*)
7786                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7787
7788 test "x$cf_header_path" != "xNONE" && \
7789 test -d "$cf_header_path" && \
7790  {
7791         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7792         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7793         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7794         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7795         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7796         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7797 }
7798
7799                         cf_header_path_list="$cf_header_path_list $cf_search"
7800                         ;;
7801                 esac
7802         done
7803 fi
7804
7805 # add the variations for the package we are looking for
7806
7807 cf_search=
7808
7809 test "x$prefix" != "xNONE" && \
7810 test -d "$prefix" && \
7811  {
7812         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7813         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7814         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7815         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7816         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7817         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7818 }
7819
7820 for cf_subdir_prefix in \
7821         /usr \
7822         /usr/local \
7823         /usr/pkg \
7824         /opt \
7825         /opt/local \
7826         $HOME
7827 do
7828
7829 test "x$cf_subdir_prefix" != "x$prefix" && \
7830 test -d "$cf_subdir_prefix" && \
7831 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7832         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7833         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7834         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7835         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7836         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7837         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7838 }
7839
7840 done
7841
7842 test "$includedir" != NONE && \
7843 test "$includedir" != "/usr/include" && \
7844 test -d "$includedir" && {
7845         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7846         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7847 }
7848
7849 test "$oldincludedir" != NONE && \
7850 test "$oldincludedir" != "/usr/include" && \
7851 test -d "$oldincludedir" && {
7852         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7853         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7854 }
7855
7856 cf_search="$cf_search $cf_header_path_list"
7857
7858         for cf_cv_header_path_utf8 in $cf_search
7859         do
7860                 if test -d "$cf_cv_header_path_utf8" ; then
7861                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7862
7863 echo "${as_me:-configure}:7863: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7864
7865                         CPPFLAGS="$cf_save_CPPFLAGS"
7866
7867         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7868         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7869
7870                         cat >"conftest.$ac_ext" <<_ACEOF
7871 #line 7871 "configure"
7872 #include "confdefs.h"
7873
7874 #include <libutf8.h>
7875 int
7876 main (void)
7877 {
7878 putwc(0,0);
7879   ;
7880   return 0;
7881 }
7882 _ACEOF
7883 rm -f "conftest.$ac_objext"
7884 if { (eval echo "$as_me:7884: \"$ac_compile\"") >&5
7885   (eval $ac_compile) 2>&5
7886   ac_status=$?
7887   echo "$as_me:7887: \$? = $ac_status" >&5
7888   (exit "$ac_status"); } &&
7889          { ac_try='test -s "conftest.$ac_objext"'
7890   { (eval echo "$as_me:7890: \"$ac_try\"") >&5
7891   (eval $ac_try) 2>&5
7892   ac_status=$?
7893   echo "$as_me:7893: \$? = $ac_status" >&5
7894   (exit "$ac_status"); }; }; then
7895
7896                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7897
7898 echo "${as_me:-configure}:7898: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7899
7900                                 cf_cv_find_linkage_utf8=maybe
7901                                 cf_test_CPPFLAGS="$CPPFLAGS"
7902                                 break
7903 else
7904   echo "$as_me: failed program was:" >&5
7905 cat "conftest.$ac_ext" >&5
7906
7907                                 CPPFLAGS="$cf_save_CPPFLAGS"
7908
7909 fi
7910 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7911                 fi
7912         done
7913
7914         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7915
7916 echo "${as_me:-configure}:7916: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7917
7918                 cf_save_LIBS="$LIBS"
7919                 cf_save_LDFLAGS="$LDFLAGS"
7920
7921                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7922
7923 cf_search=
7924 cf_library_path_list=""
7925 if test -n "${LDFLAGS}${LIBS}" ; then
7926         for cf_library_path in $LDFLAGS $LIBS
7927         do
7928                 case "$cf_library_path" in
7929                 (-L*)
7930                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7931
7932 test "x$cf_library_path" != "xNONE" && \
7933 test -d "$cf_library_path" && \
7934  {
7935         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7936         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7937         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7938         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7939         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7940         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7941 }
7942
7943                         cf_library_path_list="$cf_library_path_list $cf_search"
7944                         ;;
7945                 esac
7946         done
7947 fi
7948
7949 cf_search=
7950
7951 test "x$prefix" != "xNONE" && \
7952 test -d "$prefix" && \
7953  {
7954         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7955         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7956         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7957         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7958         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7959         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7960 }
7961
7962 for cf_subdir_prefix in \
7963         /usr \
7964         /usr/local \
7965         /usr/pkg \
7966         /opt \
7967         /opt/local \
7968         $HOME
7969 do
7970
7971 test "x$cf_subdir_prefix" != "x$prefix" && \
7972 test -d "$cf_subdir_prefix" && \
7973 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7974         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7975         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7976         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7977         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7978         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7979         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7980 }
7981
7982 done
7983
7984 cf_search="$cf_library_path_list $cf_search"
7985
7986                         for cf_cv_library_path_utf8 in $cf_search
7987                         do
7988                                 if test -d "$cf_cv_library_path_utf8" ; then
7989                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7990
7991 echo "${as_me:-configure}:7991: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7992
7993                                         CPPFLAGS="$cf_test_CPPFLAGS"
7994                                         LIBS="-lutf8  $cf_save_LIBS"
7995                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7996                                         cat >"conftest.$ac_ext" <<_ACEOF
7997 #line 7997 "configure"
7998 #include "confdefs.h"
7999
8000 #include <libutf8.h>
8001 int
8002 main (void)
8003 {
8004 putwc(0,0);
8005   ;
8006   return 0;
8007 }
8008 _ACEOF
8009 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8010 if { (eval echo "$as_me:8010: \"$ac_link\"") >&5
8011   (eval $ac_link) 2>&5
8012   ac_status=$?
8013   echo "$as_me:8013: \$? = $ac_status" >&5
8014   (exit "$ac_status"); } &&
8015          { ac_try='test -s "conftest$ac_exeext"'
8016   { (eval echo "$as_me:8016: \"$ac_try\"") >&5
8017   (eval $ac_try) 2>&5
8018   ac_status=$?
8019   echo "$as_me:8019: \$? = $ac_status" >&5
8020   (exit "$ac_status"); }; }; then
8021
8022                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8023
8024 echo "${as_me:-configure}:8024: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8025
8026                                         cf_cv_find_linkage_utf8=yes
8027                                         cf_cv_library_file_utf8="-lutf8"
8028                                         break
8029 else
8030   echo "$as_me: failed program was:" >&5
8031 cat "conftest.$ac_ext" >&5
8032
8033                                         CPPFLAGS="$cf_save_CPPFLAGS"
8034                                         LIBS="$cf_save_LIBS"
8035                                         LDFLAGS="$cf_save_LDFLAGS"
8036
8037 fi
8038 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8039                                 fi
8040                         done
8041                         CPPFLAGS="$cf_save_CPPFLAGS"
8042                         LDFLAGS="$cf_save_LDFLAGS"
8043                 fi
8044
8045         else
8046                 cf_cv_find_linkage_utf8=no
8047         fi
8048
8049 fi
8050 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8051
8052 fi
8053 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8054
8055 LIBS="$cf_save_LIBS"
8056
8057 if test "$cf_cv_find_linkage_utf8" = yes ; then
8058 cf_cv_utf8_lib=add-on
8059 else
8060 cf_cv_utf8_lib=no
8061 fi
8062
8063 fi
8064 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8065 fi
8066 echo "$as_me:8066: result: $cf_cv_utf8_lib" >&5
8067 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8068
8069 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8070 # ncurses/ncursesw:
8071 if test "$cf_cv_utf8_lib" = "add-on" ; then
8072
8073 cat >>confdefs.h <<\EOF
8074 #define HAVE_LIBUTF8_H 1
8075 EOF
8076
8077 if test -n "$cf_cv_header_path_utf8" ; then
8078   for cf_add_incdir in $cf_cv_header_path_utf8
8079   do
8080         while test "$cf_add_incdir" != /usr/include
8081         do
8082           if test -d "$cf_add_incdir"
8083           then
8084                 cf_have_incdir=no
8085                 if test -n "$CFLAGS$CPPFLAGS" ; then
8086                   # a loop is needed to ensure we can add subdirs of existing dirs
8087                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8088                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8089                           cf_have_incdir=yes; break
8090                         fi
8091                   done
8092                 fi
8093
8094                 if test "$cf_have_incdir" = no ; then
8095                   if test "$cf_add_incdir" = /usr/local/include ; then
8096                         if test "$GCC" = yes
8097                         then
8098                           cf_save_CPPFLAGS=$CPPFLAGS
8099
8100         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8101         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8102
8103                           cat >"conftest.$ac_ext" <<_ACEOF
8104 #line 8104 "configure"
8105 #include "confdefs.h"
8106 #include <stdio.h>
8107 int
8108 main (void)
8109 {
8110 printf("Hello")
8111   ;
8112   return 0;
8113 }
8114 _ACEOF
8115 rm -f "conftest.$ac_objext"
8116 if { (eval echo "$as_me:8116: \"$ac_compile\"") >&5
8117   (eval $ac_compile) 2>&5
8118   ac_status=$?
8119   echo "$as_me:8119: \$? = $ac_status" >&5
8120   (exit "$ac_status"); } &&
8121          { ac_try='test -s "conftest.$ac_objext"'
8122   { (eval echo "$as_me:8122: \"$ac_try\"") >&5
8123   (eval $ac_try) 2>&5
8124   ac_status=$?
8125   echo "$as_me:8125: \$? = $ac_status" >&5
8126   (exit "$ac_status"); }; }; then
8127   :
8128 else
8129   echo "$as_me: failed program was:" >&5
8130 cat "conftest.$ac_ext" >&5
8131 cf_have_incdir=yes
8132 fi
8133 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8134                           CPPFLAGS=$cf_save_CPPFLAGS
8135                         fi
8136                   fi
8137                 fi
8138
8139                 if test "$cf_have_incdir" = no ; then
8140                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8141
8142 echo "${as_me:-configure}:8142: testing adding $cf_add_incdir to include-path ..." 1>&5
8143
8144                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8145
8146                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8147                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8148                   cf_add_incdir="$cf_top_incdir"
8149                 else
8150                   break
8151                 fi
8152           else
8153                 break
8154           fi
8155         done
8156   done
8157 fi
8158
8159 if test -n "$cf_cv_library_path_utf8" ; then
8160         for cf_add_libdir in $cf_cv_library_path_utf8
8161         do
8162                 if test "$cf_add_libdir" = /usr/lib ; then
8163                         :
8164                 elif test -d "$cf_add_libdir"
8165                 then
8166                         cf_have_libdir=no
8167                         if test -n "$LDFLAGS$LIBS" ; then
8168                                 # a loop is needed to ensure we can add subdirs of existing dirs
8169                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
8170                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8171                                                 cf_have_libdir=yes; break
8172                                         fi
8173                                 done
8174                         fi
8175                         if test "$cf_have_libdir" = no ; then
8176                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8177
8178 echo "${as_me:-configure}:8178: testing adding $cf_add_libdir to library-path ..." 1>&5
8179
8180                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8181                         fi
8182                 fi
8183         done
8184 fi
8185
8186 cf_add_libs="$LIBS"
8187 # reverse order
8188 cf_add_0lib=
8189 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8190 # filter duplicates
8191 for cf_add_1lib in $cf_add_0lib; do
8192         for cf_add_2lib in $cf_add_libs; do
8193                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8194                         cf_add_1lib=
8195                         break
8196                 fi
8197         done
8198         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8199 done
8200 LIBS="$cf_add_libs"
8201
8202 fi
8203
8204 cf_ncuconfig_root=$cf_cv_screen
8205 cf_have_ncuconfig=no
8206
8207 if test "x${PKG_CONFIG:=none}" != xnone; then
8208         echo "$as_me:8208: checking pkg-config for $cf_ncuconfig_root" >&5
8209 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8210         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8211                 echo "$as_me:8211: result: yes" >&5
8212 echo "${ECHO_T}yes" >&6
8213
8214                 echo "$as_me:8214: checking if the $cf_ncuconfig_root package files work" >&5
8215 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8216                 cf_have_ncuconfig=unknown
8217
8218                 cf_save_CFLAGS="$CFLAGS"
8219                 cf_save_CPPFLAGS="$CPPFLAGS"
8220                 cf_save_LIBS="$LIBS"
8221
8222                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8223                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8224
8225                 # while -W for passing linker flags is prevalent, it is not "standard".
8226                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8227                 # incompatible _and_ non-standard -W option which gives an error.  Work
8228                 # around that pitfall.
8229                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8230                 (x*c[89]9@@*-W*)
8231
8232 cf_fix_cppflags=no
8233 cf_new_cflags=
8234 cf_new_cppflags=
8235 cf_new_extra_cppflags=
8236
8237 for cf_add_cflags in $cf_pkg_cflags
8238 do
8239 case "$cf_fix_cppflags" in
8240 (no)
8241         case "$cf_add_cflags" in
8242         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8243                 case "$cf_add_cflags" in
8244                 (-D*)
8245                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8246
8247                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8248                                 && test -z "${cf_tst_cflags}" \
8249                                 && cf_fix_cppflags=yes
8250
8251                         if test "$cf_fix_cppflags" = yes ; then
8252
8253         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8254         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8255
8256                                 continue
8257                         elif test "${cf_tst_cflags}" = "\"'" ; then
8258
8259         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8260         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8261
8262                                 continue
8263                         fi
8264                         ;;
8265                 esac
8266                 case "$CPPFLAGS" in
8267                 (*$cf_add_cflags)
8268                         ;;
8269                 (*)
8270                         case "$cf_add_cflags" in
8271                         (-D*)
8272                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8273
8274 CPPFLAGS=`echo "$CPPFLAGS" | \
8275         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8276                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8277
8278                                 ;;
8279                         esac
8280
8281         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8282         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8283
8284                         ;;
8285                 esac
8286                 ;;
8287         (*)
8288
8289         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8290         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8291
8292                 ;;
8293         esac
8294         ;;
8295 (yes)
8296
8297         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8298         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8299
8300         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8301
8302         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8303                 && test -z "${cf_tst_cflags}" \
8304                 && cf_fix_cppflags=no
8305         ;;
8306 esac
8307 done
8308
8309 if test -n "$cf_new_cflags" ; then
8310
8311         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8312         CFLAGS="${CFLAGS}$cf_new_cflags"
8313
8314 fi
8315
8316 if test -n "$cf_new_cppflags" ; then
8317
8318         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8319         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8320
8321 fi
8322
8323 if test -n "$cf_new_extra_cppflags" ; then
8324
8325         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8326         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8327
8328 fi
8329
8330 cf_add_libs="$LIBS"
8331 # reverse order
8332 cf_add_0lib=
8333 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8334 # filter duplicates
8335 for cf_add_1lib in $cf_add_0lib; do
8336         for cf_add_2lib in $cf_add_libs; do
8337                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8338                         cf_add_1lib=
8339                         break
8340                 fi
8341         done
8342         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8343 done
8344 LIBS="$cf_add_libs"
8345
8346                         cat >"conftest.$ac_ext" <<_ACEOF
8347 #line 8347 "configure"
8348 #include "confdefs.h"
8349 #include <${cf_cv_ncurses_header:-curses.h}>
8350 int
8351 main (void)
8352 {
8353 initscr(); mousemask(0,0); tigetstr((char *)0);
8354   ;
8355   return 0;
8356 }
8357 _ACEOF
8358 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8359 if { (eval echo "$as_me:8359: \"$ac_link\"") >&5
8360   (eval $ac_link) 2>&5
8361   ac_status=$?
8362   echo "$as_me:8362: \$? = $ac_status" >&5
8363   (exit "$ac_status"); } &&
8364          { ac_try='test -s "conftest$ac_exeext"'
8365   { (eval echo "$as_me:8365: \"$ac_try\"") >&5
8366   (eval $ac_try) 2>&5
8367   ac_status=$?
8368   echo "$as_me:8368: \$? = $ac_status" >&5
8369   (exit "$ac_status"); }; }; then
8370   if test "$cross_compiling" = yes; then
8371   cf_test_ncuconfig=maybe
8372 else
8373   cat >"conftest.$ac_ext" <<_ACEOF
8374 #line 8374 "configure"
8375 #include "confdefs.h"
8376 #include <${cf_cv_ncurses_header:-curses.h}>
8377                                         int main(void)
8378                                         { const char *xx = curses_version(); return (xx == 0); }
8379 _ACEOF
8380 rm -f "conftest$ac_exeext"
8381 if { (eval echo "$as_me:8381: \"$ac_link\"") >&5
8382   (eval $ac_link) 2>&5
8383   ac_status=$?
8384   echo "$as_me:8384: \$? = $ac_status" >&5
8385   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8386   { (eval echo "$as_me:8386: \"$ac_try\"") >&5
8387   (eval $ac_try) 2>&5
8388   ac_status=$?
8389   echo "$as_me:8389: \$? = $ac_status" >&5
8390   (exit "$ac_status"); }; }; then
8391   cf_test_ncuconfig=yes
8392 else
8393   echo "$as_me: program exited with status $ac_status" >&5
8394 echo "$as_me: failed program was:" >&5
8395 cat "conftest.$ac_ext" >&5
8396 cf_test_ncuconfig=no
8397 fi
8398 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8399 fi
8400 else
8401   echo "$as_me: failed program was:" >&5
8402 cat "conftest.$ac_ext" >&5
8403 cf_test_ncuconfig=no
8404 fi
8405 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8406
8407                         CFLAGS="$cf_save_CFLAGS"
8408                         CPPFLAGS="$cf_save_CPPFLAGS"
8409                         LIBS="$cf_save_LIBS"
8410
8411                         if test "x$cf_test_ncuconfig" != xyes; then
8412                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8413                                 cf_pkg_cflags="$cf_temp"
8414                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8415                                 cf_pkg_libs="$cf_temp"
8416                         fi
8417                         ;;
8418                 esac
8419
8420 for cf_add_cflags in $cf_pkg_cflags
8421 do
8422         case "x$cf_add_cflags" in
8423         (x-[DU]*)
8424
8425 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8426 while true
8427 do
8428         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'`
8429         test "$CFLAGS" != "$cf_old_cflag" || break
8430
8431         CFLAGS="$cf_old_cflag"
8432 done
8433
8434 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8435 while true
8436 do
8437         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'`
8438         test "$CPPFLAGS" != "$cf_old_cflag" || break
8439
8440         CPPFLAGS="$cf_old_cflag"
8441 done
8442
8443                 ;;
8444         esac
8445
8446 cf_fix_cppflags=no
8447 cf_new_cflags=
8448 cf_new_cppflags=
8449 cf_new_extra_cppflags=
8450
8451 for cf_add_cflags in $cf_add_cflags
8452 do
8453 case "$cf_fix_cppflags" in
8454 (no)
8455         case "$cf_add_cflags" in
8456         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8457                 case "$cf_add_cflags" in
8458                 (-D*)
8459                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8460
8461                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8462                                 && test -z "${cf_tst_cflags}" \
8463                                 && cf_fix_cppflags=yes
8464
8465                         if test "$cf_fix_cppflags" = yes ; then
8466
8467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8469
8470                                 continue
8471                         elif test "${cf_tst_cflags}" = "\"'" ; then
8472
8473         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8474         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8475
8476                                 continue
8477                         fi
8478                         ;;
8479                 esac
8480                 case "$CPPFLAGS" in
8481                 (*$cf_add_cflags)
8482                         ;;
8483                 (*)
8484                         case "$cf_add_cflags" in
8485                         (-D*)
8486                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8487
8488 CPPFLAGS=`echo "$CPPFLAGS" | \
8489         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8490                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8491
8492                                 ;;
8493                         esac
8494
8495         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8496         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8497
8498                         ;;
8499                 esac
8500                 ;;
8501         (*)
8502
8503         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8504         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8505
8506                 ;;
8507         esac
8508         ;;
8509 (yes)
8510
8511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8513
8514         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8515
8516         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8517                 && test -z "${cf_tst_cflags}" \
8518                 && cf_fix_cppflags=no
8519         ;;
8520 esac
8521 done
8522
8523 if test -n "$cf_new_cflags" ; then
8524
8525         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8526         CFLAGS="${CFLAGS}$cf_new_cflags"
8527
8528 fi
8529
8530 if test -n "$cf_new_cppflags" ; then
8531
8532         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8533         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8534
8535 fi
8536
8537 if test -n "$cf_new_extra_cppflags" ; then
8538
8539         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8540         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8541
8542 fi
8543
8544 done
8545
8546 cf_add_libs="$LIBS"
8547 # reverse order
8548 cf_add_0lib=
8549 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8550 # filter duplicates
8551 for cf_add_1lib in $cf_add_0lib; do
8552         for cf_add_2lib in $cf_add_libs; do
8553                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8554                         cf_add_1lib=
8555                         break
8556                 fi
8557         done
8558         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8559 done
8560 LIBS="$cf_add_libs"
8561
8562                 cat >"conftest.$ac_ext" <<_ACEOF
8563 #line 8563 "configure"
8564 #include "confdefs.h"
8565 #include <${cf_cv_ncurses_header:-curses.h}>
8566 int
8567 main (void)
8568 {
8569 initscr(); mousemask(0,0); tigetstr((char *)0);
8570   ;
8571   return 0;
8572 }
8573 _ACEOF
8574 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8575 if { (eval echo "$as_me:8575: \"$ac_link\"") >&5
8576   (eval $ac_link) 2>&5
8577   ac_status=$?
8578   echo "$as_me:8578: \$? = $ac_status" >&5
8579   (exit "$ac_status"); } &&
8580          { ac_try='test -s "conftest$ac_exeext"'
8581   { (eval echo "$as_me:8581: \"$ac_try\"") >&5
8582   (eval $ac_try) 2>&5
8583   ac_status=$?
8584   echo "$as_me:8584: \$? = $ac_status" >&5
8585   (exit "$ac_status"); }; }; then
8586   if test "$cross_compiling" = yes; then
8587   cf_have_ncuconfig=maybe
8588 else
8589   cat >"conftest.$ac_ext" <<_ACEOF
8590 #line 8590 "configure"
8591 #include "confdefs.h"
8592 #include <${cf_cv_ncurses_header:-curses.h}>
8593                                 int main(void)
8594                                 { const char *xx = curses_version(); return (xx == 0); }
8595 _ACEOF
8596 rm -f "conftest$ac_exeext"
8597 if { (eval echo "$as_me:8597: \"$ac_link\"") >&5
8598   (eval $ac_link) 2>&5
8599   ac_status=$?
8600   echo "$as_me:8600: \$? = $ac_status" >&5
8601   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8602   { (eval echo "$as_me:8602: \"$ac_try\"") >&5
8603   (eval $ac_try) 2>&5
8604   ac_status=$?
8605   echo "$as_me:8605: \$? = $ac_status" >&5
8606   (exit "$ac_status"); }; }; then
8607   cf_have_ncuconfig=yes
8608 else
8609   echo "$as_me: program exited with status $ac_status" >&5
8610 echo "$as_me: failed program was:" >&5
8611 cat "conftest.$ac_ext" >&5
8612 cf_have_ncuconfig=no
8613 fi
8614 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8615 fi
8616 else
8617   echo "$as_me: failed program was:" >&5
8618 cat "conftest.$ac_ext" >&5
8619 cf_have_ncuconfig=no
8620 fi
8621 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8622                 echo "$as_me:8622: result: $cf_have_ncuconfig" >&5
8623 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8624                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8625                 if test "$cf_have_ncuconfig" != "yes"
8626                 then
8627                         CPPFLAGS="$cf_save_CPPFLAGS"
8628                         LIBS="$cf_save_LIBS"
8629                         NCURSES_CONFIG_PKG=none
8630                 else
8631
8632 cat >>confdefs.h <<\EOF
8633 #define NCURSES 1
8634 EOF
8635
8636                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8637
8638 echo "$as_me:8638: checking for terminfo header" >&5
8639 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8640 if test "${cf_cv_term_header+set}" = set; then
8641   echo $ECHO_N "(cached) $ECHO_C" >&6
8642 else
8643
8644 case "${cf_cv_ncurses_header}" in
8645 (*/ncurses.h|*/ncursesw.h)
8646         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8647         ;;
8648 (*)
8649         cf_term_header=term.h
8650         ;;
8651 esac
8652
8653 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8654 do
8655 cat >"conftest.$ac_ext" <<_ACEOF
8656 #line 8656 "configure"
8657 #include "confdefs.h"
8658 #include <stdio.h>
8659 #include <${cf_cv_ncurses_header:-curses.h}>
8660 #include <$cf_test>
8661
8662 int
8663 main (void)
8664 {
8665 int x = auto_left_margin; (void)x
8666   ;
8667   return 0;
8668 }
8669 _ACEOF
8670 rm -f "conftest.$ac_objext"
8671 if { (eval echo "$as_me:8671: \"$ac_compile\"") >&5
8672   (eval $ac_compile) 2>&5
8673   ac_status=$?
8674   echo "$as_me:8674: \$? = $ac_status" >&5
8675   (exit "$ac_status"); } &&
8676          { ac_try='test -s "conftest.$ac_objext"'
8677   { (eval echo "$as_me:8677: \"$ac_try\"") >&5
8678   (eval $ac_try) 2>&5
8679   ac_status=$?
8680   echo "$as_me:8680: \$? = $ac_status" >&5
8681   (exit "$ac_status"); }; }; then
8682
8683         cf_cv_term_header="$cf_test"
8684 else
8685   echo "$as_me: failed program was:" >&5
8686 cat "conftest.$ac_ext" >&5
8687
8688         cf_cv_term_header=unknown
8689
8690 fi
8691 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8692         test "$cf_cv_term_header" != unknown && break
8693 done
8694
8695 fi
8696 echo "$as_me:8696: result: $cf_cv_term_header" >&5
8697 echo "${ECHO_T}$cf_cv_term_header" >&6
8698
8699 # Set definitions to allow ifdef'ing to accommodate subdirectories
8700
8701 case "$cf_cv_term_header" in
8702 (*term.h)
8703
8704 cat >>confdefs.h <<\EOF
8705 #define HAVE_TERM_H 1
8706 EOF
8707
8708         ;;
8709 esac
8710
8711 case "$cf_cv_term_header" in
8712 (ncurses/term.h)
8713
8714 cat >>confdefs.h <<\EOF
8715 #define HAVE_NCURSES_TERM_H 1
8716 EOF
8717
8718         ;;
8719 (ncursesw/term.h)
8720
8721 cat >>confdefs.h <<\EOF
8722 #define HAVE_NCURSESW_TERM_H 1
8723 EOF
8724
8725         ;;
8726 esac
8727
8728                 fi
8729
8730         else
8731                 echo "$as_me:8731: result: no" >&5
8732 echo "${ECHO_T}no" >&6
8733                 NCURSES_CONFIG_PKG=none
8734         fi
8735 else
8736         NCURSES_CONFIG_PKG=none
8737 fi
8738
8739 if test "x$cf_have_ncuconfig" = "xno"; then
8740         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8741
8742 if test -n "$ac_tool_prefix"; then
8743   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8744   do
8745     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8746 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8747 echo "$as_me:8747: checking for $ac_word" >&5
8748 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8749 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8750   echo $ECHO_N "(cached) $ECHO_C" >&6
8751 else
8752   if test -n "$NCURSES_CONFIG"; then
8753   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8754 else
8755   ac_save_IFS=$IFS; IFS=$ac_path_separator
8756 ac_dummy="$PATH"
8757 for ac_dir in $ac_dummy; do
8758   IFS=$ac_save_IFS
8759   test -z "$ac_dir" && ac_dir=.
8760   $as_executable_p "$ac_dir/$ac_word" || continue
8761 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8762 echo "$as_me:8762: found $ac_dir/$ac_word" >&5
8763 break
8764 done
8765
8766 fi
8767 fi
8768 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8769 if test -n "$NCURSES_CONFIG"; then
8770   echo "$as_me:8770: result: $NCURSES_CONFIG" >&5
8771 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8772 else
8773   echo "$as_me:8773: result: no" >&5
8774 echo "${ECHO_T}no" >&6
8775 fi
8776
8777     test -n "$NCURSES_CONFIG" && break
8778   done
8779 fi
8780 if test -z "$NCURSES_CONFIG"; then
8781   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8782   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8783 do
8784   # Extract the first word of "$ac_prog", so it can be a program name with args.
8785 set dummy $ac_prog; ac_word=$2
8786 echo "$as_me:8786: checking for $ac_word" >&5
8787 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8788 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8789   echo $ECHO_N "(cached) $ECHO_C" >&6
8790 else
8791   if test -n "$ac_ct_NCURSES_CONFIG"; then
8792   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8793 else
8794   ac_save_IFS=$IFS; IFS=$ac_path_separator
8795 ac_dummy="$PATH"
8796 for ac_dir in $ac_dummy; do
8797   IFS=$ac_save_IFS
8798   test -z "$ac_dir" && ac_dir=.
8799   $as_executable_p "$ac_dir/$ac_word" || continue
8800 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8801 echo "$as_me:8801: found $ac_dir/$ac_word" >&5
8802 break
8803 done
8804
8805 fi
8806 fi
8807 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8808 if test -n "$ac_ct_NCURSES_CONFIG"; then
8809   echo "$as_me:8809: result: $ac_ct_NCURSES_CONFIG" >&5
8810 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8811 else
8812   echo "$as_me:8812: result: no" >&5
8813 echo "${ECHO_T}no" >&6
8814 fi
8815
8816   test -n "$ac_ct_NCURSES_CONFIG" && break
8817 done
8818 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8819
8820   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8821 fi
8822
8823         if test "$NCURSES_CONFIG" != none ; then
8824
8825 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8826 do
8827         case "x$cf_add_cflags" in
8828         (x-[DU]*)
8829
8830 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8831 while true
8832 do
8833         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'`
8834         test "$CFLAGS" != "$cf_old_cflag" || break
8835
8836         CFLAGS="$cf_old_cflag"
8837 done
8838
8839 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8840 while true
8841 do
8842         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'`
8843         test "$CPPFLAGS" != "$cf_old_cflag" || break
8844
8845         CPPFLAGS="$cf_old_cflag"
8846 done
8847
8848                 ;;
8849         esac
8850
8851 cf_fix_cppflags=no
8852 cf_new_cflags=
8853 cf_new_cppflags=
8854 cf_new_extra_cppflags=
8855
8856 for cf_add_cflags in $cf_add_cflags
8857 do
8858 case "$cf_fix_cppflags" in
8859 (no)
8860         case "$cf_add_cflags" in
8861         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8862                 case "$cf_add_cflags" in
8863                 (-D*)
8864                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8865
8866                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8867                                 && test -z "${cf_tst_cflags}" \
8868                                 && cf_fix_cppflags=yes
8869
8870                         if test "$cf_fix_cppflags" = yes ; then
8871
8872         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8873         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8874
8875                                 continue
8876                         elif test "${cf_tst_cflags}" = "\"'" ; then
8877
8878         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8879         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8880
8881                                 continue
8882                         fi
8883                         ;;
8884                 esac
8885                 case "$CPPFLAGS" in
8886                 (*$cf_add_cflags)
8887                         ;;
8888                 (*)
8889                         case "$cf_add_cflags" in
8890                         (-D*)
8891                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8892
8893 CPPFLAGS=`echo "$CPPFLAGS" | \
8894         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8895                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8896
8897                                 ;;
8898                         esac
8899
8900         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8901         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8902
8903                         ;;
8904                 esac
8905                 ;;
8906         (*)
8907
8908         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8909         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8910
8911                 ;;
8912         esac
8913         ;;
8914 (yes)
8915
8916         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8917         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8918
8919         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8920
8921         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8922                 && test -z "${cf_tst_cflags}" \
8923                 && cf_fix_cppflags=no
8924         ;;
8925 esac
8926 done
8927
8928 if test -n "$cf_new_cflags" ; then
8929
8930         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8931         CFLAGS="${CFLAGS}$cf_new_cflags"
8932
8933 fi
8934
8935 if test -n "$cf_new_cppflags" ; then
8936
8937         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8938         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8939
8940 fi
8941
8942 if test -n "$cf_new_extra_cppflags" ; then
8943
8944         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8945         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8946
8947 fi
8948
8949 done
8950
8951 cf_add_libs="$LIBS"
8952 # reverse order
8953 cf_add_0lib=
8954 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8955 # filter duplicates
8956 for cf_add_1lib in $cf_add_0lib; do
8957         for cf_add_2lib in $cf_add_libs; do
8958                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8959                         cf_add_1lib=
8960                         break
8961                 fi
8962         done
8963         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8964 done
8965 LIBS="$cf_add_libs"
8966
8967                 # even with config script, some packages use no-override for curses.h
8968
8969 echo "$as_me:8969: checking if we have identified curses headers" >&5
8970 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8971 if test "${cf_cv_ncurses_header+set}" = set; then
8972   echo $ECHO_N "(cached) $ECHO_C" >&6
8973 else
8974
8975 cf_cv_ncurses_header=none
8976 for cf_header in \
8977         ncurses.h $cf_cv_screen/ncurses.h \
8978         curses.h $cf_cv_screen/curses.h
8979 do
8980 cat >"conftest.$ac_ext" <<_ACEOF
8981 #line 8981 "configure"
8982 #include "confdefs.h"
8983 #include <${cf_header}>
8984 int
8985 main (void)
8986 {
8987 initscr(); endwin()
8988   ;
8989   return 0;
8990 }
8991 _ACEOF
8992 rm -f "conftest.$ac_objext"
8993 if { (eval echo "$as_me:8993: \"$ac_compile\"") >&5
8994   (eval $ac_compile) 2>&5
8995   ac_status=$?
8996   echo "$as_me:8996: \$? = $ac_status" >&5
8997   (exit "$ac_status"); } &&
8998          { ac_try='test -s "conftest.$ac_objext"'
8999   { (eval echo "$as_me:8999: \"$ac_try\"") >&5
9000   (eval $ac_try) 2>&5
9001   ac_status=$?
9002   echo "$as_me:9002: \$? = $ac_status" >&5
9003   (exit "$ac_status"); }; }; then
9004   cf_cv_ncurses_header=$cf_header; break
9005 else
9006   echo "$as_me: failed program was:" >&5
9007 cat "conftest.$ac_ext" >&5
9008 fi
9009 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9010 done
9011
9012 fi
9013 echo "$as_me:9013: result: $cf_cv_ncurses_header" >&5
9014 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9015
9016 if test "$cf_cv_ncurses_header" = none ; then
9017         { { echo "$as_me:9017: error: No curses header-files found" >&5
9018 echo "$as_me: error: No curses header-files found" >&2;}
9019    { (exit 1); exit 1; }; }
9020 fi
9021
9022 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9023
9024 for ac_header in $cf_cv_ncurses_header
9025 do
9026 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9027 echo "$as_me:9027: checking for $ac_header" >&5
9028 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9029 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9030   echo $ECHO_N "(cached) $ECHO_C" >&6
9031 else
9032   cat >"conftest.$ac_ext" <<_ACEOF
9033 #line 9033 "configure"
9034 #include "confdefs.h"
9035 #include <$ac_header>
9036 _ACEOF
9037 if { (eval echo "$as_me:9037: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9038   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9039   ac_status=$?
9040   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9041   rm -f conftest.er1
9042   cat conftest.err >&5
9043   echo "$as_me:9043: \$? = $ac_status" >&5
9044   (exit "$ac_status"); } >/dev/null; then
9045   if test -s conftest.err; then
9046     ac_cpp_err=$ac_c_preproc_warn_flag
9047   else
9048     ac_cpp_err=
9049   fi
9050 else
9051   ac_cpp_err=yes
9052 fi
9053 if test -z "$ac_cpp_err"; then
9054   eval "$as_ac_Header=yes"
9055 else
9056   echo "$as_me: failed program was:" >&5
9057   cat "conftest.$ac_ext" >&5
9058   eval "$as_ac_Header=no"
9059 fi
9060 rm -f conftest.err "conftest.$ac_ext"
9061 fi
9062 echo "$as_me:9062: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9063 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9064 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9065   cat >>confdefs.h <<EOF
9066 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9067 EOF
9068
9069 fi
9070 done
9071
9072 cat >>confdefs.h <<\EOF
9073 #define NCURSES 1
9074 EOF
9075
9076 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9077
9078                 cat >>confdefs.h <<EOF
9079 #define $cf_nculib_ROOT 1
9080 EOF
9081
9082                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9083
9084         else
9085
9086 cf_ncuhdr_root=$cf_cv_screen
9087
9088 test -n "$cf_cv_curses_dir" && \
9089 test "$cf_cv_curses_dir" != "no" && { \
9090
9091 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9092   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9093   do
9094         while test "$cf_add_incdir" != /usr/include
9095         do
9096           if test -d "$cf_add_incdir"
9097           then
9098                 cf_have_incdir=no
9099                 if test -n "$CFLAGS$CPPFLAGS" ; then
9100                   # a loop is needed to ensure we can add subdirs of existing dirs
9101                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9102                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9103                           cf_have_incdir=yes; break
9104                         fi
9105                   done
9106                 fi
9107
9108                 if test "$cf_have_incdir" = no ; then
9109                   if test "$cf_add_incdir" = /usr/local/include ; then
9110                         if test "$GCC" = yes
9111                         then
9112                           cf_save_CPPFLAGS=$CPPFLAGS
9113
9114         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9115         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9116
9117                           cat >"conftest.$ac_ext" <<_ACEOF
9118 #line 9118 "configure"
9119 #include "confdefs.h"
9120 #include <stdio.h>
9121 int
9122 main (void)
9123 {
9124 printf("Hello")
9125   ;
9126   return 0;
9127 }
9128 _ACEOF
9129 rm -f "conftest.$ac_objext"
9130 if { (eval echo "$as_me:9130: \"$ac_compile\"") >&5
9131   (eval $ac_compile) 2>&5
9132   ac_status=$?
9133   echo "$as_me:9133: \$? = $ac_status" >&5
9134   (exit "$ac_status"); } &&
9135          { ac_try='test -s "conftest.$ac_objext"'
9136   { (eval echo "$as_me:9136: \"$ac_try\"") >&5
9137   (eval $ac_try) 2>&5
9138   ac_status=$?
9139   echo "$as_me:9139: \$? = $ac_status" >&5
9140   (exit "$ac_status"); }; }; then
9141   :
9142 else
9143   echo "$as_me: failed program was:" >&5
9144 cat "conftest.$ac_ext" >&5
9145 cf_have_incdir=yes
9146 fi
9147 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9148                           CPPFLAGS=$cf_save_CPPFLAGS
9149                         fi
9150                   fi
9151                 fi
9152
9153                 if test "$cf_have_incdir" = no ; then
9154                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9155
9156 echo "${as_me:-configure}:9156: testing adding $cf_add_incdir to include-path ..." 1>&5
9157
9158                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9159
9160                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9161                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9162                   cf_add_incdir="$cf_top_incdir"
9163                 else
9164                   break
9165                 fi
9166           else
9167                 break
9168           fi
9169         done
9170   done
9171 fi
9172
9173 }
9174
9175 echo "$as_me:9175: checking for $cf_ncuhdr_root header in include-path" >&5
9176 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9177 if test "${cf_cv_ncurses_h+set}" = set; then
9178   echo $ECHO_N "(cached) $ECHO_C" >&6
9179 else
9180
9181         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9182         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9183         for cf_header in $cf_header_list
9184         do
9185
9186         cat >"conftest.$ac_ext" <<_ACEOF
9187 #line 9187 "configure"
9188 #include "confdefs.h"
9189
9190 #include <$cf_header>
9191 int
9192 main (void)
9193 {
9194
9195 #ifdef NCURSES_VERSION
9196
9197 printf("%s\\n", NCURSES_VERSION);
9198 #else
9199 #ifdef __NCURSES_H
9200 printf("old\\n");
9201 #else
9202         make an error
9203 #endif
9204 #endif
9205
9206   ;
9207   return 0;
9208 }
9209 _ACEOF
9210 rm -f "conftest.$ac_objext"
9211 if { (eval echo "$as_me:9211: \"$ac_compile\"") >&5
9212   (eval $ac_compile) 2>&5
9213   ac_status=$?
9214   echo "$as_me:9214: \$? = $ac_status" >&5
9215   (exit "$ac_status"); } &&
9216          { ac_try='test -s "conftest.$ac_objext"'
9217   { (eval echo "$as_me:9217: \"$ac_try\"") >&5
9218   (eval $ac_try) 2>&5
9219   ac_status=$?
9220   echo "$as_me:9220: \$? = $ac_status" >&5
9221   (exit "$ac_status"); }; }; then
9222   cf_cv_ncurses_h=$cf_header
9223
9224 else
9225   echo "$as_me: failed program was:" >&5
9226 cat "conftest.$ac_ext" >&5
9227 cf_cv_ncurses_h=no
9228 fi
9229 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9230
9231                 test "$cf_cv_ncurses_h" != no && break
9232         done
9233
9234 fi
9235 echo "$as_me:9235: result: $cf_cv_ncurses_h" >&5
9236 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9237
9238 if test "$cf_cv_ncurses_h" != no ; then
9239         cf_cv_ncurses_header=$cf_cv_ncurses_h
9240 else
9241
9242 echo "$as_me:9242: checking for $cf_ncuhdr_root include-path" >&5
9243 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9244 if test "${cf_cv_ncurses_h2+set}" = set; then
9245   echo $ECHO_N "(cached) $ECHO_C" >&6
9246 else
9247
9248         test -n "$verbose" && echo
9249
9250 cf_search=
9251
9252 # collect the current set of include-directories from compiler flags
9253 cf_header_path_list=""
9254 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9255         for cf_header_path in $CPPFLAGS $CFLAGS
9256         do
9257                 case "$cf_header_path" in
9258                 (-I*)
9259                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9260
9261 test "x$cf_header_path" != "xNONE" && \
9262 test -d "$cf_header_path" && \
9263  {
9264         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9265         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
9266         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9267         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9268         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9269         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"
9270 }
9271
9272                         cf_header_path_list="$cf_header_path_list $cf_search"
9273                         ;;
9274                 esac
9275         done
9276 fi
9277
9278 # add the variations for the package we are looking for
9279
9280 cf_search=
9281
9282 test "x$prefix" != "xNONE" && \
9283 test -d "$prefix" && \
9284  {
9285         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9286         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
9287         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9288         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9289         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9290         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9291 }
9292
9293 for cf_subdir_prefix in \
9294         /usr \
9295         /usr/local \
9296         /usr/pkg \
9297         /opt \
9298         /opt/local \
9299         $HOME
9300 do
9301
9302 test "x$cf_subdir_prefix" != "x$prefix" && \
9303 test -d "$cf_subdir_prefix" && \
9304 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9305         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9306         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
9307         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9308         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9309         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9310         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"
9311 }
9312
9313 done
9314
9315 test "$includedir" != NONE && \
9316 test "$includedir" != "/usr/include" && \
9317 test -d "$includedir" && {
9318         test -d "$includedir" &&    cf_search="$cf_search $includedir"
9319         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9320 }
9321
9322 test "$oldincludedir" != NONE && \
9323 test "$oldincludedir" != "/usr/include" && \
9324 test -d "$oldincludedir" && {
9325         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
9326         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9327 }
9328
9329 cf_search="$cf_search $cf_header_path_list"
9330
9331         test -n "$verbose" && echo "search path $cf_search"
9332         cf_save2_CPPFLAGS="$CPPFLAGS"
9333         for cf_incdir in $cf_search
9334         do
9335
9336 if test -n "$cf_incdir" ; then
9337   for cf_add_incdir in $cf_incdir
9338   do
9339         while test "$cf_add_incdir" != /usr/include
9340         do
9341           if test -d "$cf_add_incdir"
9342           then
9343                 cf_have_incdir=no
9344                 if test -n "$CFLAGS$CPPFLAGS" ; then
9345                   # a loop is needed to ensure we can add subdirs of existing dirs
9346                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9347                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9348                           cf_have_incdir=yes; break
9349                         fi
9350                   done
9351                 fi
9352
9353                 if test "$cf_have_incdir" = no ; then
9354                   if test "$cf_add_incdir" = /usr/local/include ; then
9355                         if test "$GCC" = yes
9356                         then
9357                           cf_save_CPPFLAGS=$CPPFLAGS
9358
9359         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9360         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9361
9362                           cat >"conftest.$ac_ext" <<_ACEOF
9363 #line 9363 "configure"
9364 #include "confdefs.h"
9365 #include <stdio.h>
9366 int
9367 main (void)
9368 {
9369 printf("Hello")
9370   ;
9371   return 0;
9372 }
9373 _ACEOF
9374 rm -f "conftest.$ac_objext"
9375 if { (eval echo "$as_me:9375: \"$ac_compile\"") >&5
9376   (eval $ac_compile) 2>&5
9377   ac_status=$?
9378   echo "$as_me:9378: \$? = $ac_status" >&5
9379   (exit "$ac_status"); } &&
9380          { ac_try='test -s "conftest.$ac_objext"'
9381   { (eval echo "$as_me:9381: \"$ac_try\"") >&5
9382   (eval $ac_try) 2>&5
9383   ac_status=$?
9384   echo "$as_me:9384: \$? = $ac_status" >&5
9385   (exit "$ac_status"); }; }; then
9386   :
9387 else
9388   echo "$as_me: failed program was:" >&5
9389 cat "conftest.$ac_ext" >&5
9390 cf_have_incdir=yes
9391 fi
9392 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9393                           CPPFLAGS=$cf_save_CPPFLAGS
9394                         fi
9395                   fi
9396                 fi
9397
9398                 if test "$cf_have_incdir" = no ; then
9399                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9400
9401 echo "${as_me:-configure}:9401: testing adding $cf_add_incdir to include-path ..." 1>&5
9402
9403                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9404
9405                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9406                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9407                   cf_add_incdir="$cf_top_incdir"
9408                 else
9409                   break
9410                 fi
9411           else
9412                 break
9413           fi
9414         done
9415   done
9416 fi
9417
9418                 for cf_header in \
9419                         ncurses.h \
9420                         curses.h
9421                 do
9422
9423         cat >"conftest.$ac_ext" <<_ACEOF
9424 #line 9424 "configure"
9425 #include "confdefs.h"
9426
9427 #include <$cf_header>
9428 int
9429 main (void)
9430 {
9431
9432 #ifdef NCURSES_VERSION
9433
9434 printf("%s\\n", NCURSES_VERSION);
9435 #else
9436 #ifdef __NCURSES_H
9437 printf("old\\n");
9438 #else
9439         make an error
9440 #endif
9441 #endif
9442
9443   ;
9444   return 0;
9445 }
9446 _ACEOF
9447 rm -f "conftest.$ac_objext"
9448 if { (eval echo "$as_me:9448: \"$ac_compile\"") >&5
9449   (eval $ac_compile) 2>&5
9450   ac_status=$?
9451   echo "$as_me:9451: \$? = $ac_status" >&5
9452   (exit "$ac_status"); } &&
9453          { ac_try='test -s "conftest.$ac_objext"'
9454   { (eval echo "$as_me:9454: \"$ac_try\"") >&5
9455   (eval $ac_try) 2>&5
9456   ac_status=$?
9457   echo "$as_me:9457: \$? = $ac_status" >&5
9458   (exit "$ac_status"); }; }; then
9459   cf_cv_ncurses_h2=$cf_header
9460
9461 else
9462   echo "$as_me: failed program was:" >&5
9463 cat "conftest.$ac_ext" >&5
9464 cf_cv_ncurses_h2=no
9465 fi
9466 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9467
9468                         if test "$cf_cv_ncurses_h2" != no ; then
9469                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9470                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9471                                 break
9472                         fi
9473                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9474                 done
9475                 CPPFLAGS="$cf_save2_CPPFLAGS"
9476                 test "$cf_cv_ncurses_h2" != no && break
9477         done
9478         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9478: error: not found" >&5
9479 echo "$as_me: error: not found" >&2;}
9480    { (exit 1); exit 1; }; }
9481
9482 fi
9483 echo "$as_me:9483: result: $cf_cv_ncurses_h2" >&5
9484 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9485
9486         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9487         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9488         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9489                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9490         fi
9491
9492 if test -n "$cf_1st_incdir" ; then
9493   for cf_add_incdir in $cf_1st_incdir
9494   do
9495         while test "$cf_add_incdir" != /usr/include
9496         do
9497           if test -d "$cf_add_incdir"
9498           then
9499                 cf_have_incdir=no
9500                 if test -n "$CFLAGS$CPPFLAGS" ; then
9501                   # a loop is needed to ensure we can add subdirs of existing dirs
9502                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9503                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9504                           cf_have_incdir=yes; break
9505                         fi
9506                   done
9507                 fi
9508
9509                 if test "$cf_have_incdir" = no ; then
9510                   if test "$cf_add_incdir" = /usr/local/include ; then
9511                         if test "$GCC" = yes
9512                         then
9513                           cf_save_CPPFLAGS=$CPPFLAGS
9514
9515         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9516         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9517
9518                           cat >"conftest.$ac_ext" <<_ACEOF
9519 #line 9519 "configure"
9520 #include "confdefs.h"
9521 #include <stdio.h>
9522 int
9523 main (void)
9524 {
9525 printf("Hello")
9526   ;
9527   return 0;
9528 }
9529 _ACEOF
9530 rm -f "conftest.$ac_objext"
9531 if { (eval echo "$as_me:9531: \"$ac_compile\"") >&5
9532   (eval $ac_compile) 2>&5
9533   ac_status=$?
9534   echo "$as_me:9534: \$? = $ac_status" >&5
9535   (exit "$ac_status"); } &&
9536          { ac_try='test -s "conftest.$ac_objext"'
9537   { (eval echo "$as_me:9537: \"$ac_try\"") >&5
9538   (eval $ac_try) 2>&5
9539   ac_status=$?
9540   echo "$as_me:9540: \$? = $ac_status" >&5
9541   (exit "$ac_status"); }; }; then
9542   :
9543 else
9544   echo "$as_me: failed program was:" >&5
9545 cat "conftest.$ac_ext" >&5
9546 cf_have_incdir=yes
9547 fi
9548 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9549                           CPPFLAGS=$cf_save_CPPFLAGS
9550                         fi
9551                   fi
9552                 fi
9553
9554                 if test "$cf_have_incdir" = no ; then
9555                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9556
9557 echo "${as_me:-configure}:9557: testing adding $cf_add_incdir to include-path ..." 1>&5
9558
9559                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9560
9561                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9562                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9563                   cf_add_incdir="$cf_top_incdir"
9564                 else
9565                   break
9566                 fi
9567           else
9568                 break
9569           fi
9570         done
9571   done
9572 fi
9573
9574 fi
9575
9576 # Set definitions to allow ifdef'ing for ncurses.h
9577
9578 case "$cf_cv_ncurses_header" in
9579 (*ncurses.h)
9580
9581 cat >>confdefs.h <<\EOF
9582 #define HAVE_NCURSES_H 1
9583 EOF
9584
9585         ;;
9586 esac
9587
9588 case "$cf_cv_ncurses_header" in
9589 (ncurses/curses.h|ncurses/ncurses.h)
9590
9591 cat >>confdefs.h <<\EOF
9592 #define HAVE_NCURSES_NCURSES_H 1
9593 EOF
9594
9595         ;;
9596 (ncursesw/curses.h|ncursesw/ncurses.h)
9597
9598 cat >>confdefs.h <<\EOF
9599 #define HAVE_NCURSESW_NCURSES_H 1
9600 EOF
9601
9602         ;;
9603 esac
9604
9605 echo "$as_me:9605: checking for terminfo header" >&5
9606 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9607 if test "${cf_cv_term_header+set}" = set; then
9608   echo $ECHO_N "(cached) $ECHO_C" >&6
9609 else
9610
9611 case "${cf_cv_ncurses_header}" in
9612 (*/ncurses.h|*/ncursesw.h)
9613         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9614         ;;
9615 (*)
9616         cf_term_header=term.h
9617         ;;
9618 esac
9619
9620 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9621 do
9622 cat >"conftest.$ac_ext" <<_ACEOF
9623 #line 9623 "configure"
9624 #include "confdefs.h"
9625 #include <stdio.h>
9626 #include <${cf_cv_ncurses_header:-curses.h}>
9627 #include <$cf_test>
9628
9629 int
9630 main (void)
9631 {
9632 int x = auto_left_margin; (void)x
9633   ;
9634   return 0;
9635 }
9636 _ACEOF
9637 rm -f "conftest.$ac_objext"
9638 if { (eval echo "$as_me:9638: \"$ac_compile\"") >&5
9639   (eval $ac_compile) 2>&5
9640   ac_status=$?
9641   echo "$as_me:9641: \$? = $ac_status" >&5
9642   (exit "$ac_status"); } &&
9643          { ac_try='test -s "conftest.$ac_objext"'
9644   { (eval echo "$as_me:9644: \"$ac_try\"") >&5
9645   (eval $ac_try) 2>&5
9646   ac_status=$?
9647   echo "$as_me:9647: \$? = $ac_status" >&5
9648   (exit "$ac_status"); }; }; then
9649
9650         cf_cv_term_header="$cf_test"
9651 else
9652   echo "$as_me: failed program was:" >&5
9653 cat "conftest.$ac_ext" >&5
9654
9655         cf_cv_term_header=unknown
9656
9657 fi
9658 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9659         test "$cf_cv_term_header" != unknown && break
9660 done
9661
9662 fi
9663 echo "$as_me:9663: result: $cf_cv_term_header" >&5
9664 echo "${ECHO_T}$cf_cv_term_header" >&6
9665
9666 # Set definitions to allow ifdef'ing to accommodate subdirectories
9667
9668 case "$cf_cv_term_header" in
9669 (*term.h)
9670
9671 cat >>confdefs.h <<\EOF
9672 #define HAVE_TERM_H 1
9673 EOF
9674
9675         ;;
9676 esac
9677
9678 case "$cf_cv_term_header" in
9679 (ncurses/term.h)
9680
9681 cat >>confdefs.h <<\EOF
9682 #define HAVE_NCURSES_TERM_H 1
9683 EOF
9684
9685         ;;
9686 (ncursesw/term.h)
9687
9688 cat >>confdefs.h <<\EOF
9689 #define HAVE_NCURSESW_TERM_H 1
9690 EOF
9691
9692         ;;
9693 esac
9694
9695 # some applications need this, but should check for NCURSES_VERSION
9696
9697 cat >>confdefs.h <<\EOF
9698 #define NCURSES 1
9699 EOF
9700
9701 echo "$as_me:9701: checking for ncurses version" >&5
9702 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9703 if test "${cf_cv_ncurses_version+set}" = set; then
9704   echo $ECHO_N "(cached) $ECHO_C" >&6
9705 else
9706
9707         cf_cv_ncurses_version=no
9708         cf_tempfile=out$$
9709         rm -f "$cf_tempfile"
9710         if test "$cross_compiling" = yes; then
9711
9712         # This will not work if the preprocessor splits the line after the
9713         # Autoconf token.  The 'unproto' program does that.
9714         cat > "conftest.$ac_ext" <<EOF
9715 #include <${cf_cv_ncurses_header:-curses.h}>
9716 #undef Autoconf
9717 #ifdef NCURSES_VERSION
9718 Autoconf NCURSES_VERSION
9719 #else
9720 #ifdef __NCURSES_H
9721 Autoconf "old"
9722 #endif
9723 ;
9724 #endif
9725 EOF
9726         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9727         { (eval echo "$as_me:9727: \"$cf_try\"") >&5
9728   (eval $cf_try) 2>&5
9729   ac_status=$?
9730   echo "$as_me:9730: \$? = $ac_status" >&5
9731   (exit "$ac_status"); }
9732         if test -f conftest.out ; then
9733                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9734                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9735                 rm -f conftest.out
9736         fi
9737
9738 else
9739   cat >"conftest.$ac_ext" <<_ACEOF
9740 #line 9740 "configure"
9741 #include "confdefs.h"
9742
9743 $ac_includes_default
9744
9745 #include <${cf_cv_ncurses_header:-curses.h}>
9746
9747 int main(void)
9748 {
9749         FILE *fp = fopen("$cf_tempfile", "w");
9750 #ifdef NCURSES_VERSION
9751 # ifdef NCURSES_VERSION_PATCH
9752         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9753 # else
9754         fprintf(fp, "%s\\n", NCURSES_VERSION);
9755 # endif
9756 #else
9757 # ifdef __NCURSES_H
9758         fprintf(fp, "old\\n");
9759 # else
9760         make an error
9761 # endif
9762 #endif
9763         ${cf_cv_main_return:-return}(0);
9764 }
9765 _ACEOF
9766 rm -f "conftest$ac_exeext"
9767 if { (eval echo "$as_me:9767: \"$ac_link\"") >&5
9768   (eval $ac_link) 2>&5
9769   ac_status=$?
9770   echo "$as_me:9770: \$? = $ac_status" >&5
9771   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9772   { (eval echo "$as_me:9772: \"$ac_try\"") >&5
9773   (eval $ac_try) 2>&5
9774   ac_status=$?
9775   echo "$as_me:9775: \$? = $ac_status" >&5
9776   (exit "$ac_status"); }; }; then
9777
9778         cf_cv_ncurses_version=`cat $cf_tempfile`
9779 else
9780   echo "$as_me: program exited with status $ac_status" >&5
9781 echo "$as_me: failed program was:" >&5
9782 cat "conftest.$ac_ext" >&5
9783 fi
9784 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9785 fi
9786         rm -f "$cf_tempfile"
9787
9788 fi
9789 echo "$as_me:9789: result: $cf_cv_ncurses_version" >&5
9790 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9791 test "$cf_cv_ncurses_version" = no ||
9792 cat >>confdefs.h <<\EOF
9793 #define NCURSES 1
9794 EOF
9795
9796 cf_nculib_root=$cf_cv_screen
9797         # This works, except for the special case where we find gpm, but
9798         # ncurses is in a nonstandard location via $LIBS, and we really want
9799         # to link gpm.
9800 cf_ncurses_LIBS=""
9801 cf_ncurses_SAVE="$LIBS"
9802 echo "$as_me:9802: checking for Gpm_Open in -lgpm" >&5
9803 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9804 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9805   echo $ECHO_N "(cached) $ECHO_C" >&6
9806 else
9807   ac_check_lib_save_LIBS=$LIBS
9808 LIBS="-lgpm  $LIBS"
9809 cat >"conftest.$ac_ext" <<_ACEOF
9810 #line 9810 "configure"
9811 #include "confdefs.h"
9812
9813 /* Override any gcc2 internal prototype to avoid an error.  */
9814 #ifdef __cplusplus
9815 extern "C"
9816 #endif
9817 /* We use char because int might match the return type of a gcc2
9818    builtin and then its argument prototype would still apply.  */
9819 char Gpm_Open ();
9820 int
9821 main (void)
9822 {
9823 Gpm_Open ();
9824   ;
9825   return 0;
9826 }
9827 _ACEOF
9828 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9829 if { (eval echo "$as_me:9829: \"$ac_link\"") >&5
9830   (eval $ac_link) 2>&5
9831   ac_status=$?
9832   echo "$as_me:9832: \$? = $ac_status" >&5
9833   (exit "$ac_status"); } &&
9834          { ac_try='test -s "conftest$ac_exeext"'
9835   { (eval echo "$as_me:9835: \"$ac_try\"") >&5
9836   (eval $ac_try) 2>&5
9837   ac_status=$?
9838   echo "$as_me:9838: \$? = $ac_status" >&5
9839   (exit "$ac_status"); }; }; then
9840   ac_cv_lib_gpm_Gpm_Open=yes
9841 else
9842   echo "$as_me: failed program was:" >&5
9843 cat "conftest.$ac_ext" >&5
9844 ac_cv_lib_gpm_Gpm_Open=no
9845 fi
9846 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9847 LIBS=$ac_check_lib_save_LIBS
9848 fi
9849 echo "$as_me:9849: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9850 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9851 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9852   echo "$as_me:9852: checking for initscr in -lgpm" >&5
9853 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9854 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9855   echo $ECHO_N "(cached) $ECHO_C" >&6
9856 else
9857   ac_check_lib_save_LIBS=$LIBS
9858 LIBS="-lgpm  $LIBS"
9859 cat >"conftest.$ac_ext" <<_ACEOF
9860 #line 9860 "configure"
9861 #include "confdefs.h"
9862
9863 /* Override any gcc2 internal prototype to avoid an error.  */
9864 #ifdef __cplusplus
9865 extern "C"
9866 #endif
9867 /* We use char because int might match the return type of a gcc2
9868    builtin and then its argument prototype would still apply.  */
9869 char initscr ();
9870 int
9871 main (void)
9872 {
9873 initscr ();
9874   ;
9875   return 0;
9876 }
9877 _ACEOF
9878 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9879 if { (eval echo "$as_me:9879: \"$ac_link\"") >&5
9880   (eval $ac_link) 2>&5
9881   ac_status=$?
9882   echo "$as_me:9882: \$? = $ac_status" >&5
9883   (exit "$ac_status"); } &&
9884          { ac_try='test -s "conftest$ac_exeext"'
9885   { (eval echo "$as_me:9885: \"$ac_try\"") >&5
9886   (eval $ac_try) 2>&5
9887   ac_status=$?
9888   echo "$as_me:9888: \$? = $ac_status" >&5
9889   (exit "$ac_status"); }; }; then
9890   ac_cv_lib_gpm_initscr=yes
9891 else
9892   echo "$as_me: failed program was:" >&5
9893 cat "conftest.$ac_ext" >&5
9894 ac_cv_lib_gpm_initscr=no
9895 fi
9896 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9897 LIBS=$ac_check_lib_save_LIBS
9898 fi
9899 echo "$as_me:9899: result: $ac_cv_lib_gpm_initscr" >&5
9900 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9901 if test "$ac_cv_lib_gpm_initscr" = yes; then
9902   LIBS="$cf_ncurses_SAVE"
9903 else
9904   cf_ncurses_LIBS="-lgpm"
9905 fi
9906
9907 fi
9908
9909 case "$host_os" in
9910 (freebsd*)
9911         # This is only necessary if you are linking against an obsolete
9912         # version of ncurses (but it should do no harm, since it is static).
9913         if test "$cf_nculib_root" = ncurses ; then
9914                 echo "$as_me:9914: checking for tgoto in -lmytinfo" >&5
9915 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9916 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9917   echo $ECHO_N "(cached) $ECHO_C" >&6
9918 else
9919   ac_check_lib_save_LIBS=$LIBS
9920 LIBS="-lmytinfo  $LIBS"
9921 cat >"conftest.$ac_ext" <<_ACEOF
9922 #line 9922 "configure"
9923 #include "confdefs.h"
9924
9925 /* Override any gcc2 internal prototype to avoid an error.  */
9926 #ifdef __cplusplus
9927 extern "C"
9928 #endif
9929 /* We use char because int might match the return type of a gcc2
9930    builtin and then its argument prototype would still apply.  */
9931 char tgoto ();
9932 int
9933 main (void)
9934 {
9935 tgoto ();
9936   ;
9937   return 0;
9938 }
9939 _ACEOF
9940 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9941 if { (eval echo "$as_me:9941: \"$ac_link\"") >&5
9942   (eval $ac_link) 2>&5
9943   ac_status=$?
9944   echo "$as_me:9944: \$? = $ac_status" >&5
9945   (exit "$ac_status"); } &&
9946          { ac_try='test -s "conftest$ac_exeext"'
9947   { (eval echo "$as_me:9947: \"$ac_try\"") >&5
9948   (eval $ac_try) 2>&5
9949   ac_status=$?
9950   echo "$as_me:9950: \$? = $ac_status" >&5
9951   (exit "$ac_status"); }; }; then
9952   ac_cv_lib_mytinfo_tgoto=yes
9953 else
9954   echo "$as_me: failed program was:" >&5
9955 cat "conftest.$ac_ext" >&5
9956 ac_cv_lib_mytinfo_tgoto=no
9957 fi
9958 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9959 LIBS=$ac_check_lib_save_LIBS
9960 fi
9961 echo "$as_me:9961: result: $ac_cv_lib_mytinfo_tgoto" >&5
9962 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9963 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9964   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9965 fi
9966
9967         fi
9968         ;;
9969 esac
9970
9971 cf_add_libs="$LIBS"
9972 # reverse order
9973 cf_add_0lib=
9974 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9975 # filter duplicates
9976 for cf_add_1lib in $cf_add_0lib; do
9977         for cf_add_2lib in $cf_add_libs; do
9978                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9979                         cf_add_1lib=
9980                         break
9981                 fi
9982         done
9983         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9984 done
9985 LIBS="$cf_add_libs"
9986
9987 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9988 then
9989
9990 cf_add_libs="$LIBS"
9991 # reverse order
9992 cf_add_0lib=
9993 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9994 # filter duplicates
9995 for cf_add_1lib in $cf_add_0lib; do
9996         for cf_add_2lib in $cf_add_libs; do
9997                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9998                         cf_add_1lib=
9999                         break
10000                 fi
10001         done
10002         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10003 done
10004 LIBS="$cf_add_libs"
10005
10006 else
10007
10008         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10009         cf_libdir=""
10010         echo "$as_me:10010: checking for initscr" >&5
10011 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10012 if test "${ac_cv_func_initscr+set}" = set; then
10013   echo $ECHO_N "(cached) $ECHO_C" >&6
10014 else
10015   cat >"conftest.$ac_ext" <<_ACEOF
10016 #line 10016 "configure"
10017 #include "confdefs.h"
10018 #define initscr autoconf_temporary
10019 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10020 #undef initscr
10021
10022 #ifdef __cplusplus
10023 extern "C"
10024 #endif
10025
10026 /* We use char because int might match the return type of a gcc2
10027    builtin and then its argument prototype would still apply.  */
10028 char initscr (void);
10029
10030 int
10031 main (void)
10032 {
10033
10034 /* The GNU C library defines stubs for functions which it implements
10035     to always fail with ENOSYS.  Some functions are actually named
10036     something starting with __ and the normal name is an alias.  */
10037 #if defined (__stub_initscr) || defined (__stub___initscr)
10038 #error found stub for initscr
10039 #endif
10040
10041         return initscr ();
10042   ;
10043   return 0;
10044 }
10045 _ACEOF
10046 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10047 if { (eval echo "$as_me:10047: \"$ac_link\"") >&5
10048   (eval $ac_link) 2>&5
10049   ac_status=$?
10050   echo "$as_me:10050: \$? = $ac_status" >&5
10051   (exit "$ac_status"); } &&
10052          { ac_try='test -s "conftest$ac_exeext"'
10053   { (eval echo "$as_me:10053: \"$ac_try\"") >&5
10054   (eval $ac_try) 2>&5
10055   ac_status=$?
10056   echo "$as_me:10056: \$? = $ac_status" >&5
10057   (exit "$ac_status"); }; }; then
10058   ac_cv_func_initscr=yes
10059 else
10060   echo "$as_me: failed program was:" >&5
10061 cat "conftest.$ac_ext" >&5
10062 ac_cv_func_initscr=no
10063 fi
10064 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10065 fi
10066 echo "$as_me:10066: result: $ac_cv_func_initscr" >&5
10067 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10068 if test "$ac_cv_func_initscr" = yes; then
10069   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10070 else
10071
10072                 cf_save_LIBS="$LIBS"
10073                 echo "$as_me:10073: checking for initscr in -l$cf_nculib_root" >&5
10074 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10075                 LIBS="-l$cf_nculib_root $LIBS"
10076                 cat >"conftest.$ac_ext" <<_ACEOF
10077 #line 10077 "configure"
10078 #include "confdefs.h"
10079 #include <${cf_cv_ncurses_header:-curses.h}>
10080 int
10081 main (void)
10082 {
10083 initscr()
10084   ;
10085   return 0;
10086 }
10087 _ACEOF
10088 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10089 if { (eval echo "$as_me:10089: \"$ac_link\"") >&5
10090   (eval $ac_link) 2>&5
10091   ac_status=$?
10092   echo "$as_me:10092: \$? = $ac_status" >&5
10093   (exit "$ac_status"); } &&
10094          { ac_try='test -s "conftest$ac_exeext"'
10095   { (eval echo "$as_me:10095: \"$ac_try\"") >&5
10096   (eval $ac_try) 2>&5
10097   ac_status=$?
10098   echo "$as_me:10098: \$? = $ac_status" >&5
10099   (exit "$ac_status"); }; }; then
10100   echo "$as_me:10100: result: yes" >&5
10101 echo "${ECHO_T}yes" >&6
10102                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10103
10104 else
10105   echo "$as_me: failed program was:" >&5
10106 cat "conftest.$ac_ext" >&5
10107 echo "$as_me:10107: result: no" >&5
10108 echo "${ECHO_T}no" >&6
10109
10110 cf_search=
10111 cf_library_path_list=""
10112 if test -n "${LDFLAGS}${LIBS}" ; then
10113         for cf_library_path in $LDFLAGS $LIBS
10114         do
10115                 case "$cf_library_path" in
10116                 (-L*)
10117                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10118
10119 test "x$cf_library_path" != "xNONE" && \
10120 test -d "$cf_library_path" && \
10121  {
10122         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10123         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10124         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10125         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10126         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10127         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"
10128 }
10129
10130                         cf_library_path_list="$cf_library_path_list $cf_search"
10131                         ;;
10132                 esac
10133         done
10134 fi
10135
10136 cf_search=
10137
10138 test "x$prefix" != "xNONE" && \
10139 test -d "$prefix" && \
10140  {
10141         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10142         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10143         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10144         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10145         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10146         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10147 }
10148
10149 for cf_subdir_prefix in \
10150         /usr \
10151         /usr/local \
10152         /usr/pkg \
10153         /opt \
10154         /opt/local \
10155         $HOME
10156 do
10157
10158 test "x$cf_subdir_prefix" != "x$prefix" && \
10159 test -d "$cf_subdir_prefix" && \
10160 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10161         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10162         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10163         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10164         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10165         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10166         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"
10167 }
10168
10169 done
10170
10171 cf_search="$cf_library_path_list $cf_search"
10172
10173                         for cf_libdir in $cf_search
10174                         do
10175                                 echo "$as_me:10175: checking for -l$cf_nculib_root in $cf_libdir" >&5
10176 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10177                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10178                                 cat >"conftest.$ac_ext" <<_ACEOF
10179 #line 10179 "configure"
10180 #include "confdefs.h"
10181 #include <${cf_cv_ncurses_header:-curses.h}>
10182 int
10183 main (void)
10184 {
10185 initscr()
10186   ;
10187   return 0;
10188 }
10189 _ACEOF
10190 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10191 if { (eval echo "$as_me:10191: \"$ac_link\"") >&5
10192   (eval $ac_link) 2>&5
10193   ac_status=$?
10194   echo "$as_me:10194: \$? = $ac_status" >&5
10195   (exit "$ac_status"); } &&
10196          { ac_try='test -s "conftest$ac_exeext"'
10197   { (eval echo "$as_me:10197: \"$ac_try\"") >&5
10198   (eval $ac_try) 2>&5
10199   ac_status=$?
10200   echo "$as_me:10200: \$? = $ac_status" >&5
10201   (exit "$ac_status"); }; }; then
10202   echo "$as_me:10202: result: yes" >&5
10203 echo "${ECHO_T}yes" >&6
10204                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10205                                          break
10206 else
10207   echo "$as_me: failed program was:" >&5
10208 cat "conftest.$ac_ext" >&5
10209 echo "$as_me:10209: result: no" >&5
10210 echo "${ECHO_T}no" >&6
10211                                          LIBS="$cf_save_LIBS"
10212 fi
10213 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10214                         done
10215
10216 fi
10217 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10218
10219 fi
10220
10221 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10222
10223 if test "$cf_found_library" = no ; then
10224         { { echo "$as_me:10224: error: Cannot link $cf_nculib_root library" >&5
10225 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10226    { (exit 1); exit 1; }; }
10227 fi
10228
10229 fi
10230
10231 if test -n "$cf_ncurses_LIBS" ; then
10232         echo "$as_me:10232: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10233 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10234         cf_ncurses_SAVE="$LIBS"
10235         for p in $cf_ncurses_LIBS ; do
10236                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
10237                 if test "$q" != "$LIBS" ; then
10238                         LIBS="$q"
10239                 fi
10240         done
10241         cat >"conftest.$ac_ext" <<_ACEOF
10242 #line 10242 "configure"
10243 #include "confdefs.h"
10244 #include <${cf_cv_ncurses_header:-curses.h}>
10245 int
10246 main (void)
10247 {
10248 initscr(); mousemask(0,0); tigetstr((char *)0);
10249   ;
10250   return 0;
10251 }
10252 _ACEOF
10253 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10254 if { (eval echo "$as_me:10254: \"$ac_link\"") >&5
10255   (eval $ac_link) 2>&5
10256   ac_status=$?
10257   echo "$as_me:10257: \$? = $ac_status" >&5
10258   (exit "$ac_status"); } &&
10259          { ac_try='test -s "conftest$ac_exeext"'
10260   { (eval echo "$as_me:10260: \"$ac_try\"") >&5
10261   (eval $ac_try) 2>&5
10262   ac_status=$?
10263   echo "$as_me:10263: \$? = $ac_status" >&5
10264   (exit "$ac_status"); }; }; then
10265   echo "$as_me:10265: result: yes" >&5
10266 echo "${ECHO_T}yes" >&6
10267 else
10268   echo "$as_me: failed program was:" >&5
10269 cat "conftest.$ac_ext" >&5
10270 echo "$as_me:10270: result: no" >&5
10271 echo "${ECHO_T}no" >&6
10272                  LIBS="$cf_ncurses_SAVE"
10273 fi
10274 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10275 fi
10276
10277 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10278
10279 cat >>confdefs.h <<EOF
10280 #define $cf_nculib_ROOT 1
10281 EOF
10282
10283         fi
10284 else
10285         NCURSES_CONFIG=none
10286 fi
10287
10288         ;;
10289 (ncurses*)
10290
10291 cf_ncuconfig_root=$cf_cv_screen
10292 cf_have_ncuconfig=no
10293
10294 if test "x${PKG_CONFIG:=none}" != xnone; then
10295         echo "$as_me:10295: checking pkg-config for $cf_ncuconfig_root" >&5
10296 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
10297         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
10298                 echo "$as_me:10298: result: yes" >&5
10299 echo "${ECHO_T}yes" >&6
10300
10301                 echo "$as_me:10301: checking if the $cf_ncuconfig_root package files work" >&5
10302 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
10303                 cf_have_ncuconfig=unknown
10304
10305                 cf_save_CFLAGS="$CFLAGS"
10306                 cf_save_CPPFLAGS="$CPPFLAGS"
10307                 cf_save_LIBS="$LIBS"
10308
10309                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
10310                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
10311
10312                 # while -W for passing linker flags is prevalent, it is not "standard".
10313                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
10314                 # incompatible _and_ non-standard -W option which gives an error.  Work
10315                 # around that pitfall.
10316                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
10317                 (x*c[89]9@@*-W*)
10318
10319 cf_fix_cppflags=no
10320 cf_new_cflags=
10321 cf_new_cppflags=
10322 cf_new_extra_cppflags=
10323
10324 for cf_add_cflags in $cf_pkg_cflags
10325 do
10326 case "$cf_fix_cppflags" in
10327 (no)
10328         case "$cf_add_cflags" in
10329         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10330                 case "$cf_add_cflags" in
10331                 (-D*)
10332                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10333
10334                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10335                                 && test -z "${cf_tst_cflags}" \
10336                                 && cf_fix_cppflags=yes
10337
10338                         if test "$cf_fix_cppflags" = yes ; then
10339
10340         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10341         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10342
10343                                 continue
10344                         elif test "${cf_tst_cflags}" = "\"'" ; then
10345
10346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10348
10349                                 continue
10350                         fi
10351                         ;;
10352                 esac
10353                 case "$CPPFLAGS" in
10354                 (*$cf_add_cflags)
10355                         ;;
10356                 (*)
10357                         case "$cf_add_cflags" in
10358                         (-D*)
10359                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10360
10361 CPPFLAGS=`echo "$CPPFLAGS" | \
10362         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10363                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10364
10365                                 ;;
10366                         esac
10367
10368         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10369         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10370
10371                         ;;
10372                 esac
10373                 ;;
10374         (*)
10375
10376         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10377         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10378
10379                 ;;
10380         esac
10381         ;;
10382 (yes)
10383
10384         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10385         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10386
10387         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10388
10389         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10390                 && test -z "${cf_tst_cflags}" \
10391                 && cf_fix_cppflags=no
10392         ;;
10393 esac
10394 done
10395
10396 if test -n "$cf_new_cflags" ; then
10397
10398         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10399         CFLAGS="${CFLAGS}$cf_new_cflags"
10400
10401 fi
10402
10403 if test -n "$cf_new_cppflags" ; then
10404
10405         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10406         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10407
10408 fi
10409
10410 if test -n "$cf_new_extra_cppflags" ; then
10411
10412         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10413         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10414
10415 fi
10416
10417 cf_add_libs="$LIBS"
10418 # reverse order
10419 cf_add_0lib=
10420 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10421 # filter duplicates
10422 for cf_add_1lib in $cf_add_0lib; do
10423         for cf_add_2lib in $cf_add_libs; do
10424                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10425                         cf_add_1lib=
10426                         break
10427                 fi
10428         done
10429         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10430 done
10431 LIBS="$cf_add_libs"
10432
10433                         cat >"conftest.$ac_ext" <<_ACEOF
10434 #line 10434 "configure"
10435 #include "confdefs.h"
10436 #include <${cf_cv_ncurses_header:-curses.h}>
10437 int
10438 main (void)
10439 {
10440 initscr(); mousemask(0,0); tigetstr((char *)0);
10441   ;
10442   return 0;
10443 }
10444 _ACEOF
10445 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10446 if { (eval echo "$as_me:10446: \"$ac_link\"") >&5
10447   (eval $ac_link) 2>&5
10448   ac_status=$?
10449   echo "$as_me:10449: \$? = $ac_status" >&5
10450   (exit "$ac_status"); } &&
10451          { ac_try='test -s "conftest$ac_exeext"'
10452   { (eval echo "$as_me:10452: \"$ac_try\"") >&5
10453   (eval $ac_try) 2>&5
10454   ac_status=$?
10455   echo "$as_me:10455: \$? = $ac_status" >&5
10456   (exit "$ac_status"); }; }; then
10457   if test "$cross_compiling" = yes; then
10458   cf_test_ncuconfig=maybe
10459 else
10460   cat >"conftest.$ac_ext" <<_ACEOF
10461 #line 10461 "configure"
10462 #include "confdefs.h"
10463 #include <${cf_cv_ncurses_header:-curses.h}>
10464                                         int main(void)
10465                                         { const char *xx = curses_version(); return (xx == 0); }
10466 _ACEOF
10467 rm -f "conftest$ac_exeext"
10468 if { (eval echo "$as_me:10468: \"$ac_link\"") >&5
10469   (eval $ac_link) 2>&5
10470   ac_status=$?
10471   echo "$as_me:10471: \$? = $ac_status" >&5
10472   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10473   { (eval echo "$as_me:10473: \"$ac_try\"") >&5
10474   (eval $ac_try) 2>&5
10475   ac_status=$?
10476   echo "$as_me:10476: \$? = $ac_status" >&5
10477   (exit "$ac_status"); }; }; then
10478   cf_test_ncuconfig=yes
10479 else
10480   echo "$as_me: program exited with status $ac_status" >&5
10481 echo "$as_me: failed program was:" >&5
10482 cat "conftest.$ac_ext" >&5
10483 cf_test_ncuconfig=no
10484 fi
10485 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10486 fi
10487 else
10488   echo "$as_me: failed program was:" >&5
10489 cat "conftest.$ac_ext" >&5
10490 cf_test_ncuconfig=no
10491 fi
10492 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10493
10494                         CFLAGS="$cf_save_CFLAGS"
10495                         CPPFLAGS="$cf_save_CPPFLAGS"
10496                         LIBS="$cf_save_LIBS"
10497
10498                         if test "x$cf_test_ncuconfig" != xyes; then
10499                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10500                                 cf_pkg_cflags="$cf_temp"
10501                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10502                                 cf_pkg_libs="$cf_temp"
10503                         fi
10504                         ;;
10505                 esac
10506
10507 for cf_add_cflags in $cf_pkg_cflags
10508 do
10509         case "x$cf_add_cflags" in
10510         (x-[DU]*)
10511
10512 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10513 while true
10514 do
10515         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'`
10516         test "$CFLAGS" != "$cf_old_cflag" || break
10517
10518         CFLAGS="$cf_old_cflag"
10519 done
10520
10521 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10522 while true
10523 do
10524         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'`
10525         test "$CPPFLAGS" != "$cf_old_cflag" || break
10526
10527         CPPFLAGS="$cf_old_cflag"
10528 done
10529
10530                 ;;
10531         esac
10532
10533 cf_fix_cppflags=no
10534 cf_new_cflags=
10535 cf_new_cppflags=
10536 cf_new_extra_cppflags=
10537
10538 for cf_add_cflags in $cf_add_cflags
10539 do
10540 case "$cf_fix_cppflags" in
10541 (no)
10542         case "$cf_add_cflags" in
10543         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10544                 case "$cf_add_cflags" in
10545                 (-D*)
10546                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10547
10548                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10549                                 && test -z "${cf_tst_cflags}" \
10550                                 && cf_fix_cppflags=yes
10551
10552                         if test "$cf_fix_cppflags" = yes ; then
10553
10554         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10555         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10556
10557                                 continue
10558                         elif test "${cf_tst_cflags}" = "\"'" ; then
10559
10560         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10561         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10562
10563                                 continue
10564                         fi
10565                         ;;
10566                 esac
10567                 case "$CPPFLAGS" in
10568                 (*$cf_add_cflags)
10569                         ;;
10570                 (*)
10571                         case "$cf_add_cflags" in
10572                         (-D*)
10573                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10574
10575 CPPFLAGS=`echo "$CPPFLAGS" | \
10576         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10577                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10578
10579                                 ;;
10580                         esac
10581
10582         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10583         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10584
10585                         ;;
10586                 esac
10587                 ;;
10588         (*)
10589
10590         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10591         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10592
10593                 ;;
10594         esac
10595         ;;
10596 (yes)
10597
10598         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10599         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10600
10601         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10602
10603         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10604                 && test -z "${cf_tst_cflags}" \
10605                 && cf_fix_cppflags=no
10606         ;;
10607 esac
10608 done
10609
10610 if test -n "$cf_new_cflags" ; then
10611
10612         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10613         CFLAGS="${CFLAGS}$cf_new_cflags"
10614
10615 fi
10616
10617 if test -n "$cf_new_cppflags" ; then
10618
10619         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10620         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10621
10622 fi
10623
10624 if test -n "$cf_new_extra_cppflags" ; then
10625
10626         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10627         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10628
10629 fi
10630
10631 done
10632
10633 cf_add_libs="$LIBS"
10634 # reverse order
10635 cf_add_0lib=
10636 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10637 # filter duplicates
10638 for cf_add_1lib in $cf_add_0lib; do
10639         for cf_add_2lib in $cf_add_libs; do
10640                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10641                         cf_add_1lib=
10642                         break
10643                 fi
10644         done
10645         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10646 done
10647 LIBS="$cf_add_libs"
10648
10649                 cat >"conftest.$ac_ext" <<_ACEOF
10650 #line 10650 "configure"
10651 #include "confdefs.h"
10652 #include <${cf_cv_ncurses_header:-curses.h}>
10653 int
10654 main (void)
10655 {
10656 initscr(); mousemask(0,0); tigetstr((char *)0);
10657   ;
10658   return 0;
10659 }
10660 _ACEOF
10661 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10662 if { (eval echo "$as_me:10662: \"$ac_link\"") >&5
10663   (eval $ac_link) 2>&5
10664   ac_status=$?
10665   echo "$as_me:10665: \$? = $ac_status" >&5
10666   (exit "$ac_status"); } &&
10667          { ac_try='test -s "conftest$ac_exeext"'
10668   { (eval echo "$as_me:10668: \"$ac_try\"") >&5
10669   (eval $ac_try) 2>&5
10670   ac_status=$?
10671   echo "$as_me:10671: \$? = $ac_status" >&5
10672   (exit "$ac_status"); }; }; then
10673   if test "$cross_compiling" = yes; then
10674   cf_have_ncuconfig=maybe
10675 else
10676   cat >"conftest.$ac_ext" <<_ACEOF
10677 #line 10677 "configure"
10678 #include "confdefs.h"
10679 #include <${cf_cv_ncurses_header:-curses.h}>
10680                                 int main(void)
10681                                 { const char *xx = curses_version(); return (xx == 0); }
10682 _ACEOF
10683 rm -f "conftest$ac_exeext"
10684 if { (eval echo "$as_me:10684: \"$ac_link\"") >&5
10685   (eval $ac_link) 2>&5
10686   ac_status=$?
10687   echo "$as_me:10687: \$? = $ac_status" >&5
10688   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10689   { (eval echo "$as_me:10689: \"$ac_try\"") >&5
10690   (eval $ac_try) 2>&5
10691   ac_status=$?
10692   echo "$as_me:10692: \$? = $ac_status" >&5
10693   (exit "$ac_status"); }; }; then
10694   cf_have_ncuconfig=yes
10695 else
10696   echo "$as_me: program exited with status $ac_status" >&5
10697 echo "$as_me: failed program was:" >&5
10698 cat "conftest.$ac_ext" >&5
10699 cf_have_ncuconfig=no
10700 fi
10701 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10702 fi
10703 else
10704   echo "$as_me: failed program was:" >&5
10705 cat "conftest.$ac_ext" >&5
10706 cf_have_ncuconfig=no
10707 fi
10708 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10709                 echo "$as_me:10709: result: $cf_have_ncuconfig" >&5
10710 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10711                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10712                 if test "$cf_have_ncuconfig" != "yes"
10713                 then
10714                         CPPFLAGS="$cf_save_CPPFLAGS"
10715                         LIBS="$cf_save_LIBS"
10716                         NCURSES_CONFIG_PKG=none
10717                 else
10718
10719 cat >>confdefs.h <<\EOF
10720 #define NCURSES 1
10721 EOF
10722
10723                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10724
10725 echo "$as_me:10725: checking for terminfo header" >&5
10726 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10727 if test "${cf_cv_term_header+set}" = set; then
10728   echo $ECHO_N "(cached) $ECHO_C" >&6
10729 else
10730
10731 case "${cf_cv_ncurses_header}" in
10732 (*/ncurses.h|*/ncursesw.h)
10733         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10734         ;;
10735 (*)
10736         cf_term_header=term.h
10737         ;;
10738 esac
10739
10740 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10741 do
10742 cat >"conftest.$ac_ext" <<_ACEOF
10743 #line 10743 "configure"
10744 #include "confdefs.h"
10745 #include <stdio.h>
10746 #include <${cf_cv_ncurses_header:-curses.h}>
10747 #include <$cf_test>
10748
10749 int
10750 main (void)
10751 {
10752 int x = auto_left_margin; (void)x
10753   ;
10754   return 0;
10755 }
10756 _ACEOF
10757 rm -f "conftest.$ac_objext"
10758 if { (eval echo "$as_me:10758: \"$ac_compile\"") >&5
10759   (eval $ac_compile) 2>&5
10760   ac_status=$?
10761   echo "$as_me:10761: \$? = $ac_status" >&5
10762   (exit "$ac_status"); } &&
10763          { ac_try='test -s "conftest.$ac_objext"'
10764   { (eval echo "$as_me:10764: \"$ac_try\"") >&5
10765   (eval $ac_try) 2>&5
10766   ac_status=$?
10767   echo "$as_me:10767: \$? = $ac_status" >&5
10768   (exit "$ac_status"); }; }; then
10769
10770         cf_cv_term_header="$cf_test"
10771 else
10772   echo "$as_me: failed program was:" >&5
10773 cat "conftest.$ac_ext" >&5
10774
10775         cf_cv_term_header=unknown
10776
10777 fi
10778 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10779         test "$cf_cv_term_header" != unknown && break
10780 done
10781
10782 fi
10783 echo "$as_me:10783: result: $cf_cv_term_header" >&5
10784 echo "${ECHO_T}$cf_cv_term_header" >&6
10785
10786 # Set definitions to allow ifdef'ing to accommodate subdirectories
10787
10788 case "$cf_cv_term_header" in
10789 (*term.h)
10790
10791 cat >>confdefs.h <<\EOF
10792 #define HAVE_TERM_H 1
10793 EOF
10794
10795         ;;
10796 esac
10797
10798 case "$cf_cv_term_header" in
10799 (ncurses/term.h)
10800
10801 cat >>confdefs.h <<\EOF
10802 #define HAVE_NCURSES_TERM_H 1
10803 EOF
10804
10805         ;;
10806 (ncursesw/term.h)
10807
10808 cat >>confdefs.h <<\EOF
10809 #define HAVE_NCURSESW_TERM_H 1
10810 EOF
10811
10812         ;;
10813 esac
10814
10815                 fi
10816
10817         else
10818                 echo "$as_me:10818: result: no" >&5
10819 echo "${ECHO_T}no" >&6
10820                 NCURSES_CONFIG_PKG=none
10821         fi
10822 else
10823         NCURSES_CONFIG_PKG=none
10824 fi
10825
10826 if test "x$cf_have_ncuconfig" = "xno"; then
10827         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10828
10829 if test -n "$ac_tool_prefix"; then
10830   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10831   do
10832     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10833 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10834 echo "$as_me:10834: checking for $ac_word" >&5
10835 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10836 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10837   echo $ECHO_N "(cached) $ECHO_C" >&6
10838 else
10839   if test -n "$NCURSES_CONFIG"; then
10840   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10841 else
10842   ac_save_IFS=$IFS; IFS=$ac_path_separator
10843 ac_dummy="$PATH"
10844 for ac_dir in $ac_dummy; do
10845   IFS=$ac_save_IFS
10846   test -z "$ac_dir" && ac_dir=.
10847   $as_executable_p "$ac_dir/$ac_word" || continue
10848 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10849 echo "$as_me:10849: found $ac_dir/$ac_word" >&5
10850 break
10851 done
10852
10853 fi
10854 fi
10855 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10856 if test -n "$NCURSES_CONFIG"; then
10857   echo "$as_me:10857: result: $NCURSES_CONFIG" >&5
10858 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10859 else
10860   echo "$as_me:10860: result: no" >&5
10861 echo "${ECHO_T}no" >&6
10862 fi
10863
10864     test -n "$NCURSES_CONFIG" && break
10865   done
10866 fi
10867 if test -z "$NCURSES_CONFIG"; then
10868   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10869   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10870 do
10871   # Extract the first word of "$ac_prog", so it can be a program name with args.
10872 set dummy $ac_prog; ac_word=$2
10873 echo "$as_me:10873: checking for $ac_word" >&5
10874 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10875 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10876   echo $ECHO_N "(cached) $ECHO_C" >&6
10877 else
10878   if test -n "$ac_ct_NCURSES_CONFIG"; then
10879   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10880 else
10881   ac_save_IFS=$IFS; IFS=$ac_path_separator
10882 ac_dummy="$PATH"
10883 for ac_dir in $ac_dummy; do
10884   IFS=$ac_save_IFS
10885   test -z "$ac_dir" && ac_dir=.
10886   $as_executable_p "$ac_dir/$ac_word" || continue
10887 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10888 echo "$as_me:10888: found $ac_dir/$ac_word" >&5
10889 break
10890 done
10891
10892 fi
10893 fi
10894 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10895 if test -n "$ac_ct_NCURSES_CONFIG"; then
10896   echo "$as_me:10896: result: $ac_ct_NCURSES_CONFIG" >&5
10897 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10898 else
10899   echo "$as_me:10899: result: no" >&5
10900 echo "${ECHO_T}no" >&6
10901 fi
10902
10903   test -n "$ac_ct_NCURSES_CONFIG" && break
10904 done
10905 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10906
10907   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10908 fi
10909
10910         if test "$NCURSES_CONFIG" != none ; then
10911
10912 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10913 do
10914         case "x$cf_add_cflags" in
10915         (x-[DU]*)
10916
10917 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10918 while true
10919 do
10920         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'`
10921         test "$CFLAGS" != "$cf_old_cflag" || break
10922
10923         CFLAGS="$cf_old_cflag"
10924 done
10925
10926 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10927 while true
10928 do
10929         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'`
10930         test "$CPPFLAGS" != "$cf_old_cflag" || break
10931
10932         CPPFLAGS="$cf_old_cflag"
10933 done
10934
10935                 ;;
10936         esac
10937
10938 cf_fix_cppflags=no
10939 cf_new_cflags=
10940 cf_new_cppflags=
10941 cf_new_extra_cppflags=
10942
10943 for cf_add_cflags in $cf_add_cflags
10944 do
10945 case "$cf_fix_cppflags" in
10946 (no)
10947         case "$cf_add_cflags" in
10948         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10949                 case "$cf_add_cflags" in
10950                 (-D*)
10951                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10952
10953                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10954                                 && test -z "${cf_tst_cflags}" \
10955                                 && cf_fix_cppflags=yes
10956
10957                         if test "$cf_fix_cppflags" = yes ; then
10958
10959         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10960         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10961
10962                                 continue
10963                         elif test "${cf_tst_cflags}" = "\"'" ; then
10964
10965         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10966         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10967
10968                                 continue
10969                         fi
10970                         ;;
10971                 esac
10972                 case "$CPPFLAGS" in
10973                 (*$cf_add_cflags)
10974                         ;;
10975                 (*)
10976                         case "$cf_add_cflags" in
10977                         (-D*)
10978                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10979
10980 CPPFLAGS=`echo "$CPPFLAGS" | \
10981         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10982                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10983
10984                                 ;;
10985                         esac
10986
10987         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10988         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10989
10990                         ;;
10991                 esac
10992                 ;;
10993         (*)
10994
10995         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10996         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10997
10998                 ;;
10999         esac
11000         ;;
11001 (yes)
11002
11003         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11004         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11005
11006         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
11007
11008         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11009                 && test -z "${cf_tst_cflags}" \
11010                 && cf_fix_cppflags=no
11011         ;;
11012 esac
11013 done
11014
11015 if test -n "$cf_new_cflags" ; then
11016
11017         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11018         CFLAGS="${CFLAGS}$cf_new_cflags"
11019
11020 fi
11021
11022 if test -n "$cf_new_cppflags" ; then
11023
11024         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11025         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11026
11027 fi
11028
11029 if test -n "$cf_new_extra_cppflags" ; then
11030
11031         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11032         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11033
11034 fi
11035
11036 done
11037
11038 cf_add_libs="$LIBS"
11039 # reverse order
11040 cf_add_0lib=
11041 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11042 # filter duplicates
11043 for cf_add_1lib in $cf_add_0lib; do
11044         for cf_add_2lib in $cf_add_libs; do
11045                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11046                         cf_add_1lib=
11047                         break
11048                 fi
11049         done
11050         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11051 done
11052 LIBS="$cf_add_libs"
11053
11054                 # even with config script, some packages use no-override for curses.h
11055
11056 echo "$as_me:11056: checking if we have identified curses headers" >&5
11057 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
11058 if test "${cf_cv_ncurses_header+set}" = set; then
11059   echo $ECHO_N "(cached) $ECHO_C" >&6
11060 else
11061
11062 cf_cv_ncurses_header=none
11063 for cf_header in \
11064         ncurses.h $cf_cv_screen/ncurses.h \
11065         curses.h $cf_cv_screen/curses.h
11066 do
11067 cat >"conftest.$ac_ext" <<_ACEOF
11068 #line 11068 "configure"
11069 #include "confdefs.h"
11070 #include <${cf_header}>
11071 int
11072 main (void)
11073 {
11074 initscr(); endwin()
11075   ;
11076   return 0;
11077 }
11078 _ACEOF
11079 rm -f "conftest.$ac_objext"
11080 if { (eval echo "$as_me:11080: \"$ac_compile\"") >&5
11081   (eval $ac_compile) 2>&5
11082   ac_status=$?
11083   echo "$as_me:11083: \$? = $ac_status" >&5
11084   (exit "$ac_status"); } &&
11085          { ac_try='test -s "conftest.$ac_objext"'
11086   { (eval echo "$as_me:11086: \"$ac_try\"") >&5
11087   (eval $ac_try) 2>&5
11088   ac_status=$?
11089   echo "$as_me:11089: \$? = $ac_status" >&5
11090   (exit "$ac_status"); }; }; then
11091   cf_cv_ncurses_header=$cf_header; break
11092 else
11093   echo "$as_me: failed program was:" >&5
11094 cat "conftest.$ac_ext" >&5
11095 fi
11096 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11097 done
11098
11099 fi
11100 echo "$as_me:11100: result: $cf_cv_ncurses_header" >&5
11101 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
11102
11103 if test "$cf_cv_ncurses_header" = none ; then
11104         { { echo "$as_me:11104: error: No curses header-files found" >&5
11105 echo "$as_me: error: No curses header-files found" >&2;}
11106    { (exit 1); exit 1; }; }
11107 fi
11108
11109 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
11110
11111 for ac_header in $cf_cv_ncurses_header
11112 do
11113 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
11114 echo "$as_me:11114: checking for $ac_header" >&5
11115 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
11116 if eval "test \"\${$as_ac_Header+set}\" = set"; then
11117   echo $ECHO_N "(cached) $ECHO_C" >&6
11118 else
11119   cat >"conftest.$ac_ext" <<_ACEOF
11120 #line 11120 "configure"
11121 #include "confdefs.h"
11122 #include <$ac_header>
11123 _ACEOF
11124 if { (eval echo "$as_me:11124: \"$ac_cpp "conftest.$ac_ext"\"") >&5
11125   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
11126   ac_status=$?
11127   $EGREP -v '^ *\+' conftest.er1 >conftest.err
11128   rm -f conftest.er1
11129   cat conftest.err >&5
11130   echo "$as_me:11130: \$? = $ac_status" >&5
11131   (exit "$ac_status"); } >/dev/null; then
11132   if test -s conftest.err; then
11133     ac_cpp_err=$ac_c_preproc_warn_flag
11134   else
11135     ac_cpp_err=
11136   fi
11137 else
11138   ac_cpp_err=yes
11139 fi
11140 if test -z "$ac_cpp_err"; then
11141   eval "$as_ac_Header=yes"
11142 else
11143   echo "$as_me: failed program was:" >&5
11144   cat "conftest.$ac_ext" >&5
11145   eval "$as_ac_Header=no"
11146 fi
11147 rm -f conftest.err "conftest.$ac_ext"
11148 fi
11149 echo "$as_me:11149: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
11150 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
11151 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
11152   cat >>confdefs.h <<EOF
11153 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
11154 EOF
11155
11156 fi
11157 done
11158
11159 cat >>confdefs.h <<\EOF
11160 #define NCURSES 1
11161 EOF
11162
11163 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11164
11165                 cat >>confdefs.h <<EOF
11166 #define $cf_nculib_ROOT 1
11167 EOF
11168
11169                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
11170
11171         else
11172
11173 cf_ncuhdr_root=$cf_cv_screen
11174
11175 test -n "$cf_cv_curses_dir" && \
11176 test "$cf_cv_curses_dir" != "no" && { \
11177
11178 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
11179   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
11180   do
11181         while test "$cf_add_incdir" != /usr/include
11182         do
11183           if test -d "$cf_add_incdir"
11184           then
11185                 cf_have_incdir=no
11186                 if test -n "$CFLAGS$CPPFLAGS" ; then
11187                   # a loop is needed to ensure we can add subdirs of existing dirs
11188                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11189                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11190                           cf_have_incdir=yes; break
11191                         fi
11192                   done
11193                 fi
11194
11195                 if test "$cf_have_incdir" = no ; then
11196                   if test "$cf_add_incdir" = /usr/local/include ; then
11197                         if test "$GCC" = yes
11198                         then
11199                           cf_save_CPPFLAGS=$CPPFLAGS
11200
11201         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11202         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11203
11204                           cat >"conftest.$ac_ext" <<_ACEOF
11205 #line 11205 "configure"
11206 #include "confdefs.h"
11207 #include <stdio.h>
11208 int
11209 main (void)
11210 {
11211 printf("Hello")
11212   ;
11213   return 0;
11214 }
11215 _ACEOF
11216 rm -f "conftest.$ac_objext"
11217 if { (eval echo "$as_me:11217: \"$ac_compile\"") >&5
11218   (eval $ac_compile) 2>&5
11219   ac_status=$?
11220   echo "$as_me:11220: \$? = $ac_status" >&5
11221   (exit "$ac_status"); } &&
11222          { ac_try='test -s "conftest.$ac_objext"'
11223   { (eval echo "$as_me:11223: \"$ac_try\"") >&5
11224   (eval $ac_try) 2>&5
11225   ac_status=$?
11226   echo "$as_me:11226: \$? = $ac_status" >&5
11227   (exit "$ac_status"); }; }; then
11228   :
11229 else
11230   echo "$as_me: failed program was:" >&5
11231 cat "conftest.$ac_ext" >&5
11232 cf_have_incdir=yes
11233 fi
11234 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11235                           CPPFLAGS=$cf_save_CPPFLAGS
11236                         fi
11237                   fi
11238                 fi
11239
11240                 if test "$cf_have_incdir" = no ; then
11241                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11242
11243 echo "${as_me:-configure}:11243: testing adding $cf_add_incdir to include-path ..." 1>&5
11244
11245                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11246
11247                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11248                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11249                   cf_add_incdir="$cf_top_incdir"
11250                 else
11251                   break
11252                 fi
11253           else
11254                 break
11255           fi
11256         done
11257   done
11258 fi
11259
11260 }
11261
11262 echo "$as_me:11262: checking for $cf_ncuhdr_root header in include-path" >&5
11263 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
11264 if test "${cf_cv_ncurses_h+set}" = set; then
11265   echo $ECHO_N "(cached) $ECHO_C" >&6
11266 else
11267
11268         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
11269         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
11270         for cf_header in $cf_header_list
11271         do
11272
11273         cat >"conftest.$ac_ext" <<_ACEOF
11274 #line 11274 "configure"
11275 #include "confdefs.h"
11276
11277 #include <$cf_header>
11278 int
11279 main (void)
11280 {
11281
11282 #ifdef NCURSES_VERSION
11283
11284 printf("%s\\n", NCURSES_VERSION);
11285 #else
11286 #ifdef __NCURSES_H
11287 printf("old\\n");
11288 #else
11289         make an error
11290 #endif
11291 #endif
11292
11293   ;
11294   return 0;
11295 }
11296 _ACEOF
11297 rm -f "conftest.$ac_objext"
11298 if { (eval echo "$as_me:11298: \"$ac_compile\"") >&5
11299   (eval $ac_compile) 2>&5
11300   ac_status=$?
11301   echo "$as_me:11301: \$? = $ac_status" >&5
11302   (exit "$ac_status"); } &&
11303          { ac_try='test -s "conftest.$ac_objext"'
11304   { (eval echo "$as_me:11304: \"$ac_try\"") >&5
11305   (eval $ac_try) 2>&5
11306   ac_status=$?
11307   echo "$as_me:11307: \$? = $ac_status" >&5
11308   (exit "$ac_status"); }; }; then
11309   cf_cv_ncurses_h=$cf_header
11310
11311 else
11312   echo "$as_me: failed program was:" >&5
11313 cat "conftest.$ac_ext" >&5
11314 cf_cv_ncurses_h=no
11315 fi
11316 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11317
11318                 test "$cf_cv_ncurses_h" != no && break
11319         done
11320
11321 fi
11322 echo "$as_me:11322: result: $cf_cv_ncurses_h" >&5
11323 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
11324
11325 if test "$cf_cv_ncurses_h" != no ; then
11326         cf_cv_ncurses_header=$cf_cv_ncurses_h
11327 else
11328
11329 echo "$as_me:11329: checking for $cf_ncuhdr_root include-path" >&5
11330 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
11331 if test "${cf_cv_ncurses_h2+set}" = set; then
11332   echo $ECHO_N "(cached) $ECHO_C" >&6
11333 else
11334
11335         test -n "$verbose" && echo
11336
11337 cf_search=
11338
11339 # collect the current set of include-directories from compiler flags
11340 cf_header_path_list=""
11341 if test -n "${CFLAGS}${CPPFLAGS}" ; then
11342         for cf_header_path in $CPPFLAGS $CFLAGS
11343         do
11344                 case "$cf_header_path" in
11345                 (-I*)
11346                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
11347
11348 test "x$cf_header_path" != "xNONE" && \
11349 test -d "$cf_header_path" && \
11350  {
11351         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
11352         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
11353         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
11354         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
11355         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
11356         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"
11357 }
11358
11359                         cf_header_path_list="$cf_header_path_list $cf_search"
11360                         ;;
11361                 esac
11362         done
11363 fi
11364
11365 # add the variations for the package we are looking for
11366
11367 cf_search=
11368
11369 test "x$prefix" != "xNONE" && \
11370 test -d "$prefix" && \
11371  {
11372         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
11373         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
11374         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
11375         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
11376         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
11377         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
11378 }
11379
11380 for cf_subdir_prefix in \
11381         /usr \
11382         /usr/local \
11383         /usr/pkg \
11384         /opt \
11385         /opt/local \
11386         $HOME
11387 do
11388
11389 test "x$cf_subdir_prefix" != "x$prefix" && \
11390 test -d "$cf_subdir_prefix" && \
11391 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11392         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
11393         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
11394         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
11395         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
11396         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
11397         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"
11398 }
11399
11400 done
11401
11402 test "$includedir" != NONE && \
11403 test "$includedir" != "/usr/include" && \
11404 test -d "$includedir" && {
11405         test -d "$includedir" &&    cf_search="$cf_search $includedir"
11406         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
11407 }
11408
11409 test "$oldincludedir" != NONE && \
11410 test "$oldincludedir" != "/usr/include" && \
11411 test -d "$oldincludedir" && {
11412         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
11413         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
11414 }
11415
11416 cf_search="$cf_search $cf_header_path_list"
11417
11418         test -n "$verbose" && echo "search path $cf_search"
11419         cf_save2_CPPFLAGS="$CPPFLAGS"
11420         for cf_incdir in $cf_search
11421         do
11422
11423 if test -n "$cf_incdir" ; then
11424   for cf_add_incdir in $cf_incdir
11425   do
11426         while test "$cf_add_incdir" != /usr/include
11427         do
11428           if test -d "$cf_add_incdir"
11429           then
11430                 cf_have_incdir=no
11431                 if test -n "$CFLAGS$CPPFLAGS" ; then
11432                   # a loop is needed to ensure we can add subdirs of existing dirs
11433                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11434                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11435                           cf_have_incdir=yes; break
11436                         fi
11437                   done
11438                 fi
11439
11440                 if test "$cf_have_incdir" = no ; then
11441                   if test "$cf_add_incdir" = /usr/local/include ; then
11442                         if test "$GCC" = yes
11443                         then
11444                           cf_save_CPPFLAGS=$CPPFLAGS
11445
11446         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11447         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11448
11449                           cat >"conftest.$ac_ext" <<_ACEOF
11450 #line 11450 "configure"
11451 #include "confdefs.h"
11452 #include <stdio.h>
11453 int
11454 main (void)
11455 {
11456 printf("Hello")
11457   ;
11458   return 0;
11459 }
11460 _ACEOF
11461 rm -f "conftest.$ac_objext"
11462 if { (eval echo "$as_me:11462: \"$ac_compile\"") >&5
11463   (eval $ac_compile) 2>&5
11464   ac_status=$?
11465   echo "$as_me:11465: \$? = $ac_status" >&5
11466   (exit "$ac_status"); } &&
11467          { ac_try='test -s "conftest.$ac_objext"'
11468   { (eval echo "$as_me:11468: \"$ac_try\"") >&5
11469   (eval $ac_try) 2>&5
11470   ac_status=$?
11471   echo "$as_me:11471: \$? = $ac_status" >&5
11472   (exit "$ac_status"); }; }; then
11473   :
11474 else
11475   echo "$as_me: failed program was:" >&5
11476 cat "conftest.$ac_ext" >&5
11477 cf_have_incdir=yes
11478 fi
11479 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11480                           CPPFLAGS=$cf_save_CPPFLAGS
11481                         fi
11482                   fi
11483                 fi
11484
11485                 if test "$cf_have_incdir" = no ; then
11486                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11487
11488 echo "${as_me:-configure}:11488: testing adding $cf_add_incdir to include-path ..." 1>&5
11489
11490                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11491
11492                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11493                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11494                   cf_add_incdir="$cf_top_incdir"
11495                 else
11496                   break
11497                 fi
11498           else
11499                 break
11500           fi
11501         done
11502   done
11503 fi
11504
11505                 for cf_header in \
11506                         ncurses.h \
11507                         curses.h
11508                 do
11509
11510         cat >"conftest.$ac_ext" <<_ACEOF
11511 #line 11511 "configure"
11512 #include "confdefs.h"
11513
11514 #include <$cf_header>
11515 int
11516 main (void)
11517 {
11518
11519 #ifdef NCURSES_VERSION
11520
11521 printf("%s\\n", NCURSES_VERSION);
11522 #else
11523 #ifdef __NCURSES_H
11524 printf("old\\n");
11525 #else
11526         make an error
11527 #endif
11528 #endif
11529
11530   ;
11531   return 0;
11532 }
11533 _ACEOF
11534 rm -f "conftest.$ac_objext"
11535 if { (eval echo "$as_me:11535: \"$ac_compile\"") >&5
11536   (eval $ac_compile) 2>&5
11537   ac_status=$?
11538   echo "$as_me:11538: \$? = $ac_status" >&5
11539   (exit "$ac_status"); } &&
11540          { ac_try='test -s "conftest.$ac_objext"'
11541   { (eval echo "$as_me:11541: \"$ac_try\"") >&5
11542   (eval $ac_try) 2>&5
11543   ac_status=$?
11544   echo "$as_me:11544: \$? = $ac_status" >&5
11545   (exit "$ac_status"); }; }; then
11546   cf_cv_ncurses_h2=$cf_header
11547
11548 else
11549   echo "$as_me: failed program was:" >&5
11550 cat "conftest.$ac_ext" >&5
11551 cf_cv_ncurses_h2=no
11552 fi
11553 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11554
11555                         if test "$cf_cv_ncurses_h2" != no ; then
11556                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11557                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11558                                 break
11559                         fi
11560                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11561                 done
11562                 CPPFLAGS="$cf_save2_CPPFLAGS"
11563                 test "$cf_cv_ncurses_h2" != no && break
11564         done
11565         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11565: error: not found" >&5
11566 echo "$as_me: error: not found" >&2;}
11567    { (exit 1); exit 1; }; }
11568
11569 fi
11570 echo "$as_me:11570: result: $cf_cv_ncurses_h2" >&5
11571 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11572
11573         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11574         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11575         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11576                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11577         fi
11578
11579 if test -n "$cf_1st_incdir" ; then
11580   for cf_add_incdir in $cf_1st_incdir
11581   do
11582         while test "$cf_add_incdir" != /usr/include
11583         do
11584           if test -d "$cf_add_incdir"
11585           then
11586                 cf_have_incdir=no
11587                 if test -n "$CFLAGS$CPPFLAGS" ; then
11588                   # a loop is needed to ensure we can add subdirs of existing dirs
11589                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11590                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11591                           cf_have_incdir=yes; break
11592                         fi
11593                   done
11594                 fi
11595
11596                 if test "$cf_have_incdir" = no ; then
11597                   if test "$cf_add_incdir" = /usr/local/include ; then
11598                         if test "$GCC" = yes
11599                         then
11600                           cf_save_CPPFLAGS=$CPPFLAGS
11601
11602         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11603         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11604
11605                           cat >"conftest.$ac_ext" <<_ACEOF
11606 #line 11606 "configure"
11607 #include "confdefs.h"
11608 #include <stdio.h>
11609 int
11610 main (void)
11611 {
11612 printf("Hello")
11613   ;
11614   return 0;
11615 }
11616 _ACEOF
11617 rm -f "conftest.$ac_objext"
11618 if { (eval echo "$as_me:11618: \"$ac_compile\"") >&5
11619   (eval $ac_compile) 2>&5
11620   ac_status=$?
11621   echo "$as_me:11621: \$? = $ac_status" >&5
11622   (exit "$ac_status"); } &&
11623          { ac_try='test -s "conftest.$ac_objext"'
11624   { (eval echo "$as_me:11624: \"$ac_try\"") >&5
11625   (eval $ac_try) 2>&5
11626   ac_status=$?
11627   echo "$as_me:11627: \$? = $ac_status" >&5
11628   (exit "$ac_status"); }; }; then
11629   :
11630 else
11631   echo "$as_me: failed program was:" >&5
11632 cat "conftest.$ac_ext" >&5
11633 cf_have_incdir=yes
11634 fi
11635 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11636                           CPPFLAGS=$cf_save_CPPFLAGS
11637                         fi
11638                   fi
11639                 fi
11640
11641                 if test "$cf_have_incdir" = no ; then
11642                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11643
11644 echo "${as_me:-configure}:11644: testing adding $cf_add_incdir to include-path ..." 1>&5
11645
11646                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11647
11648                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11649                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11650                   cf_add_incdir="$cf_top_incdir"
11651                 else
11652                   break
11653                 fi
11654           else
11655                 break
11656           fi
11657         done
11658   done
11659 fi
11660
11661 fi
11662
11663 # Set definitions to allow ifdef'ing for ncurses.h
11664
11665 case "$cf_cv_ncurses_header" in
11666 (*ncurses.h)
11667
11668 cat >>confdefs.h <<\EOF
11669 #define HAVE_NCURSES_H 1
11670 EOF
11671
11672         ;;
11673 esac
11674
11675 case "$cf_cv_ncurses_header" in
11676 (ncurses/curses.h|ncurses/ncurses.h)
11677
11678 cat >>confdefs.h <<\EOF
11679 #define HAVE_NCURSES_NCURSES_H 1
11680 EOF
11681
11682         ;;
11683 (ncursesw/curses.h|ncursesw/ncurses.h)
11684
11685 cat >>confdefs.h <<\EOF
11686 #define HAVE_NCURSESW_NCURSES_H 1
11687 EOF
11688
11689         ;;
11690 esac
11691
11692 echo "$as_me:11692: checking for terminfo header" >&5
11693 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11694 if test "${cf_cv_term_header+set}" = set; then
11695   echo $ECHO_N "(cached) $ECHO_C" >&6
11696 else
11697
11698 case "${cf_cv_ncurses_header}" in
11699 (*/ncurses.h|*/ncursesw.h)
11700         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11701         ;;
11702 (*)
11703         cf_term_header=term.h
11704         ;;
11705 esac
11706
11707 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11708 do
11709 cat >"conftest.$ac_ext" <<_ACEOF
11710 #line 11710 "configure"
11711 #include "confdefs.h"
11712 #include <stdio.h>
11713 #include <${cf_cv_ncurses_header:-curses.h}>
11714 #include <$cf_test>
11715
11716 int
11717 main (void)
11718 {
11719 int x = auto_left_margin; (void)x
11720   ;
11721   return 0;
11722 }
11723 _ACEOF
11724 rm -f "conftest.$ac_objext"
11725 if { (eval echo "$as_me:11725: \"$ac_compile\"") >&5
11726   (eval $ac_compile) 2>&5
11727   ac_status=$?
11728   echo "$as_me:11728: \$? = $ac_status" >&5
11729   (exit "$ac_status"); } &&
11730          { ac_try='test -s "conftest.$ac_objext"'
11731   { (eval echo "$as_me:11731: \"$ac_try\"") >&5
11732   (eval $ac_try) 2>&5
11733   ac_status=$?
11734   echo "$as_me:11734: \$? = $ac_status" >&5
11735   (exit "$ac_status"); }; }; then
11736
11737         cf_cv_term_header="$cf_test"
11738 else
11739   echo "$as_me: failed program was:" >&5
11740 cat "conftest.$ac_ext" >&5
11741
11742         cf_cv_term_header=unknown
11743
11744 fi
11745 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11746         test "$cf_cv_term_header" != unknown && break
11747 done
11748
11749 fi
11750 echo "$as_me:11750: result: $cf_cv_term_header" >&5
11751 echo "${ECHO_T}$cf_cv_term_header" >&6
11752
11753 # Set definitions to allow ifdef'ing to accommodate subdirectories
11754
11755 case "$cf_cv_term_header" in
11756 (*term.h)
11757
11758 cat >>confdefs.h <<\EOF
11759 #define HAVE_TERM_H 1
11760 EOF
11761
11762         ;;
11763 esac
11764
11765 case "$cf_cv_term_header" in
11766 (ncurses/term.h)
11767
11768 cat >>confdefs.h <<\EOF
11769 #define HAVE_NCURSES_TERM_H 1
11770 EOF
11771
11772         ;;
11773 (ncursesw/term.h)
11774
11775 cat >>confdefs.h <<\EOF
11776 #define HAVE_NCURSESW_TERM_H 1
11777 EOF
11778
11779         ;;
11780 esac
11781
11782 # some applications need this, but should check for NCURSES_VERSION
11783
11784 cat >>confdefs.h <<\EOF
11785 #define NCURSES 1
11786 EOF
11787
11788 echo "$as_me:11788: checking for ncurses version" >&5
11789 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11790 if test "${cf_cv_ncurses_version+set}" = set; then
11791   echo $ECHO_N "(cached) $ECHO_C" >&6
11792 else
11793
11794         cf_cv_ncurses_version=no
11795         cf_tempfile=out$$
11796         rm -f "$cf_tempfile"
11797         if test "$cross_compiling" = yes; then
11798
11799         # This will not work if the preprocessor splits the line after the
11800         # Autoconf token.  The 'unproto' program does that.
11801         cat > "conftest.$ac_ext" <<EOF
11802 #include <${cf_cv_ncurses_header:-curses.h}>
11803 #undef Autoconf
11804 #ifdef NCURSES_VERSION
11805 Autoconf NCURSES_VERSION
11806 #else
11807 #ifdef __NCURSES_H
11808 Autoconf "old"
11809 #endif
11810 ;
11811 #endif
11812 EOF
11813         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11814         { (eval echo "$as_me:11814: \"$cf_try\"") >&5
11815   (eval $cf_try) 2>&5
11816   ac_status=$?
11817   echo "$as_me:11817: \$? = $ac_status" >&5
11818   (exit "$ac_status"); }
11819         if test -f conftest.out ; then
11820                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11821                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11822                 rm -f conftest.out
11823         fi
11824
11825 else
11826   cat >"conftest.$ac_ext" <<_ACEOF
11827 #line 11827 "configure"
11828 #include "confdefs.h"
11829
11830 $ac_includes_default
11831
11832 #include <${cf_cv_ncurses_header:-curses.h}>
11833
11834 int main(void)
11835 {
11836         FILE *fp = fopen("$cf_tempfile", "w");
11837 #ifdef NCURSES_VERSION
11838 # ifdef NCURSES_VERSION_PATCH
11839         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11840 # else
11841         fprintf(fp, "%s\\n", NCURSES_VERSION);
11842 # endif
11843 #else
11844 # ifdef __NCURSES_H
11845         fprintf(fp, "old\\n");
11846 # else
11847         make an error
11848 # endif
11849 #endif
11850         ${cf_cv_main_return:-return}(0);
11851 }
11852 _ACEOF
11853 rm -f "conftest$ac_exeext"
11854 if { (eval echo "$as_me:11854: \"$ac_link\"") >&5
11855   (eval $ac_link) 2>&5
11856   ac_status=$?
11857   echo "$as_me:11857: \$? = $ac_status" >&5
11858   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11859   { (eval echo "$as_me:11859: \"$ac_try\"") >&5
11860   (eval $ac_try) 2>&5
11861   ac_status=$?
11862   echo "$as_me:11862: \$? = $ac_status" >&5
11863   (exit "$ac_status"); }; }; then
11864
11865         cf_cv_ncurses_version=`cat $cf_tempfile`
11866 else
11867   echo "$as_me: program exited with status $ac_status" >&5
11868 echo "$as_me: failed program was:" >&5
11869 cat "conftest.$ac_ext" >&5
11870 fi
11871 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11872 fi
11873         rm -f "$cf_tempfile"
11874
11875 fi
11876 echo "$as_me:11876: result: $cf_cv_ncurses_version" >&5
11877 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11878 test "$cf_cv_ncurses_version" = no ||
11879 cat >>confdefs.h <<\EOF
11880 #define NCURSES 1
11881 EOF
11882
11883 cf_nculib_root=$cf_cv_screen
11884         # This works, except for the special case where we find gpm, but
11885         # ncurses is in a nonstandard location via $LIBS, and we really want
11886         # to link gpm.
11887 cf_ncurses_LIBS=""
11888 cf_ncurses_SAVE="$LIBS"
11889 echo "$as_me:11889: checking for Gpm_Open in -lgpm" >&5
11890 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11891 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11892   echo $ECHO_N "(cached) $ECHO_C" >&6
11893 else
11894   ac_check_lib_save_LIBS=$LIBS
11895 LIBS="-lgpm  $LIBS"
11896 cat >"conftest.$ac_ext" <<_ACEOF
11897 #line 11897 "configure"
11898 #include "confdefs.h"
11899
11900 /* Override any gcc2 internal prototype to avoid an error.  */
11901 #ifdef __cplusplus
11902 extern "C"
11903 #endif
11904 /* We use char because int might match the return type of a gcc2
11905    builtin and then its argument prototype would still apply.  */
11906 char Gpm_Open ();
11907 int
11908 main (void)
11909 {
11910 Gpm_Open ();
11911   ;
11912   return 0;
11913 }
11914 _ACEOF
11915 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11916 if { (eval echo "$as_me:11916: \"$ac_link\"") >&5
11917   (eval $ac_link) 2>&5
11918   ac_status=$?
11919   echo "$as_me:11919: \$? = $ac_status" >&5
11920   (exit "$ac_status"); } &&
11921          { ac_try='test -s "conftest$ac_exeext"'
11922   { (eval echo "$as_me:11922: \"$ac_try\"") >&5
11923   (eval $ac_try) 2>&5
11924   ac_status=$?
11925   echo "$as_me:11925: \$? = $ac_status" >&5
11926   (exit "$ac_status"); }; }; then
11927   ac_cv_lib_gpm_Gpm_Open=yes
11928 else
11929   echo "$as_me: failed program was:" >&5
11930 cat "conftest.$ac_ext" >&5
11931 ac_cv_lib_gpm_Gpm_Open=no
11932 fi
11933 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11934 LIBS=$ac_check_lib_save_LIBS
11935 fi
11936 echo "$as_me:11936: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11937 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11938 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11939   echo "$as_me:11939: checking for initscr in -lgpm" >&5
11940 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11941 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11942   echo $ECHO_N "(cached) $ECHO_C" >&6
11943 else
11944   ac_check_lib_save_LIBS=$LIBS
11945 LIBS="-lgpm  $LIBS"
11946 cat >"conftest.$ac_ext" <<_ACEOF
11947 #line 11947 "configure"
11948 #include "confdefs.h"
11949
11950 /* Override any gcc2 internal prototype to avoid an error.  */
11951 #ifdef __cplusplus
11952 extern "C"
11953 #endif
11954 /* We use char because int might match the return type of a gcc2
11955    builtin and then its argument prototype would still apply.  */
11956 char initscr ();
11957 int
11958 main (void)
11959 {
11960 initscr ();
11961   ;
11962   return 0;
11963 }
11964 _ACEOF
11965 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11966 if { (eval echo "$as_me:11966: \"$ac_link\"") >&5
11967   (eval $ac_link) 2>&5
11968   ac_status=$?
11969   echo "$as_me:11969: \$? = $ac_status" >&5
11970   (exit "$ac_status"); } &&
11971          { ac_try='test -s "conftest$ac_exeext"'
11972   { (eval echo "$as_me:11972: \"$ac_try\"") >&5
11973   (eval $ac_try) 2>&5
11974   ac_status=$?
11975   echo "$as_me:11975: \$? = $ac_status" >&5
11976   (exit "$ac_status"); }; }; then
11977   ac_cv_lib_gpm_initscr=yes
11978 else
11979   echo "$as_me: failed program was:" >&5
11980 cat "conftest.$ac_ext" >&5
11981 ac_cv_lib_gpm_initscr=no
11982 fi
11983 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11984 LIBS=$ac_check_lib_save_LIBS
11985 fi
11986 echo "$as_me:11986: result: $ac_cv_lib_gpm_initscr" >&5
11987 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11988 if test "$ac_cv_lib_gpm_initscr" = yes; then
11989   LIBS="$cf_ncurses_SAVE"
11990 else
11991   cf_ncurses_LIBS="-lgpm"
11992 fi
11993
11994 fi
11995
11996 case "$host_os" in
11997 (freebsd*)
11998         # This is only necessary if you are linking against an obsolete
11999         # version of ncurses (but it should do no harm, since it is static).
12000         if test "$cf_nculib_root" = ncurses ; then
12001                 echo "$as_me:12001: checking for tgoto in -lmytinfo" >&5
12002 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
12003 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
12004   echo $ECHO_N "(cached) $ECHO_C" >&6
12005 else
12006   ac_check_lib_save_LIBS=$LIBS
12007 LIBS="-lmytinfo  $LIBS"
12008 cat >"conftest.$ac_ext" <<_ACEOF
12009 #line 12009 "configure"
12010 #include "confdefs.h"
12011
12012 /* Override any gcc2 internal prototype to avoid an error.  */
12013 #ifdef __cplusplus
12014 extern "C"
12015 #endif
12016 /* We use char because int might match the return type of a gcc2
12017    builtin and then its argument prototype would still apply.  */
12018 char tgoto ();
12019 int
12020 main (void)
12021 {
12022 tgoto ();
12023   ;
12024   return 0;
12025 }
12026 _ACEOF
12027 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12028 if { (eval echo "$as_me:12028: \"$ac_link\"") >&5
12029   (eval $ac_link) 2>&5
12030   ac_status=$?
12031   echo "$as_me:12031: \$? = $ac_status" >&5
12032   (exit "$ac_status"); } &&
12033          { ac_try='test -s "conftest$ac_exeext"'
12034   { (eval echo "$as_me:12034: \"$ac_try\"") >&5
12035   (eval $ac_try) 2>&5
12036   ac_status=$?
12037   echo "$as_me:12037: \$? = $ac_status" >&5
12038   (exit "$ac_status"); }; }; then
12039   ac_cv_lib_mytinfo_tgoto=yes
12040 else
12041   echo "$as_me: failed program was:" >&5
12042 cat "conftest.$ac_ext" >&5
12043 ac_cv_lib_mytinfo_tgoto=no
12044 fi
12045 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12046 LIBS=$ac_check_lib_save_LIBS
12047 fi
12048 echo "$as_me:12048: result: $ac_cv_lib_mytinfo_tgoto" >&5
12049 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
12050 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
12051   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
12052 fi
12053
12054         fi
12055         ;;
12056 esac
12057
12058 cf_add_libs="$LIBS"
12059 # reverse order
12060 cf_add_0lib=
12061 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12062 # filter duplicates
12063 for cf_add_1lib in $cf_add_0lib; do
12064         for cf_add_2lib in $cf_add_libs; do
12065                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12066                         cf_add_1lib=
12067                         break
12068                 fi
12069         done
12070         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12071 done
12072 LIBS="$cf_add_libs"
12073
12074 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
12075 then
12076
12077 cf_add_libs="$LIBS"
12078 # reverse order
12079 cf_add_0lib=
12080 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12081 # filter duplicates
12082 for cf_add_1lib in $cf_add_0lib; do
12083         for cf_add_2lib in $cf_add_libs; do
12084                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12085                         cf_add_1lib=
12086                         break
12087                 fi
12088         done
12089         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12090 done
12091 LIBS="$cf_add_libs"
12092
12093 else
12094
12095         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
12096         cf_libdir=""
12097         echo "$as_me:12097: checking for initscr" >&5
12098 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
12099 if test "${ac_cv_func_initscr+set}" = set; then
12100   echo $ECHO_N "(cached) $ECHO_C" >&6
12101 else
12102   cat >"conftest.$ac_ext" <<_ACEOF
12103 #line 12103 "configure"
12104 #include "confdefs.h"
12105 #define initscr autoconf_temporary
12106 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12107 #undef initscr
12108
12109 #ifdef __cplusplus
12110 extern "C"
12111 #endif
12112
12113 /* We use char because int might match the return type of a gcc2
12114    builtin and then its argument prototype would still apply.  */
12115 char initscr (void);
12116
12117 int
12118 main (void)
12119 {
12120
12121 /* The GNU C library defines stubs for functions which it implements
12122     to always fail with ENOSYS.  Some functions are actually named
12123     something starting with __ and the normal name is an alias.  */
12124 #if defined (__stub_initscr) || defined (__stub___initscr)
12125 #error found stub for initscr
12126 #endif
12127
12128         return initscr ();
12129   ;
12130   return 0;
12131 }
12132 _ACEOF
12133 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12134 if { (eval echo "$as_me:12134: \"$ac_link\"") >&5
12135   (eval $ac_link) 2>&5
12136   ac_status=$?
12137   echo "$as_me:12137: \$? = $ac_status" >&5
12138   (exit "$ac_status"); } &&
12139          { ac_try='test -s "conftest$ac_exeext"'
12140   { (eval echo "$as_me:12140: \"$ac_try\"") >&5
12141   (eval $ac_try) 2>&5
12142   ac_status=$?
12143   echo "$as_me:12143: \$? = $ac_status" >&5
12144   (exit "$ac_status"); }; }; then
12145   ac_cv_func_initscr=yes
12146 else
12147   echo "$as_me: failed program was:" >&5
12148 cat "conftest.$ac_ext" >&5
12149 ac_cv_func_initscr=no
12150 fi
12151 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12152 fi
12153 echo "$as_me:12153: result: $ac_cv_func_initscr" >&5
12154 echo "${ECHO_T}$ac_cv_func_initscr" >&6
12155 if test "$ac_cv_func_initscr" = yes; then
12156   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12157 else
12158
12159                 cf_save_LIBS="$LIBS"
12160                 echo "$as_me:12160: checking for initscr in -l$cf_nculib_root" >&5
12161 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
12162                 LIBS="-l$cf_nculib_root $LIBS"
12163                 cat >"conftest.$ac_ext" <<_ACEOF
12164 #line 12164 "configure"
12165 #include "confdefs.h"
12166 #include <${cf_cv_ncurses_header:-curses.h}>
12167 int
12168 main (void)
12169 {
12170 initscr()
12171   ;
12172   return 0;
12173 }
12174 _ACEOF
12175 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12176 if { (eval echo "$as_me:12176: \"$ac_link\"") >&5
12177   (eval $ac_link) 2>&5
12178   ac_status=$?
12179   echo "$as_me:12179: \$? = $ac_status" >&5
12180   (exit "$ac_status"); } &&
12181          { ac_try='test -s "conftest$ac_exeext"'
12182   { (eval echo "$as_me:12182: \"$ac_try\"") >&5
12183   (eval $ac_try) 2>&5
12184   ac_status=$?
12185   echo "$as_me:12185: \$? = $ac_status" >&5
12186   (exit "$ac_status"); }; }; then
12187   echo "$as_me:12187: result: yes" >&5
12188 echo "${ECHO_T}yes" >&6
12189                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12190
12191 else
12192   echo "$as_me: failed program was:" >&5
12193 cat "conftest.$ac_ext" >&5
12194 echo "$as_me:12194: result: no" >&5
12195 echo "${ECHO_T}no" >&6
12196
12197 cf_search=
12198 cf_library_path_list=""
12199 if test -n "${LDFLAGS}${LIBS}" ; then
12200         for cf_library_path in $LDFLAGS $LIBS
12201         do
12202                 case "$cf_library_path" in
12203                 (-L*)
12204                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
12205
12206 test "x$cf_library_path" != "xNONE" && \
12207 test -d "$cf_library_path" && \
12208  {
12209         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
12210         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
12211         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
12212         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
12213         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
12214         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"
12215 }
12216
12217                         cf_library_path_list="$cf_library_path_list $cf_search"
12218                         ;;
12219                 esac
12220         done
12221 fi
12222
12223 cf_search=
12224
12225 test "x$prefix" != "xNONE" && \
12226 test -d "$prefix" && \
12227  {
12228         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
12229         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
12230         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
12231         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
12232         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
12233         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
12234 }
12235
12236 for cf_subdir_prefix in \
12237         /usr \
12238         /usr/local \
12239         /usr/pkg \
12240         /opt \
12241         /opt/local \
12242         $HOME
12243 do
12244
12245 test "x$cf_subdir_prefix" != "x$prefix" && \
12246 test -d "$cf_subdir_prefix" && \
12247 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
12248         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
12249         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
12250         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
12251         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
12252         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
12253         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"
12254 }
12255
12256 done
12257
12258 cf_search="$cf_library_path_list $cf_search"
12259
12260                         for cf_libdir in $cf_search
12261                         do
12262                                 echo "$as_me:12262: checking for -l$cf_nculib_root in $cf_libdir" >&5
12263 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
12264                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
12265                                 cat >"conftest.$ac_ext" <<_ACEOF
12266 #line 12266 "configure"
12267 #include "confdefs.h"
12268 #include <${cf_cv_ncurses_header:-curses.h}>
12269 int
12270 main (void)
12271 {
12272 initscr()
12273   ;
12274   return 0;
12275 }
12276 _ACEOF
12277 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12278 if { (eval echo "$as_me:12278: \"$ac_link\"") >&5
12279   (eval $ac_link) 2>&5
12280   ac_status=$?
12281   echo "$as_me:12281: \$? = $ac_status" >&5
12282   (exit "$ac_status"); } &&
12283          { ac_try='test -s "conftest$ac_exeext"'
12284   { (eval echo "$as_me:12284: \"$ac_try\"") >&5
12285   (eval $ac_try) 2>&5
12286   ac_status=$?
12287   echo "$as_me:12287: \$? = $ac_status" >&5
12288   (exit "$ac_status"); }; }; then
12289   echo "$as_me:12289: result: yes" >&5
12290 echo "${ECHO_T}yes" >&6
12291                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
12292                                          break
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_save_LIBS"
12299 fi
12300 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12301                         done
12302
12303 fi
12304 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12305
12306 fi
12307
12308 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
12309
12310 if test "$cf_found_library" = no ; then
12311         { { echo "$as_me:12311: error: Cannot link $cf_nculib_root library" >&5
12312 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
12313    { (exit 1); exit 1; }; }
12314 fi
12315
12316 fi
12317
12318 if test -n "$cf_ncurses_LIBS" ; then
12319         echo "$as_me:12319: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
12320 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
12321         cf_ncurses_SAVE="$LIBS"
12322         for p in $cf_ncurses_LIBS ; do
12323                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
12324                 if test "$q" != "$LIBS" ; then
12325                         LIBS="$q"
12326                 fi
12327         done
12328         cat >"conftest.$ac_ext" <<_ACEOF
12329 #line 12329 "configure"
12330 #include "confdefs.h"
12331 #include <${cf_cv_ncurses_header:-curses.h}>
12332 int
12333 main (void)
12334 {
12335 initscr(); mousemask(0,0); tigetstr((char *)0);
12336   ;
12337   return 0;
12338 }
12339 _ACEOF
12340 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12341 if { (eval echo "$as_me:12341: \"$ac_link\"") >&5
12342   (eval $ac_link) 2>&5
12343   ac_status=$?
12344   echo "$as_me:12344: \$? = $ac_status" >&5
12345   (exit "$ac_status"); } &&
12346          { ac_try='test -s "conftest$ac_exeext"'
12347   { (eval echo "$as_me:12347: \"$ac_try\"") >&5
12348   (eval $ac_try) 2>&5
12349   ac_status=$?
12350   echo "$as_me:12350: \$? = $ac_status" >&5
12351   (exit "$ac_status"); }; }; then
12352   echo "$as_me:12352: result: yes" >&5
12353 echo "${ECHO_T}yes" >&6
12354 else
12355   echo "$as_me: failed program was:" >&5
12356 cat "conftest.$ac_ext" >&5
12357 echo "$as_me:12357: result: no" >&5
12358 echo "${ECHO_T}no" >&6
12359                  LIBS="$cf_ncurses_SAVE"
12360 fi
12361 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12362 fi
12363
12364 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12365
12366 cat >>confdefs.h <<EOF
12367 #define $cf_nculib_ROOT 1
12368 EOF
12369
12370         fi
12371 else
12372         NCURSES_CONFIG=none
12373 fi
12374
12375         ;;
12376 (pdcurses)
12377         echo "$as_me:12377: checking for X" >&5
12378 echo $ECHO_N "checking for X... $ECHO_C" >&6
12379
12380 # Check whether --with-x or --without-x was given.
12381 if test "${with_x+set}" = set; then
12382   withval="$with_x"
12383
12384 fi;
12385 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
12386 if test "x$with_x" = xno; then
12387   # The user explicitly disabled X.
12388   have_x=disabled
12389 else
12390   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
12391     # Both variables are already set.
12392     have_x=yes
12393   else
12394     if test "${ac_cv_have_x+set}" = set; then
12395   echo $ECHO_N "(cached) $ECHO_C" >&6
12396 else
12397   # One or both of the vars are not set, and there is no cached value.
12398 ac_x_includes=no ac_x_libraries=no
12399 rm -fr conftest.dir
12400 if mkdir conftest.dir; then
12401   cd conftest.dir
12402   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
12403   cat >Imakefile <<'EOF'
12404 acfindx:
12405         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
12406 EOF
12407   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
12408     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
12409     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
12410     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
12411     for ac_extension in a so sl dylib dll; do
12412       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
12413          test -f "$ac_im_libdir/libX11.$ac_extension"; then
12414         ac_im_usrlibdir=$ac_im_libdir; break
12415       fi
12416     done
12417     # Screen out bogus values from the imake configuration.  They are
12418     # bogus both because they are the default anyway, and because
12419     # using them would break gcc on systems where it needs fixed includes.
12420     case $ac_im_incroot in
12421         /usr/include) ;;
12422         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
12423     esac
12424     case $ac_im_usrlibdir in
12425         /usr/lib | /lib) ;;
12426         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
12427     esac
12428   fi
12429   cd ..
12430   rm -fr conftest.dir
12431 fi
12432
12433 # Standard set of common directories for X headers.
12434 # Check X11 before X11Rn because it is often a symlink to the current release.
12435 ac_x_header_dirs='
12436 /usr/X11/include
12437 /usr/X11R7/include
12438 /usr/X11R6/include
12439 /usr/X11R5/include
12440 /usr/X11R4/include
12441
12442 /opt/local/include
12443 /opt/X11/include
12444
12445 /usr/include/X11
12446 /usr/include/X11R7
12447 /usr/include/X11R6
12448 /usr/include/X11R5
12449 /usr/include/X11R4
12450
12451 /usr/local/X11/include
12452 /usr/local/X11R7/include
12453 /usr/local/X11R6/include
12454 /usr/local/X11R5/include
12455 /usr/local/X11R4/include
12456
12457 /usr/local/include/X11
12458 /usr/local/include/X11R7
12459 /usr/local/include/X11R6
12460 /usr/local/include/X11R5
12461 /usr/local/include/X11R4
12462
12463 /usr/X386/include
12464 /usr/x386/include
12465 /usr/XFree86/include/X11
12466
12467 /usr/include
12468 /usr/local/include
12469 /usr/unsupported/include
12470 /usr/athena/include
12471 /usr/local/x11r5/include
12472 /usr/lpp/Xamples/include
12473
12474 /usr/openwin/include
12475 /usr/openwin/share/include'
12476
12477 if test "$ac_x_includes" = no; then
12478   # Guess where to find include files, by looking for Intrinsic.h.
12479   # First, try using that file with no special directory specified.
12480   cat >"conftest.$ac_ext" <<_ACEOF
12481 #line 12481 "configure"
12482 #include "confdefs.h"
12483 #include <X11/Intrinsic.h>
12484 _ACEOF
12485 if { (eval echo "$as_me:12485: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12486   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12487   ac_status=$?
12488   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12489   rm -f conftest.er1
12490   cat conftest.err >&5
12491   echo "$as_me:12491: \$? = $ac_status" >&5
12492   (exit "$ac_status"); } >/dev/null; then
12493   if test -s conftest.err; then
12494     ac_cpp_err=$ac_c_preproc_warn_flag
12495   else
12496     ac_cpp_err=
12497   fi
12498 else
12499   ac_cpp_err=yes
12500 fi
12501 if test -z "$ac_cpp_err"; then
12502   # We can compile using X headers with no special include directory.
12503 ac_x_includes=
12504 else
12505   echo "$as_me: failed program was:" >&5
12506   cat "conftest.$ac_ext" >&5
12507   for ac_dir in $ac_x_header_dirs; do
12508   if test -r "$ac_dir/X11/Intrinsic.h"; then
12509     ac_x_includes=$ac_dir
12510     break
12511   fi
12512 done
12513 fi
12514 rm -f conftest.err "conftest.$ac_ext"
12515 fi # $ac_x_includes = no
12516
12517 if test "$ac_x_libraries" = no; then
12518   # Check for the libraries.
12519   # See if we find them without any special options.
12520   # Don't add to $LIBS permanently.
12521   ac_save_LIBS=$LIBS
12522   LIBS="-lXt $LIBS"
12523   cat >"conftest.$ac_ext" <<_ACEOF
12524 #line 12524 "configure"
12525 #include "confdefs.h"
12526 #include <X11/Intrinsic.h>
12527 int
12528 main (void)
12529 {
12530 XtMalloc (0)
12531   ;
12532   return 0;
12533 }
12534 _ACEOF
12535 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12536 if { (eval echo "$as_me:12536: \"$ac_link\"") >&5
12537   (eval $ac_link) 2>&5
12538   ac_status=$?
12539   echo "$as_me:12539: \$? = $ac_status" >&5
12540   (exit "$ac_status"); } &&
12541          { ac_try='test -s "conftest$ac_exeext"'
12542   { (eval echo "$as_me:12542: \"$ac_try\"") >&5
12543   (eval $ac_try) 2>&5
12544   ac_status=$?
12545   echo "$as_me:12545: \$? = $ac_status" >&5
12546   (exit "$ac_status"); }; }; then
12547   LIBS=$ac_save_LIBS
12548 # We can link X programs with no special library path.
12549 ac_x_libraries=
12550 else
12551   echo "$as_me: failed program was:" >&5
12552 cat "conftest.$ac_ext" >&5
12553 LIBS=$ac_save_LIBS
12554 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12555 do
12556   # Don't even attempt the hair of trying to link an X program!
12557   for ac_extension in a so sl dylib dll; do
12558     if test -r "$ac_dir/libXt.$ac_extension"; then
12559       ac_x_libraries=$ac_dir
12560       break 2
12561     fi
12562   done
12563 done
12564 fi
12565 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12566 fi # $ac_x_libraries = no
12567
12568 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12569   # Didn't find X anywhere.  Cache the known absence of X.
12570   ac_cv_have_x="have_x=no"
12571 else
12572   # Record where we found X for the cache.
12573   ac_cv_have_x="have_x=yes \
12574                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12575 fi
12576 fi
12577
12578   fi
12579   eval "$ac_cv_have_x"
12580 fi # $with_x != no
12581
12582 if test "$have_x" != yes; then
12583   echo "$as_me:12583: result: $have_x" >&5
12584 echo "${ECHO_T}$have_x" >&6
12585   no_x=yes
12586 else
12587   # If each of the values was on the command line, it overrides each guess.
12588   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12589   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12590   # Update the cache value to reflect the command line values.
12591   ac_cv_have_x="have_x=yes \
12592                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12593   echo "$as_me:12593: result: libraries $x_libraries, headers $x_includes" >&5
12594 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12595 fi
12596
12597 if test "$no_x" = yes; then
12598   # Not all programs may use this symbol, but it does not hurt to define it.
12599
12600 cat >>confdefs.h <<\EOF
12601 #define X_DISPLAY_MISSING 1
12602 EOF
12603
12604   X_CFLAGS=
12605   X_PRE_LIBS=
12606   X_LIBS=
12607   X_EXTRA_LIBS=
12608 else
12609   if test -n "$x_includes"; then
12610     X_CFLAGS="$X_CFLAGS -I$x_includes"
12611   fi
12612
12613   # It would also be nice to do this for all -L options, not just this one.
12614   if test -n "$x_libraries"; then
12615     X_LIBS="$X_LIBS -L$x_libraries"
12616     # For Solaris; some versions of Sun CC require a space after -R and
12617     # others require no space.  Words are not sufficient . . . .
12618     case `(uname -sr) 2>/dev/null` in
12619     "SunOS 5"*)
12620       echo "$as_me:12620: checking whether -R must be followed by a space" >&5
12621 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12622       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12623       cat >"conftest.$ac_ext" <<_ACEOF
12624 #line 12624 "configure"
12625 #include "confdefs.h"
12626
12627 int
12628 main (void)
12629 {
12630
12631   ;
12632   return 0;
12633 }
12634 _ACEOF
12635 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12636 if { (eval echo "$as_me:12636: \"$ac_link\"") >&5
12637   (eval $ac_link) 2>&5
12638   ac_status=$?
12639   echo "$as_me:12639: \$? = $ac_status" >&5
12640   (exit "$ac_status"); } &&
12641          { ac_try='test -s "conftest$ac_exeext"'
12642   { (eval echo "$as_me:12642: \"$ac_try\"") >&5
12643   (eval $ac_try) 2>&5
12644   ac_status=$?
12645   echo "$as_me:12645: \$? = $ac_status" >&5
12646   (exit "$ac_status"); }; }; then
12647   ac_R_nospace=yes
12648 else
12649   echo "$as_me: failed program was:" >&5
12650 cat "conftest.$ac_ext" >&5
12651 ac_R_nospace=no
12652 fi
12653 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12654       if test $ac_R_nospace = yes; then
12655         echo "$as_me:12655: result: no" >&5
12656 echo "${ECHO_T}no" >&6
12657         X_LIBS="$X_LIBS -R$x_libraries"
12658       else
12659         LIBS="$ac_xsave_LIBS -R $x_libraries"
12660         cat >"conftest.$ac_ext" <<_ACEOF
12661 #line 12661 "configure"
12662 #include "confdefs.h"
12663
12664 int
12665 main (void)
12666 {
12667
12668   ;
12669   return 0;
12670 }
12671 _ACEOF
12672 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12673 if { (eval echo "$as_me:12673: \"$ac_link\"") >&5
12674   (eval $ac_link) 2>&5
12675   ac_status=$?
12676   echo "$as_me:12676: \$? = $ac_status" >&5
12677   (exit "$ac_status"); } &&
12678          { ac_try='test -s "conftest$ac_exeext"'
12679   { (eval echo "$as_me:12679: \"$ac_try\"") >&5
12680   (eval $ac_try) 2>&5
12681   ac_status=$?
12682   echo "$as_me:12682: \$? = $ac_status" >&5
12683   (exit "$ac_status"); }; }; then
12684   ac_R_space=yes
12685 else
12686   echo "$as_me: failed program was:" >&5
12687 cat "conftest.$ac_ext" >&5
12688 ac_R_space=no
12689 fi
12690 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12691         if test $ac_R_space = yes; then
12692           echo "$as_me:12692: result: yes" >&5
12693 echo "${ECHO_T}yes" >&6
12694           X_LIBS="$X_LIBS -R $x_libraries"
12695         else
12696           echo "$as_me:12696: result: neither works" >&5
12697 echo "${ECHO_T}neither works" >&6
12698         fi
12699       fi
12700       LIBS=$ac_xsave_LIBS
12701     esac
12702   fi
12703
12704   # Check for system-dependent libraries X programs must link with.
12705   # Do this before checking for the system-independent R6 libraries
12706   # (-lICE), since we may need -lsocket or whatever for X linking.
12707
12708   if test "$ISC" = yes; then
12709     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12710   else
12711     # Martyn Johnson says this is needed for Ultrix, if the X
12712     # libraries were built with DECnet support.  And Karl Berry says
12713     # the Alpha needs dnet_stub (dnet does not exist).
12714     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12715     cat >"conftest.$ac_ext" <<_ACEOF
12716 #line 12716 "configure"
12717 #include "confdefs.h"
12718
12719 /* Override any gcc2 internal prototype to avoid an error.  */
12720 #ifdef __cplusplus
12721 extern "C"
12722 #endif
12723 /* We use char because int might match the return type of a gcc2
12724    builtin and then its argument prototype would still apply.  */
12725 char XOpenDisplay ();
12726 int
12727 main (void)
12728 {
12729 XOpenDisplay ();
12730   ;
12731   return 0;
12732 }
12733 _ACEOF
12734 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12735 if { (eval echo "$as_me:12735: \"$ac_link\"") >&5
12736   (eval $ac_link) 2>&5
12737   ac_status=$?
12738   echo "$as_me:12738: \$? = $ac_status" >&5
12739   (exit "$ac_status"); } &&
12740          { ac_try='test -s "conftest$ac_exeext"'
12741   { (eval echo "$as_me:12741: \"$ac_try\"") >&5
12742   (eval $ac_try) 2>&5
12743   ac_status=$?
12744   echo "$as_me:12744: \$? = $ac_status" >&5
12745   (exit "$ac_status"); }; }; then
12746   :
12747 else
12748   echo "$as_me: failed program was:" >&5
12749 cat "conftest.$ac_ext" >&5
12750 echo "$as_me:12750: checking for dnet_ntoa in -ldnet" >&5
12751 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12752 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12753   echo $ECHO_N "(cached) $ECHO_C" >&6
12754 else
12755   ac_check_lib_save_LIBS=$LIBS
12756 LIBS="-ldnet  $LIBS"
12757 cat >"conftest.$ac_ext" <<_ACEOF
12758 #line 12758 "configure"
12759 #include "confdefs.h"
12760
12761 /* Override any gcc2 internal prototype to avoid an error.  */
12762 #ifdef __cplusplus
12763 extern "C"
12764 #endif
12765 /* We use char because int might match the return type of a gcc2
12766    builtin and then its argument prototype would still apply.  */
12767 char dnet_ntoa ();
12768 int
12769 main (void)
12770 {
12771 dnet_ntoa ();
12772   ;
12773   return 0;
12774 }
12775 _ACEOF
12776 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12777 if { (eval echo "$as_me:12777: \"$ac_link\"") >&5
12778   (eval $ac_link) 2>&5
12779   ac_status=$?
12780   echo "$as_me:12780: \$? = $ac_status" >&5
12781   (exit "$ac_status"); } &&
12782          { ac_try='test -s "conftest$ac_exeext"'
12783   { (eval echo "$as_me:12783: \"$ac_try\"") >&5
12784   (eval $ac_try) 2>&5
12785   ac_status=$?
12786   echo "$as_me:12786: \$? = $ac_status" >&5
12787   (exit "$ac_status"); }; }; then
12788   ac_cv_lib_dnet_dnet_ntoa=yes
12789 else
12790   echo "$as_me: failed program was:" >&5
12791 cat "conftest.$ac_ext" >&5
12792 ac_cv_lib_dnet_dnet_ntoa=no
12793 fi
12794 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12795 LIBS=$ac_check_lib_save_LIBS
12796 fi
12797 echo "$as_me:12797: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12798 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12799 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12800   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12801 fi
12802
12803     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12804       echo "$as_me:12804: checking for dnet_ntoa in -ldnet_stub" >&5
12805 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12806 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12807   echo $ECHO_N "(cached) $ECHO_C" >&6
12808 else
12809   ac_check_lib_save_LIBS=$LIBS
12810 LIBS="-ldnet_stub  $LIBS"
12811 cat >"conftest.$ac_ext" <<_ACEOF
12812 #line 12812 "configure"
12813 #include "confdefs.h"
12814
12815 /* Override any gcc2 internal prototype to avoid an error.  */
12816 #ifdef __cplusplus
12817 extern "C"
12818 #endif
12819 /* We use char because int might match the return type of a gcc2
12820    builtin and then its argument prototype would still apply.  */
12821 char dnet_ntoa ();
12822 int
12823 main (void)
12824 {
12825 dnet_ntoa ();
12826   ;
12827   return 0;
12828 }
12829 _ACEOF
12830 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12831 if { (eval echo "$as_me:12831: \"$ac_link\"") >&5
12832   (eval $ac_link) 2>&5
12833   ac_status=$?
12834   echo "$as_me:12834: \$? = $ac_status" >&5
12835   (exit "$ac_status"); } &&
12836          { ac_try='test -s "conftest$ac_exeext"'
12837   { (eval echo "$as_me:12837: \"$ac_try\"") >&5
12838   (eval $ac_try) 2>&5
12839   ac_status=$?
12840   echo "$as_me:12840: \$? = $ac_status" >&5
12841   (exit "$ac_status"); }; }; then
12842   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12843 else
12844   echo "$as_me: failed program was:" >&5
12845 cat "conftest.$ac_ext" >&5
12846 ac_cv_lib_dnet_stub_dnet_ntoa=no
12847 fi
12848 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12849 LIBS=$ac_check_lib_save_LIBS
12850 fi
12851 echo "$as_me:12851: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12852 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12853 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12854   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12855 fi
12856
12857     fi
12858 fi
12859 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12860     LIBS="$ac_xsave_LIBS"
12861
12862     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12863     # to get the SysV transport functions.
12864     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12865     # needs -lnsl.
12866     # The nsl library prevents programs from opening the X display
12867     # on Irix 5.2, according to T.E. Dickey.
12868     # The functions gethostbyname, getservbyname, and inet_addr are
12869     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12870     echo "$as_me:12870: checking for gethostbyname" >&5
12871 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12872 if test "${ac_cv_func_gethostbyname+set}" = set; then
12873   echo $ECHO_N "(cached) $ECHO_C" >&6
12874 else
12875   cat >"conftest.$ac_ext" <<_ACEOF
12876 #line 12876 "configure"
12877 #include "confdefs.h"
12878 #define gethostbyname autoconf_temporary
12879 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12880 #undef gethostbyname
12881
12882 #ifdef __cplusplus
12883 extern "C"
12884 #endif
12885
12886 /* We use char because int might match the return type of a gcc2
12887    builtin and then its argument prototype would still apply.  */
12888 char gethostbyname (void);
12889
12890 int
12891 main (void)
12892 {
12893
12894 /* The GNU C library defines stubs for functions which it implements
12895     to always fail with ENOSYS.  Some functions are actually named
12896     something starting with __ and the normal name is an alias.  */
12897 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12898 #error found stub for gethostbyname
12899 #endif
12900
12901         return gethostbyname ();
12902   ;
12903   return 0;
12904 }
12905 _ACEOF
12906 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12907 if { (eval echo "$as_me:12907: \"$ac_link\"") >&5
12908   (eval $ac_link) 2>&5
12909   ac_status=$?
12910   echo "$as_me:12910: \$? = $ac_status" >&5
12911   (exit "$ac_status"); } &&
12912          { ac_try='test -s "conftest$ac_exeext"'
12913   { (eval echo "$as_me:12913: \"$ac_try\"") >&5
12914   (eval $ac_try) 2>&5
12915   ac_status=$?
12916   echo "$as_me:12916: \$? = $ac_status" >&5
12917   (exit "$ac_status"); }; }; then
12918   ac_cv_func_gethostbyname=yes
12919 else
12920   echo "$as_me: failed program was:" >&5
12921 cat "conftest.$ac_ext" >&5
12922 ac_cv_func_gethostbyname=no
12923 fi
12924 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12925 fi
12926 echo "$as_me:12926: result: $ac_cv_func_gethostbyname" >&5
12927 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12928
12929     if test $ac_cv_func_gethostbyname = no; then
12930       echo "$as_me:12930: checking for gethostbyname in -lnsl" >&5
12931 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12932 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12933   echo $ECHO_N "(cached) $ECHO_C" >&6
12934 else
12935   ac_check_lib_save_LIBS=$LIBS
12936 LIBS="-lnsl  $LIBS"
12937 cat >"conftest.$ac_ext" <<_ACEOF
12938 #line 12938 "configure"
12939 #include "confdefs.h"
12940
12941 /* Override any gcc2 internal prototype to avoid an error.  */
12942 #ifdef __cplusplus
12943 extern "C"
12944 #endif
12945 /* We use char because int might match the return type of a gcc2
12946    builtin and then its argument prototype would still apply.  */
12947 char gethostbyname ();
12948 int
12949 main (void)
12950 {
12951 gethostbyname ();
12952   ;
12953   return 0;
12954 }
12955 _ACEOF
12956 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12957 if { (eval echo "$as_me:12957: \"$ac_link\"") >&5
12958   (eval $ac_link) 2>&5
12959   ac_status=$?
12960   echo "$as_me:12960: \$? = $ac_status" >&5
12961   (exit "$ac_status"); } &&
12962          { ac_try='test -s "conftest$ac_exeext"'
12963   { (eval echo "$as_me:12963: \"$ac_try\"") >&5
12964   (eval $ac_try) 2>&5
12965   ac_status=$?
12966   echo "$as_me:12966: \$? = $ac_status" >&5
12967   (exit "$ac_status"); }; }; then
12968   ac_cv_lib_nsl_gethostbyname=yes
12969 else
12970   echo "$as_me: failed program was:" >&5
12971 cat "conftest.$ac_ext" >&5
12972 ac_cv_lib_nsl_gethostbyname=no
12973 fi
12974 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12975 LIBS=$ac_check_lib_save_LIBS
12976 fi
12977 echo "$as_me:12977: result: $ac_cv_lib_nsl_gethostbyname" >&5
12978 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12979 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12980   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12981 fi
12982
12983       if test $ac_cv_lib_nsl_gethostbyname = no; then
12984         echo "$as_me:12984: checking for gethostbyname in -lbsd" >&5
12985 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12986 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12987   echo $ECHO_N "(cached) $ECHO_C" >&6
12988 else
12989   ac_check_lib_save_LIBS=$LIBS
12990 LIBS="-lbsd  $LIBS"
12991 cat >"conftest.$ac_ext" <<_ACEOF
12992 #line 12992 "configure"
12993 #include "confdefs.h"
12994
12995 /* Override any gcc2 internal prototype to avoid an error.  */
12996 #ifdef __cplusplus
12997 extern "C"
12998 #endif
12999 /* We use char because int might match the return type of a gcc2
13000    builtin and then its argument prototype would still apply.  */
13001 char gethostbyname ();
13002 int
13003 main (void)
13004 {
13005 gethostbyname ();
13006   ;
13007   return 0;
13008 }
13009 _ACEOF
13010 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13011 if { (eval echo "$as_me:13011: \"$ac_link\"") >&5
13012   (eval $ac_link) 2>&5
13013   ac_status=$?
13014   echo "$as_me:13014: \$? = $ac_status" >&5
13015   (exit "$ac_status"); } &&
13016          { ac_try='test -s "conftest$ac_exeext"'
13017   { (eval echo "$as_me:13017: \"$ac_try\"") >&5
13018   (eval $ac_try) 2>&5
13019   ac_status=$?
13020   echo "$as_me:13020: \$? = $ac_status" >&5
13021   (exit "$ac_status"); }; }; then
13022   ac_cv_lib_bsd_gethostbyname=yes
13023 else
13024   echo "$as_me: failed program was:" >&5
13025 cat "conftest.$ac_ext" >&5
13026 ac_cv_lib_bsd_gethostbyname=no
13027 fi
13028 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13029 LIBS=$ac_check_lib_save_LIBS
13030 fi
13031 echo "$as_me:13031: result: $ac_cv_lib_bsd_gethostbyname" >&5
13032 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
13033 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
13034   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
13035 fi
13036
13037       fi
13038     fi
13039
13040     # lieder@skyler.mavd.honeywell.com says without -lsocket,
13041     # socket/setsockopt and other routines are undefined under SCO ODT
13042     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
13043     # on later versions), says Simon Leinen: it contains gethostby*
13044     # variants that don't use the nameserver (or something).  -lsocket
13045     # must be given before -lnsl if both are needed.  We assume that
13046     # if connect needs -lnsl, so does gethostbyname.
13047     echo "$as_me:13047: checking for connect" >&5
13048 echo $ECHO_N "checking for connect... $ECHO_C" >&6
13049 if test "${ac_cv_func_connect+set}" = set; then
13050   echo $ECHO_N "(cached) $ECHO_C" >&6
13051 else
13052   cat >"conftest.$ac_ext" <<_ACEOF
13053 #line 13053 "configure"
13054 #include "confdefs.h"
13055 #define connect autoconf_temporary
13056 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13057 #undef connect
13058
13059 #ifdef __cplusplus
13060 extern "C"
13061 #endif
13062
13063 /* We use char because int might match the return type of a gcc2
13064    builtin and then its argument prototype would still apply.  */
13065 char connect (void);
13066
13067 int
13068 main (void)
13069 {
13070
13071 /* The GNU C library defines stubs for functions which it implements
13072     to always fail with ENOSYS.  Some functions are actually named
13073     something starting with __ and the normal name is an alias.  */
13074 #if defined (__stub_connect) || defined (__stub___connect)
13075 #error found stub for connect
13076 #endif
13077
13078         return connect ();
13079   ;
13080   return 0;
13081 }
13082 _ACEOF
13083 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13084 if { (eval echo "$as_me:13084: \"$ac_link\"") >&5
13085   (eval $ac_link) 2>&5
13086   ac_status=$?
13087   echo "$as_me:13087: \$? = $ac_status" >&5
13088   (exit "$ac_status"); } &&
13089          { ac_try='test -s "conftest$ac_exeext"'
13090   { (eval echo "$as_me:13090: \"$ac_try\"") >&5
13091   (eval $ac_try) 2>&5
13092   ac_status=$?
13093   echo "$as_me:13093: \$? = $ac_status" >&5
13094   (exit "$ac_status"); }; }; then
13095   ac_cv_func_connect=yes
13096 else
13097   echo "$as_me: failed program was:" >&5
13098 cat "conftest.$ac_ext" >&5
13099 ac_cv_func_connect=no
13100 fi
13101 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13102 fi
13103 echo "$as_me:13103: result: $ac_cv_func_connect" >&5
13104 echo "${ECHO_T}$ac_cv_func_connect" >&6
13105
13106     if test $ac_cv_func_connect = no; then
13107       echo "$as_me:13107: checking for connect in -lsocket" >&5
13108 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
13109 if test "${ac_cv_lib_socket_connect+set}" = set; then
13110   echo $ECHO_N "(cached) $ECHO_C" >&6
13111 else
13112   ac_check_lib_save_LIBS=$LIBS
13113 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
13114 cat >"conftest.$ac_ext" <<_ACEOF
13115 #line 13115 "configure"
13116 #include "confdefs.h"
13117
13118 /* Override any gcc2 internal prototype to avoid an error.  */
13119 #ifdef __cplusplus
13120 extern "C"
13121 #endif
13122 /* We use char because int might match the return type of a gcc2
13123    builtin and then its argument prototype would still apply.  */
13124 char connect ();
13125 int
13126 main (void)
13127 {
13128 connect ();
13129   ;
13130   return 0;
13131 }
13132 _ACEOF
13133 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13134 if { (eval echo "$as_me:13134: \"$ac_link\"") >&5
13135   (eval $ac_link) 2>&5
13136   ac_status=$?
13137   echo "$as_me:13137: \$? = $ac_status" >&5
13138   (exit "$ac_status"); } &&
13139          { ac_try='test -s "conftest$ac_exeext"'
13140   { (eval echo "$as_me:13140: \"$ac_try\"") >&5
13141   (eval $ac_try) 2>&5
13142   ac_status=$?
13143   echo "$as_me:13143: \$? = $ac_status" >&5
13144   (exit "$ac_status"); }; }; then
13145   ac_cv_lib_socket_connect=yes
13146 else
13147   echo "$as_me: failed program was:" >&5
13148 cat "conftest.$ac_ext" >&5
13149 ac_cv_lib_socket_connect=no
13150 fi
13151 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13152 LIBS=$ac_check_lib_save_LIBS
13153 fi
13154 echo "$as_me:13154: result: $ac_cv_lib_socket_connect" >&5
13155 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
13156 if test "$ac_cv_lib_socket_connect" = yes; then
13157   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
13158 fi
13159
13160     fi
13161
13162     # Guillermo Gomez says -lposix is necessary on A/UX.
13163     echo "$as_me:13163: checking for remove" >&5
13164 echo $ECHO_N "checking for remove... $ECHO_C" >&6
13165 if test "${ac_cv_func_remove+set}" = set; then
13166   echo $ECHO_N "(cached) $ECHO_C" >&6
13167 else
13168   cat >"conftest.$ac_ext" <<_ACEOF
13169 #line 13169 "configure"
13170 #include "confdefs.h"
13171 #define remove autoconf_temporary
13172 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13173 #undef remove
13174
13175 #ifdef __cplusplus
13176 extern "C"
13177 #endif
13178
13179 /* We use char because int might match the return type of a gcc2
13180    builtin and then its argument prototype would still apply.  */
13181 char remove (void);
13182
13183 int
13184 main (void)
13185 {
13186
13187 /* The GNU C library defines stubs for functions which it implements
13188     to always fail with ENOSYS.  Some functions are actually named
13189     something starting with __ and the normal name is an alias.  */
13190 #if defined (__stub_remove) || defined (__stub___remove)
13191 #error found stub for remove
13192 #endif
13193
13194         return remove ();
13195   ;
13196   return 0;
13197 }
13198 _ACEOF
13199 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13200 if { (eval echo "$as_me:13200: \"$ac_link\"") >&5
13201   (eval $ac_link) 2>&5
13202   ac_status=$?
13203   echo "$as_me:13203: \$? = $ac_status" >&5
13204   (exit "$ac_status"); } &&
13205          { ac_try='test -s "conftest$ac_exeext"'
13206   { (eval echo "$as_me:13206: \"$ac_try\"") >&5
13207   (eval $ac_try) 2>&5
13208   ac_status=$?
13209   echo "$as_me:13209: \$? = $ac_status" >&5
13210   (exit "$ac_status"); }; }; then
13211   ac_cv_func_remove=yes
13212 else
13213   echo "$as_me: failed program was:" >&5
13214 cat "conftest.$ac_ext" >&5
13215 ac_cv_func_remove=no
13216 fi
13217 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13218 fi
13219 echo "$as_me:13219: result: $ac_cv_func_remove" >&5
13220 echo "${ECHO_T}$ac_cv_func_remove" >&6
13221
13222     if test $ac_cv_func_remove = no; then
13223       echo "$as_me:13223: checking for remove in -lposix" >&5
13224 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
13225 if test "${ac_cv_lib_posix_remove+set}" = set; then
13226   echo $ECHO_N "(cached) $ECHO_C" >&6
13227 else
13228   ac_check_lib_save_LIBS=$LIBS
13229 LIBS="-lposix  $LIBS"
13230 cat >"conftest.$ac_ext" <<_ACEOF
13231 #line 13231 "configure"
13232 #include "confdefs.h"
13233
13234 /* Override any gcc2 internal prototype to avoid an error.  */
13235 #ifdef __cplusplus
13236 extern "C"
13237 #endif
13238 /* We use char because int might match the return type of a gcc2
13239    builtin and then its argument prototype would still apply.  */
13240 char remove ();
13241 int
13242 main (void)
13243 {
13244 remove ();
13245   ;
13246   return 0;
13247 }
13248 _ACEOF
13249 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13250 if { (eval echo "$as_me:13250: \"$ac_link\"") >&5
13251   (eval $ac_link) 2>&5
13252   ac_status=$?
13253   echo "$as_me:13253: \$? = $ac_status" >&5
13254   (exit "$ac_status"); } &&
13255          { ac_try='test -s "conftest$ac_exeext"'
13256   { (eval echo "$as_me:13256: \"$ac_try\"") >&5
13257   (eval $ac_try) 2>&5
13258   ac_status=$?
13259   echo "$as_me:13259: \$? = $ac_status" >&5
13260   (exit "$ac_status"); }; }; then
13261   ac_cv_lib_posix_remove=yes
13262 else
13263   echo "$as_me: failed program was:" >&5
13264 cat "conftest.$ac_ext" >&5
13265 ac_cv_lib_posix_remove=no
13266 fi
13267 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13268 LIBS=$ac_check_lib_save_LIBS
13269 fi
13270 echo "$as_me:13270: result: $ac_cv_lib_posix_remove" >&5
13271 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
13272 if test "$ac_cv_lib_posix_remove" = yes; then
13273   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
13274 fi
13275
13276     fi
13277
13278     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
13279     echo "$as_me:13279: checking for shmat" >&5
13280 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
13281 if test "${ac_cv_func_shmat+set}" = set; then
13282   echo $ECHO_N "(cached) $ECHO_C" >&6
13283 else
13284   cat >"conftest.$ac_ext" <<_ACEOF
13285 #line 13285 "configure"
13286 #include "confdefs.h"
13287 #define shmat autoconf_temporary
13288 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
13289 #undef shmat
13290
13291 #ifdef __cplusplus
13292 extern "C"
13293 #endif
13294
13295 /* We use char because int might match the return type of a gcc2
13296    builtin and then its argument prototype would still apply.  */
13297 char shmat (void);
13298
13299 int
13300 main (void)
13301 {
13302
13303 /* The GNU C library defines stubs for functions which it implements
13304     to always fail with ENOSYS.  Some functions are actually named
13305     something starting with __ and the normal name is an alias.  */
13306 #if defined (__stub_shmat) || defined (__stub___shmat)
13307 #error found stub for shmat
13308 #endif
13309
13310         return shmat ();
13311   ;
13312   return 0;
13313 }
13314 _ACEOF
13315 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13316 if { (eval echo "$as_me:13316: \"$ac_link\"") >&5
13317   (eval $ac_link) 2>&5
13318   ac_status=$?
13319   echo "$as_me:13319: \$? = $ac_status" >&5
13320   (exit "$ac_status"); } &&
13321          { ac_try='test -s "conftest$ac_exeext"'
13322   { (eval echo "$as_me:13322: \"$ac_try\"") >&5
13323   (eval $ac_try) 2>&5
13324   ac_status=$?
13325   echo "$as_me:13325: \$? = $ac_status" >&5
13326   (exit "$ac_status"); }; }; then
13327   ac_cv_func_shmat=yes
13328 else
13329   echo "$as_me: failed program was:" >&5
13330 cat "conftest.$ac_ext" >&5
13331 ac_cv_func_shmat=no
13332 fi
13333 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13334 fi
13335 echo "$as_me:13335: result: $ac_cv_func_shmat" >&5
13336 echo "${ECHO_T}$ac_cv_func_shmat" >&6
13337
13338     if test $ac_cv_func_shmat = no; then
13339       echo "$as_me:13339: checking for shmat in -lipc" >&5
13340 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
13341 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
13342   echo $ECHO_N "(cached) $ECHO_C" >&6
13343 else
13344   ac_check_lib_save_LIBS=$LIBS
13345 LIBS="-lipc  $LIBS"
13346 cat >"conftest.$ac_ext" <<_ACEOF
13347 #line 13347 "configure"
13348 #include "confdefs.h"
13349
13350 /* Override any gcc2 internal prototype to avoid an error.  */
13351 #ifdef __cplusplus
13352 extern "C"
13353 #endif
13354 /* We use char because int might match the return type of a gcc2
13355    builtin and then its argument prototype would still apply.  */
13356 char shmat ();
13357 int
13358 main (void)
13359 {
13360 shmat ();
13361   ;
13362   return 0;
13363 }
13364 _ACEOF
13365 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13366 if { (eval echo "$as_me:13366: \"$ac_link\"") >&5
13367   (eval $ac_link) 2>&5
13368   ac_status=$?
13369   echo "$as_me:13369: \$? = $ac_status" >&5
13370   (exit "$ac_status"); } &&
13371          { ac_try='test -s "conftest$ac_exeext"'
13372   { (eval echo "$as_me:13372: \"$ac_try\"") >&5
13373   (eval $ac_try) 2>&5
13374   ac_status=$?
13375   echo "$as_me:13375: \$? = $ac_status" >&5
13376   (exit "$ac_status"); }; }; then
13377   ac_cv_lib_ipc_shmat=yes
13378 else
13379   echo "$as_me: failed program was:" >&5
13380 cat "conftest.$ac_ext" >&5
13381 ac_cv_lib_ipc_shmat=no
13382 fi
13383 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13384 LIBS=$ac_check_lib_save_LIBS
13385 fi
13386 echo "$as_me:13386: result: $ac_cv_lib_ipc_shmat" >&5
13387 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
13388 if test "$ac_cv_lib_ipc_shmat" = yes; then
13389   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
13390 fi
13391
13392     fi
13393   fi
13394
13395   # Check for libraries that X11R6 Xt/Xaw programs need.
13396   ac_save_LDFLAGS=$LDFLAGS
13397   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
13398   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
13399   # check for ICE first), but we must link in the order -lSM -lICE or
13400   # we get undefined symbols.  So assume we have SM if we have ICE.
13401   # These have to be linked with before -lX11, unlike the other
13402   # libraries we check for below, so use a different variable.
13403   # John Interrante, Karl Berry
13404   echo "$as_me:13404: checking for IceConnectionNumber in -lICE" >&5
13405 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
13406 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
13407   echo $ECHO_N "(cached) $ECHO_C" >&6
13408 else
13409   ac_check_lib_save_LIBS=$LIBS
13410 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
13411 cat >"conftest.$ac_ext" <<_ACEOF
13412 #line 13412 "configure"
13413 #include "confdefs.h"
13414
13415 /* Override any gcc2 internal prototype to avoid an error.  */
13416 #ifdef __cplusplus
13417 extern "C"
13418 #endif
13419 /* We use char because int might match the return type of a gcc2
13420    builtin and then its argument prototype would still apply.  */
13421 char IceConnectionNumber ();
13422 int
13423 main (void)
13424 {
13425 IceConnectionNumber ();
13426   ;
13427   return 0;
13428 }
13429 _ACEOF
13430 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13431 if { (eval echo "$as_me:13431: \"$ac_link\"") >&5
13432   (eval $ac_link) 2>&5
13433   ac_status=$?
13434   echo "$as_me:13434: \$? = $ac_status" >&5
13435   (exit "$ac_status"); } &&
13436          { ac_try='test -s "conftest$ac_exeext"'
13437   { (eval echo "$as_me:13437: \"$ac_try\"") >&5
13438   (eval $ac_try) 2>&5
13439   ac_status=$?
13440   echo "$as_me:13440: \$? = $ac_status" >&5
13441   (exit "$ac_status"); }; }; then
13442   ac_cv_lib_ICE_IceConnectionNumber=yes
13443 else
13444   echo "$as_me: failed program was:" >&5
13445 cat "conftest.$ac_ext" >&5
13446 ac_cv_lib_ICE_IceConnectionNumber=no
13447 fi
13448 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13449 LIBS=$ac_check_lib_save_LIBS
13450 fi
13451 echo "$as_me:13451: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13452 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13453 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13454   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13455 fi
13456
13457   LDFLAGS=$ac_save_LDFLAGS
13458
13459 fi
13460
13461 cf_x_athena=${cf_x_athena:-Xaw}
13462
13463 echo "$as_me:13463: checking if you want to link with Xaw 3d library" >&5
13464 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13465 withval=
13466
13467 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13468 if test "${with_Xaw3d+set}" = set; then
13469   withval="$with_Xaw3d"
13470
13471 fi;
13472 if test "$withval" = yes ; then
13473         cf_x_athena=Xaw3d
13474         echo "$as_me:13474: result: yes" >&5
13475 echo "${ECHO_T}yes" >&6
13476 else
13477         echo "$as_me:13477: result: no" >&5
13478 echo "${ECHO_T}no" >&6
13479 fi
13480
13481 echo "$as_me:13481: checking if you want to link with Xaw 3d xft library" >&5
13482 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13483 withval=
13484
13485 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13486 if test "${with_Xaw3dxft+set}" = set; then
13487   withval="$with_Xaw3dxft"
13488
13489 fi;
13490 if test "$withval" = yes ; then
13491         cf_x_athena=Xaw3dxft
13492         echo "$as_me:13492: result: yes" >&5
13493 echo "${ECHO_T}yes" >&6
13494 else
13495         echo "$as_me:13495: result: no" >&5
13496 echo "${ECHO_T}no" >&6
13497 fi
13498
13499 echo "$as_me:13499: checking if you want to link with neXT Athena library" >&5
13500 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13501 withval=
13502
13503 # Check whether --with-neXtaw or --without-neXtaw was given.
13504 if test "${with_neXtaw+set}" = set; then
13505   withval="$with_neXtaw"
13506
13507 fi;
13508 if test "$withval" = yes ; then
13509         cf_x_athena=neXtaw
13510         echo "$as_me:13510: result: yes" >&5
13511 echo "${ECHO_T}yes" >&6
13512 else
13513         echo "$as_me:13513: result: no" >&5
13514 echo "${ECHO_T}no" >&6
13515 fi
13516
13517 echo "$as_me:13517: checking if you want to link with Athena-Plus library" >&5
13518 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13519 withval=
13520
13521 # Check whether --with-XawPlus or --without-XawPlus was given.
13522 if test "${with_XawPlus+set}" = set; then
13523   withval="$with_XawPlus"
13524
13525 fi;
13526 if test "$withval" = yes ; then
13527         cf_x_athena=XawPlus
13528         echo "$as_me:13528: result: yes" >&5
13529 echo "${ECHO_T}yes" >&6
13530 else
13531         echo "$as_me:13531: result: no" >&5
13532 echo "${ECHO_T}no" >&6
13533 fi
13534
13535 cf_x_athena_lib=""
13536
13537 if test "$PKG_CONFIG" != none ; then
13538         cf_athena_list=
13539         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13540         for cf_athena_pkg in \
13541                 $cf_athena_list \
13542                 ${cf_x_athena} \
13543                 ${cf_x_athena}-devel \
13544                 lib${cf_x_athena} \
13545                 lib${cf_x_athena}-devel
13546         do
13547
13548 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13549         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13550
13551 echo "${as_me:-configure}:13551: testing found package $cf_athena_pkg ..." 1>&5
13552
13553         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13554         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13555         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13556
13557 echo "${as_me:-configure}:13557: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13558
13559         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13560
13561 echo "${as_me:-configure}:13561: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13562
13563 cf_fix_cppflags=no
13564 cf_new_cflags=
13565 cf_new_cppflags=
13566 cf_new_extra_cppflags=
13567
13568 for cf_add_cflags in $cf_pkgconfig_incs
13569 do
13570 case "$cf_fix_cppflags" in
13571 (no)
13572         case "$cf_add_cflags" in
13573         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13574                 case "$cf_add_cflags" in
13575                 (-D*)
13576                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13577
13578                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13579                                 && test -z "${cf_tst_cflags}" \
13580                                 && cf_fix_cppflags=yes
13581
13582                         if test "$cf_fix_cppflags" = yes ; then
13583
13584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13586
13587                                 continue
13588                         elif test "${cf_tst_cflags}" = "\"'" ; then
13589
13590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13592
13593                                 continue
13594                         fi
13595                         ;;
13596                 esac
13597                 case "$CPPFLAGS" in
13598                 (*$cf_add_cflags)
13599                         ;;
13600                 (*)
13601                         case "$cf_add_cflags" in
13602                         (-D*)
13603                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13604
13605 CPPFLAGS=`echo "$CPPFLAGS" | \
13606         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13607                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13608
13609                                 ;;
13610                         esac
13611
13612         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13613         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13614
13615                         ;;
13616                 esac
13617                 ;;
13618         (*)
13619
13620         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13621         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13622
13623                 ;;
13624         esac
13625         ;;
13626 (yes)
13627
13628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13630
13631         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13632
13633         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13634                 && test -z "${cf_tst_cflags}" \
13635                 && cf_fix_cppflags=no
13636         ;;
13637 esac
13638 done
13639
13640 if test -n "$cf_new_cflags" ; then
13641
13642         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13643         CFLAGS="${CFLAGS}$cf_new_cflags"
13644
13645 fi
13646
13647 if test -n "$cf_new_cppflags" ; then
13648
13649         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13650         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13651
13652 fi
13653
13654 if test -n "$cf_new_extra_cppflags" ; then
13655
13656         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13657         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13658
13659 fi
13660
13661 cf_add_libs="$LIBS"
13662 # reverse order
13663 cf_add_0lib=
13664 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13665 # filter duplicates
13666 for cf_add_1lib in $cf_add_0lib; do
13667         for cf_add_2lib in $cf_add_libs; do
13668                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13669                         cf_add_1lib=
13670                         break
13671                 fi
13672         done
13673         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13674 done
13675 LIBS="$cf_add_libs"
13676
13677                         cf_x_athena_lib="$cf_pkgconfig_libs"
13678
13679 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13680
13681                         cat >>confdefs.h <<EOF
13682 #define $cf_x_athena_LIBS 1
13683 EOF
13684
13685         for cf_trim_lib in Xmu Xt X11
13686         do
13687                 case "$LIBS" in
13688                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13689                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13690                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13691
13692 echo "${as_me:-configure}:13692: testing ..trimmed $LIBS ..." 1>&5
13693
13694                         ;;
13695                 esac
13696         done
13697
13698 echo "$as_me:13698: checking for usable $cf_x_athena/Xmu package" >&5
13699 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13700 if test "${cf_cv_xaw_compat+set}" = set; then
13701   echo $ECHO_N "(cached) $ECHO_C" >&6
13702 else
13703
13704 cat >"conftest.$ac_ext" <<_ACEOF
13705 #line 13705 "configure"
13706 #include "confdefs.h"
13707
13708 $ac_includes_default
13709 #include <X11/Xmu/CharSet.h>
13710
13711 int
13712 main (void)
13713 {
13714
13715 int check = XmuCompareISOLatin1("big", "small");
13716 (void)check;
13717
13718   ;
13719   return 0;
13720 }
13721 _ACEOF
13722 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13723 if { (eval echo "$as_me:13723: \"$ac_link\"") >&5
13724   (eval $ac_link) 2>&5
13725   ac_status=$?
13726   echo "$as_me:13726: \$? = $ac_status" >&5
13727   (exit "$ac_status"); } &&
13728          { ac_try='test -s "conftest$ac_exeext"'
13729   { (eval echo "$as_me:13729: \"$ac_try\"") >&5
13730   (eval $ac_try) 2>&5
13731   ac_status=$?
13732   echo "$as_me:13732: \$? = $ac_status" >&5
13733   (exit "$ac_status"); }; }; then
13734   cf_cv_xaw_compat=yes
13735 else
13736   echo "$as_me: failed program was:" >&5
13737 cat "conftest.$ac_ext" >&5
13738 cf_cv_xaw_compat=no
13739 fi
13740 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13741 fi
13742 echo "$as_me:13742: result: $cf_cv_xaw_compat" >&5
13743 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13744
13745                         if test "$cf_cv_xaw_compat" = no
13746                         then
13747                                 # workaround for broken ".pc" files...
13748                                 case "$cf_x_athena_lib" in
13749                                 (*-lXmu*)
13750                                         ;;
13751                                 (*)
13752                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13753
13754 echo "${as_me:-configure}:13754: testing work around broken package ..." 1>&5
13755
13756                                         cf_save_xmu="$LIBS"
13757                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13758
13759 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13760         test -n "$verbose" && echo "    found package xmu" 1>&6
13761
13762 echo "${as_me:-configure}:13762: testing found package xmu ..." 1>&5
13763
13764         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13765         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13766         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13767
13768 echo "${as_me:-configure}:13768: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13769
13770         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13771
13772 echo "${as_me:-configure}:13772: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13773
13774 cf_fix_cppflags=no
13775 cf_new_cflags=
13776 cf_new_cppflags=
13777 cf_new_extra_cppflags=
13778
13779 for cf_add_cflags in $cf_pkgconfig_incs
13780 do
13781 case "$cf_fix_cppflags" in
13782 (no)
13783         case "$cf_add_cflags" in
13784         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13785                 case "$cf_add_cflags" in
13786                 (-D*)
13787                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13788
13789                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13790                                 && test -z "${cf_tst_cflags}" \
13791                                 && cf_fix_cppflags=yes
13792
13793                         if test "$cf_fix_cppflags" = yes ; then
13794
13795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13797
13798                                 continue
13799                         elif test "${cf_tst_cflags}" = "\"'" ; then
13800
13801         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13802         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13803
13804                                 continue
13805                         fi
13806                         ;;
13807                 esac
13808                 case "$CPPFLAGS" in
13809                 (*$cf_add_cflags)
13810                         ;;
13811                 (*)
13812                         case "$cf_add_cflags" in
13813                         (-D*)
13814                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13815
13816 CPPFLAGS=`echo "$CPPFLAGS" | \
13817         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13818                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13819
13820                                 ;;
13821                         esac
13822
13823         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13824         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13825
13826                         ;;
13827                 esac
13828                 ;;
13829         (*)
13830
13831         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13832         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13833
13834                 ;;
13835         esac
13836         ;;
13837 (yes)
13838
13839         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13840         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13841
13842         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13843
13844         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13845                 && test -z "${cf_tst_cflags}" \
13846                 && cf_fix_cppflags=no
13847         ;;
13848 esac
13849 done
13850
13851 if test -n "$cf_new_cflags" ; then
13852
13853         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13854         CFLAGS="${CFLAGS}$cf_new_cflags"
13855
13856 fi
13857
13858 if test -n "$cf_new_cppflags" ; then
13859
13860         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13861         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13862
13863 fi
13864
13865 if test -n "$cf_new_extra_cppflags" ; then
13866
13867         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13868         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13869
13870 fi
13871
13872 cf_add_libs="$LIBS"
13873 # reverse order
13874 cf_add_0lib=
13875 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13876 # filter duplicates
13877 for cf_add_1lib in $cf_add_0lib; do
13878         for cf_add_2lib in $cf_add_libs; do
13879                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13880                         cf_add_1lib=
13881                         break
13882                 fi
13883         done
13884         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13885 done
13886 LIBS="$cf_add_libs"
13887
13888                                                         LIBS="$cf_save_xmu"
13889
13890 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13891
13892 echo "${as_me:-configure}:13892: testing ...before $LIBS ..." 1>&5
13893
13894 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13895 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13896
13897 echo "${as_me:-configure}:13897: testing ...after  $LIBS ..." 1>&5
13898
13899 else
13900         cf_pkgconfig_incs=
13901         cf_pkgconfig_libs=
13902
13903 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13904
13905 echo "${as_me:-configure}:13905: testing ...before $LIBS ..." 1>&5
13906
13907 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13908 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13909
13910 echo "${as_me:-configure}:13910: testing ...after  $LIBS ..." 1>&5
13911
13912 fi
13913
13914         for cf_trim_lib in Xmu Xt X11
13915         do
13916                 case "$LIBS" in
13917                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13918                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13919                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13920
13921 echo "${as_me:-configure}:13921: testing ..trimmed $LIBS ..." 1>&5
13922
13923                         ;;
13924                 esac
13925         done
13926
13927                                         ;;
13928                                 esac
13929                         fi
13930
13931                         break
13932 else
13933         cf_pkgconfig_incs=
13934         cf_pkgconfig_libs=
13935         :
13936 fi
13937
13938         done
13939 fi
13940
13941 if test -z "$cf_x_athena_lib" ; then
13942
13943 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13944         test -n "$verbose" && echo "    found package Xext" 1>&6
13945
13946 echo "${as_me:-configure}:13946: testing found package Xext ..." 1>&5
13947
13948         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13949         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13950         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13951
13952 echo "${as_me:-configure}:13952: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13953
13954         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13955
13956 echo "${as_me:-configure}:13956: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13957
13958 cf_fix_cppflags=no
13959 cf_new_cflags=
13960 cf_new_cppflags=
13961 cf_new_extra_cppflags=
13962
13963 for cf_add_cflags in $cf_pkgconfig_incs
13964 do
13965 case "$cf_fix_cppflags" in
13966 (no)
13967         case "$cf_add_cflags" in
13968         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13969                 case "$cf_add_cflags" in
13970                 (-D*)
13971                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13972
13973                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13974                                 && test -z "${cf_tst_cflags}" \
13975                                 && cf_fix_cppflags=yes
13976
13977                         if test "$cf_fix_cppflags" = yes ; then
13978
13979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13981
13982                                 continue
13983                         elif test "${cf_tst_cflags}" = "\"'" ; then
13984
13985         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13986         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13987
13988                                 continue
13989                         fi
13990                         ;;
13991                 esac
13992                 case "$CPPFLAGS" in
13993                 (*$cf_add_cflags)
13994                         ;;
13995                 (*)
13996                         case "$cf_add_cflags" in
13997                         (-D*)
13998                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13999
14000 CPPFLAGS=`echo "$CPPFLAGS" | \
14001         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14002                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14003
14004                                 ;;
14005                         esac
14006
14007         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14008         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14009
14010                         ;;
14011                 esac
14012                 ;;
14013         (*)
14014
14015         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14016         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14017
14018                 ;;
14019         esac
14020         ;;
14021 (yes)
14022
14023         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14024         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14025
14026         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14027
14028         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14029                 && test -z "${cf_tst_cflags}" \
14030                 && cf_fix_cppflags=no
14031         ;;
14032 esac
14033 done
14034
14035 if test -n "$cf_new_cflags" ; then
14036
14037         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14038         CFLAGS="${CFLAGS}$cf_new_cflags"
14039
14040 fi
14041
14042 if test -n "$cf_new_cppflags" ; then
14043
14044         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14045         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14046
14047 fi
14048
14049 if test -n "$cf_new_extra_cppflags" ; then
14050
14051         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14052         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14053
14054 fi
14055
14056 cf_add_libs="$LIBS"
14057 # reverse order
14058 cf_add_0lib=
14059 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14060 # filter duplicates
14061 for cf_add_1lib in $cf_add_0lib; do
14062         for cf_add_2lib in $cf_add_libs; do
14063                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14064                         cf_add_1lib=
14065                         break
14066                 fi
14067         done
14068         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14069 done
14070 LIBS="$cf_add_libs"
14071
14072         :
14073 else
14074         cf_pkgconfig_incs=
14075         cf_pkgconfig_libs=
14076
14077         echo "$as_me:14077: checking for XextCreateExtension in -lXext" >&5
14078 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
14079 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
14080   echo $ECHO_N "(cached) $ECHO_C" >&6
14081 else
14082   ac_check_lib_save_LIBS=$LIBS
14083 LIBS="-lXext  $LIBS"
14084 cat >"conftest.$ac_ext" <<_ACEOF
14085 #line 14085 "configure"
14086 #include "confdefs.h"
14087
14088 /* Override any gcc2 internal prototype to avoid an error.  */
14089 #ifdef __cplusplus
14090 extern "C"
14091 #endif
14092 /* We use char because int might match the return type of a gcc2
14093    builtin and then its argument prototype would still apply.  */
14094 char XextCreateExtension ();
14095 int
14096 main (void)
14097 {
14098 XextCreateExtension ();
14099   ;
14100   return 0;
14101 }
14102 _ACEOF
14103 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14104 if { (eval echo "$as_me:14104: \"$ac_link\"") >&5
14105   (eval $ac_link) 2>&5
14106   ac_status=$?
14107   echo "$as_me:14107: \$? = $ac_status" >&5
14108   (exit "$ac_status"); } &&
14109          { ac_try='test -s "conftest$ac_exeext"'
14110   { (eval echo "$as_me:14110: \"$ac_try\"") >&5
14111   (eval $ac_try) 2>&5
14112   ac_status=$?
14113   echo "$as_me:14113: \$? = $ac_status" >&5
14114   (exit "$ac_status"); }; }; then
14115   ac_cv_lib_Xext_XextCreateExtension=yes
14116 else
14117   echo "$as_me: failed program was:" >&5
14118 cat "conftest.$ac_ext" >&5
14119 ac_cv_lib_Xext_XextCreateExtension=no
14120 fi
14121 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14122 LIBS=$ac_check_lib_save_LIBS
14123 fi
14124 echo "$as_me:14124: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
14125 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
14126 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
14127
14128 cf_add_libs="$LIBS"
14129 # reverse order
14130 cf_add_0lib=
14131 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14132 # filter duplicates
14133 for cf_add_1lib in $cf_add_0lib; do
14134         for cf_add_2lib in $cf_add_libs; do
14135                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14136                         cf_add_1lib=
14137                         break
14138                 fi
14139         done
14140         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14141 done
14142 LIBS="$cf_add_libs"
14143
14144 fi
14145
14146 fi
14147
14148 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
14149 # in some cases has installed dummy files in the former, other cases replaced
14150 # it with a link to the new location).  This complicates the configure script.
14151 # Check for that pitfall, and recover using pkg-config
14152 #
14153 # If none of these are set, the configuration is almost certainly broken.
14154 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
14155 then
14156
14157 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14158         test -n "$verbose" && echo "    found package x11" 1>&6
14159
14160 echo "${as_me:-configure}:14160: testing found package x11 ..." 1>&5
14161
14162         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14163         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14164         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14165
14166 echo "${as_me:-configure}:14166: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14167
14168         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14169
14170 echo "${as_me:-configure}:14170: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14171
14172 cf_fix_cppflags=no
14173 cf_new_cflags=
14174 cf_new_cppflags=
14175 cf_new_extra_cppflags=
14176
14177 for cf_add_cflags in $cf_pkgconfig_incs
14178 do
14179 case "$cf_fix_cppflags" in
14180 (no)
14181         case "$cf_add_cflags" in
14182         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14183                 case "$cf_add_cflags" in
14184                 (-D*)
14185                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14186
14187                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14188                                 && test -z "${cf_tst_cflags}" \
14189                                 && cf_fix_cppflags=yes
14190
14191                         if test "$cf_fix_cppflags" = yes ; then
14192
14193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14195
14196                                 continue
14197                         elif test "${cf_tst_cflags}" = "\"'" ; then
14198
14199         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14200         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14201
14202                                 continue
14203                         fi
14204                         ;;
14205                 esac
14206                 case "$CPPFLAGS" in
14207                 (*$cf_add_cflags)
14208                         ;;
14209                 (*)
14210                         case "$cf_add_cflags" in
14211                         (-D*)
14212                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14213
14214 CPPFLAGS=`echo "$CPPFLAGS" | \
14215         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14216                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14217
14218                                 ;;
14219                         esac
14220
14221         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14222         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14223
14224                         ;;
14225                 esac
14226                 ;;
14227         (*)
14228
14229         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14230         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14231
14232                 ;;
14233         esac
14234         ;;
14235 (yes)
14236
14237         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14238         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14239
14240         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14241
14242         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14243                 && test -z "${cf_tst_cflags}" \
14244                 && cf_fix_cppflags=no
14245         ;;
14246 esac
14247 done
14248
14249 if test -n "$cf_new_cflags" ; then
14250
14251         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14252         CFLAGS="${CFLAGS}$cf_new_cflags"
14253
14254 fi
14255
14256 if test -n "$cf_new_cppflags" ; then
14257
14258         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14259         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14260
14261 fi
14262
14263 if test -n "$cf_new_extra_cppflags" ; then
14264
14265         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14266         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14267
14268 fi
14269
14270 cf_add_libs="$LIBS"
14271 # reverse order
14272 cf_add_0lib=
14273 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14274 # filter duplicates
14275 for cf_add_1lib in $cf_add_0lib; do
14276         for cf_add_2lib in $cf_add_libs; do
14277                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14278                         cf_add_1lib=
14279                         break
14280                 fi
14281         done
14282         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14283 done
14284 LIBS="$cf_add_libs"
14285
14286         :
14287 else
14288         cf_pkgconfig_incs=
14289         cf_pkgconfig_libs=
14290         { echo "$as_me:14290: WARNING: unable to find X11 library" >&5
14291 echo "$as_me: WARNING: unable to find X11 library" >&2;}
14292 fi
14293
14294 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14295         test -n "$verbose" && echo "    found package ice" 1>&6
14296
14297 echo "${as_me:-configure}:14297: testing found package ice ..." 1>&5
14298
14299         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14300         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14301         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14302
14303 echo "${as_me:-configure}:14303: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14304
14305         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14306
14307 echo "${as_me:-configure}:14307: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14308
14309 cf_fix_cppflags=no
14310 cf_new_cflags=
14311 cf_new_cppflags=
14312 cf_new_extra_cppflags=
14313
14314 for cf_add_cflags in $cf_pkgconfig_incs
14315 do
14316 case "$cf_fix_cppflags" in
14317 (no)
14318         case "$cf_add_cflags" in
14319         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14320                 case "$cf_add_cflags" in
14321                 (-D*)
14322                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14323
14324                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14325                                 && test -z "${cf_tst_cflags}" \
14326                                 && cf_fix_cppflags=yes
14327
14328                         if test "$cf_fix_cppflags" = yes ; then
14329
14330         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14331         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14332
14333                                 continue
14334                         elif test "${cf_tst_cflags}" = "\"'" ; then
14335
14336         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14337         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14338
14339                                 continue
14340                         fi
14341                         ;;
14342                 esac
14343                 case "$CPPFLAGS" in
14344                 (*$cf_add_cflags)
14345                         ;;
14346                 (*)
14347                         case "$cf_add_cflags" in
14348                         (-D*)
14349                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14350
14351 CPPFLAGS=`echo "$CPPFLAGS" | \
14352         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14353                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14354
14355                                 ;;
14356                         esac
14357
14358         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14359         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14360
14361                         ;;
14362                 esac
14363                 ;;
14364         (*)
14365
14366         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14367         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14368
14369                 ;;
14370         esac
14371         ;;
14372 (yes)
14373
14374         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14375         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14376
14377         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14378
14379         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14380                 && test -z "${cf_tst_cflags}" \
14381                 && cf_fix_cppflags=no
14382         ;;
14383 esac
14384 done
14385
14386 if test -n "$cf_new_cflags" ; then
14387
14388         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14389         CFLAGS="${CFLAGS}$cf_new_cflags"
14390
14391 fi
14392
14393 if test -n "$cf_new_cppflags" ; then
14394
14395         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14396         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14397
14398 fi
14399
14400 if test -n "$cf_new_extra_cppflags" ; then
14401
14402         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14403         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14404
14405 fi
14406
14407 cf_add_libs="$LIBS"
14408 # reverse order
14409 cf_add_0lib=
14410 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14411 # filter duplicates
14412 for cf_add_1lib in $cf_add_0lib; do
14413         for cf_add_2lib in $cf_add_libs; do
14414                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14415                         cf_add_1lib=
14416                         break
14417                 fi
14418         done
14419         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14420 done
14421 LIBS="$cf_add_libs"
14422
14423         :
14424 else
14425         cf_pkgconfig_incs=
14426         cf_pkgconfig_libs=
14427         { echo "$as_me:14427: WARNING: unable to find ICE library" >&5
14428 echo "$as_me: WARNING: unable to find ICE library" >&2;}
14429 fi
14430
14431 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14432         test -n "$verbose" && echo "    found package sm" 1>&6
14433
14434 echo "${as_me:-configure}:14434: testing found package sm ..." 1>&5
14435
14436         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14437         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14438         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14439
14440 echo "${as_me:-configure}:14440: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14441
14442         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14443
14444 echo "${as_me:-configure}:14444: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14445
14446 cf_fix_cppflags=no
14447 cf_new_cflags=
14448 cf_new_cppflags=
14449 cf_new_extra_cppflags=
14450
14451 for cf_add_cflags in $cf_pkgconfig_incs
14452 do
14453 case "$cf_fix_cppflags" in
14454 (no)
14455         case "$cf_add_cflags" in
14456         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14457                 case "$cf_add_cflags" in
14458                 (-D*)
14459                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14460
14461                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14462                                 && test -z "${cf_tst_cflags}" \
14463                                 && cf_fix_cppflags=yes
14464
14465                         if test "$cf_fix_cppflags" = yes ; then
14466
14467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14469
14470                                 continue
14471                         elif test "${cf_tst_cflags}" = "\"'" ; then
14472
14473         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14474         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14475
14476                                 continue
14477                         fi
14478                         ;;
14479                 esac
14480                 case "$CPPFLAGS" in
14481                 (*$cf_add_cflags)
14482                         ;;
14483                 (*)
14484                         case "$cf_add_cflags" in
14485                         (-D*)
14486                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14487
14488 CPPFLAGS=`echo "$CPPFLAGS" | \
14489         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14490                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14491
14492                                 ;;
14493                         esac
14494
14495         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14496         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14497
14498                         ;;
14499                 esac
14500                 ;;
14501         (*)
14502
14503         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14504         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14505
14506                 ;;
14507         esac
14508         ;;
14509 (yes)
14510
14511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14513
14514         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14515
14516         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14517                 && test -z "${cf_tst_cflags}" \
14518                 && cf_fix_cppflags=no
14519         ;;
14520 esac
14521 done
14522
14523 if test -n "$cf_new_cflags" ; then
14524
14525         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14526         CFLAGS="${CFLAGS}$cf_new_cflags"
14527
14528 fi
14529
14530 if test -n "$cf_new_cppflags" ; then
14531
14532         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14533         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14534
14535 fi
14536
14537 if test -n "$cf_new_extra_cppflags" ; then
14538
14539         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14540         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14541
14542 fi
14543
14544 cf_add_libs="$LIBS"
14545 # reverse order
14546 cf_add_0lib=
14547 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14548 # filter duplicates
14549 for cf_add_1lib in $cf_add_0lib; do
14550         for cf_add_2lib in $cf_add_libs; do
14551                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14552                         cf_add_1lib=
14553                         break
14554                 fi
14555         done
14556         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14557 done
14558 LIBS="$cf_add_libs"
14559
14560         :
14561 else
14562         cf_pkgconfig_incs=
14563         cf_pkgconfig_libs=
14564         { echo "$as_me:14564: WARNING: unable to find SM library" >&5
14565 echo "$as_me: WARNING: unable to find SM library" >&2;}
14566 fi
14567
14568 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14569         test -n "$verbose" && echo "    found package xt" 1>&6
14570
14571 echo "${as_me:-configure}:14571: testing found package xt ..." 1>&5
14572
14573         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14574         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14575         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14576
14577 echo "${as_me:-configure}:14577: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14578
14579         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14580
14581 echo "${as_me:-configure}:14581: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14582
14583 cf_fix_cppflags=no
14584 cf_new_cflags=
14585 cf_new_cppflags=
14586 cf_new_extra_cppflags=
14587
14588 for cf_add_cflags in $cf_pkgconfig_incs
14589 do
14590 case "$cf_fix_cppflags" in
14591 (no)
14592         case "$cf_add_cflags" in
14593         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14594                 case "$cf_add_cflags" in
14595                 (-D*)
14596                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14597
14598                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14599                                 && test -z "${cf_tst_cflags}" \
14600                                 && cf_fix_cppflags=yes
14601
14602                         if test "$cf_fix_cppflags" = yes ; then
14603
14604         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14605         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14606
14607                                 continue
14608                         elif test "${cf_tst_cflags}" = "\"'" ; then
14609
14610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14612
14613                                 continue
14614                         fi
14615                         ;;
14616                 esac
14617                 case "$CPPFLAGS" in
14618                 (*$cf_add_cflags)
14619                         ;;
14620                 (*)
14621                         case "$cf_add_cflags" in
14622                         (-D*)
14623                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14624
14625 CPPFLAGS=`echo "$CPPFLAGS" | \
14626         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14627                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14628
14629                                 ;;
14630                         esac
14631
14632         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14633         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14634
14635                         ;;
14636                 esac
14637                 ;;
14638         (*)
14639
14640         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14641         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14642
14643                 ;;
14644         esac
14645         ;;
14646 (yes)
14647
14648         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14649         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14650
14651         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14652
14653         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14654                 && test -z "${cf_tst_cflags}" \
14655                 && cf_fix_cppflags=no
14656         ;;
14657 esac
14658 done
14659
14660 if test -n "$cf_new_cflags" ; then
14661
14662         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14663         CFLAGS="${CFLAGS}$cf_new_cflags"
14664
14665 fi
14666
14667 if test -n "$cf_new_cppflags" ; then
14668
14669         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14670         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14671
14672 fi
14673
14674 if test -n "$cf_new_extra_cppflags" ; then
14675
14676         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14677         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14678
14679 fi
14680
14681 cf_add_libs="$LIBS"
14682 # reverse order
14683 cf_add_0lib=
14684 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14685 # filter duplicates
14686 for cf_add_1lib in $cf_add_0lib; do
14687         for cf_add_2lib in $cf_add_libs; do
14688                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14689                         cf_add_1lib=
14690                         break
14691                 fi
14692         done
14693         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14694 done
14695 LIBS="$cf_add_libs"
14696
14697         :
14698 else
14699         cf_pkgconfig_incs=
14700         cf_pkgconfig_libs=
14701         { echo "$as_me:14701: WARNING: unable to find Xt library" >&5
14702 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14703 fi
14704
14705 else
14706         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14707 fi
14708
14709 cf_have_X_LIBS=no
14710
14711 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14712         test -n "$verbose" && echo "    found package xt" 1>&6
14713
14714 echo "${as_me:-configure}:14714: testing found package xt ..." 1>&5
14715
14716         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14717         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14718         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14719
14720 echo "${as_me:-configure}:14720: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14721
14722         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14723
14724 echo "${as_me:-configure}:14724: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14725
14726 cf_fix_cppflags=no
14727 cf_new_cflags=
14728 cf_new_cppflags=
14729 cf_new_extra_cppflags=
14730
14731 for cf_add_cflags in $cf_pkgconfig_incs
14732 do
14733 case "$cf_fix_cppflags" in
14734 (no)
14735         case "$cf_add_cflags" in
14736         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14737                 case "$cf_add_cflags" in
14738                 (-D*)
14739                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14740
14741                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14742                                 && test -z "${cf_tst_cflags}" \
14743                                 && cf_fix_cppflags=yes
14744
14745                         if test "$cf_fix_cppflags" = yes ; then
14746
14747         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14748         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14749
14750                                 continue
14751                         elif test "${cf_tst_cflags}" = "\"'" ; then
14752
14753         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14754         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14755
14756                                 continue
14757                         fi
14758                         ;;
14759                 esac
14760                 case "$CPPFLAGS" in
14761                 (*$cf_add_cflags)
14762                         ;;
14763                 (*)
14764                         case "$cf_add_cflags" in
14765                         (-D*)
14766                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14767
14768 CPPFLAGS=`echo "$CPPFLAGS" | \
14769         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14770                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14771
14772                                 ;;
14773                         esac
14774
14775         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14776         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14777
14778                         ;;
14779                 esac
14780                 ;;
14781         (*)
14782
14783         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14784         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14785
14786                 ;;
14787         esac
14788         ;;
14789 (yes)
14790
14791         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14792         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14793
14794         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14795
14796         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14797                 && test -z "${cf_tst_cflags}" \
14798                 && cf_fix_cppflags=no
14799         ;;
14800 esac
14801 done
14802
14803 if test -n "$cf_new_cflags" ; then
14804
14805         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14806         CFLAGS="${CFLAGS}$cf_new_cflags"
14807
14808 fi
14809
14810 if test -n "$cf_new_cppflags" ; then
14811
14812         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14813         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14814
14815 fi
14816
14817 if test -n "$cf_new_extra_cppflags" ; then
14818
14819         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14820         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14821
14822 fi
14823
14824 cf_add_libs="$LIBS"
14825 # reverse order
14826 cf_add_0lib=
14827 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14828 # filter duplicates
14829 for cf_add_1lib in $cf_add_0lib; do
14830         for cf_add_2lib in $cf_add_libs; do
14831                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14832                         cf_add_1lib=
14833                         break
14834                 fi
14835         done
14836         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14837 done
14838 LIBS="$cf_add_libs"
14839
14840         case "x$LIBS" in
14841         (*-lX11*)
14842                 ;;
14843         (*)
14844 # we have an "xt" package, but it may omit Xt's dependency on X11
14845 echo "$as_me:14845: checking for usable X dependency" >&5
14846 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14847 if test "${cf_cv_xt_x11_compat+set}" = set; then
14848   echo $ECHO_N "(cached) $ECHO_C" >&6
14849 else
14850
14851 cat >"conftest.$ac_ext" <<_ACEOF
14852 #line 14852 "configure"
14853 #include "confdefs.h"
14854
14855 $ac_includes_default
14856 #include <X11/Xlib.h>
14857
14858 int
14859 main (void)
14860 {
14861
14862         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14863         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14864         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14865         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14866
14867   ;
14868   return 0;
14869 }
14870 _ACEOF
14871 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14872 if { (eval echo "$as_me:14872: \"$ac_link\"") >&5
14873   (eval $ac_link) 2>&5
14874   ac_status=$?
14875   echo "$as_me:14875: \$? = $ac_status" >&5
14876   (exit "$ac_status"); } &&
14877          { ac_try='test -s "conftest$ac_exeext"'
14878   { (eval echo "$as_me:14878: \"$ac_try\"") >&5
14879   (eval $ac_try) 2>&5
14880   ac_status=$?
14881   echo "$as_me:14881: \$? = $ac_status" >&5
14882   (exit "$ac_status"); }; }; then
14883   cf_cv_xt_x11_compat=yes
14884 else
14885   echo "$as_me: failed program was:" >&5
14886 cat "conftest.$ac_ext" >&5
14887 cf_cv_xt_x11_compat=no
14888 fi
14889 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14890 fi
14891 echo "$as_me:14891: result: $cf_cv_xt_x11_compat" >&5
14892 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14893                 if test "$cf_cv_xt_x11_compat" = no
14894                 then
14895                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14896
14897 echo "${as_me:-configure}:14897: testing work around broken X11 dependency ..." 1>&5
14898
14899                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14900
14901 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14902         test -n "$verbose" && echo "    found package x11" 1>&6
14903
14904 echo "${as_me:-configure}:14904: testing found package x11 ..." 1>&5
14905
14906         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14907         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14908         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14909
14910 echo "${as_me:-configure}:14910: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14911
14912         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14913
14914 echo "${as_me:-configure}:14914: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14915
14916 cf_fix_cppflags=no
14917 cf_new_cflags=
14918 cf_new_cppflags=
14919 cf_new_extra_cppflags=
14920
14921 for cf_add_cflags in $cf_pkgconfig_incs
14922 do
14923 case "$cf_fix_cppflags" in
14924 (no)
14925         case "$cf_add_cflags" in
14926         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14927                 case "$cf_add_cflags" in
14928                 (-D*)
14929                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14930
14931                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14932                                 && test -z "${cf_tst_cflags}" \
14933                                 && cf_fix_cppflags=yes
14934
14935                         if test "$cf_fix_cppflags" = yes ; then
14936
14937         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14938         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14939
14940                                 continue
14941                         elif test "${cf_tst_cflags}" = "\"'" ; then
14942
14943         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14944         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14945
14946                                 continue
14947                         fi
14948                         ;;
14949                 esac
14950                 case "$CPPFLAGS" in
14951                 (*$cf_add_cflags)
14952                         ;;
14953                 (*)
14954                         case "$cf_add_cflags" in
14955                         (-D*)
14956                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14957
14958 CPPFLAGS=`echo "$CPPFLAGS" | \
14959         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14960                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14961
14962                                 ;;
14963                         esac
14964
14965         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14966         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14967
14968                         ;;
14969                 esac
14970                 ;;
14971         (*)
14972
14973         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14974         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14975
14976                 ;;
14977         esac
14978         ;;
14979 (yes)
14980
14981         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14982         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14983
14984         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14985
14986         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14987                 && test -z "${cf_tst_cflags}" \
14988                 && cf_fix_cppflags=no
14989         ;;
14990 esac
14991 done
14992
14993 if test -n "$cf_new_cflags" ; then
14994
14995         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14996         CFLAGS="${CFLAGS}$cf_new_cflags"
14997
14998 fi
14999
15000 if test -n "$cf_new_cppflags" ; then
15001
15002         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15003         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15004
15005 fi
15006
15007 if test -n "$cf_new_extra_cppflags" ; then
15008
15009         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15010         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15011
15012 fi
15013
15014 cf_add_libs="$LIBS"
15015 # reverse order
15016 cf_add_0lib=
15017 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15018 # filter duplicates
15019 for cf_add_1lib in $cf_add_0lib; do
15020         for cf_add_2lib in $cf_add_libs; do
15021                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15022                         cf_add_1lib=
15023                         break
15024                 fi
15025         done
15026         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15027 done
15028 LIBS="$cf_add_libs"
15029
15030         :
15031 else
15032         cf_pkgconfig_incs=
15033         cf_pkgconfig_libs=
15034
15035 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15036
15037 echo "${as_me:-configure}:15037: testing ...before $LIBS ..." 1>&5
15038
15039 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
15040 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15041
15042 echo "${as_me:-configure}:15042: testing ...after  $LIBS ..." 1>&5
15043
15044 fi
15045
15046                 fi
15047                 ;;
15048         esac
15049
15050 echo "$as_me:15050: checking for usable X Toolkit package" >&5
15051 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
15052 if test "${cf_cv_xt_ice_compat+set}" = set; then
15053   echo $ECHO_N "(cached) $ECHO_C" >&6
15054 else
15055
15056 cat >"conftest.$ac_ext" <<_ACEOF
15057 #line 15057 "configure"
15058 #include "confdefs.h"
15059
15060 $ac_includes_default
15061 #include <X11/Shell.h>
15062
15063 int
15064 main (void)
15065 {
15066 int num = IceConnectionNumber(0); (void) num
15067
15068   ;
15069   return 0;
15070 }
15071 _ACEOF
15072 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15073 if { (eval echo "$as_me:15073: \"$ac_link\"") >&5
15074   (eval $ac_link) 2>&5
15075   ac_status=$?
15076   echo "$as_me:15076: \$? = $ac_status" >&5
15077   (exit "$ac_status"); } &&
15078          { ac_try='test -s "conftest$ac_exeext"'
15079   { (eval echo "$as_me:15079: \"$ac_try\"") >&5
15080   (eval $ac_try) 2>&5
15081   ac_status=$?
15082   echo "$as_me:15082: \$? = $ac_status" >&5
15083   (exit "$ac_status"); }; }; then
15084   cf_cv_xt_ice_compat=yes
15085 else
15086   echo "$as_me: failed program was:" >&5
15087 cat "conftest.$ac_ext" >&5
15088 cf_cv_xt_ice_compat=no
15089 fi
15090 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15091 fi
15092 echo "$as_me:15092: result: $cf_cv_xt_ice_compat" >&5
15093 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
15094
15095         if test "$cf_cv_xt_ice_compat" = no
15096         then
15097                 # workaround for broken ".pc" files used for X Toolkit.
15098                 case "x$X_PRE_LIBS" in
15099                 (*-lICE*)
15100                         case "x$LIBS" in
15101                         (*-lICE*)
15102                                 ;;
15103                         (*)
15104                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
15105
15106 echo "${as_me:-configure}:15106: testing work around broken ICE dependency ..." 1>&5
15107
15108 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
15109         test -n "$verbose" && echo "    found package ice" 1>&6
15110
15111 echo "${as_me:-configure}:15111: testing found package ice ..." 1>&5
15112
15113         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
15114         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
15115         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
15116
15117 echo "${as_me:-configure}:15117: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15118
15119         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
15120
15121 echo "${as_me:-configure}:15121: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
15122
15123 cf_fix_cppflags=no
15124 cf_new_cflags=
15125 cf_new_cppflags=
15126 cf_new_extra_cppflags=
15127
15128 for cf_add_cflags in $cf_pkgconfig_incs
15129 do
15130 case "$cf_fix_cppflags" in
15131 (no)
15132         case "$cf_add_cflags" in
15133         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15134                 case "$cf_add_cflags" in
15135                 (-D*)
15136                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15137
15138                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15139                                 && test -z "${cf_tst_cflags}" \
15140                                 && cf_fix_cppflags=yes
15141
15142                         if test "$cf_fix_cppflags" = yes ; then
15143
15144         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15145         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15146
15147                                 continue
15148                         elif test "${cf_tst_cflags}" = "\"'" ; then
15149
15150         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15151         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15152
15153                                 continue
15154                         fi
15155                         ;;
15156                 esac
15157                 case "$CPPFLAGS" in
15158                 (*$cf_add_cflags)
15159                         ;;
15160                 (*)
15161                         case "$cf_add_cflags" in
15162                         (-D*)
15163                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15164
15165 CPPFLAGS=`echo "$CPPFLAGS" | \
15166         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15167                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15168
15169                                 ;;
15170                         esac
15171
15172         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15173         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15174
15175                         ;;
15176                 esac
15177                 ;;
15178         (*)
15179
15180         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15181         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15182
15183                 ;;
15184         esac
15185         ;;
15186 (yes)
15187
15188         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15189         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15190
15191         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15192
15193         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15194                 && test -z "${cf_tst_cflags}" \
15195                 && cf_fix_cppflags=no
15196         ;;
15197 esac
15198 done
15199
15200 if test -n "$cf_new_cflags" ; then
15201
15202         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15203         CFLAGS="${CFLAGS}$cf_new_cflags"
15204
15205 fi
15206
15207 if test -n "$cf_new_cppflags" ; then
15208
15209         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15210         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15211
15212 fi
15213
15214 if test -n "$cf_new_extra_cppflags" ; then
15215
15216         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15217         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15218
15219 fi
15220
15221 cf_add_libs="$LIBS"
15222 # reverse order
15223 cf_add_0lib=
15224 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15225 # filter duplicates
15226 for cf_add_1lib in $cf_add_0lib; do
15227         for cf_add_2lib in $cf_add_libs; do
15228                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15229                         cf_add_1lib=
15230                         break
15231                 fi
15232         done
15233         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15234 done
15235 LIBS="$cf_add_libs"
15236
15237 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
15238         test -n "$verbose" && echo "    found package sm" 1>&6
15239
15240 echo "${as_me:-configure}:15240: testing found package sm ..." 1>&5
15241
15242         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
15243         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
15244         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
15245
15246 echo "${as_me:-configure}:15246: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
15247
15248         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
15249
15250 echo "${as_me:-configure}:15250: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
15251
15252 cf_fix_cppflags=no
15253 cf_new_cflags=
15254 cf_new_cppflags=
15255 cf_new_extra_cppflags=
15256
15257 for cf_add_cflags in $cf_pkgconfig_incs
15258 do
15259 case "$cf_fix_cppflags" in
15260 (no)
15261         case "$cf_add_cflags" in
15262         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15263                 case "$cf_add_cflags" in
15264                 (-D*)
15265                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15266
15267                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15268                                 && test -z "${cf_tst_cflags}" \
15269                                 && cf_fix_cppflags=yes
15270
15271                         if test "$cf_fix_cppflags" = yes ; then
15272
15273         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15274         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15275
15276                                 continue
15277                         elif test "${cf_tst_cflags}" = "\"'" ; then
15278
15279         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15280         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15281
15282                                 continue
15283                         fi
15284                         ;;
15285                 esac
15286                 case "$CPPFLAGS" in
15287                 (*$cf_add_cflags)
15288                         ;;
15289                 (*)
15290                         case "$cf_add_cflags" in
15291                         (-D*)
15292                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15293
15294 CPPFLAGS=`echo "$CPPFLAGS" | \
15295         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15296                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15297
15298                                 ;;
15299                         esac
15300
15301         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15302         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15303
15304                         ;;
15305                 esac
15306                 ;;
15307         (*)
15308
15309         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15310         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15311
15312                 ;;
15313         esac
15314         ;;
15315 (yes)
15316
15317         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15318         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15319
15320         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15321
15322         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15323                 && test -z "${cf_tst_cflags}" \
15324                 && cf_fix_cppflags=no
15325         ;;
15326 esac
15327 done
15328
15329 if test -n "$cf_new_cflags" ; then
15330
15331         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15332         CFLAGS="${CFLAGS}$cf_new_cflags"
15333
15334 fi
15335
15336 if test -n "$cf_new_cppflags" ; then
15337
15338         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15339         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15340
15341 fi
15342
15343 if test -n "$cf_new_extra_cppflags" ; then
15344
15345         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15346         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15347
15348 fi
15349
15350 cf_add_libs="$LIBS"
15351 # reverse order
15352 cf_add_0lib=
15353 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15354 # filter duplicates
15355 for cf_add_1lib in $cf_add_0lib; do
15356         for cf_add_2lib in $cf_add_libs; do
15357                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15358                         cf_add_1lib=
15359                         break
15360                 fi
15361         done
15362         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15363 done
15364 LIBS="$cf_add_libs"
15365
15366         :
15367 else
15368         cf_pkgconfig_incs=
15369         cf_pkgconfig_libs=
15370         :
15371 fi
15372
15373 else
15374         cf_pkgconfig_incs=
15375         cf_pkgconfig_libs=
15376
15377 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
15378
15379 echo "${as_me:-configure}:15379: testing ...before $LIBS ..." 1>&5
15380
15381 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
15382 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
15383
15384 echo "${as_me:-configure}:15384: testing ...after  $LIBS ..." 1>&5
15385
15386 fi
15387
15388                                 ;;
15389                         esac
15390                         ;;
15391                 esac
15392         fi
15393
15394         cf_have_X_LIBS=yes
15395
15396 else
15397         cf_pkgconfig_incs=
15398         cf_pkgconfig_libs=
15399
15400         LDFLAGS="$X_LIBS $LDFLAGS"
15401
15402 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15403
15404 echo "${as_me:-configure}:15404: testing checking additions to CFLAGS ..." 1>&5
15405
15406 cf_check_cflags="$CFLAGS"
15407 cf_check_cppflags="$CPPFLAGS"
15408
15409 cf_fix_cppflags=no
15410 cf_new_cflags=
15411 cf_new_cppflags=
15412 cf_new_extra_cppflags=
15413
15414 for cf_add_cflags in $X_CFLAGS
15415 do
15416 case "$cf_fix_cppflags" in
15417 (no)
15418         case "$cf_add_cflags" in
15419         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15420                 case "$cf_add_cflags" in
15421                 (-D*)
15422                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15423
15424                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15425                                 && test -z "${cf_tst_cflags}" \
15426                                 && cf_fix_cppflags=yes
15427
15428                         if test "$cf_fix_cppflags" = yes ; then
15429
15430         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15431         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15432
15433                                 continue
15434                         elif test "${cf_tst_cflags}" = "\"'" ; then
15435
15436         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15437         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15438
15439                                 continue
15440                         fi
15441                         ;;
15442                 esac
15443                 case "$CPPFLAGS" in
15444                 (*$cf_add_cflags)
15445                         ;;
15446                 (*)
15447                         case "$cf_add_cflags" in
15448                         (-D*)
15449                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15450
15451 CPPFLAGS=`echo "$CPPFLAGS" | \
15452         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15453                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15454
15455                                 ;;
15456                         esac
15457
15458         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15459         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15460
15461                         ;;
15462                 esac
15463                 ;;
15464         (*)
15465
15466         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15467         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15468
15469                 ;;
15470         esac
15471         ;;
15472 (yes)
15473
15474         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15475         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15476
15477         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15478
15479         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15480                 && test -z "${cf_tst_cflags}" \
15481                 && cf_fix_cppflags=no
15482         ;;
15483 esac
15484 done
15485
15486 if test -n "$cf_new_cflags" ; then
15487         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15488
15489 echo "${as_me:-configure}:15489: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15490
15491         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15492         CFLAGS="${CFLAGS}$cf_new_cflags"
15493
15494 fi
15495
15496 if test -n "$cf_new_cppflags" ; then
15497         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15498
15499 echo "${as_me:-configure}:15499: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15500
15501         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15502         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15503
15504 fi
15505
15506 if test -n "$cf_new_extra_cppflags" ; then
15507         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15508
15509 echo "${as_me:-configure}:15509: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15510
15511         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15512         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15513
15514 fi
15515
15516 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15517 cat >"conftest.$ac_ext" <<_ACEOF
15518 #line 15518 "configure"
15519 #include "confdefs.h"
15520 #include <stdio.h>
15521 int
15522 main (void)
15523 {
15524 printf("Hello world");
15525   ;
15526   return 0;
15527 }
15528 _ACEOF
15529 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15530 if { (eval echo "$as_me:15530: \"$ac_link\"") >&5
15531   (eval $ac_link) 2>&5
15532   ac_status=$?
15533   echo "$as_me:15533: \$? = $ac_status" >&5
15534   (exit "$ac_status"); } &&
15535          { ac_try='test -s "conftest$ac_exeext"'
15536   { (eval echo "$as_me:15536: \"$ac_try\"") >&5
15537   (eval $ac_try) 2>&5
15538   ac_status=$?
15539   echo "$as_me:15539: \$? = $ac_status" >&5
15540   (exit "$ac_status"); }; }; then
15541   :
15542 else
15543   echo "$as_me: failed program was:" >&5
15544 cat "conftest.$ac_ext" >&5
15545 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15546
15547 echo "${as_me:-configure}:15547: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15548
15549          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15550                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15551
15552 echo "${as_me:-configure}:15552: testing but keeping change to \$CPPFLAGS ..." 1>&5
15553
15554          fi
15555          CFLAGS="$cf_check_cflags"
15556 fi
15557 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15558 fi
15559
15560         echo "$as_me:15560: checking for XOpenDisplay" >&5
15561 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15562 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15563   echo $ECHO_N "(cached) $ECHO_C" >&6
15564 else
15565   cat >"conftest.$ac_ext" <<_ACEOF
15566 #line 15566 "configure"
15567 #include "confdefs.h"
15568 #define XOpenDisplay autoconf_temporary
15569 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15570 #undef XOpenDisplay
15571
15572 #ifdef __cplusplus
15573 extern "C"
15574 #endif
15575
15576 /* We use char because int might match the return type of a gcc2
15577    builtin and then its argument prototype would still apply.  */
15578 char XOpenDisplay (void);
15579
15580 int
15581 main (void)
15582 {
15583
15584 /* The GNU C library defines stubs for functions which it implements
15585     to always fail with ENOSYS.  Some functions are actually named
15586     something starting with __ and the normal name is an alias.  */
15587 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15588 #error found stub for XOpenDisplay
15589 #endif
15590
15591         return XOpenDisplay ();
15592   ;
15593   return 0;
15594 }
15595 _ACEOF
15596 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15597 if { (eval echo "$as_me:15597: \"$ac_link\"") >&5
15598   (eval $ac_link) 2>&5
15599   ac_status=$?
15600   echo "$as_me:15600: \$? = $ac_status" >&5
15601   (exit "$ac_status"); } &&
15602          { ac_try='test -s "conftest$ac_exeext"'
15603   { (eval echo "$as_me:15603: \"$ac_try\"") >&5
15604   (eval $ac_try) 2>&5
15605   ac_status=$?
15606   echo "$as_me:15606: \$? = $ac_status" >&5
15607   (exit "$ac_status"); }; }; then
15608   ac_cv_func_XOpenDisplay=yes
15609 else
15610   echo "$as_me: failed program was:" >&5
15611 cat "conftest.$ac_ext" >&5
15612 ac_cv_func_XOpenDisplay=no
15613 fi
15614 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15615 fi
15616 echo "$as_me:15616: result: $ac_cv_func_XOpenDisplay" >&5
15617 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15618 if test "$ac_cv_func_XOpenDisplay" = yes; then
15619   :
15620 else
15621
15622         echo "$as_me:15622: checking for XOpenDisplay in -lX11" >&5
15623 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15624 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15625   echo $ECHO_N "(cached) $ECHO_C" >&6
15626 else
15627   ac_check_lib_save_LIBS=$LIBS
15628 LIBS="-lX11  $LIBS"
15629 cat >"conftest.$ac_ext" <<_ACEOF
15630 #line 15630 "configure"
15631 #include "confdefs.h"
15632
15633 /* Override any gcc2 internal prototype to avoid an error.  */
15634 #ifdef __cplusplus
15635 extern "C"
15636 #endif
15637 /* We use char because int might match the return type of a gcc2
15638    builtin and then its argument prototype would still apply.  */
15639 char XOpenDisplay ();
15640 int
15641 main (void)
15642 {
15643 XOpenDisplay ();
15644   ;
15645   return 0;
15646 }
15647 _ACEOF
15648 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15649 if { (eval echo "$as_me:15649: \"$ac_link\"") >&5
15650   (eval $ac_link) 2>&5
15651   ac_status=$?
15652   echo "$as_me:15652: \$? = $ac_status" >&5
15653   (exit "$ac_status"); } &&
15654          { ac_try='test -s "conftest$ac_exeext"'
15655   { (eval echo "$as_me:15655: \"$ac_try\"") >&5
15656   (eval $ac_try) 2>&5
15657   ac_status=$?
15658   echo "$as_me:15658: \$? = $ac_status" >&5
15659   (exit "$ac_status"); }; }; then
15660   ac_cv_lib_X11_XOpenDisplay=yes
15661 else
15662   echo "$as_me: failed program was:" >&5
15663 cat "conftest.$ac_ext" >&5
15664 ac_cv_lib_X11_XOpenDisplay=no
15665 fi
15666 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15667 LIBS=$ac_check_lib_save_LIBS
15668 fi
15669 echo "$as_me:15669: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15670 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15671 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15672
15673 cf_add_libs="$LIBS"
15674 # reverse order
15675 cf_add_0lib=
15676 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15677 # filter duplicates
15678 for cf_add_1lib in $cf_add_0lib; do
15679         for cf_add_2lib in $cf_add_libs; do
15680                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15681                         cf_add_1lib=
15682                         break
15683                 fi
15684         done
15685         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15686 done
15687 LIBS="$cf_add_libs"
15688
15689 fi
15690
15691 fi
15692
15693         echo "$as_me:15693: checking for XtAppInitialize" >&5
15694 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15695 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15696   echo $ECHO_N "(cached) $ECHO_C" >&6
15697 else
15698   cat >"conftest.$ac_ext" <<_ACEOF
15699 #line 15699 "configure"
15700 #include "confdefs.h"
15701 #define XtAppInitialize autoconf_temporary
15702 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15703 #undef XtAppInitialize
15704
15705 #ifdef __cplusplus
15706 extern "C"
15707 #endif
15708
15709 /* We use char because int might match the return type of a gcc2
15710    builtin and then its argument prototype would still apply.  */
15711 char XtAppInitialize (void);
15712
15713 int
15714 main (void)
15715 {
15716
15717 /* The GNU C library defines stubs for functions which it implements
15718     to always fail with ENOSYS.  Some functions are actually named
15719     something starting with __ and the normal name is an alias.  */
15720 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15721 #error found stub for XtAppInitialize
15722 #endif
15723
15724         return XtAppInitialize ();
15725   ;
15726   return 0;
15727 }
15728 _ACEOF
15729 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15730 if { (eval echo "$as_me:15730: \"$ac_link\"") >&5
15731   (eval $ac_link) 2>&5
15732   ac_status=$?
15733   echo "$as_me:15733: \$? = $ac_status" >&5
15734   (exit "$ac_status"); } &&
15735          { ac_try='test -s "conftest$ac_exeext"'
15736   { (eval echo "$as_me:15736: \"$ac_try\"") >&5
15737   (eval $ac_try) 2>&5
15738   ac_status=$?
15739   echo "$as_me:15739: \$? = $ac_status" >&5
15740   (exit "$ac_status"); }; }; then
15741   ac_cv_func_XtAppInitialize=yes
15742 else
15743   echo "$as_me: failed program was:" >&5
15744 cat "conftest.$ac_ext" >&5
15745 ac_cv_func_XtAppInitialize=no
15746 fi
15747 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15748 fi
15749 echo "$as_me:15749: result: $ac_cv_func_XtAppInitialize" >&5
15750 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15751 if test "$ac_cv_func_XtAppInitialize" = yes; then
15752   :
15753 else
15754
15755         echo "$as_me:15755: checking for XtAppInitialize in -lXt" >&5
15756 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15757 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15758   echo $ECHO_N "(cached) $ECHO_C" >&6
15759 else
15760   ac_check_lib_save_LIBS=$LIBS
15761 LIBS="-lXt  $LIBS"
15762 cat >"conftest.$ac_ext" <<_ACEOF
15763 #line 15763 "configure"
15764 #include "confdefs.h"
15765
15766 /* Override any gcc2 internal prototype to avoid an error.  */
15767 #ifdef __cplusplus
15768 extern "C"
15769 #endif
15770 /* We use char because int might match the return type of a gcc2
15771    builtin and then its argument prototype would still apply.  */
15772 char XtAppInitialize ();
15773 int
15774 main (void)
15775 {
15776 XtAppInitialize ();
15777   ;
15778   return 0;
15779 }
15780 _ACEOF
15781 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15782 if { (eval echo "$as_me:15782: \"$ac_link\"") >&5
15783   (eval $ac_link) 2>&5
15784   ac_status=$?
15785   echo "$as_me:15785: \$? = $ac_status" >&5
15786   (exit "$ac_status"); } &&
15787          { ac_try='test -s "conftest$ac_exeext"'
15788   { (eval echo "$as_me:15788: \"$ac_try\"") >&5
15789   (eval $ac_try) 2>&5
15790   ac_status=$?
15791   echo "$as_me:15791: \$? = $ac_status" >&5
15792   (exit "$ac_status"); }; }; then
15793   ac_cv_lib_Xt_XtAppInitialize=yes
15794 else
15795   echo "$as_me: failed program was:" >&5
15796 cat "conftest.$ac_ext" >&5
15797 ac_cv_lib_Xt_XtAppInitialize=no
15798 fi
15799 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15800 LIBS=$ac_check_lib_save_LIBS
15801 fi
15802 echo "$as_me:15802: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15803 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15804 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15805
15806 cat >>confdefs.h <<\EOF
15807 #define HAVE_LIBXT 1
15808 EOF
15809
15810                  cf_have_X_LIBS=Xt
15811                  LIBS="-lXt $LIBS"
15812 fi
15813
15814 fi
15815
15816 fi
15817
15818 if test "$cf_have_X_LIBS" = no ; then
15819         { echo "$as_me:15819: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15820 test program.  You will have to check and add the proper libraries by hand
15821 to makefile." >&5
15822 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15823 test program.  You will have to check and add the proper libraries by hand
15824 to makefile." >&2;}
15825 fi
15826
15827 cf_x_athena_root=$cf_x_athena
15828 cf_x_athena_inc=""
15829
15830 for cf_path in default \
15831         /usr/contrib/X11R6 \
15832         /usr/contrib/X11R5 \
15833         /usr/lib/X11R5 \
15834         /usr/local
15835 do
15836         if test -z "$cf_x_athena_inc" ; then
15837
15838 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15839 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15840 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15841 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15842 for cf_X_CFLAGS in $X_CFLAGS
15843 do
15844         case "x$cf_X_CFLAGS" in
15845         x-[IUD]*)
15846                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15847                 ;;
15848         *)
15849                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15850                 ;;
15851         esac
15852 done
15853
15854                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15855                 if test "$cf_path" != default ; then
15856
15857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15858         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15859
15860                         echo "$as_me:15860: checking for $cf_test in $cf_path" >&5
15861 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15862                 else
15863                         echo "$as_me:15863: checking for $cf_test" >&5
15864 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15865                 fi
15866                 cat >"conftest.$ac_ext" <<_ACEOF
15867 #line 15867 "configure"
15868 #include "confdefs.h"
15869
15870 #include <X11/Intrinsic.h>
15871 #include <$cf_test>
15872 int
15873 main (void)
15874 {
15875
15876   ;
15877   return 0;
15878 }
15879 _ACEOF
15880 rm -f "conftest.$ac_objext"
15881 if { (eval echo "$as_me:15881: \"$ac_compile\"") >&5
15882   (eval $ac_compile) 2>&5
15883   ac_status=$?
15884   echo "$as_me:15884: \$? = $ac_status" >&5
15885   (exit "$ac_status"); } &&
15886          { ac_try='test -s "conftest.$ac_objext"'
15887   { (eval echo "$as_me:15887: \"$ac_try\"") >&5
15888   (eval $ac_try) 2>&5
15889   ac_status=$?
15890   echo "$as_me:15890: \$? = $ac_status" >&5
15891   (exit "$ac_status"); }; }; then
15892   cf_result=yes
15893 else
15894   echo "$as_me: failed program was:" >&5
15895 cat "conftest.$ac_ext" >&5
15896 cf_result=no
15897 fi
15898 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15899                 echo "$as_me:15899: result: $cf_result" >&5
15900 echo "${ECHO_T}$cf_result" >&6
15901
15902 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15903 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15904 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15905
15906                 if test "$cf_result" = yes ; then
15907                         test "$cf_path"  = default && cf_x_athena_inc=default
15908                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15909                         break
15910                 fi
15911         fi
15912 done
15913
15914 if test -z "$cf_x_athena_inc" ; then
15915         { echo "$as_me:15915: WARNING: Unable to find Athena header files" >&5
15916 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15917 elif test "$cf_x_athena_inc" != default ; then
15918
15919         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15920         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15921
15922 fi
15923
15924 cf_x_athena_root=$cf_x_athena
15925 cf_x_athena_lib=""
15926
15927 for cf_path in default \
15928         /usr/contrib/X11R6 \
15929         /usr/contrib/X11R5 \
15930         /usr/lib/X11R5 \
15931         /usr/local
15932 do
15933         for cf_lib in \
15934                 ${cf_x_athena_root} \
15935                 ${cf_x_athena_root}7 \
15936                 ${cf_x_athena_root}6
15937         do
15938         for cf_libs in \
15939                 "-l$cf_lib -lXmu" \
15940                 "-l$cf_lib -lXpm -lXmu" \
15941                 "-l${cf_lib}_s -lXmu_s"
15942         do
15943                 test -n "$cf_x_athena_lib" && break
15944
15945 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15946 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15947 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15948 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15949 for cf_X_CFLAGS in $X_CFLAGS
15950 do
15951         case "x$cf_X_CFLAGS" in
15952         x-[IUD]*)
15953                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15954                 ;;
15955         *)
15956                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15957                 ;;
15958         esac
15959 done
15960
15961                 cf_test=XawSimpleMenuAddGlobalActions
15962                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15963
15964 cf_add_libs="$LIBS"
15965 # reverse order
15966 cf_add_0lib=
15967 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15968 # filter duplicates
15969 for cf_add_1lib in $cf_add_0lib; do
15970         for cf_add_2lib in $cf_add_libs; do
15971                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15972                         cf_add_1lib=
15973                         break
15974                 fi
15975         done
15976         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15977 done
15978 LIBS="$cf_add_libs"
15979
15980                 echo "$as_me:15980: checking for $cf_test in $cf_libs" >&5
15981 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15982                 cat >"conftest.$ac_ext" <<_ACEOF
15983 #line 15983 "configure"
15984 #include "confdefs.h"
15985
15986 $ac_includes_default
15987 #include <X11/Intrinsic.h>
15988 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15989
15990 int
15991 main (void)
15992 {
15993
15994 $cf_test((XtAppContext) 0)
15995   ;
15996   return 0;
15997 }
15998 _ACEOF
15999 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16000 if { (eval echo "$as_me:16000: \"$ac_link\"") >&5
16001   (eval $ac_link) 2>&5
16002   ac_status=$?
16003   echo "$as_me:16003: \$? = $ac_status" >&5
16004   (exit "$ac_status"); } &&
16005          { ac_try='test -s "conftest$ac_exeext"'
16006   { (eval echo "$as_me:16006: \"$ac_try\"") >&5
16007   (eval $ac_try) 2>&5
16008   ac_status=$?
16009   echo "$as_me:16009: \$? = $ac_status" >&5
16010   (exit "$ac_status"); }; }; then
16011   cf_result=yes
16012 else
16013   echo "$as_me: failed program was:" >&5
16014 cat "conftest.$ac_ext" >&5
16015 cf_result=no
16016 fi
16017 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16018                 echo "$as_me:16018: result: $cf_result" >&5
16019 echo "${ECHO_T}$cf_result" >&6
16020
16021 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
16022 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
16023 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
16024
16025                 if test "$cf_result" = yes ; then
16026                         cf_x_athena_lib="$cf_libs"
16027                         break
16028                 fi
16029         done # cf_libs
16030                 test -n "$cf_x_athena_lib" && break
16031         done # cf_lib
16032 done
16033
16034 if test -z "$cf_x_athena_lib" ; then
16035         { { echo "$as_me:16035: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
16036 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
16037    { (exit 1); exit 1; }; }
16038 fi
16039
16040 cf_add_libs="$LIBS"
16041 # reverse order
16042 cf_add_0lib=
16043 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16044 # filter duplicates
16045 for cf_add_1lib in $cf_add_0lib; do
16046         for cf_add_2lib in $cf_add_libs; do
16047                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16048                         cf_add_1lib=
16049                         break
16050                 fi
16051         done
16052         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16053 done
16054 LIBS="$cf_add_libs"
16055
16056 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16057
16058 cat >>confdefs.h <<EOF
16059 #define $cf_x_athena_LIBS 1
16060 EOF
16061
16062 fi
16063
16064 if test -n "$ac_tool_prefix"; then
16065   for ac_prog in xcurses-config
16066   do
16067     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
16068 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
16069 echo "$as_me:16069: checking for $ac_word" >&5
16070 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16071 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
16072   echo $ECHO_N "(cached) $ECHO_C" >&6
16073 else
16074   if test -n "$XCURSES_CONFIG"; then
16075   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
16076 else
16077   ac_save_IFS=$IFS; IFS=$ac_path_separator
16078 ac_dummy="$PATH"
16079 for ac_dir in $ac_dummy; do
16080   IFS=$ac_save_IFS
16081   test -z "$ac_dir" && ac_dir=.
16082   $as_executable_p "$ac_dir/$ac_word" || continue
16083 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
16084 echo "$as_me:16084: found $ac_dir/$ac_word" >&5
16085 break
16086 done
16087
16088 fi
16089 fi
16090 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
16091 if test -n "$XCURSES_CONFIG"; then
16092   echo "$as_me:16092: result: $XCURSES_CONFIG" >&5
16093 echo "${ECHO_T}$XCURSES_CONFIG" >&6
16094 else
16095   echo "$as_me:16095: result: no" >&5
16096 echo "${ECHO_T}no" >&6
16097 fi
16098
16099     test -n "$XCURSES_CONFIG" && break
16100   done
16101 fi
16102 if test -z "$XCURSES_CONFIG"; then
16103   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
16104   for ac_prog in xcurses-config
16105 do
16106   # Extract the first word of "$ac_prog", so it can be a program name with args.
16107 set dummy $ac_prog; ac_word=$2
16108 echo "$as_me:16108: checking for $ac_word" >&5
16109 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16110 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
16111   echo $ECHO_N "(cached) $ECHO_C" >&6
16112 else
16113   if test -n "$ac_ct_XCURSES_CONFIG"; then
16114   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
16115 else
16116   ac_save_IFS=$IFS; IFS=$ac_path_separator
16117 ac_dummy="$PATH"
16118 for ac_dir in $ac_dummy; do
16119   IFS=$ac_save_IFS
16120   test -z "$ac_dir" && ac_dir=.
16121   $as_executable_p "$ac_dir/$ac_word" || continue
16122 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
16123 echo "$as_me:16123: found $ac_dir/$ac_word" >&5
16124 break
16125 done
16126
16127 fi
16128 fi
16129 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
16130 if test -n "$ac_ct_XCURSES_CONFIG"; then
16131   echo "$as_me:16131: result: $ac_ct_XCURSES_CONFIG" >&5
16132 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
16133 else
16134   echo "$as_me:16134: result: no" >&5
16135 echo "${ECHO_T}no" >&6
16136 fi
16137
16138   test -n "$ac_ct_XCURSES_CONFIG" && break
16139 done
16140 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
16141
16142   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
16143 fi
16144
16145 if test "$XCURSES_CONFIG" != none ; then
16146
16147 cf_fix_cppflags=no
16148 cf_new_cflags=
16149 cf_new_cppflags=
16150 cf_new_extra_cppflags=
16151
16152 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
16153 do
16154 case "$cf_fix_cppflags" in
16155 (no)
16156         case "$cf_add_cflags" in
16157         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16158                 case "$cf_add_cflags" in
16159                 (-D*)
16160                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16161
16162                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16163                                 && test -z "${cf_tst_cflags}" \
16164                                 && cf_fix_cppflags=yes
16165
16166                         if test "$cf_fix_cppflags" = yes ; then
16167
16168         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16169         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16170
16171                                 continue
16172                         elif test "${cf_tst_cflags}" = "\"'" ; then
16173
16174         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16175         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16176
16177                                 continue
16178                         fi
16179                         ;;
16180                 esac
16181                 case "$CPPFLAGS" in
16182                 (*$cf_add_cflags)
16183                         ;;
16184                 (*)
16185                         case "$cf_add_cflags" in
16186                         (-D*)
16187                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16188
16189 CPPFLAGS=`echo "$CPPFLAGS" | \
16190         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16191                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16192
16193                                 ;;
16194                         esac
16195
16196         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16197         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16198
16199                         ;;
16200                 esac
16201                 ;;
16202         (*)
16203
16204         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16205         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16206
16207                 ;;
16208         esac
16209         ;;
16210 (yes)
16211
16212         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16213         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16214
16215         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16216
16217         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16218                 && test -z "${cf_tst_cflags}" \
16219                 && cf_fix_cppflags=no
16220         ;;
16221 esac
16222 done
16223
16224 if test -n "$cf_new_cflags" ; then
16225
16226         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16227         CFLAGS="${CFLAGS}$cf_new_cflags"
16228
16229 fi
16230
16231 if test -n "$cf_new_cppflags" ; then
16232
16233         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16234         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16235
16236 fi
16237
16238 if test -n "$cf_new_extra_cppflags" ; then
16239
16240         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16241         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16242
16243 fi
16244
16245 cf_add_libs="$LIBS"
16246 # reverse order
16247 cf_add_0lib=
16248 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16249 # filter duplicates
16250 for cf_add_1lib in $cf_add_0lib; do
16251         for cf_add_2lib in $cf_add_libs; do
16252                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16253                         cf_add_1lib=
16254                         break
16255                 fi
16256         done
16257         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16258 done
16259 LIBS="$cf_add_libs"
16260
16261 cf_cv_lib_XCurses=yes
16262
16263 else
16264
16265 LDFLAGS="$LDFLAGS $X_LIBS"
16266
16267 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
16268
16269 echo "${as_me:-configure}:16269: testing checking additions to CFLAGS ..." 1>&5
16270
16271 cf_check_cflags="$CFLAGS"
16272 cf_check_cppflags="$CPPFLAGS"
16273
16274 cf_fix_cppflags=no
16275 cf_new_cflags=
16276 cf_new_cppflags=
16277 cf_new_extra_cppflags=
16278
16279 for cf_add_cflags in $X_CFLAGS
16280 do
16281 case "$cf_fix_cppflags" in
16282 (no)
16283         case "$cf_add_cflags" in
16284         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16285                 case "$cf_add_cflags" in
16286                 (-D*)
16287                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16288
16289                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16290                                 && test -z "${cf_tst_cflags}" \
16291                                 && cf_fix_cppflags=yes
16292
16293                         if test "$cf_fix_cppflags" = yes ; then
16294
16295         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16296         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16297
16298                                 continue
16299                         elif test "${cf_tst_cflags}" = "\"'" ; then
16300
16301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16303
16304                                 continue
16305                         fi
16306                         ;;
16307                 esac
16308                 case "$CPPFLAGS" in
16309                 (*$cf_add_cflags)
16310                         ;;
16311                 (*)
16312                         case "$cf_add_cflags" in
16313                         (-D*)
16314                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16315
16316 CPPFLAGS=`echo "$CPPFLAGS" | \
16317         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16318                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16319
16320                                 ;;
16321                         esac
16322
16323         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16324         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16325
16326                         ;;
16327                 esac
16328                 ;;
16329         (*)
16330
16331         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16332         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16333
16334                 ;;
16335         esac
16336         ;;
16337 (yes)
16338
16339         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16340         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16341
16342         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16343
16344         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16345                 && test -z "${cf_tst_cflags}" \
16346                 && cf_fix_cppflags=no
16347         ;;
16348 esac
16349 done
16350
16351 if test -n "$cf_new_cflags" ; then
16352         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
16353
16354 echo "${as_me:-configure}:16354: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
16355
16356         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16357         CFLAGS="${CFLAGS}$cf_new_cflags"
16358
16359 fi
16360
16361 if test -n "$cf_new_cppflags" ; then
16362         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
16363
16364 echo "${as_me:-configure}:16364: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
16365
16366         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16367         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16368
16369 fi
16370
16371 if test -n "$cf_new_extra_cppflags" ; then
16372         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
16373
16374 echo "${as_me:-configure}:16374: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
16375
16376         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16377         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16378
16379 fi
16380
16381 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
16382 cat >"conftest.$ac_ext" <<_ACEOF
16383 #line 16383 "configure"
16384 #include "confdefs.h"
16385 #include <stdio.h>
16386 int
16387 main (void)
16388 {
16389 printf("Hello world");
16390   ;
16391   return 0;
16392 }
16393 _ACEOF
16394 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16395 if { (eval echo "$as_me:16395: \"$ac_link\"") >&5
16396   (eval $ac_link) 2>&5
16397   ac_status=$?
16398   echo "$as_me:16398: \$? = $ac_status" >&5
16399   (exit "$ac_status"); } &&
16400          { ac_try='test -s "conftest$ac_exeext"'
16401   { (eval echo "$as_me:16401: \"$ac_try\"") >&5
16402   (eval $ac_try) 2>&5
16403   ac_status=$?
16404   echo "$as_me:16404: \$? = $ac_status" >&5
16405   (exit "$ac_status"); }; }; then
16406   :
16407 else
16408   echo "$as_me: failed program was:" >&5
16409 cat "conftest.$ac_ext" >&5
16410 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
16411
16412 echo "${as_me:-configure}:16412: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
16413
16414          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
16415                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
16416
16417 echo "${as_me:-configure}:16417: testing but keeping change to \$CPPFLAGS ..." 1>&5
16418
16419          fi
16420          CFLAGS="$cf_check_cflags"
16421 fi
16422 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16423 fi
16424
16425 echo "$as_me:16425: checking for XOpenDisplay in -lX11" >&5
16426 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
16427 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
16428   echo $ECHO_N "(cached) $ECHO_C" >&6
16429 else
16430   ac_check_lib_save_LIBS=$LIBS
16431 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
16432 cat >"conftest.$ac_ext" <<_ACEOF
16433 #line 16433 "configure"
16434 #include "confdefs.h"
16435
16436 /* Override any gcc2 internal prototype to avoid an error.  */
16437 #ifdef __cplusplus
16438 extern "C"
16439 #endif
16440 /* We use char because int might match the return type of a gcc2
16441    builtin and then its argument prototype would still apply.  */
16442 char XOpenDisplay ();
16443 int
16444 main (void)
16445 {
16446 XOpenDisplay ();
16447   ;
16448   return 0;
16449 }
16450 _ACEOF
16451 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16452 if { (eval echo "$as_me:16452: \"$ac_link\"") >&5
16453   (eval $ac_link) 2>&5
16454   ac_status=$?
16455   echo "$as_me:16455: \$? = $ac_status" >&5
16456   (exit "$ac_status"); } &&
16457          { ac_try='test -s "conftest$ac_exeext"'
16458   { (eval echo "$as_me:16458: \"$ac_try\"") >&5
16459   (eval $ac_try) 2>&5
16460   ac_status=$?
16461   echo "$as_me:16461: \$? = $ac_status" >&5
16462   (exit "$ac_status"); }; }; then
16463   ac_cv_lib_X11_XOpenDisplay=yes
16464 else
16465   echo "$as_me: failed program was:" >&5
16466 cat "conftest.$ac_ext" >&5
16467 ac_cv_lib_X11_XOpenDisplay=no
16468 fi
16469 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16470 LIBS=$ac_check_lib_save_LIBS
16471 fi
16472 echo "$as_me:16472: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16473 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16474 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16475
16476 cf_add_libs="$LIBS"
16477 # reverse order
16478 cf_add_0lib=
16479 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16480 # filter duplicates
16481 for cf_add_1lib in $cf_add_0lib; do
16482         for cf_add_2lib in $cf_add_libs; do
16483                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16484                         cf_add_1lib=
16485                         break
16486                 fi
16487         done
16488         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16489 done
16490 LIBS="$cf_add_libs"
16491
16492 fi
16493
16494 echo "$as_me:16494: checking for XCurses library" >&5
16495 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16496 if test "${cf_cv_lib_XCurses+set}" = set; then
16497   echo $ECHO_N "(cached) $ECHO_C" >&6
16498 else
16499
16500 cf_add_libs="$LIBS"
16501 # reverse order
16502 cf_add_0lib=
16503 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16504 # filter duplicates
16505 for cf_add_1lib in $cf_add_0lib; do
16506         for cf_add_2lib in $cf_add_libs; do
16507                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16508                         cf_add_1lib=
16509                         break
16510                 fi
16511         done
16512         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16513 done
16514 LIBS="$cf_add_libs"
16515
16516 cat >"conftest.$ac_ext" <<_ACEOF
16517 #line 16517 "configure"
16518 #include "confdefs.h"
16519
16520 #include <xcurses.h>
16521 char *XCursesProgramName = "test";
16522
16523 int
16524 main (void)
16525 {
16526 XCursesExit();
16527   ;
16528   return 0;
16529 }
16530 _ACEOF
16531 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16532 if { (eval echo "$as_me:16532: \"$ac_link\"") >&5
16533   (eval $ac_link) 2>&5
16534   ac_status=$?
16535   echo "$as_me:16535: \$? = $ac_status" >&5
16536   (exit "$ac_status"); } &&
16537          { ac_try='test -s "conftest$ac_exeext"'
16538   { (eval echo "$as_me:16538: \"$ac_try\"") >&5
16539   (eval $ac_try) 2>&5
16540   ac_status=$?
16541   echo "$as_me:16541: \$? = $ac_status" >&5
16542   (exit "$ac_status"); }; }; then
16543   cf_cv_lib_XCurses=yes
16544 else
16545   echo "$as_me: failed program was:" >&5
16546 cat "conftest.$ac_ext" >&5
16547 cf_cv_lib_XCurses=no
16548 fi
16549 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16550
16551 fi
16552 echo "$as_me:16552: result: $cf_cv_lib_XCurses" >&5
16553 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16554
16555 fi
16556
16557 if test "$cf_cv_lib_XCurses" = yes ; then
16558
16559 cat >>confdefs.h <<\EOF
16560 #define UNIX 1
16561 EOF
16562
16563 cat >>confdefs.h <<\EOF
16564 #define XCURSES 1
16565 EOF
16566
16567         echo "$as_me:16567: checking for xcurses.h" >&5
16568 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16569 if test "${ac_cv_header_xcurses_h+set}" = set; then
16570   echo $ECHO_N "(cached) $ECHO_C" >&6
16571 else
16572   cat >"conftest.$ac_ext" <<_ACEOF
16573 #line 16573 "configure"
16574 #include "confdefs.h"
16575 #include <xcurses.h>
16576 _ACEOF
16577 if { (eval echo "$as_me:16577: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16578   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16579   ac_status=$?
16580   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16581   rm -f conftest.er1
16582   cat conftest.err >&5
16583   echo "$as_me:16583: \$? = $ac_status" >&5
16584   (exit "$ac_status"); } >/dev/null; then
16585   if test -s conftest.err; then
16586     ac_cpp_err=$ac_c_preproc_warn_flag
16587   else
16588     ac_cpp_err=
16589   fi
16590 else
16591   ac_cpp_err=yes
16592 fi
16593 if test -z "$ac_cpp_err"; then
16594   ac_cv_header_xcurses_h=yes
16595 else
16596   echo "$as_me: failed program was:" >&5
16597   cat "conftest.$ac_ext" >&5
16598   ac_cv_header_xcurses_h=no
16599 fi
16600 rm -f conftest.err "conftest.$ac_ext"
16601 fi
16602 echo "$as_me:16602: result: $ac_cv_header_xcurses_h" >&5
16603 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16604 if test "$ac_cv_header_xcurses_h" = yes; then
16605
16606 cat >>confdefs.h <<\EOF
16607 #define HAVE_XCURSES 1
16608 EOF
16609
16610 fi
16611
16612 else
16613         { { echo "$as_me:16613: error: Cannot link with XCurses" >&5
16614 echo "$as_me: error: Cannot link with XCurses" >&2;}
16615    { (exit 1); exit 1; }; }
16616 fi
16617
16618         ;;
16619 (*)
16620         { { echo "$as_me:16620: error: unexpected screen-value: $cf_cv_screen" >&5
16621 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16622    { (exit 1); exit 1; }; }
16623         ;;
16624 esac
16625
16626 : ${cf_nculib_root:=$cf_cv_screen}
16627 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16628 echo "$as_me:16628: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16629 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16630 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16631   echo $ECHO_N "(cached) $ECHO_C" >&6
16632 else
16633   ac_check_lib_save_LIBS=$LIBS
16634 LIBS="-l$cf_nculib_root  $LIBS"
16635 cat >"conftest.$ac_ext" <<_ACEOF
16636 #line 16636 "configure"
16637 #include "confdefs.h"
16638
16639 /* Override any gcc2 internal prototype to avoid an error.  */
16640 #ifdef __cplusplus
16641 extern "C"
16642 #endif
16643 /* We use char because int might match the return type of a gcc2
16644    builtin and then its argument prototype would still apply.  */
16645 char _nc_init_pthreads ();
16646 int
16647 main (void)
16648 {
16649 _nc_init_pthreads ();
16650   ;
16651   return 0;
16652 }
16653 _ACEOF
16654 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16655 if { (eval echo "$as_me:16655: \"$ac_link\"") >&5
16656   (eval $ac_link) 2>&5
16657   ac_status=$?
16658   echo "$as_me:16658: \$? = $ac_status" >&5
16659   (exit "$ac_status"); } &&
16660          { ac_try='test -s "conftest$ac_exeext"'
16661   { (eval echo "$as_me:16661: \"$ac_try\"") >&5
16662   (eval $ac_try) 2>&5
16663   ac_status=$?
16664   echo "$as_me:16664: \$? = $ac_status" >&5
16665   (exit "$ac_status"); }; }; then
16666   eval "$as_ac_Lib=yes"
16667 else
16668   echo "$as_me: failed program was:" >&5
16669 cat "conftest.$ac_ext" >&5
16670 eval "$as_ac_Lib=no"
16671 fi
16672 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16673 LIBS=$ac_check_lib_save_LIBS
16674 fi
16675 echo "$as_me:16675: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16676 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16677 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16678   cf_cv_ncurses_pthreads=yes
16679 else
16680   cf_cv_ncurses_pthreads=no
16681 fi
16682
16683 if test "$cf_cv_ncurses_pthreads" = yes
16684 then
16685
16686 cf_add_libs="$LIBS"
16687 # reverse order
16688 cf_add_0lib=
16689 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16690 # filter duplicates
16691 for cf_add_1lib in $cf_add_0lib; do
16692         for cf_add_2lib in $cf_add_libs; do
16693                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16694                         cf_add_1lib=
16695                         break
16696                 fi
16697         done
16698         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16699 done
16700 LIBS="$cf_add_libs"
16701
16702 fi
16703
16704 case $cf_cv_screen in
16705 (ncurses*)
16706         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16707         ;;
16708 esac
16709
16710 echo "$as_me:16710: checking for X11 rgb file" >&5
16711 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16712
16713 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16714 if test "${with_x11_rgb+set}" = set; then
16715   withval="$with_x11_rgb"
16716   RGB_PATH=$withval
16717 else
16718   RGB_PATH=auto
16719 fi;
16720
16721 if test "x$RGB_PATH" = xauto
16722 then
16723         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16724         for cf_path in \
16725                 /opt/local/share/X11/rgb.txt \
16726                 /opt/X11/share/X11/rgb.txt \
16727                 /usr/share/X11/rgb.txt \
16728                 /usr/X11/share/X11/rgb.txt \
16729                 /usr/X11/lib/X11/rgb.txt \
16730                 /usr/lib/X11/rgb.txt \
16731                 /etc/X11/rgb.txt \
16732                 /usr/pkg/lib/X11/rgb.txt \
16733                 /usr/X11R7/lib/X11/rgb.txt \
16734                 /usr/X11R6/lib/X11/rgb.txt \
16735                 /usr/X11R5/lib/X11/rgb.txt \
16736                 /usr/X11R4/lib/X11/rgb.txt \
16737                 /usr/local/lib/X11/rgb.txt \
16738                 /usr/local/share/X11/rgb.txt \
16739                 /usr/lib64/X11/rgb.txt
16740         do
16741                 if test -f "$cf_path" ; then
16742                         RGB_PATH="$cf_path"
16743                         break
16744                 fi
16745         done
16746 else
16747         cf_path=$RGB_PATH
16748
16749 if test "x$prefix" != xNONE; then
16750         cf_path_syntax="$prefix"
16751 else
16752         cf_path_syntax="$ac_default_prefix"
16753 fi
16754
16755 case ".$cf_path" in
16756 (.\$\(*\)*|.\'*\'*)
16757         ;;
16758 (..|./*|.\\*)
16759         ;;
16760 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16761         ;;
16762 (.\$\{*prefix\}*|.\$\{*dir\}*)
16763         eval cf_path="$cf_path"
16764         case ".$cf_path" in
16765         (.NONE/*)
16766                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16767                 ;;
16768         esac
16769         ;;
16770 (.no|.NONE/*)
16771         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16772         ;;
16773 (*)
16774         { { echo "$as_me:16774: error: expected a pathname, not \"$cf_path\"" >&5
16775 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16776    { (exit 1); exit 1; }; }
16777         ;;
16778 esac
16779
16780 fi
16781
16782 echo "$as_me:16782: result: $RGB_PATH" >&5
16783 echo "${ECHO_T}$RGB_PATH" >&6
16784
16785 cat >>confdefs.h <<EOF
16786 #define RGB_PATH "$cf_path"
16787 EOF
16788
16789 no_x11_rgb=
16790 if test "$RGB_PATH" = no
16791 then
16792         no_x11_rgb="#"
16793 fi
16794
16795 cf_curses_headers=
16796
16797 case $cf_cv_screen in
16798 (pdcurses)
16799         cf_default_panel=no
16800         cf_default_form=no
16801         cf_default_menu=no
16802         cf_default_tinfo=no
16803         ;;
16804 (xcurses|bsdcurses)
16805         cf_default_panel=no
16806         cf_default_form=no
16807         cf_default_menu=no
16808         cf_default_tinfo=yes
16809         ;;
16810 (*)
16811         cf_default_panel=yes
16812         cf_default_form=yes
16813         cf_default_menu=yes
16814         cf_default_tinfo=yes
16815         case $cf_cv_screen in
16816         (ncurses*)
16817                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16818                 ;;
16819         esac
16820         ;;
16821 esac
16822
16823 echo "$as_me:16823: checking for desired basename for form library" >&5
16824 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16825
16826 # Check whether --with-form-libname or --without-form-libname was given.
16827 if test "${with_form_libname+set}" = set; then
16828   withval="$with_form_libname"
16829   with_lib_basename=$withval
16830 else
16831   with_lib_basename=form
16832 fi;
16833 FORM_NAME="$with_lib_basename"
16834
16835 case "x$FORM_NAME" in
16836 (x|xno|xnone|xyes)
16837         FORM_NAME=form
16838         ;;
16839 (*)
16840         ;;
16841 esac
16842
16843 echo "$as_me:16843: result: $FORM_NAME" >&5
16844 echo "${ECHO_T}$FORM_NAME" >&6
16845
16846 echo "$as_me:16846: checking for desired basename for menu library" >&5
16847 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16848
16849 # Check whether --with-menu-libname or --without-menu-libname was given.
16850 if test "${with_menu_libname+set}" = set; then
16851   withval="$with_menu_libname"
16852   with_lib_basename=$withval
16853 else
16854   with_lib_basename=menu
16855 fi;
16856 MENU_NAME="$with_lib_basename"
16857
16858 case "x$MENU_NAME" in
16859 (x|xno|xnone|xyes)
16860         MENU_NAME=menu
16861         ;;
16862 (*)
16863         ;;
16864 esac
16865
16866 echo "$as_me:16866: result: $MENU_NAME" >&5
16867 echo "${ECHO_T}$MENU_NAME" >&6
16868
16869 echo "$as_me:16869: checking for desired basename for panel library" >&5
16870 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16871
16872 # Check whether --with-panel-libname or --without-panel-libname was given.
16873 if test "${with_panel_libname+set}" = set; then
16874   withval="$with_panel_libname"
16875   with_lib_basename=$withval
16876 else
16877   with_lib_basename=panel
16878 fi;
16879 PANEL_NAME="$with_lib_basename"
16880
16881 case "x$PANEL_NAME" in
16882 (x|xno|xnone|xyes)
16883         PANEL_NAME=panel
16884         ;;
16885 (*)
16886         ;;
16887 esac
16888
16889 echo "$as_me:16889: result: $PANEL_NAME" >&5
16890 echo "${ECHO_T}$PANEL_NAME" >&6
16891
16892 echo "$as_me:16892: checking if you want to check for panel functions" >&5
16893 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16894
16895 # Check whether --enable-panel or --disable-panel was given.
16896 if test "${enable_panel+set}" = set; then
16897   enableval="$enable_panel"
16898   test "$enableval" != no && enableval=yes
16899         if test "$enableval" != "yes" ; then
16900     cf_enable_panel=no
16901         else
16902                 cf_enable_panel=$cf_default_panel
16903         fi
16904 else
16905   enableval=yes
16906         cf_enable_panel=$cf_default_panel
16907
16908 fi;
16909 echo "$as_me:16909: result: $cf_enable_panel" >&5
16910 echo "${ECHO_T}$cf_enable_panel" >&6
16911 if test $cf_enable_panel = yes
16912 then
16913
16914 cf_have_curses_lib=no
16915
16916 : ${NCURSES_CONFIG_PKG:=none}
16917 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16918         :
16919 elif test "x${PKG_CONFIG:=none}" != xnone; then
16920         echo "$as_me:16920: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16921 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16922         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16923                 echo "$as_me:16923: result: yes" >&5
16924 echo "${ECHO_T}yes" >&6
16925
16926                 echo "$as_me:16926: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16927 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16928
16929                 cf_save_CFLAGS="$CFLAGS"
16930                 cf_save_CPPFLAGS="$CPPFLAGS"
16931                 cf_save_LIBS="$LIBS"
16932
16933 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16934 do
16935         case "x$cf_add_cflags" in
16936         (x-[DU]*)
16937
16938 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16939 while true
16940 do
16941         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'`
16942         test "$CFLAGS" != "$cf_old_cflag" || break
16943
16944         CFLAGS="$cf_old_cflag"
16945 done
16946
16947 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
16948 while true
16949 do
16950         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'`
16951         test "$CPPFLAGS" != "$cf_old_cflag" || break
16952
16953         CPPFLAGS="$cf_old_cflag"
16954 done
16955
16956                 ;;
16957         esac
16958
16959 cf_fix_cppflags=no
16960 cf_new_cflags=
16961 cf_new_cppflags=
16962 cf_new_extra_cppflags=
16963
16964 for cf_add_cflags in $cf_add_cflags
16965 do
16966 case "$cf_fix_cppflags" in
16967 (no)
16968         case "$cf_add_cflags" in
16969         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16970                 case "$cf_add_cflags" in
16971                 (-D*)
16972                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16973
16974                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16975                                 && test -z "${cf_tst_cflags}" \
16976                                 && cf_fix_cppflags=yes
16977
16978                         if test "$cf_fix_cppflags" = yes ; then
16979
16980         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16981         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16982
16983                                 continue
16984                         elif test "${cf_tst_cflags}" = "\"'" ; then
16985
16986         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16987         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16988
16989                                 continue
16990                         fi
16991                         ;;
16992                 esac
16993                 case "$CPPFLAGS" in
16994                 (*$cf_add_cflags)
16995                         ;;
16996                 (*)
16997                         case "$cf_add_cflags" in
16998                         (-D*)
16999                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17000
17001 CPPFLAGS=`echo "$CPPFLAGS" | \
17002         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17003                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17004
17005                                 ;;
17006                         esac
17007
17008         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17009         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17010
17011                         ;;
17012                 esac
17013                 ;;
17014         (*)
17015
17016         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17017         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17018
17019                 ;;
17020         esac
17021         ;;
17022 (yes)
17023
17024         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17025         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17026
17027         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17028
17029         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17030                 && test -z "${cf_tst_cflags}" \
17031                 && cf_fix_cppflags=no
17032         ;;
17033 esac
17034 done
17035
17036 if test -n "$cf_new_cflags" ; then
17037
17038         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17039         CFLAGS="${CFLAGS}$cf_new_cflags"
17040
17041 fi
17042
17043 if test -n "$cf_new_cppflags" ; then
17044
17045         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17046         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17047
17048 fi
17049
17050 if test -n "$cf_new_extra_cppflags" ; then
17051
17052         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17053         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17054
17055 fi
17056
17057 done
17058
17059 cf_add_libs="$LIBS"
17060 # reverse order
17061 cf_add_0lib=
17062 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17063 # filter duplicates
17064 for cf_add_1lib in $cf_add_0lib; do
17065         for cf_add_2lib in $cf_add_libs; do
17066                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17067                         cf_add_1lib=
17068                         break
17069                 fi
17070         done
17071         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17072 done
17073 LIBS="$cf_add_libs"
17074
17075                 cat >"conftest.$ac_ext" <<_ACEOF
17076 #line 17076 "configure"
17077 #include "confdefs.h"
17078 #include <$PANEL_NAME.h>
17079 int
17080 main (void)
17081 {
17082 (void) new_panel ( 0 );
17083   ;
17084   return 0;
17085 }
17086 _ACEOF
17087 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17088 if { (eval echo "$as_me:17088: \"$ac_link\"") >&5
17089   (eval $ac_link) 2>&5
17090   ac_status=$?
17091   echo "$as_me:17091: \$? = $ac_status" >&5
17092   (exit "$ac_status"); } &&
17093          { ac_try='test -s "conftest$ac_exeext"'
17094   { (eval echo "$as_me:17094: \"$ac_try\"") >&5
17095   (eval $ac_try) 2>&5
17096   ac_status=$?
17097   echo "$as_me:17097: \$? = $ac_status" >&5
17098   (exit "$ac_status"); }; }; then
17099   if test "$cross_compiling" = yes; then
17100   cf_have_curses_lib=maybe
17101 else
17102   cat >"conftest.$ac_ext" <<_ACEOF
17103 #line 17103 "configure"
17104 #include "confdefs.h"
17105 #include <$PANEL_NAME.h>
17106                                 int main(void)
17107                                 { (void) new_panel ( 0 ); return 0; }
17108 _ACEOF
17109 rm -f "conftest$ac_exeext"
17110 if { (eval echo "$as_me:17110: \"$ac_link\"") >&5
17111   (eval $ac_link) 2>&5
17112   ac_status=$?
17113   echo "$as_me:17113: \$? = $ac_status" >&5
17114   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17115   { (eval echo "$as_me:17115: \"$ac_try\"") >&5
17116   (eval $ac_try) 2>&5
17117   ac_status=$?
17118   echo "$as_me:17118: \$? = $ac_status" >&5
17119   (exit "$ac_status"); }; }; then
17120   cf_have_curses_lib=yes
17121 else
17122   echo "$as_me: program exited with status $ac_status" >&5
17123 echo "$as_me: failed program was:" >&5
17124 cat "conftest.$ac_ext" >&5
17125 cf_have_curses_lib=no
17126 fi
17127 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17128 fi
17129 else
17130   echo "$as_me: failed program was:" >&5
17131 cat "conftest.$ac_ext" >&5
17132 cf_have_curses_lib=no
17133 fi
17134 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17135                 echo "$as_me:17135: result: $cf_have_curses_lib" >&5
17136 echo "${ECHO_T}$cf_have_curses_lib" >&6
17137                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17138                 if test "$cf_have_curses_lib" = "yes"
17139                 then
17140
17141 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17142
17143                         cat >>confdefs.h <<EOF
17144 #define $cf_upper 1
17145 EOF
17146
17147                 else
17148                         CFLAGS="$cf_save_CFLAGS"
17149                         CPPFLAGS="$cf_save_CPPFLAGS"
17150                         LIBS="$cf_save_LIBS"
17151                 fi
17152         fi
17153 fi
17154 if test "$cf_have_curses_lib" = no; then
17155         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
17156 echo "$as_me:17156: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
17157 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
17158 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17159   echo $ECHO_N "(cached) $ECHO_C" >&6
17160 else
17161   ac_check_lib_save_LIBS=$LIBS
17162 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
17163 cat >"conftest.$ac_ext" <<_ACEOF
17164 #line 17164 "configure"
17165 #include "confdefs.h"
17166
17167 /* Override any gcc2 internal prototype to avoid an error.  */
17168 #ifdef __cplusplus
17169 extern "C"
17170 #endif
17171 /* We use char because int might match the return type of a gcc2
17172    builtin and then its argument prototype would still apply.  */
17173 char new_panel ();
17174 int
17175 main (void)
17176 {
17177 new_panel ();
17178   ;
17179   return 0;
17180 }
17181 _ACEOF
17182 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17183 if { (eval echo "$as_me:17183: \"$ac_link\"") >&5
17184   (eval $ac_link) 2>&5
17185   ac_status=$?
17186   echo "$as_me:17186: \$? = $ac_status" >&5
17187   (exit "$ac_status"); } &&
17188          { ac_try='test -s "conftest$ac_exeext"'
17189   { (eval echo "$as_me:17189: \"$ac_try\"") >&5
17190   (eval $ac_try) 2>&5
17191   ac_status=$?
17192   echo "$as_me:17192: \$? = $ac_status" >&5
17193   (exit "$ac_status"); }; }; then
17194   eval "$as_ac_Lib=yes"
17195 else
17196   echo "$as_me: failed program was:" >&5
17197 cat "conftest.$ac_ext" >&5
17198 eval "$as_ac_Lib=no"
17199 fi
17200 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17201 LIBS=$ac_check_lib_save_LIBS
17202 fi
17203 echo "$as_me:17203: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17204 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17205 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17206
17207 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17208
17209 cf_add_libs="$LIBS"
17210 # reverse order
17211 cf_add_0lib=
17212 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17213 # filter duplicates
17214 for cf_add_1lib in $cf_add_0lib; do
17215         for cf_add_2lib in $cf_add_libs; do
17216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17217                         cf_add_1lib=
17218                         break
17219                 fi
17220         done
17221         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17222 done
17223 LIBS="$cf_add_libs"
17224
17225                 cat >>confdefs.h <<EOF
17226 #define $cf_upper 1
17227 EOF
17228
17229 fi
17230
17231 fi
17232
17233         cf_curses_headers="$cf_curses_headers panel.h"
17234 fi
17235
17236 echo "$as_me:17236: checking if you want to check for menu functions" >&5
17237 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
17238
17239 # Check whether --enable-menu or --disable-menu was given.
17240 if test "${enable_menu+set}" = set; then
17241   enableval="$enable_menu"
17242   test "$enableval" != no && enableval=yes
17243         if test "$enableval" != "yes" ; then
17244     cf_enable_menu=no
17245         else
17246                 cf_enable_menu=$cf_default_menu
17247         fi
17248 else
17249   enableval=yes
17250         cf_enable_menu=$cf_default_menu
17251
17252 fi;
17253 echo "$as_me:17253: result: $cf_enable_menu" >&5
17254 echo "${ECHO_T}$cf_enable_menu" >&6
17255 if test $cf_enable_menu = yes
17256 then
17257         case $cf_cv_screen in
17258         (ncurses*)
17259                 ;;
17260         (curses*)
17261
17262 echo "$as_me:17262: checking for NetBSD menu.h" >&5
17263 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
17264 if test "${cf_cv_netbsd_menu_h+set}" = set; then
17265   echo $ECHO_N "(cached) $ECHO_C" >&6
17266 else
17267
17268 cat >"conftest.$ac_ext" <<_ACEOF
17269 #line 17269 "configure"
17270 #include "confdefs.h"
17271
17272 #include <${cf_cv_ncurses_header:-curses.h}>
17273 #include <menu.h>
17274
17275 int
17276 main (void)
17277 {
17278
17279         MENU *menu;
17280         int y = menu->max_item_width;
17281
17282   ;
17283   return 0;
17284 }
17285 _ACEOF
17286 rm -f "conftest.$ac_objext"
17287 if { (eval echo "$as_me:17287: \"$ac_compile\"") >&5
17288   (eval $ac_compile) 2>&5
17289   ac_status=$?
17290   echo "$as_me:17290: \$? = $ac_status" >&5
17291   (exit "$ac_status"); } &&
17292          { ac_try='test -s "conftest.$ac_objext"'
17293   { (eval echo "$as_me:17293: \"$ac_try\"") >&5
17294   (eval $ac_try) 2>&5
17295   ac_status=$?
17296   echo "$as_me:17296: \$? = $ac_status" >&5
17297   (exit "$ac_status"); }; }; then
17298   cf_cv_netbsd_menu_h=yes
17299
17300 else
17301   echo "$as_me: failed program was:" >&5
17302 cat "conftest.$ac_ext" >&5
17303 cf_cv_netbsd_menu_h=no
17304 fi
17305 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17306
17307 fi
17308 echo "$as_me:17308: result: $cf_cv_netbsd_menu_h" >&5
17309 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
17310
17311 test "$cf_cv_netbsd_menu_h" = yes &&
17312 cat >>confdefs.h <<\EOF
17313 #define HAVE_NETBSD_MENU_H 1
17314 EOF
17315
17316                 ;;
17317         esac
17318
17319 cf_have_curses_lib=no
17320
17321 : ${NCURSES_CONFIG_PKG:=none}
17322 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17323         :
17324 elif test "x${PKG_CONFIG:=none}" != xnone; then
17325         echo "$as_me:17325: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
17326 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17327         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
17328                 echo "$as_me:17328: result: yes" >&5
17329 echo "${ECHO_T}yes" >&6
17330
17331                 echo "$as_me:17331: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
17332 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17333
17334                 cf_save_CFLAGS="$CFLAGS"
17335                 cf_save_CPPFLAGS="$CPPFLAGS"
17336                 cf_save_LIBS="$LIBS"
17337
17338 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
17339 do
17340         case "x$cf_add_cflags" in
17341         (x-[DU]*)
17342
17343 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17344 while true
17345 do
17346         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'`
17347         test "$CFLAGS" != "$cf_old_cflag" || break
17348
17349         CFLAGS="$cf_old_cflag"
17350 done
17351
17352 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17353 while true
17354 do
17355         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'`
17356         test "$CPPFLAGS" != "$cf_old_cflag" || break
17357
17358         CPPFLAGS="$cf_old_cflag"
17359 done
17360
17361                 ;;
17362         esac
17363
17364 cf_fix_cppflags=no
17365 cf_new_cflags=
17366 cf_new_cppflags=
17367 cf_new_extra_cppflags=
17368
17369 for cf_add_cflags in $cf_add_cflags
17370 do
17371 case "$cf_fix_cppflags" in
17372 (no)
17373         case "$cf_add_cflags" in
17374         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17375                 case "$cf_add_cflags" in
17376                 (-D*)
17377                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17378
17379                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17380                                 && test -z "${cf_tst_cflags}" \
17381                                 && cf_fix_cppflags=yes
17382
17383                         if test "$cf_fix_cppflags" = yes ; then
17384
17385         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17386         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17387
17388                                 continue
17389                         elif test "${cf_tst_cflags}" = "\"'" ; then
17390
17391         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17392         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17393
17394                                 continue
17395                         fi
17396                         ;;
17397                 esac
17398                 case "$CPPFLAGS" in
17399                 (*$cf_add_cflags)
17400                         ;;
17401                 (*)
17402                         case "$cf_add_cflags" in
17403                         (-D*)
17404                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17405
17406 CPPFLAGS=`echo "$CPPFLAGS" | \
17407         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17408                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17409
17410                                 ;;
17411                         esac
17412
17413         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17414         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17415
17416                         ;;
17417                 esac
17418                 ;;
17419         (*)
17420
17421         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17422         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17423
17424                 ;;
17425         esac
17426         ;;
17427 (yes)
17428
17429         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17430         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17431
17432         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17433
17434         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17435                 && test -z "${cf_tst_cflags}" \
17436                 && cf_fix_cppflags=no
17437         ;;
17438 esac
17439 done
17440
17441 if test -n "$cf_new_cflags" ; then
17442
17443         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17444         CFLAGS="${CFLAGS}$cf_new_cflags"
17445
17446 fi
17447
17448 if test -n "$cf_new_cppflags" ; then
17449
17450         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17451         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17452
17453 fi
17454
17455 if test -n "$cf_new_extra_cppflags" ; then
17456
17457         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17458         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17459
17460 fi
17461
17462 done
17463
17464 cf_add_libs="$LIBS"
17465 # reverse order
17466 cf_add_0lib=
17467 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17468 # filter duplicates
17469 for cf_add_1lib in $cf_add_0lib; do
17470         for cf_add_2lib in $cf_add_libs; do
17471                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17472                         cf_add_1lib=
17473                         break
17474                 fi
17475         done
17476         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17477 done
17478 LIBS="$cf_add_libs"
17479
17480                 cat >"conftest.$ac_ext" <<_ACEOF
17481 #line 17481 "configure"
17482 #include "confdefs.h"
17483 #include <$MENU_NAME.h>
17484 int
17485 main (void)
17486 {
17487 (void) menu_driver ( 0,0 );
17488   ;
17489   return 0;
17490 }
17491 _ACEOF
17492 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17493 if { (eval echo "$as_me:17493: \"$ac_link\"") >&5
17494   (eval $ac_link) 2>&5
17495   ac_status=$?
17496   echo "$as_me:17496: \$? = $ac_status" >&5
17497   (exit "$ac_status"); } &&
17498          { ac_try='test -s "conftest$ac_exeext"'
17499   { (eval echo "$as_me:17499: \"$ac_try\"") >&5
17500   (eval $ac_try) 2>&5
17501   ac_status=$?
17502   echo "$as_me:17502: \$? = $ac_status" >&5
17503   (exit "$ac_status"); }; }; then
17504   if test "$cross_compiling" = yes; then
17505   cf_have_curses_lib=maybe
17506 else
17507   cat >"conftest.$ac_ext" <<_ACEOF
17508 #line 17508 "configure"
17509 #include "confdefs.h"
17510 #include <$MENU_NAME.h>
17511                                 int main(void)
17512                                 { (void) menu_driver ( 0,0 ); return 0; }
17513 _ACEOF
17514 rm -f "conftest$ac_exeext"
17515 if { (eval echo "$as_me:17515: \"$ac_link\"") >&5
17516   (eval $ac_link) 2>&5
17517   ac_status=$?
17518   echo "$as_me:17518: \$? = $ac_status" >&5
17519   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17520   { (eval echo "$as_me:17520: \"$ac_try\"") >&5
17521   (eval $ac_try) 2>&5
17522   ac_status=$?
17523   echo "$as_me:17523: \$? = $ac_status" >&5
17524   (exit "$ac_status"); }; }; then
17525   cf_have_curses_lib=yes
17526 else
17527   echo "$as_me: program exited with status $ac_status" >&5
17528 echo "$as_me: failed program was:" >&5
17529 cat "conftest.$ac_ext" >&5
17530 cf_have_curses_lib=no
17531 fi
17532 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17533 fi
17534 else
17535   echo "$as_me: failed program was:" >&5
17536 cat "conftest.$ac_ext" >&5
17537 cf_have_curses_lib=no
17538 fi
17539 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17540                 echo "$as_me:17540: result: $cf_have_curses_lib" >&5
17541 echo "${ECHO_T}$cf_have_curses_lib" >&6
17542                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17543                 if test "$cf_have_curses_lib" = "yes"
17544                 then
17545
17546 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17547
17548                         cat >>confdefs.h <<EOF
17549 #define $cf_upper 1
17550 EOF
17551
17552                 else
17553                         CFLAGS="$cf_save_CFLAGS"
17554                         CPPFLAGS="$cf_save_CPPFLAGS"
17555                         LIBS="$cf_save_LIBS"
17556                 fi
17557         fi
17558 fi
17559 if test "$cf_have_curses_lib" = no; then
17560         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17561 echo "$as_me:17561: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17562 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17563 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17564   echo $ECHO_N "(cached) $ECHO_C" >&6
17565 else
17566   ac_check_lib_save_LIBS=$LIBS
17567 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17568 cat >"conftest.$ac_ext" <<_ACEOF
17569 #line 17569 "configure"
17570 #include "confdefs.h"
17571
17572 /* Override any gcc2 internal prototype to avoid an error.  */
17573 #ifdef __cplusplus
17574 extern "C"
17575 #endif
17576 /* We use char because int might match the return type of a gcc2
17577    builtin and then its argument prototype would still apply.  */
17578 char menu_driver ();
17579 int
17580 main (void)
17581 {
17582 menu_driver ();
17583   ;
17584   return 0;
17585 }
17586 _ACEOF
17587 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17588 if { (eval echo "$as_me:17588: \"$ac_link\"") >&5
17589   (eval $ac_link) 2>&5
17590   ac_status=$?
17591   echo "$as_me:17591: \$? = $ac_status" >&5
17592   (exit "$ac_status"); } &&
17593          { ac_try='test -s "conftest$ac_exeext"'
17594   { (eval echo "$as_me:17594: \"$ac_try\"") >&5
17595   (eval $ac_try) 2>&5
17596   ac_status=$?
17597   echo "$as_me:17597: \$? = $ac_status" >&5
17598   (exit "$ac_status"); }; }; then
17599   eval "$as_ac_Lib=yes"
17600 else
17601   echo "$as_me: failed program was:" >&5
17602 cat "conftest.$ac_ext" >&5
17603 eval "$as_ac_Lib=no"
17604 fi
17605 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17606 LIBS=$ac_check_lib_save_LIBS
17607 fi
17608 echo "$as_me:17608: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17609 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17610 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17611
17612 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17613
17614 cf_add_libs="$LIBS"
17615 # reverse order
17616 cf_add_0lib=
17617 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17618 # filter duplicates
17619 for cf_add_1lib in $cf_add_0lib; do
17620         for cf_add_2lib in $cf_add_libs; do
17621                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17622                         cf_add_1lib=
17623                         break
17624                 fi
17625         done
17626         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17627 done
17628 LIBS="$cf_add_libs"
17629
17630                 cat >>confdefs.h <<EOF
17631 #define $cf_upper 1
17632 EOF
17633
17634 fi
17635
17636 fi
17637
17638         cf_curses_headers="$cf_curses_headers menu.h"
17639 fi
17640
17641 echo "$as_me:17641: checking if you want to check for form functions" >&5
17642 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17643
17644 # Check whether --enable-form or --disable-form was given.
17645 if test "${enable_form+set}" = set; then
17646   enableval="$enable_form"
17647   test "$enableval" != no && enableval=yes
17648         if test "$enableval" != "yes" ; then
17649     cf_enable_form=no
17650         else
17651                 cf_enable_form=$cf_default_form
17652         fi
17653 else
17654   enableval=yes
17655         cf_enable_form=$cf_default_form
17656
17657 fi;
17658 echo "$as_me:17658: result: $cf_enable_form" >&5
17659 echo "${ECHO_T}$cf_enable_form" >&6
17660 if test $cf_enable_form = yes
17661 then
17662         case $cf_cv_screen in
17663         (ncurses*)
17664                 ;;
17665         (curses*)
17666
17667 echo "$as_me:17667: checking for NetBSD form.h" >&5
17668 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17669 if test "${cf_cv_netbsd_form_h+set}" = set; then
17670   echo $ECHO_N "(cached) $ECHO_C" >&6
17671 else
17672
17673 cat >"conftest.$ac_ext" <<_ACEOF
17674 #line 17674 "configure"
17675 #include "confdefs.h"
17676
17677 #include <${cf_cv_ncurses_header:-curses.h}>
17678 #include <form.h>
17679
17680 int
17681 main (void)
17682 {
17683
17684         FORM *form;
17685         int y = current_field(form)->cursor_ypos;
17686         int x = current_field(form)->cursor_xpos;
17687
17688   ;
17689   return 0;
17690 }
17691 _ACEOF
17692 rm -f "conftest.$ac_objext"
17693 if { (eval echo "$as_me:17693: \"$ac_compile\"") >&5
17694   (eval $ac_compile) 2>&5
17695   ac_status=$?
17696   echo "$as_me:17696: \$? = $ac_status" >&5
17697   (exit "$ac_status"); } &&
17698          { ac_try='test -s "conftest.$ac_objext"'
17699   { (eval echo "$as_me:17699: \"$ac_try\"") >&5
17700   (eval $ac_try) 2>&5
17701   ac_status=$?
17702   echo "$as_me:17702: \$? = $ac_status" >&5
17703   (exit "$ac_status"); }; }; then
17704   cf_cv_netbsd_form_h=yes
17705
17706 else
17707   echo "$as_me: failed program was:" >&5
17708 cat "conftest.$ac_ext" >&5
17709 cf_cv_netbsd_form_h=no
17710 fi
17711 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17712
17713 fi
17714 echo "$as_me:17714: result: $cf_cv_netbsd_form_h" >&5
17715 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17716
17717 test "$cf_cv_netbsd_form_h" = yes &&
17718 cat >>confdefs.h <<\EOF
17719 #define HAVE_NETBSD_FORM_H 1
17720 EOF
17721
17722                 ;;
17723         esac
17724
17725 cf_have_curses_lib=no
17726
17727 : ${NCURSES_CONFIG_PKG:=none}
17728 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17729         :
17730 elif test "x${PKG_CONFIG:=none}" != xnone; then
17731         echo "$as_me:17731: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17732 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17733         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17734                 echo "$as_me:17734: result: yes" >&5
17735 echo "${ECHO_T}yes" >&6
17736
17737                 echo "$as_me:17737: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17738 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17739
17740                 cf_save_CFLAGS="$CFLAGS"
17741                 cf_save_CPPFLAGS="$CPPFLAGS"
17742                 cf_save_LIBS="$LIBS"
17743
17744 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17745 do
17746         case "x$cf_add_cflags" in
17747         (x-[DU]*)
17748
17749 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17750 while true
17751 do
17752         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'`
17753         test "$CFLAGS" != "$cf_old_cflag" || break
17754
17755         CFLAGS="$cf_old_cflag"
17756 done
17757
17758 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
17759 while true
17760 do
17761         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'`
17762         test "$CPPFLAGS" != "$cf_old_cflag" || break
17763
17764         CPPFLAGS="$cf_old_cflag"
17765 done
17766
17767                 ;;
17768         esac
17769
17770 cf_fix_cppflags=no
17771 cf_new_cflags=
17772 cf_new_cppflags=
17773 cf_new_extra_cppflags=
17774
17775 for cf_add_cflags in $cf_add_cflags
17776 do
17777 case "$cf_fix_cppflags" in
17778 (no)
17779         case "$cf_add_cflags" in
17780         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17781                 case "$cf_add_cflags" in
17782                 (-D*)
17783                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17784
17785                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17786                                 && test -z "${cf_tst_cflags}" \
17787                                 && cf_fix_cppflags=yes
17788
17789                         if test "$cf_fix_cppflags" = yes ; then
17790
17791         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17792         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17793
17794                                 continue
17795                         elif test "${cf_tst_cflags}" = "\"'" ; then
17796
17797         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17798         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17799
17800                                 continue
17801                         fi
17802                         ;;
17803                 esac
17804                 case "$CPPFLAGS" in
17805                 (*$cf_add_cflags)
17806                         ;;
17807                 (*)
17808                         case "$cf_add_cflags" in
17809                         (-D*)
17810                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17811
17812 CPPFLAGS=`echo "$CPPFLAGS" | \
17813         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17814                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17815
17816                                 ;;
17817                         esac
17818
17819         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17820         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17821
17822                         ;;
17823                 esac
17824                 ;;
17825         (*)
17826
17827         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17828         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17829
17830                 ;;
17831         esac
17832         ;;
17833 (yes)
17834
17835         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17836         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17837
17838         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17839
17840         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17841                 && test -z "${cf_tst_cflags}" \
17842                 && cf_fix_cppflags=no
17843         ;;
17844 esac
17845 done
17846
17847 if test -n "$cf_new_cflags" ; then
17848
17849         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17850         CFLAGS="${CFLAGS}$cf_new_cflags"
17851
17852 fi
17853
17854 if test -n "$cf_new_cppflags" ; then
17855
17856         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17857         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17858
17859 fi
17860
17861 if test -n "$cf_new_extra_cppflags" ; then
17862
17863         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17864         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17865
17866 fi
17867
17868 done
17869
17870 cf_add_libs="$LIBS"
17871 # reverse order
17872 cf_add_0lib=
17873 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17874 # filter duplicates
17875 for cf_add_1lib in $cf_add_0lib; do
17876         for cf_add_2lib in $cf_add_libs; do
17877                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17878                         cf_add_1lib=
17879                         break
17880                 fi
17881         done
17882         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17883 done
17884 LIBS="$cf_add_libs"
17885
17886                 cat >"conftest.$ac_ext" <<_ACEOF
17887 #line 17887 "configure"
17888 #include "confdefs.h"
17889 #include <$FORM_NAME.h>
17890 int
17891 main (void)
17892 {
17893 (void) form_driver ( 0,0 );
17894   ;
17895   return 0;
17896 }
17897 _ACEOF
17898 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17899 if { (eval echo "$as_me:17899: \"$ac_link\"") >&5
17900   (eval $ac_link) 2>&5
17901   ac_status=$?
17902   echo "$as_me:17902: \$? = $ac_status" >&5
17903   (exit "$ac_status"); } &&
17904          { ac_try='test -s "conftest$ac_exeext"'
17905   { (eval echo "$as_me:17905: \"$ac_try\"") >&5
17906   (eval $ac_try) 2>&5
17907   ac_status=$?
17908   echo "$as_me:17908: \$? = $ac_status" >&5
17909   (exit "$ac_status"); }; }; then
17910   if test "$cross_compiling" = yes; then
17911   cf_have_curses_lib=maybe
17912 else
17913   cat >"conftest.$ac_ext" <<_ACEOF
17914 #line 17914 "configure"
17915 #include "confdefs.h"
17916 #include <$FORM_NAME.h>
17917                                 int main(void)
17918                                 { (void) form_driver ( 0,0 ); return 0; }
17919 _ACEOF
17920 rm -f "conftest$ac_exeext"
17921 if { (eval echo "$as_me:17921: \"$ac_link\"") >&5
17922   (eval $ac_link) 2>&5
17923   ac_status=$?
17924   echo "$as_me:17924: \$? = $ac_status" >&5
17925   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17926   { (eval echo "$as_me:17926: \"$ac_try\"") >&5
17927   (eval $ac_try) 2>&5
17928   ac_status=$?
17929   echo "$as_me:17929: \$? = $ac_status" >&5
17930   (exit "$ac_status"); }; }; then
17931   cf_have_curses_lib=yes
17932 else
17933   echo "$as_me: program exited with status $ac_status" >&5
17934 echo "$as_me: failed program was:" >&5
17935 cat "conftest.$ac_ext" >&5
17936 cf_have_curses_lib=no
17937 fi
17938 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17939 fi
17940 else
17941   echo "$as_me: failed program was:" >&5
17942 cat "conftest.$ac_ext" >&5
17943 cf_have_curses_lib=no
17944 fi
17945 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17946                 echo "$as_me:17946: result: $cf_have_curses_lib" >&5
17947 echo "${ECHO_T}$cf_have_curses_lib" >&6
17948                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17949                 if test "$cf_have_curses_lib" = "yes"
17950                 then
17951
17952 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17953
17954                         cat >>confdefs.h <<EOF
17955 #define $cf_upper 1
17956 EOF
17957
17958                 else
17959                         CFLAGS="$cf_save_CFLAGS"
17960                         CPPFLAGS="$cf_save_CPPFLAGS"
17961                         LIBS="$cf_save_LIBS"
17962                 fi
17963         fi
17964 fi
17965 if test "$cf_have_curses_lib" = no; then
17966         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17967 echo "$as_me:17967: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17968 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17969 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17970   echo $ECHO_N "(cached) $ECHO_C" >&6
17971 else
17972   ac_check_lib_save_LIBS=$LIBS
17973 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17974 cat >"conftest.$ac_ext" <<_ACEOF
17975 #line 17975 "configure"
17976 #include "confdefs.h"
17977
17978 /* Override any gcc2 internal prototype to avoid an error.  */
17979 #ifdef __cplusplus
17980 extern "C"
17981 #endif
17982 /* We use char because int might match the return type of a gcc2
17983    builtin and then its argument prototype would still apply.  */
17984 char form_driver ();
17985 int
17986 main (void)
17987 {
17988 form_driver ();
17989   ;
17990   return 0;
17991 }
17992 _ACEOF
17993 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17994 if { (eval echo "$as_me:17994: \"$ac_link\"") >&5
17995   (eval $ac_link) 2>&5
17996   ac_status=$?
17997   echo "$as_me:17997: \$? = $ac_status" >&5
17998   (exit "$ac_status"); } &&
17999          { ac_try='test -s "conftest$ac_exeext"'
18000   { (eval echo "$as_me:18000: \"$ac_try\"") >&5
18001   (eval $ac_try) 2>&5
18002   ac_status=$?
18003   echo "$as_me:18003: \$? = $ac_status" >&5
18004   (exit "$ac_status"); }; }; then
18005   eval "$as_ac_Lib=yes"
18006 else
18007   echo "$as_me: failed program was:" >&5
18008 cat "conftest.$ac_ext" >&5
18009 eval "$as_ac_Lib=no"
18010 fi
18011 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18012 LIBS=$ac_check_lib_save_LIBS
18013 fi
18014 echo "$as_me:18014: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
18015 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
18016 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
18017
18018 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18019
18020 cf_add_libs="$LIBS"
18021 # reverse order
18022 cf_add_0lib=
18023 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18024 # filter duplicates
18025 for cf_add_1lib in $cf_add_0lib; do
18026         for cf_add_2lib in $cf_add_libs; do
18027                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18028                         cf_add_1lib=
18029                         break
18030                 fi
18031         done
18032         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18033 done
18034 LIBS="$cf_add_libs"
18035
18036                 cat >>confdefs.h <<EOF
18037 #define $cf_upper 1
18038 EOF
18039
18040 fi
18041
18042 fi
18043
18044         cf_curses_headers="$cf_curses_headers form.h"
18045 fi
18046
18047 # look for curses-related headers
18048
18049 for ac_header in $cf_curses_headers
18050 do
18051 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18052 echo "$as_me:18052: checking for $ac_header" >&5
18053 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18054 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18055   echo $ECHO_N "(cached) $ECHO_C" >&6
18056 else
18057   cat >"conftest.$ac_ext" <<_ACEOF
18058 #line 18058 "configure"
18059 #include "confdefs.h"
18060 #include <$ac_header>
18061 _ACEOF
18062 if { (eval echo "$as_me:18062: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18063   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18064   ac_status=$?
18065   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18066   rm -f conftest.er1
18067   cat conftest.err >&5
18068   echo "$as_me:18068: \$? = $ac_status" >&5
18069   (exit "$ac_status"); } >/dev/null; then
18070   if test -s conftest.err; then
18071     ac_cpp_err=$ac_c_preproc_warn_flag
18072   else
18073     ac_cpp_err=
18074   fi
18075 else
18076   ac_cpp_err=yes
18077 fi
18078 if test -z "$ac_cpp_err"; then
18079   eval "$as_ac_Header=yes"
18080 else
18081   echo "$as_me: failed program was:" >&5
18082   cat "conftest.$ac_ext" >&5
18083   eval "$as_ac_Header=no"
18084 fi
18085 rm -f conftest.err "conftest.$ac_ext"
18086 fi
18087 echo "$as_me:18087: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18088 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18089 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18090   cat >>confdefs.h <<EOF
18091 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18092 EOF
18093
18094 fi
18095 done
18096
18097 echo "$as_me:18097: checking for ANSI C header files" >&5
18098 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
18099 if test "${ac_cv_header_stdc+set}" = set; then
18100   echo $ECHO_N "(cached) $ECHO_C" >&6
18101 else
18102   cat >"conftest.$ac_ext" <<_ACEOF
18103 #line 18103 "configure"
18104 #include "confdefs.h"
18105 #include <stdlib.h>
18106 #include <stdarg.h>
18107 #include <string.h>
18108 #include <float.h>
18109
18110 _ACEOF
18111 if { (eval echo "$as_me:18111: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18112   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18113   ac_status=$?
18114   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18115   rm -f conftest.er1
18116   cat conftest.err >&5
18117   echo "$as_me:18117: \$? = $ac_status" >&5
18118   (exit "$ac_status"); } >/dev/null; then
18119   if test -s conftest.err; then
18120     ac_cpp_err=$ac_c_preproc_warn_flag
18121   else
18122     ac_cpp_err=
18123   fi
18124 else
18125   ac_cpp_err=yes
18126 fi
18127 if test -z "$ac_cpp_err"; then
18128   ac_cv_header_stdc=yes
18129 else
18130   echo "$as_me: failed program was:" >&5
18131   cat "conftest.$ac_ext" >&5
18132   ac_cv_header_stdc=no
18133 fi
18134 rm -f conftest.err "conftest.$ac_ext"
18135
18136 if test $ac_cv_header_stdc = yes; then
18137   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
18138   cat >"conftest.$ac_ext" <<_ACEOF
18139 #line 18139 "configure"
18140 #include "confdefs.h"
18141 #include <string.h>
18142
18143 _ACEOF
18144 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18145   $EGREP "memchr" >/dev/null 2>&1; then
18146   :
18147 else
18148   ac_cv_header_stdc=no
18149 fi
18150 rm -rf conftest*
18151
18152 fi
18153
18154 if test $ac_cv_header_stdc = yes; then
18155   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
18156   cat >"conftest.$ac_ext" <<_ACEOF
18157 #line 18157 "configure"
18158 #include "confdefs.h"
18159 #include <stdlib.h>
18160
18161 _ACEOF
18162 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18163   $EGREP "free" >/dev/null 2>&1; then
18164   :
18165 else
18166   ac_cv_header_stdc=no
18167 fi
18168 rm -rf conftest*
18169
18170 fi
18171
18172 if test $ac_cv_header_stdc = yes; then
18173   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
18174   if test "$cross_compiling" = yes; then
18175   :
18176 else
18177   cat >"conftest.$ac_ext" <<_ACEOF
18178 #line 18178 "configure"
18179 #include "confdefs.h"
18180 #include <ctype.h>
18181 #if ((' ' & 0x0FF) == 0x020)
18182 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
18183 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
18184 #else
18185 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
18186                      || ('j' <= (c) && (c) <= 'r') \
18187                      || ('s' <= (c) && (c) <= 'z'))
18188 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
18189 #endif
18190
18191 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
18192 int
18193 main (void)
18194 {
18195   int i;
18196   for (i = 0; i < 256; i++)
18197     if (XOR (islower (i), ISLOWER (i))
18198         || toupper (i) != TOUPPER (i))
18199       $ac_main_return(2);
18200   $ac_main_return (0);
18201 }
18202 _ACEOF
18203 rm -f "conftest$ac_exeext"
18204 if { (eval echo "$as_me:18204: \"$ac_link\"") >&5
18205   (eval $ac_link) 2>&5
18206   ac_status=$?
18207   echo "$as_me:18207: \$? = $ac_status" >&5
18208   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
18209   { (eval echo "$as_me:18209: \"$ac_try\"") >&5
18210   (eval $ac_try) 2>&5
18211   ac_status=$?
18212   echo "$as_me:18212: \$? = $ac_status" >&5
18213   (exit "$ac_status"); }; }; then
18214   :
18215 else
18216   echo "$as_me: program exited with status $ac_status" >&5
18217 echo "$as_me: failed program was:" >&5
18218 cat "conftest.$ac_ext" >&5
18219 ac_cv_header_stdc=no
18220 fi
18221 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
18222 fi
18223 fi
18224 fi
18225 echo "$as_me:18225: result: $ac_cv_header_stdc" >&5
18226 echo "${ECHO_T}$ac_cv_header_stdc" >&6
18227 if test $ac_cv_header_stdc = yes; then
18228
18229 cat >>confdefs.h <<\EOF
18230 #define STDC_HEADERS 1
18231 EOF
18232
18233 fi
18234
18235 echo "$as_me:18235: checking whether time.h and sys/time.h may both be included" >&5
18236 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
18237 if test "${ac_cv_header_time+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 <sys/types.h>
18244 #include <sys/time.h>
18245 #include <time.h>
18246
18247 int
18248 main (void)
18249 {
18250 if ((struct tm *) 0)
18251 return 0;
18252   ;
18253   return 0;
18254 }
18255 _ACEOF
18256 rm -f "conftest.$ac_objext"
18257 if { (eval echo "$as_me:18257: \"$ac_compile\"") >&5
18258   (eval $ac_compile) 2>&5
18259   ac_status=$?
18260   echo "$as_me:18260: \$? = $ac_status" >&5
18261   (exit "$ac_status"); } &&
18262          { ac_try='test -s "conftest.$ac_objext"'
18263   { (eval echo "$as_me:18263: \"$ac_try\"") >&5
18264   (eval $ac_try) 2>&5
18265   ac_status=$?
18266   echo "$as_me:18266: \$? = $ac_status" >&5
18267   (exit "$ac_status"); }; }; then
18268   ac_cv_header_time=yes
18269 else
18270   echo "$as_me: failed program was:" >&5
18271 cat "conftest.$ac_ext" >&5
18272 ac_cv_header_time=no
18273 fi
18274 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18275 fi
18276 echo "$as_me:18276: result: $ac_cv_header_time" >&5
18277 echo "${ECHO_T}$ac_cv_header_time" >&6
18278 if test $ac_cv_header_time = yes; then
18279
18280 cat >>confdefs.h <<\EOF
18281 #define TIME_WITH_SYS_TIME 1
18282 EOF
18283
18284 fi
18285
18286 for ac_header in \
18287 getopt.h \
18288 locale.h \
18289 math.h \
18290 stdarg.h \
18291 stdint.h \
18292 sys/ioctl.h \
18293 sys/select.h \
18294 sys/time.h \
18295 termios.h \
18296 unistd.h \
18297
18298 do
18299 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18300 echo "$as_me:18300: checking for $ac_header" >&5
18301 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18302 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18303   echo $ECHO_N "(cached) $ECHO_C" >&6
18304 else
18305   cat >"conftest.$ac_ext" <<_ACEOF
18306 #line 18306 "configure"
18307 #include "confdefs.h"
18308 #include <$ac_header>
18309 _ACEOF
18310 if { (eval echo "$as_me:18310: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18311   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18312   ac_status=$?
18313   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18314   rm -f conftest.er1
18315   cat conftest.err >&5
18316   echo "$as_me:18316: \$? = $ac_status" >&5
18317   (exit "$ac_status"); } >/dev/null; then
18318   if test -s conftest.err; then
18319     ac_cpp_err=$ac_c_preproc_warn_flag
18320   else
18321     ac_cpp_err=
18322   fi
18323 else
18324   ac_cpp_err=yes
18325 fi
18326 if test -z "$ac_cpp_err"; then
18327   eval "$as_ac_Header=yes"
18328 else
18329   echo "$as_me: failed program was:" >&5
18330   cat "conftest.$ac_ext" >&5
18331   eval "$as_ac_Header=no"
18332 fi
18333 rm -f conftest.err "conftest.$ac_ext"
18334 fi
18335 echo "$as_me:18335: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18336 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18337 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18338   cat >>confdefs.h <<EOF
18339 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18340 EOF
18341
18342 fi
18343 done
18344
18345 for ac_header in unistd.h getopt.h
18346 do
18347 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
18348 echo "$as_me:18348: checking for $ac_header" >&5
18349 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
18350 if eval "test \"\${$as_ac_Header+set}\" = set"; then
18351   echo $ECHO_N "(cached) $ECHO_C" >&6
18352 else
18353   cat >"conftest.$ac_ext" <<_ACEOF
18354 #line 18354 "configure"
18355 #include "confdefs.h"
18356 #include <$ac_header>
18357 _ACEOF
18358 if { (eval echo "$as_me:18358: \"$ac_cpp "conftest.$ac_ext"\"") >&5
18359   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
18360   ac_status=$?
18361   $EGREP -v '^ *\+' conftest.er1 >conftest.err
18362   rm -f conftest.er1
18363   cat conftest.err >&5
18364   echo "$as_me:18364: \$? = $ac_status" >&5
18365   (exit "$ac_status"); } >/dev/null; then
18366   if test -s conftest.err; then
18367     ac_cpp_err=$ac_c_preproc_warn_flag
18368   else
18369     ac_cpp_err=
18370   fi
18371 else
18372   ac_cpp_err=yes
18373 fi
18374 if test -z "$ac_cpp_err"; then
18375   eval "$as_ac_Header=yes"
18376 else
18377   echo "$as_me: failed program was:" >&5
18378   cat "conftest.$ac_ext" >&5
18379   eval "$as_ac_Header=no"
18380 fi
18381 rm -f conftest.err "conftest.$ac_ext"
18382 fi
18383 echo "$as_me:18383: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
18384 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
18385 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
18386   cat >>confdefs.h <<EOF
18387 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
18388 EOF
18389
18390 fi
18391 done
18392
18393 echo "$as_me:18393: checking for header declaring getopt variables" >&5
18394 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
18395 if test "${cf_cv_getopt_header+set}" = set; then
18396   echo $ECHO_N "(cached) $ECHO_C" >&6
18397 else
18398
18399 cf_cv_getopt_header=none
18400 for cf_header in stdio.h stdlib.h unistd.h getopt.h
18401 do
18402 cat >"conftest.$ac_ext" <<_ACEOF
18403 #line 18403 "configure"
18404 #include "confdefs.h"
18405
18406 #include <$cf_header>
18407 int
18408 main (void)
18409 {
18410 int x = optind; char *y = optarg; (void)x; (void)y
18411   ;
18412   return 0;
18413 }
18414 _ACEOF
18415 rm -f "conftest.$ac_objext"
18416 if { (eval echo "$as_me:18416: \"$ac_compile\"") >&5
18417   (eval $ac_compile) 2>&5
18418   ac_status=$?
18419   echo "$as_me:18419: \$? = $ac_status" >&5
18420   (exit "$ac_status"); } &&
18421          { ac_try='test -s "conftest.$ac_objext"'
18422   { (eval echo "$as_me:18422: \"$ac_try\"") >&5
18423   (eval $ac_try) 2>&5
18424   ac_status=$?
18425   echo "$as_me:18425: \$? = $ac_status" >&5
18426   (exit "$ac_status"); }; }; then
18427   cf_cv_getopt_header=$cf_header
18428  break
18429 else
18430   echo "$as_me: failed program was:" >&5
18431 cat "conftest.$ac_ext" >&5
18432 fi
18433 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18434 done
18435
18436 fi
18437 echo "$as_me:18437: result: $cf_cv_getopt_header" >&5
18438 echo "${ECHO_T}$cf_cv_getopt_header" >&6
18439 if test "$cf_cv_getopt_header" != none ; then
18440
18441 cat >>confdefs.h <<\EOF
18442 #define HAVE_GETOPT_HEADER 1
18443 EOF
18444
18445 fi
18446 if test "$cf_cv_getopt_header" = getopt.h ; then
18447
18448 cat >>confdefs.h <<\EOF
18449 #define NEED_GETOPT_H 1
18450 EOF
18451
18452 fi
18453
18454 for ac_func in \
18455 cfmakeraw \
18456 getopt \
18457 gettimeofday \
18458 snprintf \
18459 strdup \
18460 strstr \
18461 tsearch \
18462
18463 do
18464 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18465 echo "$as_me:18465: checking for $ac_func" >&5
18466 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18467 if eval "test \"\${$as_ac_var+set}\" = set"; then
18468   echo $ECHO_N "(cached) $ECHO_C" >&6
18469 else
18470   cat >"conftest.$ac_ext" <<_ACEOF
18471 #line 18471 "configure"
18472 #include "confdefs.h"
18473 #define $ac_func autoconf_temporary
18474 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18475 #undef $ac_func
18476
18477 #ifdef __cplusplus
18478 extern "C"
18479 #endif
18480
18481 /* We use char because int might match the return type of a gcc2
18482    builtin and then its argument prototype would still apply.  */
18483 char $ac_func (void);
18484
18485 int
18486 main (void)
18487 {
18488
18489 /* The GNU C library defines stubs for functions which it implements
18490     to always fail with ENOSYS.  Some functions are actually named
18491     something starting with __ and the normal name is an alias.  */
18492 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18493 #error found stub for $ac_func
18494 #endif
18495
18496         return $ac_func ();
18497   ;
18498   return 0;
18499 }
18500 _ACEOF
18501 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18502 if { (eval echo "$as_me:18502: \"$ac_link\"") >&5
18503   (eval $ac_link) 2>&5
18504   ac_status=$?
18505   echo "$as_me:18505: \$? = $ac_status" >&5
18506   (exit "$ac_status"); } &&
18507          { ac_try='test -s "conftest$ac_exeext"'
18508   { (eval echo "$as_me:18508: \"$ac_try\"") >&5
18509   (eval $ac_try) 2>&5
18510   ac_status=$?
18511   echo "$as_me:18511: \$? = $ac_status" >&5
18512   (exit "$ac_status"); }; }; then
18513   eval "$as_ac_var=yes"
18514 else
18515   echo "$as_me: failed program was:" >&5
18516 cat "conftest.$ac_ext" >&5
18517 eval "$as_ac_var=no"
18518 fi
18519 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18520 fi
18521 echo "$as_me:18521: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18522 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18523 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18524   cat >>confdefs.h <<EOF
18525 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18526 EOF
18527
18528 fi
18529 done
18530
18531 # use a compile-check to work with ncurses*-config and subdirectory includes
18532 echo "$as_me:18532: checking if we can use termcap.h" >&5
18533 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
18534 if test "${cf_cv_have_termcap_h+set}" = set; then
18535   echo $ECHO_N "(cached) $ECHO_C" >&6
18536 else
18537
18538         cat >"conftest.$ac_ext" <<_ACEOF
18539 #line 18539 "configure"
18540 #include "confdefs.h"
18541
18542 #include <curses.h>
18543 #ifdef NCURSES_VERSION
18544 #undef NCURSES_VERSION
18545 #endif
18546 #include <termcap.h>
18547 #ifndef NCURSES_VERSION
18548 #error wrong header
18549 #endif
18550
18551 int
18552 main (void)
18553 {
18554 return 0;
18555   ;
18556   return 0;
18557 }
18558 _ACEOF
18559 rm -f "conftest.$ac_objext"
18560 if { (eval echo "$as_me:18560: \"$ac_compile\"") >&5
18561   (eval $ac_compile) 2>&5
18562   ac_status=$?
18563   echo "$as_me:18563: \$? = $ac_status" >&5
18564   (exit "$ac_status"); } &&
18565          { ac_try='test -s "conftest.$ac_objext"'
18566   { (eval echo "$as_me:18566: \"$ac_try\"") >&5
18567   (eval $ac_try) 2>&5
18568   ac_status=$?
18569   echo "$as_me:18569: \$? = $ac_status" >&5
18570   (exit "$ac_status"); }; }; then
18571   cf_cv_have_termcap_h=yes
18572 else
18573   echo "$as_me: failed program was:" >&5
18574 cat "conftest.$ac_ext" >&5
18575 cf_cv_have_termcap_h=no
18576 fi
18577 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18578 fi
18579 echo "$as_me:18579: result: $cf_cv_have_termcap_h" >&5
18580 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18581 if test "x$cf_cv_have_termcap_h" = xyes
18582 then
18583
18584 cat >>confdefs.h <<\EOF
18585 #define HAVE_TERMCAP_H 1
18586 EOF
18587
18588 else
18589 echo "$as_me:18589: checking if we can use ncurses/termcap.h" >&5
18590 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18591 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18592   echo $ECHO_N "(cached) $ECHO_C" >&6
18593 else
18594
18595         cat >"conftest.$ac_ext" <<_ACEOF
18596 #line 18596 "configure"
18597 #include "confdefs.h"
18598
18599 #include <ncurses/curses.h>
18600 #ifdef NCURSES_VERSION
18601 #undef NCURSES_VERSION
18602 #endif
18603 #include <ncurses/termcap.h>
18604 #ifndef NCURSES_VERSION
18605 #error wrong header
18606 #endif
18607
18608 int
18609 main (void)
18610 {
18611 return 0;
18612   ;
18613   return 0;
18614 }
18615 _ACEOF
18616 rm -f "conftest.$ac_objext"
18617 if { (eval echo "$as_me:18617: \"$ac_compile\"") >&5
18618   (eval $ac_compile) 2>&5
18619   ac_status=$?
18620   echo "$as_me:18620: \$? = $ac_status" >&5
18621   (exit "$ac_status"); } &&
18622          { ac_try='test -s "conftest.$ac_objext"'
18623   { (eval echo "$as_me:18623: \"$ac_try\"") >&5
18624   (eval $ac_try) 2>&5
18625   ac_status=$?
18626   echo "$as_me:18626: \$? = $ac_status" >&5
18627   (exit "$ac_status"); }; }; then
18628   cf_cv_have_ncurses_termcap_h=yes
18629 else
18630   echo "$as_me: failed program was:" >&5
18631 cat "conftest.$ac_ext" >&5
18632 cf_cv_have_ncurses_termcap_h=no
18633 fi
18634 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18635 fi
18636 echo "$as_me:18636: result: $cf_cv_have_ncurses_termcap_h" >&5
18637 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18638 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18639 cat >>confdefs.h <<\EOF
18640 #define HAVE_NCURSES_TERMCAP_H 1
18641 EOF
18642
18643 fi
18644
18645 if test "x$ac_cv_func_getopt" = xno; then
18646         { { echo "$as_me:18646: error: getopt is required for building programs" >&5
18647 echo "$as_me: error: getopt is required for building programs" >&2;}
18648    { (exit 1); exit 1; }; }
18649 fi
18650
18651 if test "$cf_enable_widec" = yes; then
18652
18653 for ac_func in \
18654 mblen \
18655 mbrlen \
18656 mbrtowc \
18657 mbsrtowcs \
18658 mbstowcs \
18659 mbtowc \
18660 wcsrtombs \
18661 wcstombs \
18662
18663 do
18664 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18665 echo "$as_me:18665: checking for $ac_func" >&5
18666 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18667 if eval "test \"\${$as_ac_var+set}\" = set"; then
18668   echo $ECHO_N "(cached) $ECHO_C" >&6
18669 else
18670   cat >"conftest.$ac_ext" <<_ACEOF
18671 #line 18671 "configure"
18672 #include "confdefs.h"
18673 #define $ac_func autoconf_temporary
18674 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18675 #undef $ac_func
18676
18677 #ifdef __cplusplus
18678 extern "C"
18679 #endif
18680
18681 /* We use char because int might match the return type of a gcc2
18682    builtin and then its argument prototype would still apply.  */
18683 char $ac_func (void);
18684
18685 int
18686 main (void)
18687 {
18688
18689 /* The GNU C library defines stubs for functions which it implements
18690     to always fail with ENOSYS.  Some functions are actually named
18691     something starting with __ and the normal name is an alias.  */
18692 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18693 #error found stub for $ac_func
18694 #endif
18695
18696         return $ac_func ();
18697   ;
18698   return 0;
18699 }
18700 _ACEOF
18701 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18702 if { (eval echo "$as_me:18702: \"$ac_link\"") >&5
18703   (eval $ac_link) 2>&5
18704   ac_status=$?
18705   echo "$as_me:18705: \$? = $ac_status" >&5
18706   (exit "$ac_status"); } &&
18707          { ac_try='test -s "conftest$ac_exeext"'
18708   { (eval echo "$as_me:18708: \"$ac_try\"") >&5
18709   (eval $ac_try) 2>&5
18710   ac_status=$?
18711   echo "$as_me:18711: \$? = $ac_status" >&5
18712   (exit "$ac_status"); }; }; then
18713   eval "$as_ac_var=yes"
18714 else
18715   echo "$as_me: failed program was:" >&5
18716 cat "conftest.$ac_ext" >&5
18717 eval "$as_ac_var=no"
18718 fi
18719 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18720 fi
18721 echo "$as_me:18721: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18722 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18723 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18724   cat >>confdefs.h <<EOF
18725 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18726 EOF
18727
18728 fi
18729 done
18730
18731 fi
18732
18733 echo "$as_me:18733: checking definition to turn on extended curses functions" >&5
18734 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18735 if test "${cf_cv_need_xopen_extension+set}" = set; then
18736   echo $ECHO_N "(cached) $ECHO_C" >&6
18737 else
18738
18739 cf_cv_need_xopen_extension=unknown
18740 cat >"conftest.$ac_ext" <<_ACEOF
18741 #line 18741 "configure"
18742 #include "confdefs.h"
18743
18744 $ac_includes_default
18745 #include <${cf_cv_ncurses_header:-curses.h}>
18746 int
18747 main (void)
18748 {
18749
18750 #if defined(NCURSES_VERSION_PATCH)
18751 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18752         make an error
18753 #endif
18754 #endif
18755 #ifdef NCURSES_WIDECHAR
18756 make an error   /* prefer to fall-through on the second checks */
18757 #endif
18758         cchar_t check;
18759         int check2 = curs_set((int)sizeof(check));
18760         long x = winnstr(stdscr, "", 0);
18761         int x1, y1;
18762         (void)check2;
18763         getbegyx(stdscr, y1, x1);
18764         (void)x;
18765         (void)y1;
18766         (void)x1;
18767
18768   ;
18769   return 0;
18770 }
18771 _ACEOF
18772 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18773 if { (eval echo "$as_me:18773: \"$ac_link\"") >&5
18774   (eval $ac_link) 2>&5
18775   ac_status=$?
18776   echo "$as_me:18776: \$? = $ac_status" >&5
18777   (exit "$ac_status"); } &&
18778          { ac_try='test -s "conftest$ac_exeext"'
18779   { (eval echo "$as_me:18779: \"$ac_try\"") >&5
18780   (eval $ac_try) 2>&5
18781   ac_status=$?
18782   echo "$as_me:18782: \$? = $ac_status" >&5
18783   (exit "$ac_status"); }; }; then
18784   cf_cv_need_xopen_extension=none
18785 else
18786   echo "$as_me: failed program was:" >&5
18787 cat "conftest.$ac_ext" >&5
18788
18789         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18790         do
18791                 cat >"conftest.$ac_ext" <<_ACEOF
18792 #line 18792 "configure"
18793 #include "confdefs.h"
18794
18795 #define $cf_try_xopen_extension 1
18796 $ac_includes_default
18797 #include <${cf_cv_ncurses_header:-curses.h}>
18798 int
18799 main (void)
18800 {
18801
18802                 cchar_t check;
18803                 int check2 = curs_set((int)sizeof(check));
18804                 long x = winnstr(stdscr, "", 0);
18805                 int x1, y1;
18806                 getbegyx(stdscr, y1, x1);
18807                 (void)check2;
18808                 (void)x;
18809                 (void)y1;
18810                 (void)x1;
18811
18812   ;
18813   return 0;
18814 }
18815 _ACEOF
18816 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18817 if { (eval echo "$as_me:18817: \"$ac_link\"") >&5
18818   (eval $ac_link) 2>&5
18819   ac_status=$?
18820   echo "$as_me:18820: \$? = $ac_status" >&5
18821   (exit "$ac_status"); } &&
18822          { ac_try='test -s "conftest$ac_exeext"'
18823   { (eval echo "$as_me:18823: \"$ac_try\"") >&5
18824   (eval $ac_try) 2>&5
18825   ac_status=$?
18826   echo "$as_me:18826: \$? = $ac_status" >&5
18827   (exit "$ac_status"); }; }; then
18828   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18829 else
18830   echo "$as_me: failed program was:" >&5
18831 cat "conftest.$ac_ext" >&5
18832 fi
18833 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18834         done
18835
18836 fi
18837 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18838
18839 fi
18840 echo "$as_me:18840: result: $cf_cv_need_xopen_extension" >&5
18841 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18842
18843 case "$cf_cv_need_xopen_extension" in
18844 (*_*)
18845
18846         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18847         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18848
18849         ;;
18850 esac
18851
18852 echo "$as_me:18852: checking for term.h" >&5
18853 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18854 if test "${cf_cv_term_header+set}" = set; then
18855   echo $ECHO_N "(cached) $ECHO_C" >&6
18856 else
18857
18858 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18859 # for <term.h> if we do not find the variant.
18860
18861 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18862
18863 case "${cf_cv_ncurses_header:-curses.h}" in
18864 (*/*)
18865         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18866         cf_header_list="$cf_header_item $cf_header_list"
18867         ;;
18868 esac
18869
18870 for cf_header in $cf_header_list
18871 do
18872         cat >"conftest.$ac_ext" <<_ACEOF
18873 #line 18873 "configure"
18874 #include "confdefs.h"
18875
18876 #include <${cf_cv_ncurses_header:-curses.h}>
18877 #include <${cf_header}>
18878 int
18879 main (void)
18880 {
18881 WINDOW *x; (void)x
18882   ;
18883   return 0;
18884 }
18885 _ACEOF
18886 rm -f "conftest.$ac_objext"
18887 if { (eval echo "$as_me:18887: \"$ac_compile\"") >&5
18888   (eval $ac_compile) 2>&5
18889   ac_status=$?
18890   echo "$as_me:18890: \$? = $ac_status" >&5
18891   (exit "$ac_status"); } &&
18892          { ac_try='test -s "conftest.$ac_objext"'
18893   { (eval echo "$as_me:18893: \"$ac_try\"") >&5
18894   (eval $ac_try) 2>&5
18895   ac_status=$?
18896   echo "$as_me:18896: \$? = $ac_status" >&5
18897   (exit "$ac_status"); }; }; then
18898   cf_cv_term_header=$cf_header
18899          break
18900 else
18901   echo "$as_me: failed program was:" >&5
18902 cat "conftest.$ac_ext" >&5
18903 cf_cv_term_header=no
18904 fi
18905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18906 done
18907
18908 case "$cf_cv_term_header" in
18909 (no)
18910         # If curses is ncurses, some packagers still mess it up by trying to make
18911         # us use GNU termcap.  This handles the most common case.
18912         for cf_header in ncurses/term.h ncursesw/term.h
18913         do
18914                 cat >"conftest.$ac_ext" <<_ACEOF
18915 #line 18915 "configure"
18916 #include "confdefs.h"
18917
18918 #include <${cf_cv_ncurses_header:-curses.h}>
18919 #ifdef NCURSES_VERSION
18920 #include <${cf_header}>
18921 #else
18922 make an error
18923 #endif
18924 int
18925 main (void)
18926 {
18927 WINDOW *x; (void)x
18928   ;
18929   return 0;
18930 }
18931 _ACEOF
18932 rm -f "conftest.$ac_objext"
18933 if { (eval echo "$as_me:18933: \"$ac_compile\"") >&5
18934   (eval $ac_compile) 2>&5
18935   ac_status=$?
18936   echo "$as_me:18936: \$? = $ac_status" >&5
18937   (exit "$ac_status"); } &&
18938          { ac_try='test -s "conftest.$ac_objext"'
18939   { (eval echo "$as_me:18939: \"$ac_try\"") >&5
18940   (eval $ac_try) 2>&5
18941   ac_status=$?
18942   echo "$as_me:18942: \$? = $ac_status" >&5
18943   (exit "$ac_status"); }; }; then
18944   cf_cv_term_header=$cf_header
18945                          break
18946 else
18947   echo "$as_me: failed program was:" >&5
18948 cat "conftest.$ac_ext" >&5
18949 cf_cv_term_header=no
18950 fi
18951 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18952         done
18953         ;;
18954 esac
18955
18956 fi
18957 echo "$as_me:18957: result: $cf_cv_term_header" >&5
18958 echo "${ECHO_T}$cf_cv_term_header" >&6
18959
18960 case "$cf_cv_term_header" in
18961 (term.h)
18962
18963 cat >>confdefs.h <<\EOF
18964 #define HAVE_TERM_H 1
18965 EOF
18966
18967         ;;
18968 (ncurses/term.h)
18969
18970 cat >>confdefs.h <<\EOF
18971 #define HAVE_NCURSES_TERM_H 1
18972 EOF
18973
18974         ;;
18975 (ncursesw/term.h)
18976
18977 cat >>confdefs.h <<\EOF
18978 #define HAVE_NCURSESW_TERM_H 1
18979 EOF
18980
18981         ;;
18982 esac
18983
18984 echo "$as_me:18984: checking for unctrl.h" >&5
18985 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18986 if test "${cf_cv_unctrl_header+set}" = set; then
18987   echo $ECHO_N "(cached) $ECHO_C" >&6
18988 else
18989
18990 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18991 # for <unctrl.h> if we do not find the variant.
18992
18993 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18994
18995 case "${cf_cv_ncurses_header:-curses.h}" in
18996 (*/*)
18997         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18998         cf_header_list="$cf_header_item $cf_header_list"
18999         ;;
19000 esac
19001
19002 for cf_header in $cf_header_list
19003 do
19004         cat >"conftest.$ac_ext" <<_ACEOF
19005 #line 19005 "configure"
19006 #include "confdefs.h"
19007
19008 #include <${cf_cv_ncurses_header:-curses.h}>
19009 #include <${cf_header}>
19010 int
19011 main (void)
19012 {
19013 WINDOW *x; (void)x
19014   ;
19015   return 0;
19016 }
19017 _ACEOF
19018 rm -f "conftest.$ac_objext"
19019 if { (eval echo "$as_me:19019: \"$ac_compile\"") >&5
19020   (eval $ac_compile) 2>&5
19021   ac_status=$?
19022   echo "$as_me:19022: \$? = $ac_status" >&5
19023   (exit "$ac_status"); } &&
19024          { ac_try='test -s "conftest.$ac_objext"'
19025   { (eval echo "$as_me:19025: \"$ac_try\"") >&5
19026   (eval $ac_try) 2>&5
19027   ac_status=$?
19028   echo "$as_me:19028: \$? = $ac_status" >&5
19029   (exit "$ac_status"); }; }; then
19030   cf_cv_unctrl_header=$cf_header
19031          break
19032 else
19033   echo "$as_me: failed program was:" >&5
19034 cat "conftest.$ac_ext" >&5
19035 cf_cv_unctrl_header=no
19036 fi
19037 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19038 done
19039
19040 fi
19041 echo "$as_me:19041: result: $cf_cv_unctrl_header" >&5
19042 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
19043
19044 case "$cf_cv_unctrl_header" in
19045 (no)
19046         { echo "$as_me:19046: WARNING: unctrl.h header not found" >&5
19047 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
19048         ;;
19049 esac
19050
19051 case "$cf_cv_unctrl_header" in
19052 (unctrl.h)
19053
19054 cat >>confdefs.h <<\EOF
19055 #define HAVE_UNCTRL_H 1
19056 EOF
19057
19058         ;;
19059 (ncurses/unctrl.h)
19060
19061 cat >>confdefs.h <<\EOF
19062 #define HAVE_NCURSES_UNCTRL_H 1
19063 EOF
19064
19065         ;;
19066 (ncursesw/unctrl.h)
19067
19068 cat >>confdefs.h <<\EOF
19069 #define HAVE_NCURSESW_UNCTRL_H 1
19070 EOF
19071
19072         ;;
19073 esac
19074
19075 for cf_func in \
19076 alloc_pair \
19077 assume_default_colors \
19078 chgat \
19079 color_content \
19080 color_set \
19081 copywin \
19082 curses_trace \
19083 delscreen \
19084 dupwin \
19085 exit_curses \
19086 exit_terminfo \
19087 filter \
19088 getbegx \
19089 getcurx \
19090 getmaxx \
19091 getnstr \
19092 getparx \
19093 getwin \
19094 halfdelay \
19095 init_extended_color \
19096 mvderwin \
19097 mvvline \
19098 mvwin \
19099 mvwvline \
19100 napms \
19101 newpad \
19102 putwin \
19103 reset_color_pairs \
19104 resize_term \
19105 resizeterm \
19106 restartterm \
19107 ripoffline \
19108 scr_dump \
19109 setupterm \
19110 slk_color \
19111 slk_init \
19112 termattrs \
19113 termname \
19114 tgetent \
19115 tigetnum \
19116 tigetstr \
19117 tputs_sp \
19118 typeahead \
19119 unget_wch \
19120 use_default_colors \
19121 use_env \
19122 use_extended_names \
19123 use_screen \
19124 use_window \
19125 vid_puts \
19126 vidputs \
19127 vsscanf \
19128 vw_printw \
19129 wchgat \
19130 winsdelln \
19131 winsstr \
19132 wresize \
19133 wsyncdown \
19134 _tracef \
19135
19136 do
19137
19138 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19139
19140         echo "$as_me:19140: checking for ${cf_func}" >&5
19141 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19142
19143 echo "${as_me:-configure}:19143: testing ${cf_func} ..." 1>&5
19144
19145         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19146   echo $ECHO_N "(cached) $ECHO_C" >&6
19147 else
19148
19149                 eval cf_result='$ac_cv_func_'$cf_func
19150                 if test ".$cf_result" != ".no"; then
19151                         cat >"conftest.$ac_ext" <<_ACEOF
19152 #line 19152 "configure"
19153 #include "confdefs.h"
19154
19155 #ifdef HAVE_XCURSES
19156 #include <xcurses.h>
19157 char * XCursesProgramName = "test";
19158 #else
19159 #include <${cf_cv_ncurses_header:-curses.h}>
19160 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19161 #include <ncursesw/term.h>
19162 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19163 #include <ncurses/term.h>
19164 #elif defined(HAVE_TERM_H)
19165 #include <term.h>
19166 #endif
19167 #endif
19168
19169 int
19170 main (void)
19171 {
19172
19173 #ifndef ${cf_func}
19174 long foo = (long)(&${cf_func});
19175 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19176 if (foo + 1234L > 5678L)
19177         ${cf_cv_main_return:-return}(foo != 0);
19178 #endif
19179
19180   ;
19181   return 0;
19182 }
19183 _ACEOF
19184 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19185 if { (eval echo "$as_me:19185: \"$ac_link\"") >&5
19186   (eval $ac_link) 2>&5
19187   ac_status=$?
19188   echo "$as_me:19188: \$? = $ac_status" >&5
19189   (exit "$ac_status"); } &&
19190          { ac_try='test -s "conftest$ac_exeext"'
19191   { (eval echo "$as_me:19191: \"$ac_try\"") >&5
19192   (eval $ac_try) 2>&5
19193   ac_status=$?
19194   echo "$as_me:19194: \$? = $ac_status" >&5
19195   (exit "$ac_status"); }; }; then
19196   cf_result=yes
19197 else
19198   echo "$as_me: failed program was:" >&5
19199 cat "conftest.$ac_ext" >&5
19200 cf_result=no
19201 fi
19202 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19203                 fi
19204                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19205
19206 fi
19207
19208         # use the computed/retrieved cache-value:
19209         eval 'cf_result=$cf_cv_func_'$cf_func
19210         echo "$as_me:19210: result: $cf_result" >&5
19211 echo "${ECHO_T}$cf_result" >&6
19212         if test "$cf_result" != no; then
19213                 cat >>confdefs.h <<EOF
19214 #define HAVE_${cf_tr_func} 1
19215 EOF
19216
19217         fi
19218 done
19219
19220 for cf_func in tputs
19221 do
19222
19223 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19224
19225         echo "$as_me:19225: checking for ${cf_func}" >&5
19226 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
19227
19228 echo "${as_me:-configure}:19228: testing ${cf_func} ..." 1>&5
19229
19230         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
19231   echo $ECHO_N "(cached) $ECHO_C" >&6
19232 else
19233
19234                 eval cf_result='$ac_cv_func_'$cf_func
19235                 if test ".$cf_result" != ".no"; then
19236                         cat >"conftest.$ac_ext" <<_ACEOF
19237 #line 19237 "configure"
19238 #include "confdefs.h"
19239
19240 #ifdef HAVE_XCURSES
19241 #include <xcurses.h>
19242 char * XCursesProgramName = "test";
19243 #else
19244 #include <${cf_cv_ncurses_header:-curses.h}>
19245 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19246 #include <ncursesw/term.h>
19247 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19248 #include <ncurses/term.h>
19249 #elif defined(HAVE_TERM_H)
19250 #include <term.h>
19251 #endif
19252 #endif
19253
19254 int
19255 main (void)
19256 {
19257
19258 #ifndef ${cf_func}
19259 long foo = (long)(&${cf_func});
19260 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
19261 if (foo + 1234L > 5678L)
19262         ${cf_cv_main_return:-return}(foo != 0);
19263 #endif
19264
19265   ;
19266   return 0;
19267 }
19268 _ACEOF
19269 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19270 if { (eval echo "$as_me:19270: \"$ac_link\"") >&5
19271   (eval $ac_link) 2>&5
19272   ac_status=$?
19273   echo "$as_me:19273: \$? = $ac_status" >&5
19274   (exit "$ac_status"); } &&
19275          { ac_try='test -s "conftest$ac_exeext"'
19276   { (eval echo "$as_me:19276: \"$ac_try\"") >&5
19277   (eval $ac_try) 2>&5
19278   ac_status=$?
19279   echo "$as_me:19279: \$? = $ac_status" >&5
19280   (exit "$ac_status"); }; }; then
19281   cf_result=yes
19282 else
19283   echo "$as_me: failed program was:" >&5
19284 cat "conftest.$ac_ext" >&5
19285 cf_result=no
19286 fi
19287 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19288                 fi
19289                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
19290
19291 fi
19292
19293         # use the computed/retrieved cache-value:
19294         eval 'cf_result=$cf_cv_func_'$cf_func
19295         echo "$as_me:19295: result: $cf_result" >&5
19296 echo "${ECHO_T}$cf_result" >&6
19297         if test "$cf_result" != no; then
19298                 cat >>confdefs.h <<EOF
19299 #define HAVE_${cf_tr_func} 1
19300 EOF
19301
19302         fi
19303 done
19304
19305 if test "x$cf_cv_func_tputs" = xyes
19306 then
19307         cf_done=no
19308         for cf_arg in int char
19309         do
19310                 for cf_ret in int void
19311                 do
19312                         if test "$cf_ret" = void
19313                         then
19314                                 cf_return="/* nothing */"
19315                         else
19316                                 cf_return="return value"
19317                         fi
19318                         cat >"conftest.$ac_ext" <<_ACEOF
19319 #line 19319 "configure"
19320 #include "confdefs.h"
19321
19322 #include <${cf_cv_ncurses_header:-curses.h}>
19323 #include <$cf_cv_term_header>
19324
19325 static $cf_ret outc($cf_arg value) { $cf_return; }
19326
19327 int
19328 main (void)
19329 {
19330
19331         tputs("hello", 0, outc);
19332         ${cf_cv_main_return:-return}(0);
19333
19334   ;
19335   return 0;
19336 }
19337 _ACEOF
19338 rm -f "conftest.$ac_objext"
19339 if { (eval echo "$as_me:19339: \"$ac_compile\"") >&5
19340   (eval $ac_compile) 2>&5
19341   ac_status=$?
19342   echo "$as_me:19342: \$? = $ac_status" >&5
19343   (exit "$ac_status"); } &&
19344          { ac_try='test -s "conftest.$ac_objext"'
19345   { (eval echo "$as_me:19345: \"$ac_try\"") >&5
19346   (eval $ac_try) 2>&5
19347   ac_status=$?
19348   echo "$as_me:19348: \$? = $ac_status" >&5
19349   (exit "$ac_status"); }; }; then
19350
19351                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
19352
19353 echo "${as_me:-configure}:19353: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
19354
19355                 cat >>confdefs.h <<EOF
19356 #define TPUTS_ARG               $cf_arg
19357 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
19358 #define TPUTS_RETURN(value)     $cf_return
19359 EOF
19360                 cf_done=yes
19361                 break
19362
19363 else
19364   echo "$as_me: failed program was:" >&5
19365 cat "conftest.$ac_ext" >&5
19366 fi
19367 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19368                 done
19369                 test "$cf_done" = yes && break
19370         done
19371 fi
19372
19373 echo "$as_me:19373: checking for ncurses extended functions" >&5
19374 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
19375 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
19376   echo $ECHO_N "(cached) $ECHO_C" >&6
19377 else
19378
19379 cat >"conftest.$ac_ext" <<_ACEOF
19380 #line 19380 "configure"
19381 #include "confdefs.h"
19382
19383 #include <${cf_cv_ncurses_header:-curses.h}>
19384 int
19385 main (void)
19386 {
19387
19388 int x = NCURSES_EXT_FUNCS
19389
19390   ;
19391   return 0;
19392 }
19393 _ACEOF
19394 rm -f "conftest.$ac_objext"
19395 if { (eval echo "$as_me:19395: \"$ac_compile\"") >&5
19396   (eval $ac_compile) 2>&5
19397   ac_status=$?
19398   echo "$as_me:19398: \$? = $ac_status" >&5
19399   (exit "$ac_status"); } &&
19400          { ac_try='test -s "conftest.$ac_objext"'
19401   { (eval echo "$as_me:19401: \"$ac_try\"") >&5
19402   (eval $ac_try) 2>&5
19403   ac_status=$?
19404   echo "$as_me:19404: \$? = $ac_status" >&5
19405   (exit "$ac_status"); }; }; then
19406   cf_cv_ncurses_ext_funcs=defined
19407 else
19408   echo "$as_me: failed program was:" >&5
19409 cat "conftest.$ac_ext" >&5
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
19420         (void) assume_default_colors (0, 0);
19421         (void) curses_version ();
19422         (void) define_key (0, 0);
19423         (void) is_term_resized (0, 0);
19424         (void) key_defined (0);
19425         (void) keybound (0, 0);
19426         (void) keyok (0, 0);
19427         (void) resize_term (0, 0);
19428         (void) resizeterm (0, 0);
19429         (void) use_default_colors ();
19430         (void) use_extended_names (0);
19431         (void) wresize (0, 0, 0);
19432   ;
19433   return 0;
19434 }
19435 _ACEOF
19436 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19437 if { (eval echo "$as_me:19437: \"$ac_link\"") >&5
19438   (eval $ac_link) 2>&5
19439   ac_status=$?
19440   echo "$as_me:19440: \$? = $ac_status" >&5
19441   (exit "$ac_status"); } &&
19442          { ac_try='test -s "conftest$ac_exeext"'
19443   { (eval echo "$as_me:19443: \"$ac_try\"") >&5
19444   (eval $ac_try) 2>&5
19445   ac_status=$?
19446   echo "$as_me:19446: \$? = $ac_status" >&5
19447   (exit "$ac_status"); }; }; then
19448   cf_cv_ncurses_ext_funcs=yes
19449 else
19450   echo "$as_me: failed program was:" >&5
19451 cat "conftest.$ac_ext" >&5
19452 cf_cv_ncurses_ext_funcs=no
19453 fi
19454 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19455
19456 fi
19457 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19458
19459 fi
19460 echo "$as_me:19460: result: $cf_cv_ncurses_ext_funcs" >&5
19461 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
19462 test "$cf_cv_ncurses_ext_funcs" = yes &&
19463 cat >>confdefs.h <<\EOF
19464 #define NCURSES_EXT_FUNCS 1
19465 EOF
19466
19467 if test "$cf_enable_widec" = yes
19468 then
19469         # workaround for systems with ncurses before 20111029, due to change of
19470         # feature test macro from _XPG5 to _XOPEN_SOURCE
19471         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
19472         then
19473                 cf_define_xpg5=no
19474                 echo "$as_me:19474: checking if _XPG5 should be defined to enable wide-characters" >&5
19475 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
19476
19477                 cat >"conftest.$ac_ext" <<_ACEOF
19478 #line 19478 "configure"
19479 #include "confdefs.h"
19480
19481 #include <${cf_cv_ncurses_header:-curses.h}>
19482 int
19483 main (void)
19484 {
19485 int x = _XPG5
19486   ;
19487   return 0;
19488 }
19489 _ACEOF
19490 rm -f "conftest.$ac_objext"
19491 if { (eval echo "$as_me:19491: \"$ac_compile\"") >&5
19492   (eval $ac_compile) 2>&5
19493   ac_status=$?
19494   echo "$as_me:19494: \$? = $ac_status" >&5
19495   (exit "$ac_status"); } &&
19496          { ac_try='test -s "conftest.$ac_objext"'
19497   { (eval echo "$as_me:19497: \"$ac_try\"") >&5
19498   (eval $ac_try) 2>&5
19499   ac_status=$?
19500   echo "$as_me:19500: \$? = $ac_status" >&5
19501   (exit "$ac_status"); }; }; then
19502   :
19503 else
19504   echo "$as_me: failed program was:" >&5
19505 cat "conftest.$ac_ext" >&5
19506 cf_save_cppflags="$CPPFLAGS"
19507                          CPPFLAGS="$CPPFLAGS -D_XPG5"
19508                          cat >"conftest.$ac_ext" <<_ACEOF
19509 #line 19509 "configure"
19510 #include "confdefs.h"
19511
19512 #include <${cf_cv_ncurses_header:-curses.h}>
19513 int
19514 main (void)
19515 {
19516 int x = _XPG5
19517   ;
19518   return 0;
19519 }
19520 _ACEOF
19521 rm -f "conftest.$ac_objext"
19522 if { (eval echo "$as_me:19522: \"$ac_compile\"") >&5
19523   (eval $ac_compile) 2>&5
19524   ac_status=$?
19525   echo "$as_me:19525: \$? = $ac_status" >&5
19526   (exit "$ac_status"); } &&
19527          { ac_try='test -s "conftest.$ac_objext"'
19528   { (eval echo "$as_me:19528: \"$ac_try\"") >&5
19529   (eval $ac_try) 2>&5
19530   ac_status=$?
19531   echo "$as_me:19531: \$? = $ac_status" >&5
19532   (exit "$ac_status"); }; }; then
19533   cf_define_xpg5=yes
19534 else
19535   echo "$as_me: failed program was:" >&5
19536 cat "conftest.$ac_ext" >&5
19537 fi
19538 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19539                          CPPFLAGS="$cf_save_cppflags"
19540 fi
19541 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19542                 echo "$as_me:19542: result: $cf_define_xpg5" >&5
19543 echo "${ECHO_T}$cf_define_xpg5" >&6
19544
19545                 if test "$cf_define_xpg5" = yes
19546                 then
19547                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19548                 fi
19549         fi
19550
19551         echo "$as_me:19551: checking for wide-character functions" >&5
19552 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19553 if test "${cf_cv_widechar_funcs+set}" = set; then
19554   echo $ECHO_N "(cached) $ECHO_C" >&6
19555 else
19556
19557         cat >"conftest.$ac_ext" <<_ACEOF
19558 #line 19558 "configure"
19559 #include "confdefs.h"
19560
19561 #include <${cf_cv_ncurses_header:-curses.h}>
19562 int
19563 main (void)
19564 {
19565
19566                 static wchar_t src_wchar[2];
19567                 static cchar_t dst_cchar;
19568                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
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_widechar_funcs=yes
19587 else
19588   echo "$as_me: failed program was:" >&5
19589 cat "conftest.$ac_ext" >&5
19590 cf_cv_widechar_funcs=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_widechar_funcs" >&5
19596 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19597         if test "$cf_cv_widechar_funcs" != no ; then
19598
19599 cat >>confdefs.h <<\EOF
19600 #define USE_WIDEC_SUPPORT 1
19601 EOF
19602
19603         else
19604                 cat >>confdefs.h <<\EOF
19605 #define USE_WIDEC_SUPPORT 0
19606 EOF
19607
19608         fi
19609 else
19610         cat >>confdefs.h <<\EOF
19611 #define USE_WIDEC_SUPPORT 0
19612 EOF
19613
19614 fi
19615
19616 echo "$as_me:19616: checking if $cf_cv_screen library uses pthreads" >&5
19617 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19618 if test "${cf_cv_use_pthreads+set}" = set; then
19619   echo $ECHO_N "(cached) $ECHO_C" >&6
19620 else
19621
19622 cat >"conftest.$ac_ext" <<_ACEOF
19623 #line 19623 "configure"
19624 #include "confdefs.h"
19625
19626 #include <${cf_cv_ncurses_header:-curses.h}>
19627 extern void _nc_init_pthreads(void);
19628
19629 int
19630 main (void)
19631 {
19632
19633         initscr();
19634         _nc_init_pthreads();
19635
19636   ;
19637   return 0;
19638 }
19639 _ACEOF
19640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19641 if { (eval echo "$as_me:19641: \"$ac_link\"") >&5
19642   (eval $ac_link) 2>&5
19643   ac_status=$?
19644   echo "$as_me:19644: \$? = $ac_status" >&5
19645   (exit "$ac_status"); } &&
19646          { ac_try='test -s "conftest$ac_exeext"'
19647   { (eval echo "$as_me:19647: \"$ac_try\"") >&5
19648   (eval $ac_try) 2>&5
19649   ac_status=$?
19650   echo "$as_me:19650: \$? = $ac_status" >&5
19651   (exit "$ac_status"); }; }; then
19652   cf_cv_use_pthreads=yes
19653 else
19654   echo "$as_me: failed program was:" >&5
19655 cat "conftest.$ac_ext" >&5
19656 cf_cv_use_pthreads=no
19657 fi
19658 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19659
19660 fi
19661 echo "$as_me:19661: result: $cf_cv_use_pthreads" >&5
19662 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19663 test $cf_cv_use_pthreads = yes &&
19664 cat >>confdefs.h <<\EOF
19665 #define USE_PTHREADS 1
19666 EOF
19667
19668 echo "$as_me:19668: checking if sys/time.h works with sys/select.h" >&5
19669 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19670 if test "${cf_cv_sys_time_select+set}" = set; then
19671   echo $ECHO_N "(cached) $ECHO_C" >&6
19672 else
19673
19674 cat >"conftest.$ac_ext" <<_ACEOF
19675 #line 19675 "configure"
19676 #include "confdefs.h"
19677
19678 #include <sys/types.h>
19679 #ifdef HAVE_SYS_TIME_H
19680 #include <sys/time.h>
19681 #endif
19682 #ifdef HAVE_SYS_SELECT_H
19683 #include <sys/select.h>
19684 #endif
19685
19686 int
19687 main (void)
19688 {
19689
19690   ;
19691   return 0;
19692 }
19693 _ACEOF
19694 rm -f "conftest.$ac_objext"
19695 if { (eval echo "$as_me:19695: \"$ac_compile\"") >&5
19696   (eval $ac_compile) 2>&5
19697   ac_status=$?
19698   echo "$as_me:19698: \$? = $ac_status" >&5
19699   (exit "$ac_status"); } &&
19700          { ac_try='test -s "conftest.$ac_objext"'
19701   { (eval echo "$as_me:19701: \"$ac_try\"") >&5
19702   (eval $ac_try) 2>&5
19703   ac_status=$?
19704   echo "$as_me:19704: \$? = $ac_status" >&5
19705   (exit "$ac_status"); }; }; then
19706   cf_cv_sys_time_select=yes
19707 else
19708   echo "$as_me: failed program was:" >&5
19709 cat "conftest.$ac_ext" >&5
19710 cf_cv_sys_time_select=no
19711 fi
19712 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19713
19714 fi
19715
19716 echo "$as_me:19716: result: $cf_cv_sys_time_select" >&5
19717 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19718 test "$cf_cv_sys_time_select" = yes &&
19719 cat >>confdefs.h <<\EOF
19720 #define HAVE_SYS_TIME_SELECT 1
19721 EOF
19722
19723 # special check for test/ditto.c
19724
19725 echo "$as_me:19725: checking for openpty in -lutil" >&5
19726 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19727 if test "${ac_cv_lib_util_openpty+set}" = set; then
19728   echo $ECHO_N "(cached) $ECHO_C" >&6
19729 else
19730   ac_check_lib_save_LIBS=$LIBS
19731 LIBS="-lutil  $LIBS"
19732 cat >"conftest.$ac_ext" <<_ACEOF
19733 #line 19733 "configure"
19734 #include "confdefs.h"
19735
19736 /* Override any gcc2 internal prototype to avoid an error.  */
19737 #ifdef __cplusplus
19738 extern "C"
19739 #endif
19740 /* We use char because int might match the return type of a gcc2
19741    builtin and then its argument prototype would still apply.  */
19742 char openpty ();
19743 int
19744 main (void)
19745 {
19746 openpty ();
19747   ;
19748   return 0;
19749 }
19750 _ACEOF
19751 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19752 if { (eval echo "$as_me:19752: \"$ac_link\"") >&5
19753   (eval $ac_link) 2>&5
19754   ac_status=$?
19755   echo "$as_me:19755: \$? = $ac_status" >&5
19756   (exit "$ac_status"); } &&
19757          { ac_try='test -s "conftest$ac_exeext"'
19758   { (eval echo "$as_me:19758: \"$ac_try\"") >&5
19759   (eval $ac_try) 2>&5
19760   ac_status=$?
19761   echo "$as_me:19761: \$? = $ac_status" >&5
19762   (exit "$ac_status"); }; }; then
19763   ac_cv_lib_util_openpty=yes
19764 else
19765   echo "$as_me: failed program was:" >&5
19766 cat "conftest.$ac_ext" >&5
19767 ac_cv_lib_util_openpty=no
19768 fi
19769 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19770 LIBS=$ac_check_lib_save_LIBS
19771 fi
19772 echo "$as_me:19772: result: $ac_cv_lib_util_openpty" >&5
19773 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19774 if test "$ac_cv_lib_util_openpty" = yes; then
19775   cf_cv_lib_util=yes
19776 else
19777   cf_cv_lib_util=no
19778 fi
19779
19780 echo "$as_me:19780: checking for openpty header" >&5
19781 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19782 if test "${cf_cv_func_openpty+set}" = set; then
19783   echo $ECHO_N "(cached) $ECHO_C" >&6
19784 else
19785
19786         cf_save_LIBS="$LIBS"
19787         test "$cf_cv_lib_util" = yes && {
19788 cf_add_libs="$LIBS"
19789 # reverse order
19790 cf_add_0lib=
19791 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19792 # filter duplicates
19793 for cf_add_1lib in $cf_add_0lib; do
19794         for cf_add_2lib in $cf_add_libs; do
19795                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19796                         cf_add_1lib=
19797                         break
19798                 fi
19799         done
19800         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19801 done
19802 LIBS="$cf_add_libs"
19803  }
19804         for cf_header in pty.h libutil.h util.h
19805         do
19806         cat >"conftest.$ac_ext" <<_ACEOF
19807 #line 19807 "configure"
19808 #include "confdefs.h"
19809
19810 #include <$cf_header>
19811
19812 int
19813 main (void)
19814 {
19815
19816         int x = openpty((int *)0, (int *)0, (char *)0,
19817                                    (struct termios *)0, (struct winsize *)0);
19818
19819   ;
19820   return 0;
19821 }
19822 _ACEOF
19823 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19824 if { (eval echo "$as_me:19824: \"$ac_link\"") >&5
19825   (eval $ac_link) 2>&5
19826   ac_status=$?
19827   echo "$as_me:19827: \$? = $ac_status" >&5
19828   (exit "$ac_status"); } &&
19829          { ac_try='test -s "conftest$ac_exeext"'
19830   { (eval echo "$as_me:19830: \"$ac_try\"") >&5
19831   (eval $ac_try) 2>&5
19832   ac_status=$?
19833   echo "$as_me:19833: \$? = $ac_status" >&5
19834   (exit "$ac_status"); }; }; then
19835
19836                 cf_cv_func_openpty=$cf_header
19837                 break
19838
19839 else
19840   echo "$as_me: failed program was:" >&5
19841 cat "conftest.$ac_ext" >&5
19842
19843                 cf_cv_func_openpty=no
19844
19845 fi
19846 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19847         done
19848         LIBS="$cf_save_LIBS"
19849
19850 fi
19851 echo "$as_me:19851: result: $cf_cv_func_openpty" >&5
19852 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19853
19854 if test "$cf_cv_func_openpty" != no ; then
19855
19856 cat >>confdefs.h <<EOF
19857 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19858 EOF
19859
19860 cat >>confdefs.h <<\EOF
19861 #define USE_XTERM_PTY 1
19862 EOF
19863
19864         if test "x$cf_cv_lib_util" = xyes ; then
19865
19866 cf_add_libs="$TEST_LIBS"
19867 # reverse order
19868 cf_add_0lib=
19869 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19870 # filter duplicates
19871 for cf_add_1lib in $cf_add_0lib; do
19872         for cf_add_2lib in $cf_add_libs; do
19873                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19874                         cf_add_1lib=
19875                         break
19876                 fi
19877         done
19878         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19879 done
19880 TEST_LIBS="$cf_add_libs"
19881
19882         fi
19883 fi
19884
19885 echo "$as_me:19885: checking for function curses_version" >&5
19886 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19887 if test "${cf_cv_func_curses_version+set}" = set; then
19888   echo $ECHO_N "(cached) $ECHO_C" >&6
19889 else
19890
19891 if test "$cross_compiling" = yes; then
19892   cf_cv_func_curses_version=unknown
19893 else
19894   cat >"conftest.$ac_ext" <<_ACEOF
19895 #line 19895 "configure"
19896 #include "confdefs.h"
19897
19898 $ac_includes_default
19899
19900 #include <${cf_cv_ncurses_header:-curses.h}>
19901
19902 int main(void)
19903 {
19904         char temp[1024];
19905         sprintf(temp, "%.999s\\n", curses_version());
19906         ${cf_cv_main_return:-return}(0);
19907 }
19908
19909 _ACEOF
19910 rm -f "conftest$ac_exeext"
19911 if { (eval echo "$as_me:19911: \"$ac_link\"") >&5
19912   (eval $ac_link) 2>&5
19913   ac_status=$?
19914   echo "$as_me:19914: \$? = $ac_status" >&5
19915   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19916   { (eval echo "$as_me:19916: \"$ac_try\"") >&5
19917   (eval $ac_try) 2>&5
19918   ac_status=$?
19919   echo "$as_me:19919: \$? = $ac_status" >&5
19920   (exit "$ac_status"); }; }; then
19921   cf_cv_func_curses_version=yes
19922
19923 else
19924   echo "$as_me: program exited with status $ac_status" >&5
19925 echo "$as_me: failed program was:" >&5
19926 cat "conftest.$ac_ext" >&5
19927 cf_cv_func_curses_version=no
19928
19929 fi
19930 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19931 fi
19932 rm -f core
19933 fi
19934 echo "$as_me:19934: result: $cf_cv_func_curses_version" >&5
19935 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19936 test "$cf_cv_func_curses_version" = yes &&
19937 cat >>confdefs.h <<\EOF
19938 #define HAVE_CURSES_VERSION 1
19939 EOF
19940
19941 echo "$as_me:19941: checking for alternate character set array" >&5
19942 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19943 if test "${cf_cv_curses_acs_map+set}" = set; then
19944   echo $ECHO_N "(cached) $ECHO_C" >&6
19945 else
19946
19947 cf_cv_curses_acs_map=unknown
19948 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19949 do
19950 cat >"conftest.$ac_ext" <<_ACEOF
19951 #line 19951 "configure"
19952 #include "confdefs.h"
19953
19954 #include <${cf_cv_ncurses_header:-curses.h}>
19955
19956 int
19957 main (void)
19958 {
19959
19960 ${name}['k'] = ACS_PLUS
19961
19962   ;
19963   return 0;
19964 }
19965 _ACEOF
19966 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19967 if { (eval echo "$as_me:19967: \"$ac_link\"") >&5
19968   (eval $ac_link) 2>&5
19969   ac_status=$?
19970   echo "$as_me:19970: \$? = $ac_status" >&5
19971   (exit "$ac_status"); } &&
19972          { ac_try='test -s "conftest$ac_exeext"'
19973   { (eval echo "$as_me:19973: \"$ac_try\"") >&5
19974   (eval $ac_try) 2>&5
19975   ac_status=$?
19976   echo "$as_me:19976: \$? = $ac_status" >&5
19977   (exit "$ac_status"); }; }; then
19978   cf_cv_curses_acs_map=$name; break
19979 else
19980   echo "$as_me: failed program was:" >&5
19981 cat "conftest.$ac_ext" >&5
19982 fi
19983 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19984 done
19985
19986 fi
19987 echo "$as_me:19987: result: $cf_cv_curses_acs_map" >&5
19988 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19989
19990 test "$cf_cv_curses_acs_map" != unknown &&
19991 cat >>confdefs.h <<EOF
19992 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19993 EOF
19994
19995 if test "$cf_enable_widec" = yes; then
19996
19997 echo "$as_me:19997: checking for wide alternate character set array" >&5
19998 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19999 if test "${cf_cv_curses_wacs_map+set}" = set; then
20000   echo $ECHO_N "(cached) $ECHO_C" >&6
20001 else
20002
20003         cf_cv_curses_wacs_map=unknown
20004         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
20005         do
20006         cat >"conftest.$ac_ext" <<_ACEOF
20007 #line 20007 "configure"
20008 #include "confdefs.h"
20009
20010 #ifndef _XOPEN_SOURCE_EXTENDED
20011 #define _XOPEN_SOURCE_EXTENDED
20012 #endif
20013 #include <${cf_cv_ncurses_header:-curses.h}>
20014 int
20015 main (void)
20016 {
20017 void *foo = &(${name}['k']); (void)foo
20018   ;
20019   return 0;
20020 }
20021 _ACEOF
20022 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20023 if { (eval echo "$as_me:20023: \"$ac_link\"") >&5
20024   (eval $ac_link) 2>&5
20025   ac_status=$?
20026   echo "$as_me:20026: \$? = $ac_status" >&5
20027   (exit "$ac_status"); } &&
20028          { ac_try='test -s "conftest$ac_exeext"'
20029   { (eval echo "$as_me:20029: \"$ac_try\"") >&5
20030   (eval $ac_try) 2>&5
20031   ac_status=$?
20032   echo "$as_me:20032: \$? = $ac_status" >&5
20033   (exit "$ac_status"); }; }; then
20034   cf_cv_curses_wacs_map=$name
20035          break
20036 else
20037   echo "$as_me: failed program was:" >&5
20038 cat "conftest.$ac_ext" >&5
20039 fi
20040 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20041         done
20042 fi
20043 echo "$as_me:20043: result: $cf_cv_curses_wacs_map" >&5
20044 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
20045
20046 test "$cf_cv_curses_wacs_map" != unknown &&
20047 cat >>confdefs.h <<EOF
20048 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
20049 EOF
20050
20051 echo "$as_me:20051: checking for wide alternate character constants" >&5
20052 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
20053 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
20054   echo $ECHO_N "(cached) $ECHO_C" >&6
20055 else
20056
20057 cf_cv_curses_wacs_symbols=no
20058 if test "$cf_cv_curses_wacs_map" != unknown
20059 then
20060         cat >"conftest.$ac_ext" <<_ACEOF
20061 #line 20061 "configure"
20062 #include "confdefs.h"
20063
20064 #ifndef _XOPEN_SOURCE_EXTENDED
20065 #define _XOPEN_SOURCE_EXTENDED
20066 #endif
20067 #include <${cf_cv_ncurses_header:-curses.h}>
20068 int
20069 main (void)
20070 {
20071 cchar_t *foo = WACS_PLUS;
20072          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
20073   ;
20074   return 0;
20075 }
20076 _ACEOF
20077 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20078 if { (eval echo "$as_me:20078: \"$ac_link\"") >&5
20079   (eval $ac_link) 2>&5
20080   ac_status=$?
20081   echo "$as_me:20081: \$? = $ac_status" >&5
20082   (exit "$ac_status"); } &&
20083          { ac_try='test -s "conftest$ac_exeext"'
20084   { (eval echo "$as_me:20084: \"$ac_try\"") >&5
20085   (eval $ac_try) 2>&5
20086   ac_status=$?
20087   echo "$as_me:20087: \$? = $ac_status" >&5
20088   (exit "$ac_status"); }; }; then
20089   cf_cv_curses_wacs_symbols=yes
20090 else
20091   echo "$as_me: failed program was:" >&5
20092 cat "conftest.$ac_ext" >&5
20093 fi
20094 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20095 else
20096         cat >"conftest.$ac_ext" <<_ACEOF
20097 #line 20097 "configure"
20098 #include "confdefs.h"
20099
20100 #ifndef _XOPEN_SOURCE_EXTENDED
20101 #define _XOPEN_SOURCE_EXTENDED
20102 #endif
20103 #include <${cf_cv_ncurses_header:-curses.h}>
20104 int
20105 main (void)
20106 {
20107 cchar_t *foo = WACS_PLUS; (void)foo
20108   ;
20109   return 0;
20110 }
20111 _ACEOF
20112 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20113 if { (eval echo "$as_me:20113: \"$ac_link\"") >&5
20114   (eval $ac_link) 2>&5
20115   ac_status=$?
20116   echo "$as_me:20116: \$? = $ac_status" >&5
20117   (exit "$ac_status"); } &&
20118          { ac_try='test -s "conftest$ac_exeext"'
20119   { (eval echo "$as_me:20119: \"$ac_try\"") >&5
20120   (eval $ac_try) 2>&5
20121   ac_status=$?
20122   echo "$as_me:20122: \$? = $ac_status" >&5
20123   (exit "$ac_status"); }; }; then
20124   cf_cv_curses_wacs_symbols=yes
20125 else
20126   echo "$as_me: failed program was:" >&5
20127 cat "conftest.$ac_ext" >&5
20128 fi
20129 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20130 fi
20131
20132 fi
20133 echo "$as_me:20133: result: $cf_cv_curses_wacs_symbols" >&5
20134 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
20135
20136 test "$cf_cv_curses_wacs_symbols" != no &&
20137 cat >>confdefs.h <<\EOF
20138 #define CURSES_WACS_SYMBOLS 1
20139 EOF
20140
20141 fi
20142
20143 echo "$as_me:20143: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20144 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20145 cat >"conftest.$ac_ext" <<_ACEOF
20146 #line 20146 "configure"
20147 #include "confdefs.h"
20148
20149 #ifndef _XOPEN_SOURCE_EXTENDED
20150 #define _XOPEN_SOURCE_EXTENDED
20151 #endif
20152 #include <${cf_cv_ncurses_header:-curses.h}>
20153 int
20154 main (void)
20155 {
20156
20157 attr_t foo
20158
20159   ;
20160   return 0;
20161 }
20162 _ACEOF
20163 rm -f "conftest.$ac_objext"
20164 if { (eval echo "$as_me:20164: \"$ac_compile\"") >&5
20165   (eval $ac_compile) 2>&5
20166   ac_status=$?
20167   echo "$as_me:20167: \$? = $ac_status" >&5
20168   (exit "$ac_status"); } &&
20169          { ac_try='test -s "conftest.$ac_objext"'
20170   { (eval echo "$as_me:20170: \"$ac_try\"") >&5
20171   (eval $ac_try) 2>&5
20172   ac_status=$?
20173   echo "$as_me:20173: \$? = $ac_status" >&5
20174   (exit "$ac_status"); }; }; then
20175   cf_result=yes
20176 else
20177   echo "$as_me: failed program was:" >&5
20178 cat "conftest.$ac_ext" >&5
20179 cf_result=no
20180 fi
20181 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20182 echo "$as_me:20182: result: $cf_result" >&5
20183 echo "${ECHO_T}$cf_result" >&6
20184 if test "$cf_result" = yes ; then
20185
20186 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20187
20188 cat >>confdefs.h <<EOF
20189 #define $cf_result 1
20190 EOF
20191
20192 else
20193
20194 cat >>confdefs.h <<EOF
20195 #define attr_t long
20196 EOF
20197
20198 fi
20199
20200 if test "$cf_enable_widec" = yes; then
20201
20202 # This is needed on Tru64 5.0 to declare mbstate_t
20203 echo "$as_me:20203: checking if we must include wchar.h to declare mbstate_t" >&5
20204 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
20205 if test "${cf_cv_mbstate_t+set}" = set; then
20206   echo $ECHO_N "(cached) $ECHO_C" >&6
20207 else
20208
20209 cat >"conftest.$ac_ext" <<_ACEOF
20210 #line 20210 "configure"
20211 #include "confdefs.h"
20212
20213 #include <stdlib.h>
20214 #include <stdarg.h>
20215 #include <stdio.h>
20216 #ifdef HAVE_LIBUTF8_H
20217 #include <libutf8.h>
20218 #endif
20219 int
20220 main (void)
20221 {
20222 mbstate_t state
20223   ;
20224   return 0;
20225 }
20226 _ACEOF
20227 rm -f "conftest.$ac_objext"
20228 if { (eval echo "$as_me:20228: \"$ac_compile\"") >&5
20229   (eval $ac_compile) 2>&5
20230   ac_status=$?
20231   echo "$as_me:20231: \$? = $ac_status" >&5
20232   (exit "$ac_status"); } &&
20233          { ac_try='test -s "conftest.$ac_objext"'
20234   { (eval echo "$as_me:20234: \"$ac_try\"") >&5
20235   (eval $ac_try) 2>&5
20236   ac_status=$?
20237   echo "$as_me:20237: \$? = $ac_status" >&5
20238   (exit "$ac_status"); }; }; then
20239   cf_cv_mbstate_t=no
20240 else
20241   echo "$as_me: failed program was:" >&5
20242 cat "conftest.$ac_ext" >&5
20243 cat >"conftest.$ac_ext" <<_ACEOF
20244 #line 20244 "configure"
20245 #include "confdefs.h"
20246
20247 #include <stdlib.h>
20248 #include <stdarg.h>
20249 #include <stdio.h>
20250 #include <wchar.h>
20251 #ifdef HAVE_LIBUTF8_H
20252 #include <libutf8.h>
20253 #endif
20254 int
20255 main (void)
20256 {
20257 mbstate_t value
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_mbstate_t=yes
20275 else
20276   echo "$as_me: failed program was:" >&5
20277 cat "conftest.$ac_ext" >&5
20278 cf_cv_mbstate_t=unknown
20279 fi
20280 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20281 fi
20282 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20283 fi
20284 echo "$as_me:20284: result: $cf_cv_mbstate_t" >&5
20285 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
20286
20287 if test "$cf_cv_mbstate_t" = yes ; then
20288
20289 cat >>confdefs.h <<\EOF
20290 #define NEED_WCHAR_H 1
20291 EOF
20292
20293         NEED_WCHAR_H=1
20294 fi
20295
20296 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
20297 if test "$cf_cv_mbstate_t" = unknown ; then
20298         NCURSES_MBSTATE_T=1
20299 fi
20300
20301 # if we find mbstate_t in either place, use substitution to provide a fallback.
20302 if test "$cf_cv_mbstate_t" != unknown ; then
20303         NCURSES_OK_MBSTATE_T=1
20304 fi
20305
20306 # This is needed on Tru64 5.0 to declare wchar_t
20307 echo "$as_me:20307: checking if we must include wchar.h to declare wchar_t" >&5
20308 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
20309 if test "${cf_cv_wchar_t+set}" = set; then
20310   echo $ECHO_N "(cached) $ECHO_C" >&6
20311 else
20312
20313 cat >"conftest.$ac_ext" <<_ACEOF
20314 #line 20314 "configure"
20315 #include "confdefs.h"
20316
20317 #include <stdlib.h>
20318 #include <stdarg.h>
20319 #include <stdio.h>
20320 #ifdef HAVE_LIBUTF8_H
20321 #include <libutf8.h>
20322 #endif
20323 int
20324 main (void)
20325 {
20326 wchar_t state
20327   ;
20328   return 0;
20329 }
20330 _ACEOF
20331 rm -f "conftest.$ac_objext"
20332 if { (eval echo "$as_me:20332: \"$ac_compile\"") >&5
20333   (eval $ac_compile) 2>&5
20334   ac_status=$?
20335   echo "$as_me:20335: \$? = $ac_status" >&5
20336   (exit "$ac_status"); } &&
20337          { ac_try='test -s "conftest.$ac_objext"'
20338   { (eval echo "$as_me:20338: \"$ac_try\"") >&5
20339   (eval $ac_try) 2>&5
20340   ac_status=$?
20341   echo "$as_me:20341: \$? = $ac_status" >&5
20342   (exit "$ac_status"); }; }; then
20343   cf_cv_wchar_t=no
20344 else
20345   echo "$as_me: failed program was:" >&5
20346 cat "conftest.$ac_ext" >&5
20347 cat >"conftest.$ac_ext" <<_ACEOF
20348 #line 20348 "configure"
20349 #include "confdefs.h"
20350
20351 #include <stdlib.h>
20352 #include <stdarg.h>
20353 #include <stdio.h>
20354 #include <wchar.h>
20355 #ifdef HAVE_LIBUTF8_H
20356 #include <libutf8.h>
20357 #endif
20358 int
20359 main (void)
20360 {
20361 wchar_t value
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_wchar_t=yes
20379 else
20380   echo "$as_me: failed program was:" >&5
20381 cat "conftest.$ac_ext" >&5
20382 cf_cv_wchar_t=unknown
20383 fi
20384 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20385 fi
20386 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20387 fi
20388 echo "$as_me:20388: result: $cf_cv_wchar_t" >&5
20389 echo "${ECHO_T}$cf_cv_wchar_t" >&6
20390
20391 if test "$cf_cv_wchar_t" = yes ; then
20392
20393 cat >>confdefs.h <<\EOF
20394 #define NEED_WCHAR_H 1
20395 EOF
20396
20397         NEED_WCHAR_H=1
20398 fi
20399
20400 # if we do not find wchar_t in either place, use substitution to provide a fallback.
20401 if test "$cf_cv_wchar_t" = unknown ; then
20402         NCURSES_WCHAR_T=1
20403 fi
20404
20405 # if we find wchar_t in either place, use substitution to provide a fallback.
20406 if test "$cf_cv_wchar_t" != unknown ; then
20407         NCURSES_OK_WCHAR_T=1
20408 fi
20409
20410 # This is needed on Tru64 5.0 to declare wint_t
20411 echo "$as_me:20411: checking if we must include wchar.h to declare wint_t" >&5
20412 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
20413 if test "${cf_cv_wint_t+set}" = set; then
20414   echo $ECHO_N "(cached) $ECHO_C" >&6
20415 else
20416
20417 cat >"conftest.$ac_ext" <<_ACEOF
20418 #line 20418 "configure"
20419 #include "confdefs.h"
20420
20421 #include <stdlib.h>
20422 #include <stdarg.h>
20423 #include <stdio.h>
20424 #ifdef HAVE_LIBUTF8_H
20425 #include <libutf8.h>
20426 #endif
20427 int
20428 main (void)
20429 {
20430 wint_t state
20431   ;
20432   return 0;
20433 }
20434 _ACEOF
20435 rm -f "conftest.$ac_objext"
20436 if { (eval echo "$as_me:20436: \"$ac_compile\"") >&5
20437   (eval $ac_compile) 2>&5
20438   ac_status=$?
20439   echo "$as_me:20439: \$? = $ac_status" >&5
20440   (exit "$ac_status"); } &&
20441          { ac_try='test -s "conftest.$ac_objext"'
20442   { (eval echo "$as_me:20442: \"$ac_try\"") >&5
20443   (eval $ac_try) 2>&5
20444   ac_status=$?
20445   echo "$as_me:20445: \$? = $ac_status" >&5
20446   (exit "$ac_status"); }; }; then
20447   cf_cv_wint_t=no
20448 else
20449   echo "$as_me: failed program was:" >&5
20450 cat "conftest.$ac_ext" >&5
20451 cat >"conftest.$ac_ext" <<_ACEOF
20452 #line 20452 "configure"
20453 #include "confdefs.h"
20454
20455 #include <stdlib.h>
20456 #include <stdarg.h>
20457 #include <stdio.h>
20458 #include <wchar.h>
20459 #ifdef HAVE_LIBUTF8_H
20460 #include <libutf8.h>
20461 #endif
20462 int
20463 main (void)
20464 {
20465 wint_t value
20466   ;
20467   return 0;
20468 }
20469 _ACEOF
20470 rm -f "conftest.$ac_objext"
20471 if { (eval echo "$as_me:20471: \"$ac_compile\"") >&5
20472   (eval $ac_compile) 2>&5
20473   ac_status=$?
20474   echo "$as_me:20474: \$? = $ac_status" >&5
20475   (exit "$ac_status"); } &&
20476          { ac_try='test -s "conftest.$ac_objext"'
20477   { (eval echo "$as_me:20477: \"$ac_try\"") >&5
20478   (eval $ac_try) 2>&5
20479   ac_status=$?
20480   echo "$as_me:20480: \$? = $ac_status" >&5
20481   (exit "$ac_status"); }; }; then
20482   cf_cv_wint_t=yes
20483 else
20484   echo "$as_me: failed program was:" >&5
20485 cat "conftest.$ac_ext" >&5
20486 cf_cv_wint_t=unknown
20487 fi
20488 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20489 fi
20490 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20491 fi
20492 echo "$as_me:20492: result: $cf_cv_wint_t" >&5
20493 echo "${ECHO_T}$cf_cv_wint_t" >&6
20494
20495 if test "$cf_cv_wint_t" = yes ; then
20496
20497 cat >>confdefs.h <<\EOF
20498 #define NEED_WCHAR_H 1
20499 EOF
20500
20501         NEED_WCHAR_H=1
20502 fi
20503
20504 # if we do not find wint_t in either place, use substitution to provide a fallback.
20505 if test "$cf_cv_wint_t" = unknown ; then
20506         NCURSES_WINT_T=1
20507 fi
20508
20509 # if we find wint_t in either place, use substitution to provide a fallback.
20510 if test "$cf_cv_wint_t" != unknown ; then
20511         NCURSES_OK_WINT_T=1
20512 fi
20513
20514         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
20515
20516 echo "$as_me:20516: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20517 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20518 cat >"conftest.$ac_ext" <<_ACEOF
20519 #line 20519 "configure"
20520 #include "confdefs.h"
20521
20522 #ifndef _XOPEN_SOURCE_EXTENDED
20523 #define _XOPEN_SOURCE_EXTENDED
20524 #endif
20525 #include <${cf_cv_ncurses_header:-curses.h}>
20526 int
20527 main (void)
20528 {
20529
20530 mbstate_t foo
20531
20532   ;
20533   return 0;
20534 }
20535 _ACEOF
20536 rm -f "conftest.$ac_objext"
20537 if { (eval echo "$as_me:20537: \"$ac_compile\"") >&5
20538   (eval $ac_compile) 2>&5
20539   ac_status=$?
20540   echo "$as_me:20540: \$? = $ac_status" >&5
20541   (exit "$ac_status"); } &&
20542          { ac_try='test -s "conftest.$ac_objext"'
20543   { (eval echo "$as_me:20543: \"$ac_try\"") >&5
20544   (eval $ac_try) 2>&5
20545   ac_status=$?
20546   echo "$as_me:20546: \$? = $ac_status" >&5
20547   (exit "$ac_status"); }; }; then
20548   cf_result=yes
20549 else
20550   echo "$as_me: failed program was:" >&5
20551 cat "conftest.$ac_ext" >&5
20552 cf_result=no
20553 fi
20554 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20555 echo "$as_me:20555: result: $cf_result" >&5
20556 echo "${ECHO_T}$cf_result" >&6
20557 if test "$cf_result" = yes ; then
20558
20559 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20560
20561 cat >>confdefs.h <<EOF
20562 #define $cf_result 1
20563 EOF
20564
20565 else
20566
20567 cat >>confdefs.h <<EOF
20568 #define mbstate_t long
20569 EOF
20570
20571 fi
20572
20573         fi
20574
20575         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20576
20577 echo "$as_me:20577: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20578 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20579 cat >"conftest.$ac_ext" <<_ACEOF
20580 #line 20580 "configure"
20581 #include "confdefs.h"
20582
20583 #ifndef _XOPEN_SOURCE_EXTENDED
20584 #define _XOPEN_SOURCE_EXTENDED
20585 #endif
20586 #include <${cf_cv_ncurses_header:-curses.h}>
20587 int
20588 main (void)
20589 {
20590
20591 wchar_t foo
20592
20593   ;
20594   return 0;
20595 }
20596 _ACEOF
20597 rm -f "conftest.$ac_objext"
20598 if { (eval echo "$as_me:20598: \"$ac_compile\"") >&5
20599   (eval $ac_compile) 2>&5
20600   ac_status=$?
20601   echo "$as_me:20601: \$? = $ac_status" >&5
20602   (exit "$ac_status"); } &&
20603          { ac_try='test -s "conftest.$ac_objext"'
20604   { (eval echo "$as_me:20604: \"$ac_try\"") >&5
20605   (eval $ac_try) 2>&5
20606   ac_status=$?
20607   echo "$as_me:20607: \$? = $ac_status" >&5
20608   (exit "$ac_status"); }; }; then
20609   cf_result=yes
20610 else
20611   echo "$as_me: failed program was:" >&5
20612 cat "conftest.$ac_ext" >&5
20613 cf_result=no
20614 fi
20615 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20616 echo "$as_me:20616: result: $cf_result" >&5
20617 echo "${ECHO_T}$cf_result" >&6
20618 if test "$cf_result" = yes ; then
20619
20620 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20621
20622 cat >>confdefs.h <<EOF
20623 #define $cf_result 1
20624 EOF
20625
20626 else
20627
20628 cat >>confdefs.h <<EOF
20629 #define wchar_t long
20630 EOF
20631
20632 fi
20633
20634         fi
20635
20636         if test "$NCURSES_OK_WINT_T" = 0 ; then
20637
20638 echo "$as_me:20638: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20639 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20640 cat >"conftest.$ac_ext" <<_ACEOF
20641 #line 20641 "configure"
20642 #include "confdefs.h"
20643
20644 #ifndef _XOPEN_SOURCE_EXTENDED
20645 #define _XOPEN_SOURCE_EXTENDED
20646 #endif
20647 #include <${cf_cv_ncurses_header:-curses.h}>
20648 int
20649 main (void)
20650 {
20651
20652 wint_t foo
20653
20654   ;
20655   return 0;
20656 }
20657 _ACEOF
20658 rm -f "conftest.$ac_objext"
20659 if { (eval echo "$as_me:20659: \"$ac_compile\"") >&5
20660   (eval $ac_compile) 2>&5
20661   ac_status=$?
20662   echo "$as_me:20662: \$? = $ac_status" >&5
20663   (exit "$ac_status"); } &&
20664          { ac_try='test -s "conftest.$ac_objext"'
20665   { (eval echo "$as_me:20665: \"$ac_try\"") >&5
20666   (eval $ac_try) 2>&5
20667   ac_status=$?
20668   echo "$as_me:20668: \$? = $ac_status" >&5
20669   (exit "$ac_status"); }; }; then
20670   cf_result=yes
20671 else
20672   echo "$as_me: failed program was:" >&5
20673 cat "conftest.$ac_ext" >&5
20674 cf_result=no
20675 fi
20676 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20677 echo "$as_me:20677: result: $cf_result" >&5
20678 echo "${ECHO_T}$cf_result" >&6
20679 if test "$cf_result" = yes ; then
20680
20681 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20682
20683 cat >>confdefs.h <<EOF
20684 #define $cf_result 1
20685 EOF
20686
20687 else
20688
20689 cat >>confdefs.h <<EOF
20690 #define wint_t long
20691 EOF
20692
20693 fi
20694
20695         fi
20696 fi
20697
20698 for cf_data in \
20699 TABSIZE \
20700 curscr \
20701 ospeed \
20702 boolnames \
20703 boolfnames \
20704 ttytype
20705 do
20706 echo "$as_me:20706: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20707 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20708
20709 cat >"conftest.$ac_ext" <<_ACEOF
20710 #line 20710 "configure"
20711 #include "confdefs.h"
20712
20713 #ifdef HAVE_XCURSES
20714 #include <xcurses.h>
20715 char * XCursesProgramName = "test";
20716 #else
20717 #include <${cf_cv_ncurses_header:-curses.h}>
20718 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20719 #include <ncursesw/term.h>
20720 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20721 #include <ncurses/term.h>
20722 #elif defined(HAVE_TERM_H)
20723 #include <term.h>
20724 #endif
20725 #endif
20726
20727 int
20728 main (void)
20729 {
20730
20731 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20732         const void *foo = (const void *)($cf_data);
20733 #else
20734         const void *foo = &($cf_data);
20735 #endif
20736         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20737
20738   ;
20739   return 0;
20740 }
20741 _ACEOF
20742 rm -f "conftest.$ac_objext"
20743 if { (eval echo "$as_me:20743: \"$ac_compile\"") >&5
20744   (eval $ac_compile) 2>&5
20745   ac_status=$?
20746   echo "$as_me:20746: \$? = $ac_status" >&5
20747   (exit "$ac_status"); } &&
20748          { ac_try='test -s "conftest.$ac_objext"'
20749   { (eval echo "$as_me:20749: \"$ac_try\"") >&5
20750   (eval $ac_try) 2>&5
20751   ac_status=$?
20752   echo "$as_me:20752: \$? = $ac_status" >&5
20753   (exit "$ac_status"); }; }; then
20754   cf_result=yes
20755
20756 else
20757   echo "$as_me: failed program was:" >&5
20758 cat "conftest.$ac_ext" >&5
20759 cf_result=no
20760 fi
20761 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20762 echo "$as_me:20762: result: $cf_result" >&5
20763 echo "${ECHO_T}$cf_result" >&6
20764
20765 if test "$cf_result" = yes ; then
20766
20767 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20768
20769         cat >>confdefs.h <<EOF
20770 #define $cf_result 1
20771 EOF
20772
20773 else
20774         echo "$as_me:20774: checking for data $cf_data in library" >&5
20775 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20776         # BSD linkers insist on making weak linkage, but resolve at runtime.
20777         if test "$cross_compiling" = yes; then
20778
20779         # cross-compiling
20780         cat >"conftest.$ac_ext" <<_ACEOF
20781 #line 20781 "configure"
20782 #include "confdefs.h"
20783
20784 #ifdef HAVE_XCURSES
20785 #include <xcurses.h>
20786 char * XCursesProgramName = "test";
20787 #else
20788 #include <${cf_cv_ncurses_header:-curses.h}>
20789 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20790 #include <ncursesw/term.h>
20791 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20792 #include <ncurses/term.h>
20793 #elif defined(HAVE_TERM_H)
20794 #include <term.h>
20795 #endif
20796 #endif
20797
20798 extern char $cf_data;
20799 int
20800 main (void)
20801 {
20802
20803         do {
20804
20805 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20806         const void *foo = (const void *)($cf_data);
20807 #else
20808         const void *foo = &($cf_data);
20809 #endif
20810         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20811
20812                 ${cf_cv_main_return:-return}(foo == 0);
20813         } while (0)
20814
20815   ;
20816   return 0;
20817 }
20818 _ACEOF
20819 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20820 if { (eval echo "$as_me:20820: \"$ac_link\"") >&5
20821   (eval $ac_link) 2>&5
20822   ac_status=$?
20823   echo "$as_me:20823: \$? = $ac_status" >&5
20824   (exit "$ac_status"); } &&
20825          { ac_try='test -s "conftest$ac_exeext"'
20826   { (eval echo "$as_me:20826: \"$ac_try\"") >&5
20827   (eval $ac_try) 2>&5
20828   ac_status=$?
20829   echo "$as_me:20829: \$? = $ac_status" >&5
20830   (exit "$ac_status"); }; }; then
20831   cf_result=yes
20832 else
20833   echo "$as_me: failed program was:" >&5
20834 cat "conftest.$ac_ext" >&5
20835 cf_result=no
20836 fi
20837 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20838
20839 else
20840   cat >"conftest.$ac_ext" <<_ACEOF
20841 #line 20841 "configure"
20842 #include "confdefs.h"
20843
20844 #ifdef HAVE_XCURSES
20845 #include <xcurses.h>
20846 char * XCursesProgramName = "test";
20847 #else
20848 #include <${cf_cv_ncurses_header:-curses.h}>
20849 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20850 #include <ncursesw/term.h>
20851 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20852 #include <ncurses/term.h>
20853 #elif defined(HAVE_TERM_H)
20854 #include <term.h>
20855 #endif
20856 #endif
20857
20858 extern char $cf_data;
20859 int main(void)
20860 {
20861
20862 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20863         const void *foo = (const void *)($cf_data);
20864 #else
20865         const void *foo = &($cf_data);
20866 #endif
20867         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20868
20869         ${cf_cv_main_return:-return}(foo == 0);
20870 }
20871 _ACEOF
20872 rm -f "conftest$ac_exeext"
20873 if { (eval echo "$as_me:20873: \"$ac_link\"") >&5
20874   (eval $ac_link) 2>&5
20875   ac_status=$?
20876   echo "$as_me:20876: \$? = $ac_status" >&5
20877   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20878   { (eval echo "$as_me:20878: \"$ac_try\"") >&5
20879   (eval $ac_try) 2>&5
20880   ac_status=$?
20881   echo "$as_me:20881: \$? = $ac_status" >&5
20882   (exit "$ac_status"); }; }; then
20883   cf_result=yes
20884
20885 else
20886   echo "$as_me: program exited with status $ac_status" >&5
20887 echo "$as_me: failed program was:" >&5
20888 cat "conftest.$ac_ext" >&5
20889 cf_result=no
20890 fi
20891 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20892 fi
20893         echo "$as_me:20893: result: $cf_result" >&5
20894 echo "${ECHO_T}$cf_result" >&6
20895         if test "$cf_result" = yes ; then
20896
20897 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20898
20899                 cat >>confdefs.h <<EOF
20900 #define $cf_result 1
20901 EOF
20902
20903                 # do not exit loop here, since we prefer system's declarations
20904         fi
20905 fi
20906 done
20907
20908 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20909 then
20910         echo "$as_me:20910: checking for X" >&5
20911 echo $ECHO_N "checking for X... $ECHO_C" >&6
20912
20913 # Check whether --with-x or --without-x was given.
20914 if test "${with_x+set}" = set; then
20915   withval="$with_x"
20916
20917 fi;
20918 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20919 if test "x$with_x" = xno; then
20920   # The user explicitly disabled X.
20921   have_x=disabled
20922 else
20923   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20924     # Both variables are already set.
20925     have_x=yes
20926   else
20927     if test "${ac_cv_have_x+set}" = set; then
20928   echo $ECHO_N "(cached) $ECHO_C" >&6
20929 else
20930   # One or both of the vars are not set, and there is no cached value.
20931 ac_x_includes=no ac_x_libraries=no
20932 rm -fr conftest.dir
20933 if mkdir conftest.dir; then
20934   cd conftest.dir
20935   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20936   cat >Imakefile <<'EOF'
20937 acfindx:
20938         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20939 EOF
20940   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20941     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20942     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20943     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20944     for ac_extension in a so sl dylib dll; do
20945       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20946          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20947         ac_im_usrlibdir=$ac_im_libdir; break
20948       fi
20949     done
20950     # Screen out bogus values from the imake configuration.  They are
20951     # bogus both because they are the default anyway, and because
20952     # using them would break gcc on systems where it needs fixed includes.
20953     case $ac_im_incroot in
20954         /usr/include) ;;
20955         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20956     esac
20957     case $ac_im_usrlibdir in
20958         /usr/lib | /lib) ;;
20959         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20960     esac
20961   fi
20962   cd ..
20963   rm -fr conftest.dir
20964 fi
20965
20966 # Standard set of common directories for X headers.
20967 # Check X11 before X11Rn because it is often a symlink to the current release.
20968 ac_x_header_dirs='
20969 /usr/X11/include
20970 /usr/X11R7/include
20971 /usr/X11R6/include
20972 /usr/X11R5/include
20973 /usr/X11R4/include
20974
20975 /opt/local/include
20976 /opt/X11/include
20977
20978 /usr/include/X11
20979 /usr/include/X11R7
20980 /usr/include/X11R6
20981 /usr/include/X11R5
20982 /usr/include/X11R4
20983
20984 /usr/local/X11/include
20985 /usr/local/X11R7/include
20986 /usr/local/X11R6/include
20987 /usr/local/X11R5/include
20988 /usr/local/X11R4/include
20989
20990 /usr/local/include/X11
20991 /usr/local/include/X11R7
20992 /usr/local/include/X11R6
20993 /usr/local/include/X11R5
20994 /usr/local/include/X11R4
20995
20996 /usr/X386/include
20997 /usr/x386/include
20998 /usr/XFree86/include/X11
20999
21000 /usr/include
21001 /usr/local/include
21002 /usr/unsupported/include
21003 /usr/athena/include
21004 /usr/local/x11r5/include
21005 /usr/lpp/Xamples/include
21006
21007 /usr/openwin/include
21008 /usr/openwin/share/include'
21009
21010 if test "$ac_x_includes" = no; then
21011   # Guess where to find include files, by looking for Intrinsic.h.
21012   # First, try using that file with no special directory specified.
21013   cat >"conftest.$ac_ext" <<_ACEOF
21014 #line 21014 "configure"
21015 #include "confdefs.h"
21016 #include <X11/Intrinsic.h>
21017 _ACEOF
21018 if { (eval echo "$as_me:21018: \"$ac_cpp "conftest.$ac_ext"\"") >&5
21019   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
21020   ac_status=$?
21021   $EGREP -v '^ *\+' conftest.er1 >conftest.err
21022   rm -f conftest.er1
21023   cat conftest.err >&5
21024   echo "$as_me:21024: \$? = $ac_status" >&5
21025   (exit "$ac_status"); } >/dev/null; then
21026   if test -s conftest.err; then
21027     ac_cpp_err=$ac_c_preproc_warn_flag
21028   else
21029     ac_cpp_err=
21030   fi
21031 else
21032   ac_cpp_err=yes
21033 fi
21034 if test -z "$ac_cpp_err"; then
21035   # We can compile using X headers with no special include directory.
21036 ac_x_includes=
21037 else
21038   echo "$as_me: failed program was:" >&5
21039   cat "conftest.$ac_ext" >&5
21040   for ac_dir in $ac_x_header_dirs; do
21041   if test -r "$ac_dir/X11/Intrinsic.h"; then
21042     ac_x_includes=$ac_dir
21043     break
21044   fi
21045 done
21046 fi
21047 rm -f conftest.err "conftest.$ac_ext"
21048 fi # $ac_x_includes = no
21049
21050 if test "$ac_x_libraries" = no; then
21051   # Check for the libraries.
21052   # See if we find them without any special options.
21053   # Don't add to $LIBS permanently.
21054   ac_save_LIBS=$LIBS
21055   LIBS="-lXt $LIBS"
21056   cat >"conftest.$ac_ext" <<_ACEOF
21057 #line 21057 "configure"
21058 #include "confdefs.h"
21059 #include <X11/Intrinsic.h>
21060 int
21061 main (void)
21062 {
21063 XtMalloc (0)
21064   ;
21065   return 0;
21066 }
21067 _ACEOF
21068 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21069 if { (eval echo "$as_me:21069: \"$ac_link\"") >&5
21070   (eval $ac_link) 2>&5
21071   ac_status=$?
21072   echo "$as_me:21072: \$? = $ac_status" >&5
21073   (exit "$ac_status"); } &&
21074          { ac_try='test -s "conftest$ac_exeext"'
21075   { (eval echo "$as_me:21075: \"$ac_try\"") >&5
21076   (eval $ac_try) 2>&5
21077   ac_status=$?
21078   echo "$as_me:21078: \$? = $ac_status" >&5
21079   (exit "$ac_status"); }; }; then
21080   LIBS=$ac_save_LIBS
21081 # We can link X programs with no special library path.
21082 ac_x_libraries=
21083 else
21084   echo "$as_me: failed program was:" >&5
21085 cat "conftest.$ac_ext" >&5
21086 LIBS=$ac_save_LIBS
21087 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
21088 do
21089   # Don't even attempt the hair of trying to link an X program!
21090   for ac_extension in a so sl dylib dll; do
21091     if test -r "$ac_dir/libXt.$ac_extension"; then
21092       ac_x_libraries=$ac_dir
21093       break 2
21094     fi
21095   done
21096 done
21097 fi
21098 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21099 fi # $ac_x_libraries = no
21100
21101 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
21102   # Didn't find X anywhere.  Cache the known absence of X.
21103   ac_cv_have_x="have_x=no"
21104 else
21105   # Record where we found X for the cache.
21106   ac_cv_have_x="have_x=yes \
21107                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
21108 fi
21109 fi
21110
21111   fi
21112   eval "$ac_cv_have_x"
21113 fi # $with_x != no
21114
21115 if test "$have_x" != yes; then
21116   echo "$as_me:21116: result: $have_x" >&5
21117 echo "${ECHO_T}$have_x" >&6
21118   no_x=yes
21119 else
21120   # If each of the values was on the command line, it overrides each guess.
21121   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
21122   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
21123   # Update the cache value to reflect the command line values.
21124   ac_cv_have_x="have_x=yes \
21125                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
21126   echo "$as_me:21126: result: libraries $x_libraries, headers $x_includes" >&5
21127 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
21128 fi
21129
21130         if test "$no_x" = yes; then
21131   # Not all programs may use this symbol, but it does not hurt to define it.
21132
21133 cat >>confdefs.h <<\EOF
21134 #define X_DISPLAY_MISSING 1
21135 EOF
21136
21137   X_CFLAGS=
21138   X_PRE_LIBS=
21139   X_LIBS=
21140   X_EXTRA_LIBS=
21141 else
21142   if test -n "$x_includes"; then
21143     X_CFLAGS="$X_CFLAGS -I$x_includes"
21144   fi
21145
21146   # It would also be nice to do this for all -L options, not just this one.
21147   if test -n "$x_libraries"; then
21148     X_LIBS="$X_LIBS -L$x_libraries"
21149     # For Solaris; some versions of Sun CC require a space after -R and
21150     # others require no space.  Words are not sufficient . . . .
21151     case `(uname -sr) 2>/dev/null` in
21152     "SunOS 5"*)
21153       echo "$as_me:21153: checking whether -R must be followed by a space" >&5
21154 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
21155       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
21156       cat >"conftest.$ac_ext" <<_ACEOF
21157 #line 21157 "configure"
21158 #include "confdefs.h"
21159
21160 int
21161 main (void)
21162 {
21163
21164   ;
21165   return 0;
21166 }
21167 _ACEOF
21168 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21169 if { (eval echo "$as_me:21169: \"$ac_link\"") >&5
21170   (eval $ac_link) 2>&5
21171   ac_status=$?
21172   echo "$as_me:21172: \$? = $ac_status" >&5
21173   (exit "$ac_status"); } &&
21174          { ac_try='test -s "conftest$ac_exeext"'
21175   { (eval echo "$as_me:21175: \"$ac_try\"") >&5
21176   (eval $ac_try) 2>&5
21177   ac_status=$?
21178   echo "$as_me:21178: \$? = $ac_status" >&5
21179   (exit "$ac_status"); }; }; then
21180   ac_R_nospace=yes
21181 else
21182   echo "$as_me: failed program was:" >&5
21183 cat "conftest.$ac_ext" >&5
21184 ac_R_nospace=no
21185 fi
21186 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21187       if test $ac_R_nospace = yes; then
21188         echo "$as_me:21188: result: no" >&5
21189 echo "${ECHO_T}no" >&6
21190         X_LIBS="$X_LIBS -R$x_libraries"
21191       else
21192         LIBS="$ac_xsave_LIBS -R $x_libraries"
21193         cat >"conftest.$ac_ext" <<_ACEOF
21194 #line 21194 "configure"
21195 #include "confdefs.h"
21196
21197 int
21198 main (void)
21199 {
21200
21201   ;
21202   return 0;
21203 }
21204 _ACEOF
21205 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21206 if { (eval echo "$as_me:21206: \"$ac_link\"") >&5
21207   (eval $ac_link) 2>&5
21208   ac_status=$?
21209   echo "$as_me:21209: \$? = $ac_status" >&5
21210   (exit "$ac_status"); } &&
21211          { ac_try='test -s "conftest$ac_exeext"'
21212   { (eval echo "$as_me:21212: \"$ac_try\"") >&5
21213   (eval $ac_try) 2>&5
21214   ac_status=$?
21215   echo "$as_me:21215: \$? = $ac_status" >&5
21216   (exit "$ac_status"); }; }; then
21217   ac_R_space=yes
21218 else
21219   echo "$as_me: failed program was:" >&5
21220 cat "conftest.$ac_ext" >&5
21221 ac_R_space=no
21222 fi
21223 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21224         if test $ac_R_space = yes; then
21225           echo "$as_me:21225: result: yes" >&5
21226 echo "${ECHO_T}yes" >&6
21227           X_LIBS="$X_LIBS -R $x_libraries"
21228         else
21229           echo "$as_me:21229: result: neither works" >&5
21230 echo "${ECHO_T}neither works" >&6
21231         fi
21232       fi
21233       LIBS=$ac_xsave_LIBS
21234     esac
21235   fi
21236
21237   # Check for system-dependent libraries X programs must link with.
21238   # Do this before checking for the system-independent R6 libraries
21239   # (-lICE), since we may need -lsocket or whatever for X linking.
21240
21241   if test "$ISC" = yes; then
21242     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
21243   else
21244     # Martyn Johnson says this is needed for Ultrix, if the X
21245     # libraries were built with DECnet support.  And Karl Berry says
21246     # the Alpha needs dnet_stub (dnet does not exist).
21247     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
21248     cat >"conftest.$ac_ext" <<_ACEOF
21249 #line 21249 "configure"
21250 #include "confdefs.h"
21251
21252 /* Override any gcc2 internal prototype to avoid an error.  */
21253 #ifdef __cplusplus
21254 extern "C"
21255 #endif
21256 /* We use char because int might match the return type of a gcc2
21257    builtin and then its argument prototype would still apply.  */
21258 char XOpenDisplay ();
21259 int
21260 main (void)
21261 {
21262 XOpenDisplay ();
21263   ;
21264   return 0;
21265 }
21266 _ACEOF
21267 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21268 if { (eval echo "$as_me:21268: \"$ac_link\"") >&5
21269   (eval $ac_link) 2>&5
21270   ac_status=$?
21271   echo "$as_me:21271: \$? = $ac_status" >&5
21272   (exit "$ac_status"); } &&
21273          { ac_try='test -s "conftest$ac_exeext"'
21274   { (eval echo "$as_me:21274: \"$ac_try\"") >&5
21275   (eval $ac_try) 2>&5
21276   ac_status=$?
21277   echo "$as_me:21277: \$? = $ac_status" >&5
21278   (exit "$ac_status"); }; }; then
21279   :
21280 else
21281   echo "$as_me: failed program was:" >&5
21282 cat "conftest.$ac_ext" >&5
21283 echo "$as_me:21283: checking for dnet_ntoa in -ldnet" >&5
21284 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
21285 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
21286   echo $ECHO_N "(cached) $ECHO_C" >&6
21287 else
21288   ac_check_lib_save_LIBS=$LIBS
21289 LIBS="-ldnet  $LIBS"
21290 cat >"conftest.$ac_ext" <<_ACEOF
21291 #line 21291 "configure"
21292 #include "confdefs.h"
21293
21294 /* Override any gcc2 internal prototype to avoid an error.  */
21295 #ifdef __cplusplus
21296 extern "C"
21297 #endif
21298 /* We use char because int might match the return type of a gcc2
21299    builtin and then its argument prototype would still apply.  */
21300 char dnet_ntoa ();
21301 int
21302 main (void)
21303 {
21304 dnet_ntoa ();
21305   ;
21306   return 0;
21307 }
21308 _ACEOF
21309 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21310 if { (eval echo "$as_me:21310: \"$ac_link\"") >&5
21311   (eval $ac_link) 2>&5
21312   ac_status=$?
21313   echo "$as_me:21313: \$? = $ac_status" >&5
21314   (exit "$ac_status"); } &&
21315          { ac_try='test -s "conftest$ac_exeext"'
21316   { (eval echo "$as_me:21316: \"$ac_try\"") >&5
21317   (eval $ac_try) 2>&5
21318   ac_status=$?
21319   echo "$as_me:21319: \$? = $ac_status" >&5
21320   (exit "$ac_status"); }; }; then
21321   ac_cv_lib_dnet_dnet_ntoa=yes
21322 else
21323   echo "$as_me: failed program was:" >&5
21324 cat "conftest.$ac_ext" >&5
21325 ac_cv_lib_dnet_dnet_ntoa=no
21326 fi
21327 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21328 LIBS=$ac_check_lib_save_LIBS
21329 fi
21330 echo "$as_me:21330: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
21331 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
21332 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
21333   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
21334 fi
21335
21336     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
21337       echo "$as_me:21337: checking for dnet_ntoa in -ldnet_stub" >&5
21338 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
21339 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
21340   echo $ECHO_N "(cached) $ECHO_C" >&6
21341 else
21342   ac_check_lib_save_LIBS=$LIBS
21343 LIBS="-ldnet_stub  $LIBS"
21344 cat >"conftest.$ac_ext" <<_ACEOF
21345 #line 21345 "configure"
21346 #include "confdefs.h"
21347
21348 /* Override any gcc2 internal prototype to avoid an error.  */
21349 #ifdef __cplusplus
21350 extern "C"
21351 #endif
21352 /* We use char because int might match the return type of a gcc2
21353    builtin and then its argument prototype would still apply.  */
21354 char dnet_ntoa ();
21355 int
21356 main (void)
21357 {
21358 dnet_ntoa ();
21359   ;
21360   return 0;
21361 }
21362 _ACEOF
21363 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21364 if { (eval echo "$as_me:21364: \"$ac_link\"") >&5
21365   (eval $ac_link) 2>&5
21366   ac_status=$?
21367   echo "$as_me:21367: \$? = $ac_status" >&5
21368   (exit "$ac_status"); } &&
21369          { ac_try='test -s "conftest$ac_exeext"'
21370   { (eval echo "$as_me:21370: \"$ac_try\"") >&5
21371   (eval $ac_try) 2>&5
21372   ac_status=$?
21373   echo "$as_me:21373: \$? = $ac_status" >&5
21374   (exit "$ac_status"); }; }; then
21375   ac_cv_lib_dnet_stub_dnet_ntoa=yes
21376 else
21377   echo "$as_me: failed program was:" >&5
21378 cat "conftest.$ac_ext" >&5
21379 ac_cv_lib_dnet_stub_dnet_ntoa=no
21380 fi
21381 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21382 LIBS=$ac_check_lib_save_LIBS
21383 fi
21384 echo "$as_me:21384: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
21385 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
21386 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
21387   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
21388 fi
21389
21390     fi
21391 fi
21392 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21393     LIBS="$ac_xsave_LIBS"
21394
21395     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
21396     # to get the SysV transport functions.
21397     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
21398     # needs -lnsl.
21399     # The nsl library prevents programs from opening the X display
21400     # on Irix 5.2, according to T.E. Dickey.
21401     # The functions gethostbyname, getservbyname, and inet_addr are
21402     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
21403     echo "$as_me:21403: checking for gethostbyname" >&5
21404 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
21405 if test "${ac_cv_func_gethostbyname+set}" = set; then
21406   echo $ECHO_N "(cached) $ECHO_C" >&6
21407 else
21408   cat >"conftest.$ac_ext" <<_ACEOF
21409 #line 21409 "configure"
21410 #include "confdefs.h"
21411 #define gethostbyname autoconf_temporary
21412 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21413 #undef gethostbyname
21414
21415 #ifdef __cplusplus
21416 extern "C"
21417 #endif
21418
21419 /* We use char because int might match the return type of a gcc2
21420    builtin and then its argument prototype would still apply.  */
21421 char gethostbyname (void);
21422
21423 int
21424 main (void)
21425 {
21426
21427 /* The GNU C library defines stubs for functions which it implements
21428     to always fail with ENOSYS.  Some functions are actually named
21429     something starting with __ and the normal name is an alias.  */
21430 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
21431 #error found stub for gethostbyname
21432 #endif
21433
21434         return gethostbyname ();
21435   ;
21436   return 0;
21437 }
21438 _ACEOF
21439 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21440 if { (eval echo "$as_me:21440: \"$ac_link\"") >&5
21441   (eval $ac_link) 2>&5
21442   ac_status=$?
21443   echo "$as_me:21443: \$? = $ac_status" >&5
21444   (exit "$ac_status"); } &&
21445          { ac_try='test -s "conftest$ac_exeext"'
21446   { (eval echo "$as_me:21446: \"$ac_try\"") >&5
21447   (eval $ac_try) 2>&5
21448   ac_status=$?
21449   echo "$as_me:21449: \$? = $ac_status" >&5
21450   (exit "$ac_status"); }; }; then
21451   ac_cv_func_gethostbyname=yes
21452 else
21453   echo "$as_me: failed program was:" >&5
21454 cat "conftest.$ac_ext" >&5
21455 ac_cv_func_gethostbyname=no
21456 fi
21457 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21458 fi
21459 echo "$as_me:21459: result: $ac_cv_func_gethostbyname" >&5
21460 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
21461
21462     if test $ac_cv_func_gethostbyname = no; then
21463       echo "$as_me:21463: checking for gethostbyname in -lnsl" >&5
21464 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
21465 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
21466   echo $ECHO_N "(cached) $ECHO_C" >&6
21467 else
21468   ac_check_lib_save_LIBS=$LIBS
21469 LIBS="-lnsl  $LIBS"
21470 cat >"conftest.$ac_ext" <<_ACEOF
21471 #line 21471 "configure"
21472 #include "confdefs.h"
21473
21474 /* Override any gcc2 internal prototype to avoid an error.  */
21475 #ifdef __cplusplus
21476 extern "C"
21477 #endif
21478 /* We use char because int might match the return type of a gcc2
21479    builtin and then its argument prototype would still apply.  */
21480 char gethostbyname ();
21481 int
21482 main (void)
21483 {
21484 gethostbyname ();
21485   ;
21486   return 0;
21487 }
21488 _ACEOF
21489 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21490 if { (eval echo "$as_me:21490: \"$ac_link\"") >&5
21491   (eval $ac_link) 2>&5
21492   ac_status=$?
21493   echo "$as_me:21493: \$? = $ac_status" >&5
21494   (exit "$ac_status"); } &&
21495          { ac_try='test -s "conftest$ac_exeext"'
21496   { (eval echo "$as_me:21496: \"$ac_try\"") >&5
21497   (eval $ac_try) 2>&5
21498   ac_status=$?
21499   echo "$as_me:21499: \$? = $ac_status" >&5
21500   (exit "$ac_status"); }; }; then
21501   ac_cv_lib_nsl_gethostbyname=yes
21502 else
21503   echo "$as_me: failed program was:" >&5
21504 cat "conftest.$ac_ext" >&5
21505 ac_cv_lib_nsl_gethostbyname=no
21506 fi
21507 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21508 LIBS=$ac_check_lib_save_LIBS
21509 fi
21510 echo "$as_me:21510: result: $ac_cv_lib_nsl_gethostbyname" >&5
21511 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
21512 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
21513   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
21514 fi
21515
21516       if test $ac_cv_lib_nsl_gethostbyname = no; then
21517         echo "$as_me:21517: checking for gethostbyname in -lbsd" >&5
21518 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
21519 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
21520   echo $ECHO_N "(cached) $ECHO_C" >&6
21521 else
21522   ac_check_lib_save_LIBS=$LIBS
21523 LIBS="-lbsd  $LIBS"
21524 cat >"conftest.$ac_ext" <<_ACEOF
21525 #line 21525 "configure"
21526 #include "confdefs.h"
21527
21528 /* Override any gcc2 internal prototype to avoid an error.  */
21529 #ifdef __cplusplus
21530 extern "C"
21531 #endif
21532 /* We use char because int might match the return type of a gcc2
21533    builtin and then its argument prototype would still apply.  */
21534 char gethostbyname ();
21535 int
21536 main (void)
21537 {
21538 gethostbyname ();
21539   ;
21540   return 0;
21541 }
21542 _ACEOF
21543 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21544 if { (eval echo "$as_me:21544: \"$ac_link\"") >&5
21545   (eval $ac_link) 2>&5
21546   ac_status=$?
21547   echo "$as_me:21547: \$? = $ac_status" >&5
21548   (exit "$ac_status"); } &&
21549          { ac_try='test -s "conftest$ac_exeext"'
21550   { (eval echo "$as_me:21550: \"$ac_try\"") >&5
21551   (eval $ac_try) 2>&5
21552   ac_status=$?
21553   echo "$as_me:21553: \$? = $ac_status" >&5
21554   (exit "$ac_status"); }; }; then
21555   ac_cv_lib_bsd_gethostbyname=yes
21556 else
21557   echo "$as_me: failed program was:" >&5
21558 cat "conftest.$ac_ext" >&5
21559 ac_cv_lib_bsd_gethostbyname=no
21560 fi
21561 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21562 LIBS=$ac_check_lib_save_LIBS
21563 fi
21564 echo "$as_me:21564: result: $ac_cv_lib_bsd_gethostbyname" >&5
21565 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21566 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21567   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21568 fi
21569
21570       fi
21571     fi
21572
21573     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21574     # socket/setsockopt and other routines are undefined under SCO ODT
21575     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21576     # on later versions), says Simon Leinen: it contains gethostby*
21577     # variants that don't use the nameserver (or something).  -lsocket
21578     # must be given before -lnsl if both are needed.  We assume that
21579     # if connect needs -lnsl, so does gethostbyname.
21580     echo "$as_me:21580: checking for connect" >&5
21581 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21582 if test "${ac_cv_func_connect+set}" = set; then
21583   echo $ECHO_N "(cached) $ECHO_C" >&6
21584 else
21585   cat >"conftest.$ac_ext" <<_ACEOF
21586 #line 21586 "configure"
21587 #include "confdefs.h"
21588 #define connect autoconf_temporary
21589 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21590 #undef connect
21591
21592 #ifdef __cplusplus
21593 extern "C"
21594 #endif
21595
21596 /* We use char because int might match the return type of a gcc2
21597    builtin and then its argument prototype would still apply.  */
21598 char connect (void);
21599
21600 int
21601 main (void)
21602 {
21603
21604 /* The GNU C library defines stubs for functions which it implements
21605     to always fail with ENOSYS.  Some functions are actually named
21606     something starting with __ and the normal name is an alias.  */
21607 #if defined (__stub_connect) || defined (__stub___connect)
21608 #error found stub for connect
21609 #endif
21610
21611         return connect ();
21612   ;
21613   return 0;
21614 }
21615 _ACEOF
21616 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21617 if { (eval echo "$as_me:21617: \"$ac_link\"") >&5
21618   (eval $ac_link) 2>&5
21619   ac_status=$?
21620   echo "$as_me:21620: \$? = $ac_status" >&5
21621   (exit "$ac_status"); } &&
21622          { ac_try='test -s "conftest$ac_exeext"'
21623   { (eval echo "$as_me:21623: \"$ac_try\"") >&5
21624   (eval $ac_try) 2>&5
21625   ac_status=$?
21626   echo "$as_me:21626: \$? = $ac_status" >&5
21627   (exit "$ac_status"); }; }; then
21628   ac_cv_func_connect=yes
21629 else
21630   echo "$as_me: failed program was:" >&5
21631 cat "conftest.$ac_ext" >&5
21632 ac_cv_func_connect=no
21633 fi
21634 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21635 fi
21636 echo "$as_me:21636: result: $ac_cv_func_connect" >&5
21637 echo "${ECHO_T}$ac_cv_func_connect" >&6
21638
21639     if test $ac_cv_func_connect = no; then
21640       echo "$as_me:21640: checking for connect in -lsocket" >&5
21641 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21642 if test "${ac_cv_lib_socket_connect+set}" = set; then
21643   echo $ECHO_N "(cached) $ECHO_C" >&6
21644 else
21645   ac_check_lib_save_LIBS=$LIBS
21646 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21647 cat >"conftest.$ac_ext" <<_ACEOF
21648 #line 21648 "configure"
21649 #include "confdefs.h"
21650
21651 /* Override any gcc2 internal prototype to avoid an error.  */
21652 #ifdef __cplusplus
21653 extern "C"
21654 #endif
21655 /* We use char because int might match the return type of a gcc2
21656    builtin and then its argument prototype would still apply.  */
21657 char connect ();
21658 int
21659 main (void)
21660 {
21661 connect ();
21662   ;
21663   return 0;
21664 }
21665 _ACEOF
21666 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21667 if { (eval echo "$as_me:21667: \"$ac_link\"") >&5
21668   (eval $ac_link) 2>&5
21669   ac_status=$?
21670   echo "$as_me:21670: \$? = $ac_status" >&5
21671   (exit "$ac_status"); } &&
21672          { ac_try='test -s "conftest$ac_exeext"'
21673   { (eval echo "$as_me:21673: \"$ac_try\"") >&5
21674   (eval $ac_try) 2>&5
21675   ac_status=$?
21676   echo "$as_me:21676: \$? = $ac_status" >&5
21677   (exit "$ac_status"); }; }; then
21678   ac_cv_lib_socket_connect=yes
21679 else
21680   echo "$as_me: failed program was:" >&5
21681 cat "conftest.$ac_ext" >&5
21682 ac_cv_lib_socket_connect=no
21683 fi
21684 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21685 LIBS=$ac_check_lib_save_LIBS
21686 fi
21687 echo "$as_me:21687: result: $ac_cv_lib_socket_connect" >&5
21688 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21689 if test "$ac_cv_lib_socket_connect" = yes; then
21690   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21691 fi
21692
21693     fi
21694
21695     # Guillermo Gomez says -lposix is necessary on A/UX.
21696     echo "$as_me:21696: checking for remove" >&5
21697 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21698 if test "${ac_cv_func_remove+set}" = set; then
21699   echo $ECHO_N "(cached) $ECHO_C" >&6
21700 else
21701   cat >"conftest.$ac_ext" <<_ACEOF
21702 #line 21702 "configure"
21703 #include "confdefs.h"
21704 #define remove autoconf_temporary
21705 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21706 #undef remove
21707
21708 #ifdef __cplusplus
21709 extern "C"
21710 #endif
21711
21712 /* We use char because int might match the return type of a gcc2
21713    builtin and then its argument prototype would still apply.  */
21714 char remove (void);
21715
21716 int
21717 main (void)
21718 {
21719
21720 /* The GNU C library defines stubs for functions which it implements
21721     to always fail with ENOSYS.  Some functions are actually named
21722     something starting with __ and the normal name is an alias.  */
21723 #if defined (__stub_remove) || defined (__stub___remove)
21724 #error found stub for remove
21725 #endif
21726
21727         return remove ();
21728   ;
21729   return 0;
21730 }
21731 _ACEOF
21732 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21733 if { (eval echo "$as_me:21733: \"$ac_link\"") >&5
21734   (eval $ac_link) 2>&5
21735   ac_status=$?
21736   echo "$as_me:21736: \$? = $ac_status" >&5
21737   (exit "$ac_status"); } &&
21738          { ac_try='test -s "conftest$ac_exeext"'
21739   { (eval echo "$as_me:21739: \"$ac_try\"") >&5
21740   (eval $ac_try) 2>&5
21741   ac_status=$?
21742   echo "$as_me:21742: \$? = $ac_status" >&5
21743   (exit "$ac_status"); }; }; then
21744   ac_cv_func_remove=yes
21745 else
21746   echo "$as_me: failed program was:" >&5
21747 cat "conftest.$ac_ext" >&5
21748 ac_cv_func_remove=no
21749 fi
21750 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21751 fi
21752 echo "$as_me:21752: result: $ac_cv_func_remove" >&5
21753 echo "${ECHO_T}$ac_cv_func_remove" >&6
21754
21755     if test $ac_cv_func_remove = no; then
21756       echo "$as_me:21756: checking for remove in -lposix" >&5
21757 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21758 if test "${ac_cv_lib_posix_remove+set}" = set; then
21759   echo $ECHO_N "(cached) $ECHO_C" >&6
21760 else
21761   ac_check_lib_save_LIBS=$LIBS
21762 LIBS="-lposix  $LIBS"
21763 cat >"conftest.$ac_ext" <<_ACEOF
21764 #line 21764 "configure"
21765 #include "confdefs.h"
21766
21767 /* Override any gcc2 internal prototype to avoid an error.  */
21768 #ifdef __cplusplus
21769 extern "C"
21770 #endif
21771 /* We use char because int might match the return type of a gcc2
21772    builtin and then its argument prototype would still apply.  */
21773 char remove ();
21774 int
21775 main (void)
21776 {
21777 remove ();
21778   ;
21779   return 0;
21780 }
21781 _ACEOF
21782 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21783 if { (eval echo "$as_me:21783: \"$ac_link\"") >&5
21784   (eval $ac_link) 2>&5
21785   ac_status=$?
21786   echo "$as_me:21786: \$? = $ac_status" >&5
21787   (exit "$ac_status"); } &&
21788          { ac_try='test -s "conftest$ac_exeext"'
21789   { (eval echo "$as_me:21789: \"$ac_try\"") >&5
21790   (eval $ac_try) 2>&5
21791   ac_status=$?
21792   echo "$as_me:21792: \$? = $ac_status" >&5
21793   (exit "$ac_status"); }; }; then
21794   ac_cv_lib_posix_remove=yes
21795 else
21796   echo "$as_me: failed program was:" >&5
21797 cat "conftest.$ac_ext" >&5
21798 ac_cv_lib_posix_remove=no
21799 fi
21800 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21801 LIBS=$ac_check_lib_save_LIBS
21802 fi
21803 echo "$as_me:21803: result: $ac_cv_lib_posix_remove" >&5
21804 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21805 if test "$ac_cv_lib_posix_remove" = yes; then
21806   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21807 fi
21808
21809     fi
21810
21811     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21812     echo "$as_me:21812: checking for shmat" >&5
21813 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21814 if test "${ac_cv_func_shmat+set}" = set; then
21815   echo $ECHO_N "(cached) $ECHO_C" >&6
21816 else
21817   cat >"conftest.$ac_ext" <<_ACEOF
21818 #line 21818 "configure"
21819 #include "confdefs.h"
21820 #define shmat autoconf_temporary
21821 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21822 #undef shmat
21823
21824 #ifdef __cplusplus
21825 extern "C"
21826 #endif
21827
21828 /* We use char because int might match the return type of a gcc2
21829    builtin and then its argument prototype would still apply.  */
21830 char shmat (void);
21831
21832 int
21833 main (void)
21834 {
21835
21836 /* The GNU C library defines stubs for functions which it implements
21837     to always fail with ENOSYS.  Some functions are actually named
21838     something starting with __ and the normal name is an alias.  */
21839 #if defined (__stub_shmat) || defined (__stub___shmat)
21840 #error found stub for shmat
21841 #endif
21842
21843         return shmat ();
21844   ;
21845   return 0;
21846 }
21847 _ACEOF
21848 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21849 if { (eval echo "$as_me:21849: \"$ac_link\"") >&5
21850   (eval $ac_link) 2>&5
21851   ac_status=$?
21852   echo "$as_me:21852: \$? = $ac_status" >&5
21853   (exit "$ac_status"); } &&
21854          { ac_try='test -s "conftest$ac_exeext"'
21855   { (eval echo "$as_me:21855: \"$ac_try\"") >&5
21856   (eval $ac_try) 2>&5
21857   ac_status=$?
21858   echo "$as_me:21858: \$? = $ac_status" >&5
21859   (exit "$ac_status"); }; }; then
21860   ac_cv_func_shmat=yes
21861 else
21862   echo "$as_me: failed program was:" >&5
21863 cat "conftest.$ac_ext" >&5
21864 ac_cv_func_shmat=no
21865 fi
21866 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21867 fi
21868 echo "$as_me:21868: result: $ac_cv_func_shmat" >&5
21869 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21870
21871     if test $ac_cv_func_shmat = no; then
21872       echo "$as_me:21872: checking for shmat in -lipc" >&5
21873 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21874 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21875   echo $ECHO_N "(cached) $ECHO_C" >&6
21876 else
21877   ac_check_lib_save_LIBS=$LIBS
21878 LIBS="-lipc  $LIBS"
21879 cat >"conftest.$ac_ext" <<_ACEOF
21880 #line 21880 "configure"
21881 #include "confdefs.h"
21882
21883 /* Override any gcc2 internal prototype to avoid an error.  */
21884 #ifdef __cplusplus
21885 extern "C"
21886 #endif
21887 /* We use char because int might match the return type of a gcc2
21888    builtin and then its argument prototype would still apply.  */
21889 char shmat ();
21890 int
21891 main (void)
21892 {
21893 shmat ();
21894   ;
21895   return 0;
21896 }
21897 _ACEOF
21898 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21899 if { (eval echo "$as_me:21899: \"$ac_link\"") >&5
21900   (eval $ac_link) 2>&5
21901   ac_status=$?
21902   echo "$as_me:21902: \$? = $ac_status" >&5
21903   (exit "$ac_status"); } &&
21904          { ac_try='test -s "conftest$ac_exeext"'
21905   { (eval echo "$as_me:21905: \"$ac_try\"") >&5
21906   (eval $ac_try) 2>&5
21907   ac_status=$?
21908   echo "$as_me:21908: \$? = $ac_status" >&5
21909   (exit "$ac_status"); }; }; then
21910   ac_cv_lib_ipc_shmat=yes
21911 else
21912   echo "$as_me: failed program was:" >&5
21913 cat "conftest.$ac_ext" >&5
21914 ac_cv_lib_ipc_shmat=no
21915 fi
21916 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21917 LIBS=$ac_check_lib_save_LIBS
21918 fi
21919 echo "$as_me:21919: result: $ac_cv_lib_ipc_shmat" >&5
21920 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21921 if test "$ac_cv_lib_ipc_shmat" = yes; then
21922   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21923 fi
21924
21925     fi
21926   fi
21927
21928   # Check for libraries that X11R6 Xt/Xaw programs need.
21929   ac_save_LDFLAGS=$LDFLAGS
21930   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21931   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21932   # check for ICE first), but we must link in the order -lSM -lICE or
21933   # we get undefined symbols.  So assume we have SM if we have ICE.
21934   # These have to be linked with before -lX11, unlike the other
21935   # libraries we check for below, so use a different variable.
21936   # John Interrante, Karl Berry
21937   echo "$as_me:21937: checking for IceConnectionNumber in -lICE" >&5
21938 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21939 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21940   echo $ECHO_N "(cached) $ECHO_C" >&6
21941 else
21942   ac_check_lib_save_LIBS=$LIBS
21943 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21944 cat >"conftest.$ac_ext" <<_ACEOF
21945 #line 21945 "configure"
21946 #include "confdefs.h"
21947
21948 /* Override any gcc2 internal prototype to avoid an error.  */
21949 #ifdef __cplusplus
21950 extern "C"
21951 #endif
21952 /* We use char because int might match the return type of a gcc2
21953    builtin and then its argument prototype would still apply.  */
21954 char IceConnectionNumber ();
21955 int
21956 main (void)
21957 {
21958 IceConnectionNumber ();
21959   ;
21960   return 0;
21961 }
21962 _ACEOF
21963 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21964 if { (eval echo "$as_me:21964: \"$ac_link\"") >&5
21965   (eval $ac_link) 2>&5
21966   ac_status=$?
21967   echo "$as_me:21967: \$? = $ac_status" >&5
21968   (exit "$ac_status"); } &&
21969          { ac_try='test -s "conftest$ac_exeext"'
21970   { (eval echo "$as_me:21970: \"$ac_try\"") >&5
21971   (eval $ac_try) 2>&5
21972   ac_status=$?
21973   echo "$as_me:21973: \$? = $ac_status" >&5
21974   (exit "$ac_status"); }; }; then
21975   ac_cv_lib_ICE_IceConnectionNumber=yes
21976 else
21977   echo "$as_me: failed program was:" >&5
21978 cat "conftest.$ac_ext" >&5
21979 ac_cv_lib_ICE_IceConnectionNumber=no
21980 fi
21981 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21982 LIBS=$ac_check_lib_save_LIBS
21983 fi
21984 echo "$as_me:21984: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21985 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21986 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21987   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21988 fi
21989
21990   LDFLAGS=$ac_save_LDFLAGS
21991
21992 fi
21993
21994 fi
21995
21996 if test "$GCC" = yes || test "$GXX" = yes
21997 then
21998
21999 if test "$GCC" = yes || test "$GXX" = yes
22000 then
22001         case $CFLAGS in
22002         (*-Werror=*)
22003                 cf_temp_flags=
22004                 for cf_temp_scan in $CFLAGS
22005                 do
22006                         case "x$cf_temp_scan" in
22007                         (x-Werror=format*)
22008
22009         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22010         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22011
22012                                 ;;
22013                         (x-Werror=*)
22014
22015         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22016         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22017
22018                                 ;;
22019                         (*)
22020
22021         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22022         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22023
22024                                 ;;
22025                         esac
22026                 done
22027                 if test "x$CFLAGS" != "x$cf_temp_flags"
22028                 then
22029                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
22030
22031 echo "${as_me:-configure}:22031: testing repairing CFLAGS: $CFLAGS ..." 1>&5
22032
22033                         CFLAGS="$cf_temp_flags"
22034                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
22035
22036 echo "${as_me:-configure}:22036: testing ... fixed $CFLAGS ..." 1>&5
22037
22038                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22039
22040 echo "${as_me:-configure}:22040: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22041
22042                 fi
22043                 ;;
22044         esac
22045 fi
22046
22047 if test "$GCC" = yes || test "$GXX" = yes
22048 then
22049         case $CPPFLAGS in
22050         (*-Werror=*)
22051                 cf_temp_flags=
22052                 for cf_temp_scan in $CPPFLAGS
22053                 do
22054                         case "x$cf_temp_scan" in
22055                         (x-Werror=format*)
22056
22057         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22058         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22059
22060                                 ;;
22061                         (x-Werror=*)
22062
22063         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22064         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22065
22066                                 ;;
22067                         (*)
22068
22069         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22070         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22071
22072                                 ;;
22073                         esac
22074                 done
22075                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
22076                 then
22077                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
22078
22079 echo "${as_me:-configure}:22079: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
22080
22081                         CPPFLAGS="$cf_temp_flags"
22082                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
22083
22084 echo "${as_me:-configure}:22084: testing ... fixed $CPPFLAGS ..." 1>&5
22085
22086                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22087
22088 echo "${as_me:-configure}:22088: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22089
22090                 fi
22091                 ;;
22092         esac
22093 fi
22094
22095 if test "$GCC" = yes || test "$GXX" = yes
22096 then
22097         case $LDFLAGS in
22098         (*-Werror=*)
22099                 cf_temp_flags=
22100                 for cf_temp_scan in $LDFLAGS
22101                 do
22102                         case "x$cf_temp_scan" in
22103                         (x-Werror=format*)
22104
22105         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22106         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22107
22108                                 ;;
22109                         (x-Werror=*)
22110
22111         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
22112         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
22113
22114                                 ;;
22115                         (*)
22116
22117         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
22118         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
22119
22120                                 ;;
22121                         esac
22122                 done
22123                 if test "x$LDFLAGS" != "x$cf_temp_flags"
22124                 then
22125                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
22126
22127 echo "${as_me:-configure}:22127: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
22128
22129                         LDFLAGS="$cf_temp_flags"
22130                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
22131
22132 echo "${as_me:-configure}:22132: testing ... fixed $LDFLAGS ..." 1>&5
22133
22134                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
22135
22136 echo "${as_me:-configure}:22136: testing ... extra $EXTRA_CFLAGS ..." 1>&5
22137
22138                 fi
22139                 ;;
22140         esac
22141 fi
22142
22143 echo "$as_me:22143: checking if you want to turn on gcc warnings" >&5
22144 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
22145
22146 # Check whether --enable-warnings or --disable-warnings was given.
22147 if test "${enable_warnings+set}" = set; then
22148   enableval="$enable_warnings"
22149   test "$enableval" != yes && enableval=no
22150         if test "$enableval" != "no" ; then
22151     enable_warnings=yes
22152         else
22153                 enable_warnings=no
22154         fi
22155 else
22156   enableval=no
22157         enable_warnings=no
22158
22159 fi;
22160 echo "$as_me:22160: result: $enable_warnings" >&5
22161 echo "${ECHO_T}$enable_warnings" >&6
22162 if test "$enable_warnings" = "yes"
22163 then
22164
22165 if test "$GCC" = yes || test "$GXX" = yes
22166 then
22167 cat > conftest.i <<EOF
22168 #ifndef GCC_PRINTF
22169 #define GCC_PRINTF 0
22170 #endif
22171 #ifndef GCC_SCANF
22172 #define GCC_SCANF 0
22173 #endif
22174 #ifndef GCC_NORETURN
22175 #define GCC_NORETURN /* nothing */
22176 #endif
22177 #ifndef GCC_UNUSED
22178 #define GCC_UNUSED /* nothing */
22179 #endif
22180 EOF
22181 if test "$GCC" = yes
22182 then
22183         { echo "$as_me:22183: checking for $CC __attribute__ directives..." >&5
22184 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
22185 cat > "conftest.$ac_ext" <<EOF
22186 #line 22186 "${as_me:-configure}"
22187 #include <stdio.h>
22188 #include "confdefs.h"
22189 #include "conftest.h"
22190 #include "conftest.i"
22191 #if     GCC_PRINTF
22192 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
22193 #else
22194 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
22195 #endif
22196 #if     GCC_SCANF
22197 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
22198 #else
22199 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
22200 #endif
22201 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
22202 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
22203 extern GCC_NORETURN void foo(void);
22204 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
22205 EOF
22206         cf_printf_attribute=no
22207         cf_scanf_attribute=no
22208         for cf_attribute in scanf printf unused noreturn
22209         do
22210
22211 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
22212
22213                 cf_directive="__attribute__(($cf_attribute))"
22214                 echo "checking for $CC $cf_directive" 1>&5
22215
22216                 case "$cf_attribute" in
22217                 (printf)
22218                         cf_printf_attribute=yes
22219                         cat >conftest.h <<EOF
22220 #define GCC_$cf_ATTRIBUTE 1
22221 EOF
22222                         ;;
22223                 (scanf)
22224                         cf_scanf_attribute=yes
22225                         cat >conftest.h <<EOF
22226 #define GCC_$cf_ATTRIBUTE 1
22227 EOF
22228                         ;;
22229                 (*)
22230                         cat >conftest.h <<EOF
22231 #define GCC_$cf_ATTRIBUTE $cf_directive
22232 EOF
22233                         ;;
22234                 esac
22235
22236                 if { (eval echo "$as_me:22236: \"$ac_compile\"") >&5
22237   (eval $ac_compile) 2>&5
22238   ac_status=$?
22239   echo "$as_me:22239: \$? = $ac_status" >&5
22240   (exit "$ac_status"); }; then
22241                         test -n "$verbose" && echo "$as_me:22241: result: ... $cf_attribute" >&5
22242 echo "${ECHO_T}... $cf_attribute" >&6
22243                         cat conftest.h >>confdefs.h
22244                         case "$cf_attribute" in
22245                         (noreturn)
22246
22247 cat >>confdefs.h <<EOF
22248 #define GCC_NORETURN $cf_directive
22249 EOF
22250
22251                                 ;;
22252                         (printf)
22253                                 cf_value='/* nothing */'
22254                                 if test "$cf_printf_attribute" != no ; then
22255                                         cf_value='__attribute__((format(printf,fmt,var)))'
22256
22257 cat >>confdefs.h <<\EOF
22258 #define GCC_PRINTF 1
22259 EOF
22260
22261                                 fi
22262
22263 cat >>confdefs.h <<EOF
22264 #define GCC_PRINTFLIKE(fmt,var) $cf_value
22265 EOF
22266
22267                                 ;;
22268                         (scanf)
22269                                 cf_value='/* nothing */'
22270                                 if test "$cf_scanf_attribute" != no ; then
22271                                         cf_value='__attribute__((format(scanf,fmt,var)))'
22272
22273 cat >>confdefs.h <<\EOF
22274 #define GCC_SCANF 1
22275 EOF
22276
22277                                 fi
22278
22279 cat >>confdefs.h <<EOF
22280 #define GCC_SCANFLIKE(fmt,var) $cf_value
22281 EOF
22282
22283                                 ;;
22284                         (unused)
22285
22286 cat >>confdefs.h <<EOF
22287 #define GCC_UNUSED $cf_directive
22288 EOF
22289
22290                                 ;;
22291                         esac
22292                 fi
22293         done
22294 else
22295         ${FGREP-fgrep} define conftest.i >>confdefs.h
22296 fi
22297 rm -rf ./conftest*
22298 fi
22299
22300 if test "x$have_x" = xyes; then
22301
22302 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
22303 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
22304 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
22305 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
22306 for cf_X_CFLAGS in $X_CFLAGS
22307 do
22308         case "x$cf_X_CFLAGS" in
22309         x-[IUD]*)
22310                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
22311                 ;;
22312         *)
22313                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
22314                 ;;
22315         esac
22316 done
22317
22318 cat >"conftest.$ac_ext" <<_ACEOF
22319 #line 22319 "configure"
22320 #include "confdefs.h"
22321
22322 #include <stdlib.h>
22323 #include <X11/Intrinsic.h>
22324
22325 int
22326 main (void)
22327 {
22328 String foo = malloc(1); free((void*)foo)
22329   ;
22330   return 0;
22331 }
22332 _ACEOF
22333 rm -f "conftest.$ac_objext"
22334 if { (eval echo "$as_me:22334: \"$ac_compile\"") >&5
22335   (eval $ac_compile) 2>&5
22336   ac_status=$?
22337   echo "$as_me:22337: \$? = $ac_status" >&5
22338   (exit "$ac_status"); } &&
22339          { ac_try='test -s "conftest.$ac_objext"'
22340   { (eval echo "$as_me:22340: \"$ac_try\"") >&5
22341   (eval $ac_try) 2>&5
22342   ac_status=$?
22343   echo "$as_me:22343: \$? = $ac_status" >&5
22344   (exit "$ac_status"); }; }; then
22345
22346 echo "$as_me:22346: checking for X11/Xt const-feature" >&5
22347 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
22348 if test "${cf_cv_const_x_string+set}" = set; then
22349   echo $ECHO_N "(cached) $ECHO_C" >&6
22350 else
22351
22352         cat >"conftest.$ac_ext" <<_ACEOF
22353 #line 22353 "configure"
22354 #include "confdefs.h"
22355
22356 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
22357 #undef  XTSTRINGDEFINES /* X11R5 and later */
22358 #include <stdlib.h>
22359 #include <X11/Intrinsic.h>
22360
22361 int
22362 main (void)
22363 {
22364 String foo = malloc(1); *foo = 0
22365   ;
22366   return 0;
22367 }
22368 _ACEOF
22369 rm -f "conftest.$ac_objext"
22370 if { (eval echo "$as_me:22370: \"$ac_compile\"") >&5
22371   (eval $ac_compile) 2>&5
22372   ac_status=$?
22373   echo "$as_me:22373: \$? = $ac_status" >&5
22374   (exit "$ac_status"); } &&
22375          { ac_try='test -s "conftest.$ac_objext"'
22376   { (eval echo "$as_me:22376: \"$ac_try\"") >&5
22377   (eval $ac_try) 2>&5
22378   ac_status=$?
22379   echo "$as_me:22379: \$? = $ac_status" >&5
22380   (exit "$ac_status"); }; }; then
22381
22382                         cf_cv_const_x_string=no
22383
22384 else
22385   echo "$as_me: failed program was:" >&5
22386 cat "conftest.$ac_ext" >&5
22387
22388                         cf_cv_const_x_string=yes
22389
22390 fi
22391 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22392
22393 fi
22394 echo "$as_me:22394: result: $cf_cv_const_x_string" >&5
22395 echo "${ECHO_T}$cf_cv_const_x_string" >&6
22396
22397 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
22398 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
22399 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
22400
22401 case "$cf_cv_const_x_string" in
22402 (no)
22403
22404         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22405         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
22406
22407         ;;
22408 (*)
22409
22410         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22411         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
22412
22413         ;;
22414 esac
22415
22416 else
22417   echo "$as_me: failed program was:" >&5
22418 cat "conftest.$ac_ext" >&5
22419 fi
22420 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
22421  fi
22422 cat > "conftest.$ac_ext" <<EOF
22423 #line 22423 "${as_me:-configure}"
22424 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
22425 EOF
22426 if test "$INTEL_COMPILER" = yes
22427 then
22428 # The "-wdXXX" options suppress warnings:
22429 # remark #1419: external declaration in primary source file
22430 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
22431 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
22432 # remark #193: zero used for undefined preprocessing identifier
22433 # remark #593: variable "curs_sb_left_arrow" was set but never used
22434 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
22435 # remark #869: parameter "tw" was never referenced
22436 # remark #981: operands are evaluated in unspecified order
22437 # warning #279: controlling expression is constant
22438
22439         { echo "$as_me:22439: checking for $CC warning options..." >&5
22440 echo "$as_me: checking for $CC warning options..." >&6;}
22441         cf_save_CFLAGS="$CFLAGS"
22442         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
22443         for cf_opt in \
22444                 wd1419 \
22445                 wd1683 \
22446                 wd1684 \
22447                 wd193 \
22448                 wd593 \
22449                 wd279 \
22450                 wd810 \
22451                 wd869 \
22452                 wd981
22453         do
22454                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22455                 if { (eval echo "$as_me:22455: \"$ac_compile\"") >&5
22456   (eval $ac_compile) 2>&5
22457   ac_status=$?
22458   echo "$as_me:22458: \$? = $ac_status" >&5
22459   (exit "$ac_status"); }; then
22460                         test -n "$verbose" && echo "$as_me:22460: result: ... -$cf_opt" >&5
22461 echo "${ECHO_T}... -$cf_opt" >&6
22462                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22463                 fi
22464         done
22465         CFLAGS="$cf_save_CFLAGS"
22466 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
22467 then
22468         { echo "$as_me:22468: checking for $CC warning options..." >&5
22469 echo "$as_me: checking for $CC warning options..." >&6;}
22470         cf_save_CFLAGS="$CFLAGS"
22471         cf_warn_CONST=""
22472         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
22473         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
22474         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
22475         for cf_opt in W Wall \
22476                 Wbad-function-cast \
22477                 Wcast-align \
22478                 Wcast-qual \
22479                 Wdeclaration-after-statement \
22480                 Wextra \
22481                 Winline \
22482                 Wmissing-declarations \
22483                 Wmissing-prototypes \
22484                 Wnested-externs \
22485                 Wpointer-arith \
22486                 Wshadow \
22487                 Wstrict-prototypes \
22488                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
22489         do
22490                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
22491                 if { (eval echo "$as_me:22491: \"$ac_compile\"") >&5
22492   (eval $ac_compile) 2>&5
22493   ac_status=$?
22494   echo "$as_me:22494: \$? = $ac_status" >&5
22495   (exit "$ac_status"); }; then
22496                         test -n "$verbose" && echo "$as_me:22496: result: ... -$cf_opt" >&5
22497 echo "${ECHO_T}... -$cf_opt" >&6
22498                         case "$cf_opt" in
22499                         (Winline)
22500                                 case "$GCC_VERSION" in
22501                                 ([34].*)
22502                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22503
22504 echo "${as_me:-configure}:22504: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22505
22506                                         continue;;
22507                                 esac
22508                                 ;;
22509                         (Wpointer-arith)
22510                                 case "$GCC_VERSION" in
22511                                 ([12].*)
22512                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
22513
22514 echo "${as_me:-configure}:22514: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
22515
22516                                         continue;;
22517                                 esac
22518                                 ;;
22519                         esac
22520                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
22521                 fi
22522         done
22523         CFLAGS="$cf_save_CFLAGS"
22524 fi
22525 rm -rf ./conftest*
22526
22527 fi
22528
22529 fi
22530
22531 echo "$as_me:22531: checking if you want to use dmalloc for testing" >&5
22532 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
22533
22534 # Check whether --with-dmalloc or --without-dmalloc was given.
22535 if test "${with_dmalloc+set}" = set; then
22536   withval="$with_dmalloc"
22537   case "x$withval" in
22538         (x|xno) ;;
22539         (*)
22540                 : "${with_cflags:=-g}"
22541                 : "${enable_leaks:=no}"
22542                 with_dmalloc=yes
22543
22544 cat >>confdefs.h <<EOF
22545 #define USE_DMALLOC 1
22546 EOF
22547
22548                 ;;
22549         esac
22550 else
22551   with_dmalloc=
22552 fi;
22553 echo "$as_me:22553: result: ${with_dmalloc:-no}" >&5
22554 echo "${ECHO_T}${with_dmalloc:-no}" >&6
22555
22556 case ".$with_cflags" in
22557 (.*-g*)
22558         case .$CFLAGS in
22559         (.*-g*)
22560                 ;;
22561         (*)
22562
22563 cf_fix_cppflags=no
22564 cf_new_cflags=
22565 cf_new_cppflags=
22566 cf_new_extra_cppflags=
22567
22568 for cf_add_cflags in -g
22569 do
22570 case "$cf_fix_cppflags" in
22571 (no)
22572         case "$cf_add_cflags" in
22573         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22574                 case "$cf_add_cflags" in
22575                 (-D*)
22576                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22577
22578                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22579                                 && test -z "${cf_tst_cflags}" \
22580                                 && cf_fix_cppflags=yes
22581
22582                         if test "$cf_fix_cppflags" = yes ; then
22583
22584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22586
22587                                 continue
22588                         elif test "${cf_tst_cflags}" = "\"'" ; then
22589
22590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22592
22593                                 continue
22594                         fi
22595                         ;;
22596                 esac
22597                 case "$CPPFLAGS" in
22598                 (*$cf_add_cflags)
22599                         ;;
22600                 (*)
22601                         case "$cf_add_cflags" in
22602                         (-D*)
22603                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22604
22605 CPPFLAGS=`echo "$CPPFLAGS" | \
22606         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22607                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22608
22609                                 ;;
22610                         esac
22611
22612         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22613         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22614
22615                         ;;
22616                 esac
22617                 ;;
22618         (*)
22619
22620         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22621         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22622
22623                 ;;
22624         esac
22625         ;;
22626 (yes)
22627
22628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22630
22631         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22632
22633         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22634                 && test -z "${cf_tst_cflags}" \
22635                 && cf_fix_cppflags=no
22636         ;;
22637 esac
22638 done
22639
22640 if test -n "$cf_new_cflags" ; then
22641
22642         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22643         CFLAGS="${CFLAGS}$cf_new_cflags"
22644
22645 fi
22646
22647 if test -n "$cf_new_cppflags" ; then
22648
22649         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22650         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22651
22652 fi
22653
22654 if test -n "$cf_new_extra_cppflags" ; then
22655
22656         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22657         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22658
22659 fi
22660
22661                 ;;
22662         esac
22663         ;;
22664 esac
22665
22666 if test "$with_dmalloc" = yes ; then
22667         echo "$as_me:22667: checking for dmalloc.h" >&5
22668 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22669 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22670   echo $ECHO_N "(cached) $ECHO_C" >&6
22671 else
22672   cat >"conftest.$ac_ext" <<_ACEOF
22673 #line 22673 "configure"
22674 #include "confdefs.h"
22675 #include <dmalloc.h>
22676 _ACEOF
22677 if { (eval echo "$as_me:22677: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22678   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22679   ac_status=$?
22680   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22681   rm -f conftest.er1
22682   cat conftest.err >&5
22683   echo "$as_me:22683: \$? = $ac_status" >&5
22684   (exit "$ac_status"); } >/dev/null; then
22685   if test -s conftest.err; then
22686     ac_cpp_err=$ac_c_preproc_warn_flag
22687   else
22688     ac_cpp_err=
22689   fi
22690 else
22691   ac_cpp_err=yes
22692 fi
22693 if test -z "$ac_cpp_err"; then
22694   ac_cv_header_dmalloc_h=yes
22695 else
22696   echo "$as_me: failed program was:" >&5
22697   cat "conftest.$ac_ext" >&5
22698   ac_cv_header_dmalloc_h=no
22699 fi
22700 rm -f conftest.err "conftest.$ac_ext"
22701 fi
22702 echo "$as_me:22702: result: $ac_cv_header_dmalloc_h" >&5
22703 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22704 if test "$ac_cv_header_dmalloc_h" = yes; then
22705
22706 echo "$as_me:22706: checking for dmalloc_debug in -ldmalloc" >&5
22707 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22708 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22709   echo $ECHO_N "(cached) $ECHO_C" >&6
22710 else
22711   ac_check_lib_save_LIBS=$LIBS
22712 LIBS="-ldmalloc  $LIBS"
22713 cat >"conftest.$ac_ext" <<_ACEOF
22714 #line 22714 "configure"
22715 #include "confdefs.h"
22716
22717 /* Override any gcc2 internal prototype to avoid an error.  */
22718 #ifdef __cplusplus
22719 extern "C"
22720 #endif
22721 /* We use char because int might match the return type of a gcc2
22722    builtin and then its argument prototype would still apply.  */
22723 char dmalloc_debug ();
22724 int
22725 main (void)
22726 {
22727 dmalloc_debug ();
22728   ;
22729   return 0;
22730 }
22731 _ACEOF
22732 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22733 if { (eval echo "$as_me:22733: \"$ac_link\"") >&5
22734   (eval $ac_link) 2>&5
22735   ac_status=$?
22736   echo "$as_me:22736: \$? = $ac_status" >&5
22737   (exit "$ac_status"); } &&
22738          { ac_try='test -s "conftest$ac_exeext"'
22739   { (eval echo "$as_me:22739: \"$ac_try\"") >&5
22740   (eval $ac_try) 2>&5
22741   ac_status=$?
22742   echo "$as_me:22742: \$? = $ac_status" >&5
22743   (exit "$ac_status"); }; }; then
22744   ac_cv_lib_dmalloc_dmalloc_debug=yes
22745 else
22746   echo "$as_me: failed program was:" >&5
22747 cat "conftest.$ac_ext" >&5
22748 ac_cv_lib_dmalloc_dmalloc_debug=no
22749 fi
22750 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22751 LIBS=$ac_check_lib_save_LIBS
22752 fi
22753 echo "$as_me:22753: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22754 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22755 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22756   cat >>confdefs.h <<EOF
22757 #define HAVE_LIBDMALLOC 1
22758 EOF
22759
22760   LIBS="-ldmalloc $LIBS"
22761
22762 fi
22763
22764 fi
22765
22766 fi
22767
22768 echo "$as_me:22768: checking if you want to use dbmalloc for testing" >&5
22769 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22770
22771 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22772 if test "${with_dbmalloc+set}" = set; then
22773   withval="$with_dbmalloc"
22774   case "x$withval" in
22775         (x|xno) ;;
22776         (*)
22777                 : "${with_cflags:=-g}"
22778                 : "${enable_leaks:=no}"
22779                 with_dbmalloc=yes
22780
22781 cat >>confdefs.h <<EOF
22782 #define USE_DBMALLOC 1
22783 EOF
22784
22785                 ;;
22786         esac
22787 else
22788   with_dbmalloc=
22789 fi;
22790 echo "$as_me:22790: result: ${with_dbmalloc:-no}" >&5
22791 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22792
22793 case ".$with_cflags" in
22794 (.*-g*)
22795         case .$CFLAGS in
22796         (.*-g*)
22797                 ;;
22798         (*)
22799
22800 cf_fix_cppflags=no
22801 cf_new_cflags=
22802 cf_new_cppflags=
22803 cf_new_extra_cppflags=
22804
22805 for cf_add_cflags in -g
22806 do
22807 case "$cf_fix_cppflags" in
22808 (no)
22809         case "$cf_add_cflags" in
22810         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22811                 case "$cf_add_cflags" in
22812                 (-D*)
22813                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22814
22815                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22816                                 && test -z "${cf_tst_cflags}" \
22817                                 && cf_fix_cppflags=yes
22818
22819                         if test "$cf_fix_cppflags" = yes ; then
22820
22821         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22822         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22823
22824                                 continue
22825                         elif test "${cf_tst_cflags}" = "\"'" ; then
22826
22827         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22828         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22829
22830                                 continue
22831                         fi
22832                         ;;
22833                 esac
22834                 case "$CPPFLAGS" in
22835                 (*$cf_add_cflags)
22836                         ;;
22837                 (*)
22838                         case "$cf_add_cflags" in
22839                         (-D*)
22840                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22841
22842 CPPFLAGS=`echo "$CPPFLAGS" | \
22843         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22844                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22845
22846                                 ;;
22847                         esac
22848
22849         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22850         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22851
22852                         ;;
22853                 esac
22854                 ;;
22855         (*)
22856
22857         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22858         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22859
22860                 ;;
22861         esac
22862         ;;
22863 (yes)
22864
22865         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22866         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22867
22868         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22869
22870         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22871                 && test -z "${cf_tst_cflags}" \
22872                 && cf_fix_cppflags=no
22873         ;;
22874 esac
22875 done
22876
22877 if test -n "$cf_new_cflags" ; then
22878
22879         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22880         CFLAGS="${CFLAGS}$cf_new_cflags"
22881
22882 fi
22883
22884 if test -n "$cf_new_cppflags" ; then
22885
22886         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22887         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22888
22889 fi
22890
22891 if test -n "$cf_new_extra_cppflags" ; then
22892
22893         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22894         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22895
22896 fi
22897
22898                 ;;
22899         esac
22900         ;;
22901 esac
22902
22903 if test "$with_dbmalloc" = yes ; then
22904         echo "$as_me:22904: checking for dbmalloc.h" >&5
22905 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22906 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22907   echo $ECHO_N "(cached) $ECHO_C" >&6
22908 else
22909   cat >"conftest.$ac_ext" <<_ACEOF
22910 #line 22910 "configure"
22911 #include "confdefs.h"
22912 #include <dbmalloc.h>
22913 _ACEOF
22914 if { (eval echo "$as_me:22914: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22915   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22916   ac_status=$?
22917   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22918   rm -f conftest.er1
22919   cat conftest.err >&5
22920   echo "$as_me:22920: \$? = $ac_status" >&5
22921   (exit "$ac_status"); } >/dev/null; then
22922   if test -s conftest.err; then
22923     ac_cpp_err=$ac_c_preproc_warn_flag
22924   else
22925     ac_cpp_err=
22926   fi
22927 else
22928   ac_cpp_err=yes
22929 fi
22930 if test -z "$ac_cpp_err"; then
22931   ac_cv_header_dbmalloc_h=yes
22932 else
22933   echo "$as_me: failed program was:" >&5
22934   cat "conftest.$ac_ext" >&5
22935   ac_cv_header_dbmalloc_h=no
22936 fi
22937 rm -f conftest.err "conftest.$ac_ext"
22938 fi
22939 echo "$as_me:22939: result: $ac_cv_header_dbmalloc_h" >&5
22940 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22941 if test "$ac_cv_header_dbmalloc_h" = yes; then
22942
22943 echo "$as_me:22943: checking for debug_malloc in -ldbmalloc" >&5
22944 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22945 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22946   echo $ECHO_N "(cached) $ECHO_C" >&6
22947 else
22948   ac_check_lib_save_LIBS=$LIBS
22949 LIBS="-ldbmalloc  $LIBS"
22950 cat >"conftest.$ac_ext" <<_ACEOF
22951 #line 22951 "configure"
22952 #include "confdefs.h"
22953
22954 /* Override any gcc2 internal prototype to avoid an error.  */
22955 #ifdef __cplusplus
22956 extern "C"
22957 #endif
22958 /* We use char because int might match the return type of a gcc2
22959    builtin and then its argument prototype would still apply.  */
22960 char debug_malloc ();
22961 int
22962 main (void)
22963 {
22964 debug_malloc ();
22965   ;
22966   return 0;
22967 }
22968 _ACEOF
22969 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22970 if { (eval echo "$as_me:22970: \"$ac_link\"") >&5
22971   (eval $ac_link) 2>&5
22972   ac_status=$?
22973   echo "$as_me:22973: \$? = $ac_status" >&5
22974   (exit "$ac_status"); } &&
22975          { ac_try='test -s "conftest$ac_exeext"'
22976   { (eval echo "$as_me:22976: \"$ac_try\"") >&5
22977   (eval $ac_try) 2>&5
22978   ac_status=$?
22979   echo "$as_me:22979: \$? = $ac_status" >&5
22980   (exit "$ac_status"); }; }; then
22981   ac_cv_lib_dbmalloc_debug_malloc=yes
22982 else
22983   echo "$as_me: failed program was:" >&5
22984 cat "conftest.$ac_ext" >&5
22985 ac_cv_lib_dbmalloc_debug_malloc=no
22986 fi
22987 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22988 LIBS=$ac_check_lib_save_LIBS
22989 fi
22990 echo "$as_me:22990: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22991 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22992 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22993   cat >>confdefs.h <<EOF
22994 #define HAVE_LIBDBMALLOC 1
22995 EOF
22996
22997   LIBS="-ldbmalloc $LIBS"
22998
22999 fi
23000
23001 fi
23002
23003 fi
23004
23005 echo "$as_me:23005: checking if you want to use valgrind for testing" >&5
23006 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
23007
23008 # Check whether --with-valgrind or --without-valgrind was given.
23009 if test "${with_valgrind+set}" = set; then
23010   withval="$with_valgrind"
23011   case "x$withval" in
23012         (x|xno) ;;
23013         (*)
23014                 : "${with_cflags:=-g}"
23015                 : "${enable_leaks:=no}"
23016                 with_valgrind=yes
23017
23018 cat >>confdefs.h <<EOF
23019 #define USE_VALGRIND 1
23020 EOF
23021
23022                 ;;
23023         esac
23024 else
23025   with_valgrind=
23026 fi;
23027 echo "$as_me:23027: result: ${with_valgrind:-no}" >&5
23028 echo "${ECHO_T}${with_valgrind:-no}" >&6
23029
23030 case ".$with_cflags" in
23031 (.*-g*)
23032         case .$CFLAGS in
23033         (.*-g*)
23034                 ;;
23035         (*)
23036
23037 cf_fix_cppflags=no
23038 cf_new_cflags=
23039 cf_new_cppflags=
23040 cf_new_extra_cppflags=
23041
23042 for cf_add_cflags in -g
23043 do
23044 case "$cf_fix_cppflags" in
23045 (no)
23046         case "$cf_add_cflags" in
23047         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
23048                 case "$cf_add_cflags" in
23049                 (-D*)
23050                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
23051
23052                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23053                                 && test -z "${cf_tst_cflags}" \
23054                                 && cf_fix_cppflags=yes
23055
23056                         if test "$cf_fix_cppflags" = yes ; then
23057
23058         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23059         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23060
23061                                 continue
23062                         elif test "${cf_tst_cflags}" = "\"'" ; then
23063
23064         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23065         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23066
23067                                 continue
23068                         fi
23069                         ;;
23070                 esac
23071                 case "$CPPFLAGS" in
23072                 (*$cf_add_cflags)
23073                         ;;
23074                 (*)
23075                         case "$cf_add_cflags" in
23076                         (-D*)
23077                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
23078
23079 CPPFLAGS=`echo "$CPPFLAGS" | \
23080         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
23081                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
23082
23083                                 ;;
23084                         esac
23085
23086         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
23087         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
23088
23089                         ;;
23090                 esac
23091                 ;;
23092         (*)
23093
23094         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
23095         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
23096
23097                 ;;
23098         esac
23099         ;;
23100 (yes)
23101
23102         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
23103         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
23104
23105         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
23106
23107         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
23108                 && test -z "${cf_tst_cflags}" \
23109                 && cf_fix_cppflags=no
23110         ;;
23111 esac
23112 done
23113
23114 if test -n "$cf_new_cflags" ; then
23115
23116         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
23117         CFLAGS="${CFLAGS}$cf_new_cflags"
23118
23119 fi
23120
23121 if test -n "$cf_new_cppflags" ; then
23122
23123         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
23124         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
23125
23126 fi
23127
23128 if test -n "$cf_new_extra_cppflags" ; then
23129
23130         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
23131         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
23132
23133 fi
23134
23135                 ;;
23136         esac
23137         ;;
23138 esac
23139
23140 echo "$as_me:23140: checking if you want to perform memory-leak testing" >&5
23141 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
23142
23143 # Check whether --enable-leaks or --disable-leaks was given.
23144 if test "${enable_leaks+set}" = set; then
23145   enableval="$enable_leaks"
23146   enable_leaks=$enableval
23147 else
23148   enable_leaks=yes
23149 fi;
23150 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
23151 echo "$as_me:23151: result: $with_no_leaks" >&5
23152 echo "${ECHO_T}$with_no_leaks" >&6
23153
23154 if test "$enable_leaks" = no ; then
23155
23156 cat >>confdefs.h <<\EOF
23157 #define NO_LEAKS 1
23158 EOF
23159
23160 cat >>confdefs.h <<\EOF
23161 #define YY_NO_LEAKS 1
23162 EOF
23163
23164 fi
23165
23166 LD_RPATH_OPT=
23167 if test "x$cf_cv_enable_rpath" != xno
23168 then
23169         echo "$as_me:23169: checking for an rpath option" >&5
23170 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
23171         case "$cf_cv_system_name" in
23172         (irix*)
23173                 if test "$GCC" = yes; then
23174                         LD_RPATH_OPT="-Wl,-rpath,"
23175                 else
23176                         LD_RPATH_OPT="-rpath "
23177                 fi
23178                 ;;
23179         (linux*|gnu*|k*bsd*-gnu|freebsd*)
23180                 LD_RPATH_OPT="-Wl,-rpath,"
23181                 ;;
23182         (openbsd[2-9].*|mirbsd*)
23183                 LD_RPATH_OPT="-Wl,-rpath,"
23184                 ;;
23185         (dragonfly*)
23186                 LD_RPATH_OPT="-rpath "
23187                 ;;
23188         (netbsd*)
23189                 LD_RPATH_OPT="-Wl,-rpath,"
23190                 ;;
23191         (osf*|mls+*)
23192                 LD_RPATH_OPT="-rpath "
23193                 ;;
23194         (solaris2*)
23195                 LD_RPATH_OPT="-R"
23196                 ;;
23197         (*)
23198                 ;;
23199         esac
23200         echo "$as_me:23200: result: $LD_RPATH_OPT" >&5
23201 echo "${ECHO_T}$LD_RPATH_OPT" >&6
23202
23203         case "x$LD_RPATH_OPT" in
23204         (x-R*)
23205                 echo "$as_me:23205: checking if we need a space after rpath option" >&5
23206 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
23207                 cf_save_LIBS="$LIBS"
23208
23209 cf_add_libs="$LIBS"
23210 # reverse order
23211 cf_add_0lib=
23212 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
23213 # filter duplicates
23214 for cf_add_1lib in $cf_add_0lib; do
23215         for cf_add_2lib in $cf_add_libs; do
23216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
23217                         cf_add_1lib=
23218                         break
23219                 fi
23220         done
23221         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
23222 done
23223 LIBS="$cf_add_libs"
23224
23225                 cat >"conftest.$ac_ext" <<_ACEOF
23226 #line 23226 "configure"
23227 #include "confdefs.h"
23228
23229 int
23230 main (void)
23231 {
23232
23233   ;
23234   return 0;
23235 }
23236 _ACEOF
23237 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23238 if { (eval echo "$as_me:23238: \"$ac_link\"") >&5
23239   (eval $ac_link) 2>&5
23240   ac_status=$?
23241   echo "$as_me:23241: \$? = $ac_status" >&5
23242   (exit "$ac_status"); } &&
23243          { ac_try='test -s "conftest$ac_exeext"'
23244   { (eval echo "$as_me:23244: \"$ac_try\"") >&5
23245   (eval $ac_try) 2>&5
23246   ac_status=$?
23247   echo "$as_me:23247: \$? = $ac_status" >&5
23248   (exit "$ac_status"); }; }; then
23249   cf_rpath_space=no
23250 else
23251   echo "$as_me: failed program was:" >&5
23252 cat "conftest.$ac_ext" >&5
23253 cf_rpath_space=yes
23254 fi
23255 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23256                 LIBS="$cf_save_LIBS"
23257                 echo "$as_me:23257: result: $cf_rpath_space" >&5
23258 echo "${ECHO_T}$cf_rpath_space" >&6
23259                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
23260                 ;;
23261         esac
23262 fi
23263
23264 echo "$as_me:23264: checking if rpath-hack should be disabled" >&5
23265 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
23266
23267 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
23268 if test "${enable_rpath_hack+set}" = set; then
23269   enableval="$enable_rpath_hack"
23270   test "$enableval" != no && enableval=yes
23271         if test "$enableval" != "yes" ; then
23272     enable_rpath_hack=no
23273         else
23274                 enable_rpath_hack=yes
23275         fi
23276 else
23277   enableval=yes
23278         enable_rpath_hack=yes
23279
23280 fi;
23281 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
23282 echo "$as_me:23282: result: $cf_disable_rpath_hack" >&5
23283 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
23284
23285 if test "$enable_rpath_hack" = yes ; then
23286
23287 echo "$as_me:23287: checking for updated LDFLAGS" >&5
23288 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
23289 if test -n "$LD_RPATH_OPT" ; then
23290         echo "$as_me:23290: result: maybe" >&5
23291 echo "${ECHO_T}maybe" >&6
23292
23293         for ac_prog in ldd
23294 do
23295   # Extract the first word of "$ac_prog", so it can be a program name with args.
23296 set dummy $ac_prog; ac_word=$2
23297 echo "$as_me:23297: checking for $ac_word" >&5
23298 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
23299 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
23300   echo $ECHO_N "(cached) $ECHO_C" >&6
23301 else
23302   if test -n "$cf_ldd_prog"; then
23303   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
23304 else
23305   ac_save_IFS=$IFS; IFS=$ac_path_separator
23306 ac_dummy="$PATH"
23307 for ac_dir in $ac_dummy; do
23308   IFS=$ac_save_IFS
23309   test -z "$ac_dir" && ac_dir=.
23310   $as_executable_p "$ac_dir/$ac_word" || continue
23311 ac_cv_prog_cf_ldd_prog="$ac_prog"
23312 echo "$as_me:23312: found $ac_dir/$ac_word" >&5
23313 break
23314 done
23315
23316 fi
23317 fi
23318 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
23319 if test -n "$cf_ldd_prog"; then
23320   echo "$as_me:23320: result: $cf_ldd_prog" >&5
23321 echo "${ECHO_T}$cf_ldd_prog" >&6
23322 else
23323   echo "$as_me:23323: result: no" >&5
23324 echo "${ECHO_T}no" >&6
23325 fi
23326
23327   test -n "$cf_ldd_prog" && break
23328 done
23329 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
23330
23331         cf_rpath_list="/usr/lib /lib"
23332         if test "$cf_ldd_prog" != no
23333         then
23334                 cf_rpath_oops=
23335
23336 cat >"conftest.$ac_ext" <<_ACEOF
23337 #line 23337 "configure"
23338 #include "confdefs.h"
23339 #include <stdio.h>
23340 int
23341 main (void)
23342 {
23343 printf("Hello");
23344   ;
23345   return 0;
23346 }
23347 _ACEOF
23348 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
23349 if { (eval echo "$as_me:23349: \"$ac_link\"") >&5
23350   (eval $ac_link) 2>&5
23351   ac_status=$?
23352   echo "$as_me:23352: \$? = $ac_status" >&5
23353   (exit "$ac_status"); } &&
23354          { ac_try='test -s "conftest$ac_exeext"'
23355   { (eval echo "$as_me:23355: \"$ac_try\"") >&5
23356   (eval $ac_try) 2>&5
23357   ac_status=$?
23358   echo "$as_me:23358: \$? = $ac_status" >&5
23359   (exit "$ac_status"); }; }; then
23360   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
23361                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
23362 else
23363   echo "$as_me: failed program was:" >&5
23364 cat "conftest.$ac_ext" >&5
23365 fi
23366 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
23367
23368                 # If we passed the link-test, but get a "not found" on a given library,
23369                 # this could be due to inept reconfiguration of gcc to make it only
23370                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
23371                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
23372                 # /usr/local libraries.
23373                 if test -n "$cf_rpath_oops"
23374                 then
23375                         for cf_rpath_src in $cf_rpath_oops
23376                         do
23377                                 for cf_rpath_dir in \
23378                                         /usr/local \
23379                                         /usr/pkg \
23380                                         /opt/sfw
23381                                 do
23382                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
23383                                         then
23384                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
23385
23386 echo "${as_me:-configure}:23386: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
23387
23388                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
23389                                                 break
23390                                         fi
23391                                 done
23392                         done
23393                 fi
23394         fi
23395
23396         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23397
23398 echo "${as_me:-configure}:23398: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23399
23400 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
23401
23402 echo "${as_me:-configure}:23402: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
23403
23404 cf_rpath_dst=
23405 for cf_rpath_src in $LDFLAGS
23406 do
23407         case "$cf_rpath_src" in
23408         (-L*)
23409
23410                 # check if this refers to a directory which we will ignore
23411                 cf_rpath_skip=no
23412                 if test -n "$cf_rpath_list"
23413                 then
23414                         for cf_rpath_item in $cf_rpath_list
23415                         do
23416                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23417                                 then
23418                                         cf_rpath_skip=yes
23419                                         break
23420                                 fi
23421                         done
23422                 fi
23423
23424                 if test "$cf_rpath_skip" = no
23425                 then
23426                         # transform the option
23427                         if test "$LD_RPATH_OPT" = "-R " ; then
23428                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23429                         else
23430                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23431                         fi
23432
23433                         # if we have not already added this, add it now
23434                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23435                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23436                         then
23437                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23438
23439 echo "${as_me:-configure}:23439: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23440
23441                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23442                         fi
23443                 fi
23444                 ;;
23445         esac
23446         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23447 done
23448 LDFLAGS=$cf_rpath_dst
23449
23450 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
23451
23452 echo "${as_me:-configure}:23452: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
23453
23454 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
23455
23456 echo "${as_me:-configure}:23456: testing ...checking LIBS $LIBS ..." 1>&5
23457
23458 cf_rpath_dst=
23459 for cf_rpath_src in $LIBS
23460 do
23461         case "$cf_rpath_src" in
23462         (-L*)
23463
23464                 # check if this refers to a directory which we will ignore
23465                 cf_rpath_skip=no
23466                 if test -n "$cf_rpath_list"
23467                 then
23468                         for cf_rpath_item in $cf_rpath_list
23469                         do
23470                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
23471                                 then
23472                                         cf_rpath_skip=yes
23473                                         break
23474                                 fi
23475                         done
23476                 fi
23477
23478                 if test "$cf_rpath_skip" = no
23479                 then
23480                         # transform the option
23481                         if test "$LD_RPATH_OPT" = "-R " ; then
23482                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
23483                         else
23484                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
23485                         fi
23486
23487                         # if we have not already added this, add it now
23488                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
23489                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
23490                         then
23491                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
23492
23493 echo "${as_me:-configure}:23493: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
23494
23495                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
23496                         fi
23497                 fi
23498                 ;;
23499         esac
23500         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
23501 done
23502 LIBS=$cf_rpath_dst
23503
23504 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
23505
23506 echo "${as_me:-configure}:23506: testing ...checked LIBS $LIBS ..." 1>&5
23507
23508         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
23509
23510 echo "${as_me:-configure}:23510: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
23511
23512 else
23513         echo "$as_me:23513: result: no" >&5
23514 echo "${ECHO_T}no" >&6
23515 fi
23516
23517 fi
23518
23519 TEST_ARGS="$LIBS"
23520 LIBS=
23521
23522 ac_config_files="$ac_config_files Makefile"
23523 ac_config_commands="$ac_config_commands default"
23524 cat >confcache <<\_ACEOF
23525 # This file is a shell script that caches the results of configure
23526 # tests run on this system so they can be shared between configure
23527 # scripts and configure runs, see configure's option --config-cache.
23528 # It is not useful on other systems.  If it contains results you don't
23529 # want to keep, you may remove or edit it.
23530 #
23531 # config.status only pays attention to the cache file if you give it
23532 # the --recheck option to rerun configure.
23533 #
23534 # `ac_cv_env_foo' variables (set or unset) will be overriden when
23535 # loading this file, other *unset* `ac_cv_foo' will be assigned the
23536 # following values.
23537
23538 _ACEOF
23539
23540 # The following way of writing the cache mishandles newlines in values,
23541 # but we know of no workaround that is simple, portable, and efficient.
23542 # So, don't put newlines in cache variables' values.
23543 # Ultrix sh set writes to stderr and can't be redirected directly,
23544 # and sets the high bit in the cache file unless we assign to the vars.
23545 {
23546   (set) 2>&1 |
23547     case `(ac_space=' '; set | grep ac_space) 2>&1` in
23548     *ac_space=\ *)
23549       # `set' does not quote correctly, so add quotes (double-quote
23550       # substitution turns \\\\ into \\, and sed turns \\ into \).
23551       sed -n \
23552         "s/'/'\\\\''/g;
23553           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
23554       ;;
23555     *)
23556       # `set' quotes correctly as required by POSIX, so do not add quotes.
23557       sed -n \
23558         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
23559       ;;
23560     esac;
23561 } |
23562   sed '
23563      t clear
23564      : clear
23565      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
23566      t end
23567      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
23568      : end' >>confcache
23569 if cmp -s $cache_file confcache; then :; else
23570   if test -w $cache_file; then
23571     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
23572     cat confcache >$cache_file
23573   else
23574     echo "not updating unwritable cache $cache_file"
23575   fi
23576 fi
23577 rm -f confcache
23578
23579 test "x$prefix" = xNONE && prefix=$ac_default_prefix
23580 # Let make expand exec_prefix.
23581 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
23582
23583 # VPATH may cause trouble with some makes, so we remove $(srcdir),
23584 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
23585 # trailing colons and then remove the whole line if VPATH becomes empty
23586 # (actually we leave an empty line to preserve line numbers).
23587 if test "x$srcdir" = x.; then
23588   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23589 s/:*\$(srcdir):*/:/;
23590 s/:*\${srcdir}:*/:/;
23591 s/:*@srcdir@:*/:/;
23592 s/^\([^=]*=[    ]*\):*/\1/;
23593 s/:*$//;
23594 s/^[^=]*=[      ]*$//;
23595 }'
23596 fi
23597
23598 DEFS=-DHAVE_CONFIG_H
23599
23600 : "${CONFIG_STATUS=./config.status}"
23601 ac_clean_files_save=$ac_clean_files
23602 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23603 { echo "$as_me:23603: creating $CONFIG_STATUS" >&5
23604 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23605 cat >"$CONFIG_STATUS" <<_ACEOF
23606 #! $SHELL
23607 # Generated automatically by configure.
23608 # Run this file to recreate the current configuration.
23609 # Compiler output produced by configure, useful for debugging
23610 # configure, is in config.log if it exists.
23611
23612 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
23613
23614 debug=false
23615 SHELL=\${CONFIG_SHELL-$SHELL}
23616 ac_cs_invocation="\$0 \$@"
23617
23618 CLICOLOR_FORCE= GREP_OPTIONS=
23619 unset CLICOLOR_FORCE GREP_OPTIONS
23620 _ACEOF
23621
23622 cat >>"$CONFIG_STATUS" <<\_ACEOF
23623 # Be Bourne compatible
23624 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23625   emulate sh
23626   NULLCMD=:
23627 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23628   set -o posix
23629 fi
23630
23631 # Name of the executable.
23632 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23633
23634 if expr a : '\(a\)' >/dev/null 2>&1; then
23635   as_expr="expr"
23636 else
23637   as_expr="false"
23638 fi
23639
23640 rm -f conf$$ conf$$.exe conf$$.file
23641 echo >conf$$.file
23642 if ln -s conf$$.file conf$$ 2>/dev/null; then
23643   # We could just check for DJGPP; but this test a) works b) is more generic
23644   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23645   if test -f conf$$.exe; then
23646     # Don't use ln at all; we don't have any links
23647     as_ln_s='cp -p'
23648   else
23649     as_ln_s='ln -s'
23650   fi
23651 elif ln conf$$.file conf$$ 2>/dev/null; then
23652   as_ln_s='ln'
23653 else
23654   as_ln_s='cp -p'
23655 fi
23656 rm -f conf$$ conf$$.exe conf$$.file
23657
23658 as_executable_p="test -f"
23659
23660 # Support unset when possible.
23661 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23662   as_unset="unset"
23663 else
23664   as_unset="false"
23665 fi
23666
23667 # NLS nuisances.
23668 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23669 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23670 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23671 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23672 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23673 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23674 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23675 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23676
23677 # IFS
23678 # We need space, tab and new line, in precisely that order.
23679 as_nl='
23680 '
23681 IFS="   $as_nl"
23682
23683 # CDPATH.
23684 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23685
23686 exec 6>&1
23687
23688 _ACEOF
23689
23690 # Files that config.status was made for.
23691 if test -n "$ac_config_files"; then
23692   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23693 fi
23694
23695 if test -n "$ac_config_headers"; then
23696   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23697 fi
23698
23699 if test -n "$ac_config_links"; then
23700   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23701 fi
23702
23703 if test -n "$ac_config_commands"; then
23704   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23705 fi
23706
23707 cat >>"$CONFIG_STATUS" <<\EOF
23708
23709 ac_cs_usage="\
23710 \`$as_me' instantiates files from templates according to the
23711 current configuration.
23712
23713 Usage: $0 [OPTIONS] [FILE]...
23714
23715   -h, --help       print this help, then exit
23716   -V, --version    print version number, then exit
23717   -d, --debug      don't remove temporary files
23718       --recheck    update $as_me by reconfiguring in the same conditions
23719   --file=FILE[:TEMPLATE]
23720                    instantiate the configuration file FILE
23721   --header=FILE[:TEMPLATE]
23722                    instantiate the configuration header FILE
23723
23724 Configuration files:
23725 $config_files
23726
23727 Configuration headers:
23728 $config_headers
23729
23730 Configuration commands:
23731 $config_commands
23732
23733 Report bugs to <dickey@invisible-island.net>."
23734 EOF
23735
23736 cat >>"$CONFIG_STATUS" <<EOF
23737 ac_cs_version="\\
23738 config.status
23739 configured by $0, generated by GNU Autoconf 2.52.20230114,
23740   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23741
23742 Copyright 2003-2022,2023        Thomas E. Dickey
23743 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23744 Free Software Foundation, Inc.
23745 This config.status script is free software; the Free Software Foundation
23746 gives unlimited permission to copy, distribute and modify it."
23747 srcdir="$srcdir"
23748 INSTALL="$INSTALL"
23749 EOF
23750
23751 cat >>"$CONFIG_STATUS" <<\EOF
23752 # If no file are specified by the user, then we need to provide default
23753 # value.  By we need to know if files were specified by the user.
23754 ac_need_defaults=:
23755 while test $# != 0
23756 do
23757   case $1 in
23758   --*=*)
23759     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23760     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23761     shift
23762     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23763     shift
23764     ;;
23765   -*);;
23766   *) # This is not an option, so the user has probably given explicit
23767      # arguments.
23768      ac_need_defaults=false;;
23769   esac
23770
23771   case $1 in
23772   # Handling of the options.
23773 EOF
23774 cat >>"$CONFIG_STATUS" <<EOF
23775   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23776     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23777     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23778 EOF
23779 cat >>"$CONFIG_STATUS" <<\EOF
23780   --version | --vers* | -V )
23781     echo "$ac_cs_version"; exit 0 ;;
23782   --he | --h)
23783     # Conflict between --help and --header
23784     { { echo "$as_me:23784: error: ambiguous option: $1
23785 Try \`$0 --help' for more information." >&5
23786 echo "$as_me: error: ambiguous option: $1
23787 Try \`$0 --help' for more information." >&2;}
23788    { (exit 1); exit 1; }; };;
23789   --help | --hel | -h )
23790     echo "$ac_cs_usage"; exit 0 ;;
23791   --debug | --d* | -d )
23792     debug=: ;;
23793   --file | --fil | --fi | --f )
23794     shift
23795     CONFIG_FILES="$CONFIG_FILES $1"
23796     ac_need_defaults=false;;
23797   --header | --heade | --head | --hea )
23798     shift
23799     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23800     ac_need_defaults=false;;
23801
23802   # This is an error.
23803   -*) { { echo "$as_me:23803: error: unrecognized option: $1
23804 Try \`$0 --help' for more information." >&5
23805 echo "$as_me: error: unrecognized option: $1
23806 Try \`$0 --help' for more information." >&2;}
23807    { (exit 1); exit 1; }; } ;;
23808
23809   *) ac_config_targets="$ac_config_targets $1" ;;
23810
23811   esac
23812   shift
23813 done
23814
23815 exec 5>>config.log
23816 cat >&5 << _ACEOF
23817
23818 ## ----------------------- ##
23819 ## Running config.status.  ##
23820 ## ----------------------- ##
23821
23822 This file was extended by $as_me 2.52.20230114, executed with
23823   CONFIG_FILES    = $CONFIG_FILES
23824   CONFIG_HEADERS  = $CONFIG_HEADERS
23825   CONFIG_LINKS    = $CONFIG_LINKS
23826   CONFIG_COMMANDS = $CONFIG_COMMANDS
23827   > "$ac_cs_invocation"
23828 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23829
23830 _ACEOF
23831 EOF
23832
23833 cat >>"$CONFIG_STATUS" <<EOF
23834 #
23835 # INIT-COMMANDS section.
23836 #
23837
23838 AWK="$AWK"
23839 ECHO_CC="$ECHO_CC"
23840 ECHO_LD="$ECHO_LD"
23841 SHOW_CC="$SHOW_LD"
23842
23843 EOF
23844
23845 cat >>"$CONFIG_STATUS" <<\EOF
23846 for ac_config_target in $ac_config_targets
23847 do
23848   case "$ac_config_target" in
23849   # Handling of arguments.
23850   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23851   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23852   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23853   *) { { echo "$as_me:23853: error: invalid argument: $ac_config_target" >&5
23854 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23855    { (exit 1); exit 1; }; };;
23856   esac
23857 done
23858
23859 # If the user did not use the arguments to specify the items to instantiate,
23860 # then the envvar interface is used.  Set only those that are not.
23861 # We use the long form for the default assignment because of an extremely
23862 # bizarre bug on SunOS 4.1.3.
23863 if "$ac_need_defaults"; then
23864   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23865   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23866   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23867 fi
23868
23869 # Create a temporary directory, and hook for its removal unless debugging.
23870 $debug ||
23871 {
23872   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23873   trap '{ (exit 1); exit 1; }' 1 2 13 15
23874 }
23875
23876 # Create a (secure) tmp directory for tmp files.
23877 : "${TMPDIR=/tmp}"
23878 {
23879   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23880   test -n "$tmp" && test -d "$tmp"
23881 }  ||
23882 {
23883   tmp=$TMPDIR/cs$$-$RANDOM
23884   (umask 077 && mkdir "$tmp")
23885 } ||
23886 {
23887    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23888    { (exit 1); exit 1; }
23889 }
23890
23891 EOF
23892
23893 cat >>"$CONFIG_STATUS" <<EOF
23894
23895 #
23896 # CONFIG_FILES section.
23897 #
23898
23899 # No need to generate the scripts if there are no CONFIG_FILES.
23900 # This happens for instance when ./config.status config.h
23901 if test -n "\$CONFIG_FILES"; then
23902   # Protect against being on the right side of a sed subst in config.status.
23903   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23904    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
23905 s,@SHELL@,$SHELL,;t t
23906 s,@exec_prefix@,$exec_prefix,;t t
23907 s,@prefix@,$prefix,;t t
23908 s,@program_transform_name@,$program_transform_name,;t t
23909 s,@bindir@,$bindir,;t t
23910 s,@sbindir@,$sbindir,;t t
23911 s,@libexecdir@,$libexecdir,;t t
23912 s,@datarootdir@,$datarootdir,;t t
23913 s,@datadir@,$datadir,;t t
23914 s,@sysconfdir@,$sysconfdir,;t t
23915 s,@sharedstatedir@,$sharedstatedir,;t t
23916 s,@localstatedir@,$localstatedir,;t t
23917 s,@runstatedir@,$runstatedir,;t t
23918 s,@libdir@,$libdir,;t t
23919 s,@includedir@,$includedir,;t t
23920 s,@oldincludedir@,$oldincludedir,;t t
23921 s,@infodir@,$infodir,;t t
23922 s,@mandir@,$mandir,;t t
23923 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23924 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23925 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23926 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23927 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23928 s,@build_alias@,$build_alias,;t t
23929 s,@host_alias@,$host_alias,;t t
23930 s,@target_alias@,$target_alias,;t t
23931 s,@ECHO_C@,$ECHO_C,;t t
23932 s,@ECHO_N@,$ECHO_N,;t t
23933 s,@ECHO_T@,$ECHO_T,;t t
23934 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23935 s,@DEFS@,$DEFS,;t t
23936 s,@LIBS@,$LIBS,;t t
23937 s,@build@,$build,;t t
23938 s,@build_cpu@,$build_cpu,;t t
23939 s,@build_vendor@,$build_vendor,;t t
23940 s,@build_os@,$build_os,;t t
23941 s,@host@,$host,;t t
23942 s,@host_cpu@,$host_cpu,;t t
23943 s,@host_vendor@,$host_vendor,;t t
23944 s,@host_os@,$host_os,;t t
23945 s,@SET_MAKE@,$SET_MAKE,;t t
23946 s,@CC@,$CC,;t t
23947 s,@CFLAGS@,$CFLAGS,;t t
23948 s,@LDFLAGS@,$LDFLAGS,;t t
23949 s,@CPPFLAGS@,$CPPFLAGS,;t t
23950 s,@ac_ct_CC@,$ac_ct_CC,;t t
23951 s,@EXEEXT@,$EXEEXT,;t t
23952 s,@OBJEXT@,$OBJEXT,;t t
23953 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23954 s,@CPP@,$CPP,;t t
23955 s,@GREP@,$GREP,;t t
23956 s,@EGREP@,$EGREP,;t t
23957 s,@AWK@,$AWK,;t t
23958 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23959 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23960 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23961 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23962 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23963 s,@LINT@,$LINT,;t t
23964 s,@LINT_OPTS@,$LINT_OPTS,;t t
23965 s,@LINT_LIBS@,$LINT_LIBS,;t t
23966 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
23967 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
23968 s,@CTAGS@,$CTAGS,;t t
23969 s,@ETAGS@,$ETAGS,;t t
23970 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23971 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23972 s,@MATH_LIB@,$MATH_LIB,;t t
23973 s,@top_builddir@,$top_builddir,;t t
23974 s,@CC_G_OPT@,$CC_G_OPT,;t t
23975 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23976 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23977 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23978 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23979 s,@LD@,$LD,;t t
23980 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23981 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23982 s,@LD_MODEL@,$LD_MODEL,;t t
23983 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23984 s,@LIBTOOL@,$LIBTOOL,;t t
23985 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23986 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23987 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23988 s,@LIB_LINK@,$LIB_LINK,;t t
23989 s,@LINK_TESTS@,$LINK_TESTS,;t t
23990 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23991 s,@PACKAGE@,$PACKAGE,;t t
23992 s,@PTHREAD@,$PTHREAD,;t t
23993 s,@TEST_ARGS@,$TEST_ARGS,;t t
23994 s,@TEST_DEPS@,$TEST_DEPS,;t t
23995 s,@TEST_LIBS@,$TEST_LIBS,;t t
23996 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23997 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23998 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23999 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
24000 s,@includesubdir@,$includesubdir,;t t
24001 s,@FGREP@,$FGREP,;t t
24002 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
24003 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
24004 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
24005 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
24006 s,@ECHO_LT@,$ECHO_LT,;t t
24007 s,@ECHO_LD@,$ECHO_LD,;t t
24008 s,@RULE_CC@,$RULE_CC,;t t
24009 s,@SHOW_CC@,$SHOW_CC,;t t
24010 s,@ECHO_CC@,$ECHO_CC,;t t
24011 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
24012 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
24013 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
24014 s,@X_CFLAGS@,$X_CFLAGS,;t t
24015 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
24016 s,@X_LIBS@,$X_LIBS,;t t
24017 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
24018 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
24019 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
24020 s,@cf_cv_screen@,$cf_cv_screen,;t t
24021 s,@RGB_PATH@,$RGB_PATH,;t t
24022 s,@no_x11_rgb@,$no_x11_rgb,;t t
24023 s,@FORM_NAME@,$FORM_NAME,;t t
24024 s,@MENU_NAME@,$MENU_NAME,;t t
24025 s,@PANEL_NAME@,$PANEL_NAME,;t t
24026 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
24027 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
24028 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
24029 CEOF
24030
24031 EOF
24032
24033   cat >>"$CONFIG_STATUS" <<\EOF
24034   # Split the substitutions into bite-sized pieces for seds with
24035   # small command number limits, like on Digital OSF/1 and HP-UX.
24036   ac_max_sed_lines=48
24037   ac_sed_frag=1 # Number of current file.
24038   ac_beg=1 # First line for current file.
24039   ac_end=$ac_max_sed_lines # Line after last line for current file.
24040   ac_more_lines=:
24041   ac_sed_cmds=
24042   while "$ac_more_lines"; do
24043     if test "$ac_beg" -gt 1; then
24044       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
24045     else
24046       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
24047     fi
24048     if test ! -s "$tmp"/subs.frag; then
24049       ac_more_lines=false
24050     else
24051       # The purpose of the label and of the branching condition is to
24052       # speed up the sed processing (if there are no `@' at all, there
24053       # is no need to browse any of the substitutions).
24054       # These are the two extra sed commands mentioned above.
24055       (echo ':t
24056   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
24057       # It is possible to make a multiline substitution using escaped newlines.
24058       # Ensure that we do not split the substitution between script fragments.
24059       ac_BEG=$ac_end
24060       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
24061       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
24062       if test -s "$tmp"/subs.next; then
24063         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
24064         if test ! -s "$tmp"/subs.edit; then
24065           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
24066           if test ! -s "$tmp"/subs.edit; then
24067             if test "$ac_beg" -gt 1; then
24068               ac_end=`expr "$ac_end" - 1`
24069               continue
24070             fi
24071           fi
24072         fi
24073       fi
24074
24075       if test -z "$ac_sed_cmds"; then
24076         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
24077       else
24078         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
24079       fi
24080       ac_sed_frag=`expr "$ac_sed_frag" + 1`
24081       ac_beg=$ac_end
24082       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
24083     fi
24084   done
24085   if test -z "$ac_sed_cmds"; then
24086     ac_sed_cmds="cat"
24087   fi
24088 fi # test -n "$CONFIG_FILES"
24089
24090 EOF
24091 cat >>"$CONFIG_STATUS" <<\EOF
24092 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
24093   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24094   case "$ac_file" in
24095   - | *:- | *:-:* ) # input from stdin
24096         cat >"$tmp"/stdin
24097         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24098         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24099   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24100         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24101   * )   ac_file_in=$ac_file.in ;;
24102   esac
24103
24104   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
24105   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24106          X"$ac_file" : 'X\(//\)[^/]' \| \
24107          X"$ac_file" : 'X\(//\)$' \| \
24108          X"$ac_file" : 'X\(/\)' \| \
24109          .     : '\(.\)' 2>/dev/null ||
24110 echo X"$ac_file" |
24111     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24112           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24113           /^X\(\/\/\)$/{ s//\1/; q; }
24114           /^X\(\/\).*/{ s//\1/; q; }
24115           s/.*/./; q'`
24116   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24117     { case "$ac_dir" in
24118   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24119   *)                      as_incr_dir=.;;
24120 esac
24121 as_dummy="$ac_dir"
24122 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24123   case $as_mkdir_dir in
24124     # Skip DOS drivespec
24125     ?:) as_incr_dir=$as_mkdir_dir ;;
24126     *)
24127       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24128       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24129     ;;
24130   esac
24131 done; }
24132
24133     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
24134     # A "../" for each directory in $ac_dir_suffix.
24135     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
24136   else
24137     ac_dir_suffix= ac_dots=
24138   fi
24139
24140   case "$srcdir" in
24141   .)  ac_srcdir=.
24142       if test -z "$ac_dots"; then
24143          ac_top_srcdir=.
24144       else
24145          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
24146       fi ;;
24147   [\\/]* | ?:[\\/]* )
24148       ac_srcdir="$srcdir$ac_dir_suffix";
24149       ac_top_srcdir="$srcdir" ;;
24150   *) # Relative path.
24151     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
24152     ac_top_srcdir="$ac_dots$srcdir" ;;
24153   esac
24154
24155   case $INSTALL in
24156   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
24157   *) ac_INSTALL=$ac_dots$INSTALL ;;
24158   esac
24159
24160   if test x"$ac_file" != x-; then
24161     { echo "$as_me:24161: creating $ac_file" >&5
24162 echo "$as_me: creating $ac_file" >&6;}
24163     rm -f "$ac_file"
24164   fi
24165   # Let's still pretend it is `configure' which instantiates (i.e., don't
24166   # use $as_me), people would be surprised to read:
24167   #    /* config.h.  Generated automatically by config.status.  */
24168   configure_input="Generated automatically from `echo $ac_file_in |
24169                                                  sed 's,.*/,,'` by configure."
24170
24171   # First look for the input files in the build tree, otherwise in the
24172   # src tree.
24173   ac_file_inputs=`IFS=:
24174     for f in $ac_file_in; do
24175       case $f in
24176       -) echo "$tmp"/stdin ;;
24177       [\\/$]*)
24178          # Absolute (can't be DOS-style, as IFS=:)
24179          test -f "$f" || { { echo "$as_me:24179: error: cannot find input file: $f" >&5
24180 echo "$as_me: error: cannot find input file: $f" >&2;}
24181    { (exit 1); exit 1; }; }
24182          echo "$f";;
24183       *) # Relative
24184          if test -f "$f"; then
24185            # Build tree
24186            echo "$f"
24187          elif test -f "$srcdir/$f"; then
24188            # Source tree
24189            echo "$srcdir/$f"
24190          else
24191            # /dev/null tree
24192            { { echo "$as_me:24192: error: cannot find input file: $f" >&5
24193 echo "$as_me: error: cannot find input file: $f" >&2;}
24194    { (exit 1); exit 1; }; }
24195          fi;;
24196       esac
24197     done` || { (exit 1); exit 1; }
24198 EOF
24199 cat >>"$CONFIG_STATUS" <<\EOF
24200   ac_warn_datarootdir=no
24201   if test x"$ac_file" != x-; then
24202     for ac_item in $ac_file_inputs
24203     do
24204       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
24205       if test -n "$ac_seen"; then
24206         ac_used=`grep '@datarootdir@' "$ac_item"`
24207         if test -z "$ac_used"; then
24208           { echo "$as_me:24208: WARNING: datarootdir was used implicitly but not set:
24209 $ac_seen" >&5
24210 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
24211 $ac_seen" >&2;}
24212           ac_warn_datarootdir=yes
24213         fi
24214       fi
24215       ac_seen=`grep '${datarootdir}' "$ac_item"`
24216       if test -n "$ac_seen"; then
24217         { echo "$as_me:24217: WARNING: datarootdir was used explicitly but not set:
24218 $ac_seen" >&5
24219 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
24220 $ac_seen" >&2;}
24221         ac_warn_datarootdir=yes
24222       fi
24223     done
24224   fi
24225
24226 if test "x$ac_warn_datarootdir" = xyes; then
24227   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
24228 fi
24229
24230 EOF
24231 cat >>"$CONFIG_STATUS" <<EOF
24232   sed "$ac_vpsub
24233 $extrasub
24234 EOF
24235 cat >>"$CONFIG_STATUS" <<\EOF
24236 :t
24237 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
24238 s,@configure_input@,$configure_input,;t t
24239 s,@srcdir@,$ac_srcdir,;t t
24240 s,@top_srcdir@,$ac_top_srcdir,;t t
24241 s,@INSTALL@,$ac_INSTALL,;t t
24242 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
24243   rm -f "$tmp"/stdin
24244 EOF
24245 : "${FGREP:=grep -F}"
24246 : "${EGREP:=grep -E}"
24247 cat >>"$CONFIG_STATUS" <<EOF
24248   : "\${FGREP:=$FGREP}"
24249   : "\${EGREP:=$EGREP}"
24250 EOF
24251 cat >>"$CONFIG_STATUS" <<\EOF
24252   if test x"$ac_file" != x-; then
24253     cp "$tmp/out" "$ac_file"
24254
24255     for ac_name in prefix exec_prefix datarootdir
24256     do
24257         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
24258         if test -n "$ac_seen"; then
24259             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
24260             if test -z "$ac_init"; then
24261               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
24262               { echo "$as_me:24262: WARNING: Variable $ac_name is used but was not set:
24263 $ac_seen" >&5
24264 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
24265 $ac_seen" >&2;}
24266             fi
24267         fi
24268     done
24269     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
24270     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
24271     if test -s "$tmp"/out; then
24272       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
24273       { echo "$as_me:24273: WARNING: Some variables may not be substituted:
24274 $ac_seen" >&5
24275 echo "$as_me: WARNING: Some variables may not be substituted:
24276 $ac_seen" >&2;}
24277     fi
24278   else
24279     cat "$tmp"/out
24280   fi
24281   rm -f "$tmp"/out
24282
24283 done
24284 EOF
24285 cat >>"$CONFIG_STATUS" <<\EOF
24286
24287 #
24288 # CONFIG_HEADER section.
24289 #
24290
24291 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
24292 # NAME is the cpp macro being defined and VALUE is the value it is being given.
24293 #
24294 # ac_d sets the value in "#define NAME VALUE" lines.
24295 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
24296 ac_dB='[        ].*$,\1#\2'
24297 ac_dC=' '
24298 ac_dD=',;t'
24299 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
24300 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24301 ac_iB='\([      ]\),\1#\2define\3'
24302 ac_iC=' '
24303 ac_iD='\4,;t'
24304 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
24305 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
24306 ac_uB='$,\1#\2define\3'
24307 ac_uC=' '
24308 ac_uD=',;t'
24309
24310 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
24311   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
24312   case "$ac_file" in
24313   - | *:- | *:-:* ) # input from stdin
24314         cat >"$tmp"/stdin
24315         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24316         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24317   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
24318         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
24319   * )   ac_file_in=$ac_file.in ;;
24320   esac
24321
24322   test x"$ac_file" != x- && { echo "$as_me:24322: creating $ac_file" >&5
24323 echo "$as_me: creating $ac_file" >&6;}
24324
24325   # First look for the input files in the build tree, otherwise in the
24326   # src tree.
24327   ac_file_inputs=`IFS=:
24328     for f in $ac_file_in; do
24329       case $f in
24330       -) echo "$tmp"/stdin ;;
24331       [\\/$]*)
24332          # Absolute (can't be DOS-style, as IFS=:)
24333          test -f "$f" || { { echo "$as_me:24333: error: cannot find input file: $f" >&5
24334 echo "$as_me: error: cannot find input file: $f" >&2;}
24335    { (exit 1); exit 1; }; }
24336          echo $f;;
24337       *) # Relative
24338          if test -f "$f"; then
24339            # Build tree
24340            echo $f
24341          elif test -f "$srcdir/$f"; then
24342            # Source tree
24343            echo "$srcdir/$f"
24344          else
24345            # /dev/null tree
24346            { { echo "$as_me:24346: error: cannot find input file: $f" >&5
24347 echo "$as_me: error: cannot find input file: $f" >&2;}
24348    { (exit 1); exit 1; }; }
24349          fi;;
24350       esac
24351     done` || { (exit 1); exit 1; }
24352   # Remove the trailing spaces.
24353   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
24354
24355 EOF
24356
24357 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
24358 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
24359 # be either 'cat' or 'sort'.
24360 cat confdefs.h | uniq >conftest.vals
24361
24362 # Break up conftest.vals because some shells have a limit on
24363 # the size of here documents, and old seds have small limits too.
24364
24365 rm -f conftest.tail
24366 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
24367 while grep . conftest.vals >/dev/null
24368 do
24369   # Write chunks of a limited-size here document to conftest.frag.
24370   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
24371   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
24372   echo 'CEOF' >> "$CONFIG_STATUS"
24373   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
24374   rm -f conftest.vals
24375   mv conftest.tail conftest.vals
24376 done
24377 rm -f conftest.vals
24378
24379 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
24380 # marker @DEFS@.
24381 echo '  cat >> conftest.edit <<CEOF
24382 /@DEFS@/r conftest.frag
24383 /@DEFS@/d
24384 CEOF
24385 sed -f conftest.edit "$tmp"/in > "$tmp"/out
24386 rm -f "$tmp"/in
24387 mv "$tmp"/out "$tmp"/in
24388 rm -f conftest.edit conftest.frag
24389 ' >> "$CONFIG_STATUS"
24390
24391 cat >>"$CONFIG_STATUS" <<\EOF
24392   # Let's still pretend it is `configure' which instantiates (i.e., don't
24393   # use $as_me), people would be surprised to read:
24394   #    /* config.h.  Generated automatically by config.status.  */
24395   if test x"$ac_file" = x-; then
24396     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
24397   else
24398     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
24399   fi
24400   cat "$tmp"/in >>"$tmp"/config.h
24401   rm -f "$tmp"/in
24402   if test x"$ac_file" != x-; then
24403     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
24404       { echo "$as_me:24404: $ac_file is unchanged" >&5
24405 echo "$as_me: $ac_file is unchanged" >&6;}
24406     else
24407       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
24408          X"$ac_file" : 'X\(//\)[^/]' \| \
24409          X"$ac_file" : 'X\(//\)$' \| \
24410          X"$ac_file" : 'X\(/\)' \| \
24411          .     : '\(.\)' 2>/dev/null ||
24412 echo X"$ac_file" |
24413     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
24414           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
24415           /^X\(\/\/\)$/{ s//\1/; q; }
24416           /^X\(\/\).*/{ s//\1/; q; }
24417           s/.*/./; q'`
24418       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
24419         { case "$ac_dir" in
24420   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
24421   *)                      as_incr_dir=.;;
24422 esac
24423 as_dummy="$ac_dir"
24424 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
24425   case $as_mkdir_dir in
24426     # Skip DOS drivespec
24427     ?:) as_incr_dir=$as_mkdir_dir ;;
24428     *)
24429       as_incr_dir=$as_incr_dir/$as_mkdir_dir
24430       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
24431     ;;
24432   esac
24433 done; }
24434
24435       fi
24436       rm -f "$ac_file"
24437       mv "$tmp/config.h" "$ac_file"
24438     fi
24439   else
24440     cat "$tmp"/config.h
24441     rm -f "$tmp"/config.h
24442   fi
24443 done
24444 EOF
24445 cat >>"$CONFIG_STATUS" <<\EOF
24446 #
24447 # CONFIG_COMMANDS section.
24448 #
24449 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
24450   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
24451   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
24452
24453   case "$ac_dest" in
24454     default )
24455
24456 for cf_dir in .
24457 do
24458         if test ! -d "$srcdir/$cf_dir" ; then
24459                 continue
24460         elif test -f "$srcdir/$cf_dir/programs" ; then
24461                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
24462         fi
24463 done
24464
24465         cat >>Makefile <<TEST_EOF
24466
24467 # These rules are generated so we do not rely on suffix rules, which do not
24468 # work consistently for different make-programs (the '\$(MODEL)/' confuses
24469 # some, and the '\$x' confuses others).
24470 TEST_EOF
24471
24472 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
24473 for N in $LIST
24474 do
24475         cat >>Makefile <<TEST_EOF
24476
24477 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
24478         \$(srcdir)/test.priv.h \\
24479         ncurses_cfg.h
24480         $SHOW_CC
24481         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
24482 TEST_EOF
24483 done
24484
24485 if test -f ../config.guess && test -f ../config.sub
24486 then
24487         cat >>Makefile <<TEST_EOF
24488
24489 # if we used CF_INHERIT for getting these files, we can remove them
24490 distclean::
24491         rm -f config.guess config.sub
24492 TEST_EOF
24493 fi
24494  ;;
24495   esac
24496 done
24497 EOF
24498
24499 cat >>"$CONFIG_STATUS" <<\EOF
24500
24501 { (exit 0); exit 0; }
24502 EOF
24503 chmod +x "$CONFIG_STATUS"
24504 ac_clean_files=$ac_clean_files_save
24505
24506 # configure is writing to config.log, and then calls config.status.
24507 # config.status does its own redirection, appending to config.log.
24508 # Unfortunately, on DOS this fails, as config.log is still kept open
24509 # by configure, so config.status won't be able to write to it; its
24510 # output is simply discarded.  So we exec the FD to /dev/null,
24511 # effectively closing config.log, so it can be properly (re)opened and
24512 # appended to by config.status.  When coming back to configure, we
24513 # need to make the FD available again.
24514 if test "$no_create" != yes; then
24515   ac_cs_success=:
24516   exec 5>/dev/null
24517   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
24518   exec 5>>config.log
24519   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
24520   # would make configure fail if this is the last instruction.
24521   "$ac_cs_success" || { (exit 1); exit 1; }
24522 fi
24523