]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20210508
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20210105.
4 #
5 # Copyright 2003-2020,2021      Thomas E. Dickey
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset="unset"
64 else
65   as_unset="false"
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS=
101 MAKEFLAGS=
102 SHELL=${CONFIG_SHELL-/bin/sh}
103
104 # Maximum number of lines to put in a shell here document.
105 # This variable seems obsolete.  It should probably be removed, and
106 # only ac_max_sed_lines should be used.
107 : "${ac_max_here_lines=38}"
108
109 ac_unique_file="ncurses.c"
110
111 # Initialize some variables set by options.
112 ac_init_help=
113 ac_init_version=false
114 # The variables have the same names as the options, with
115 # dashes changed to underlines.
116 cache_file=/dev/null
117 exec_prefix=NONE
118 no_create=
119 no_recursion=
120 prefix=NONE
121 program_prefix=NONE
122 program_suffix=NONE
123 program_transform_name=s,x,x,
124 silent=
125 site=
126 srcdir=
127 verbose=
128 x_includes=NONE
129 x_libraries=NONE
130
131 # Installation directory options.
132 # These are left unexpanded so users can "make install exec_prefix=/foo"
133 # and all the variables that are supposed to be based on exec_prefix
134 # by default will actually change.
135 # Use braces instead of parens because sh, perl, etc. also accept them.
136 bindir='${exec_prefix}/bin'
137 sbindir='${exec_prefix}/sbin'
138 libexecdir='${exec_prefix}/libexec'
139 datarootdir='${prefix}/share'
140 datadir='${datarootdir}'
141 sysconfdir='${prefix}/etc'
142 sharedstatedir='${prefix}/com'
143 localstatedir='${prefix}/var'
144 runstatedir='${localstatedir}/run'
145 libdir='${exec_prefix}/lib'
146 includedir='${prefix}/include'
147 oldincludedir='/usr/include'
148 infodir='${datarootdir}/info'
149 mandir='${datarootdir}/man'
150
151 # Identity of this package.
152 PACKAGE_NAME=
153 PACKAGE_TARNAME=
154 PACKAGE_VERSION=
155 PACKAGE_STRING=
156 PACKAGE_BUGREPORT=
157
158 ac_prev=
159 for ac_option
160 do
161   # If the previous option needs an argument, assign it.
162   if test -n "$ac_prev"; then
163     eval "$ac_prev=\$ac_option"
164     ac_prev=
165     continue
166   fi
167
168   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
169
170   # Accept the important Cygnus configure options, so we can diagnose typos.
171
172   case "$ac_option" in
173
174   -bindir | --bindir | --bindi | --bind | --bin | --bi)
175     ac_prev=bindir ;;
176   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
177     bindir=$ac_optarg ;;
178
179   -build | --build | --buil | --bui | --bu)
180     ac_prev=build_alias ;;
181   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
182     build_alias=$ac_optarg ;;
183
184   -cache-file | --cache-file | --cache-fil | --cache-fi \
185   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
186     ac_prev=cache_file ;;
187   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
188   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
189     cache_file=$ac_optarg ;;
190
191   --config-cache | -C)
192     cache_file=config.cache ;;
193
194   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
195     ac_prev=datadir ;;
196   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
197   | --da=*)
198     datadir=$ac_optarg ;;
199
200   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
201   | --dataroo | --dataro | --datar)
202     ac_prev=datarootdir ;;
203   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
204   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
205     datarootdir=$ac_optarg ;;
206
207   -disable-* | --disable-*)
208     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
209     # Reject names that are not valid shell variable names.
210     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
211       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
212    { (exit 1); exit 1; }; }
213     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
214     eval "enable_$ac_feature=no" ;;
215
216   -enable-* | --enable-*)
217     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
218     # Reject names that are not valid shell variable names.
219     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
220       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
221    { (exit 1); exit 1; }; }
222     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
223     case "$ac_option" in
224       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
225       *) ac_optarg=yes ;;
226     esac
227     eval "enable_$ac_feature='$ac_optarg'" ;;
228
229   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
230   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
231   | --exec | --exe | --ex)
232     ac_prev=exec_prefix ;;
233   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
234   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
235   | --exec=* | --exe=* | --ex=*)
236     exec_prefix=$ac_optarg ;;
237
238   -gas | --gas | --ga | --g)
239     # Obsolete; use --with-gas.
240     with_gas=yes ;;
241
242   -help | --help | --hel | --he | -h)
243     ac_init_help=long ;;
244   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
245     ac_init_help=recursive ;;
246   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
247     ac_init_help=short ;;
248
249   -host | --host | --hos | --ho)
250     ac_prev=host_alias ;;
251   -host=* | --host=* | --hos=* | --ho=*)
252     host_alias=$ac_optarg ;;
253
254   -includedir | --includedir | --includedi | --included | --include \
255   | --includ | --inclu | --incl | --inc)
256     ac_prev=includedir ;;
257   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
258   | --includ=* | --inclu=* | --incl=* | --inc=*)
259     includedir=$ac_optarg ;;
260
261   -infodir | --infodir | --infodi | --infod | --info | --inf)
262     ac_prev=infodir ;;
263   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
264     infodir=$ac_optarg ;;
265
266   -libdir | --libdir | --libdi | --libd)
267     ac_prev=libdir ;;
268   -libdir=* | --libdir=* | --libdi=* | --libd=*)
269     libdir=$ac_optarg ;;
270
271   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
272   | --libexe | --libex | --libe)
273     ac_prev=libexecdir ;;
274   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
275   | --libexe=* | --libex=* | --libe=*)
276     libexecdir=$ac_optarg ;;
277
278   -localstatedir | --localstatedir | --localstatedi | --localstated \
279   | --localstate | --localstat | --localsta | --localst \
280   | --locals | --local | --loca | --loc | --lo)
281     ac_prev=localstatedir ;;
282   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
283   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
284   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
285     localstatedir=$ac_optarg ;;
286
287   -runstatedir | --runstatedir | --runstatedi | --runstated \
288   | --runstate | --runstat | --runsta | --runst \
289   | --runs | --run | --ru)
290     ac_prev=runstatedir ;;
291   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
292   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
293   | --runs=* | --run=* | --ru=*)
294     runstatedir=$ac_optarg ;;
295
296   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
297     ac_prev=mandir ;;
298   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
299     mandir=$ac_optarg ;;
300
301   -nfp | --nfp | --nf)
302     # Obsolete; use --without-fp.
303     with_fp=no ;;
304
305   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
306   | --no-cr | --no-c)
307     no_create=yes ;;
308
309   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
310   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
311     no_recursion=yes ;;
312
313   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
314   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
315   | --oldin | --oldi | --old | --ol | --o)
316     ac_prev=oldincludedir ;;
317   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
318   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
319   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
320     oldincludedir=$ac_optarg ;;
321
322   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
323     ac_prev=prefix ;;
324   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
325     prefix=$ac_optarg ;;
326
327   -program-prefix | --program-prefix | --program-prefi | --program-pref \
328   | --program-pre | --program-pr | --program-p)
329     ac_prev=program_prefix ;;
330   -program-prefix=* | --program-prefix=* | --program-prefi=* \
331   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
332     program_prefix=$ac_optarg ;;
333
334   -program-suffix | --program-suffix | --program-suffi | --program-suff \
335   | --program-suf | --program-su | --program-s)
336     ac_prev=program_suffix ;;
337   -program-suffix=* | --program-suffix=* | --program-suffi=* \
338   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
339     program_suffix=$ac_optarg ;;
340
341   -program-transform-name | --program-transform-name \
342   | --program-transform-nam | --program-transform-na \
343   | --program-transform-n | --program-transform- \
344   | --program-transform | --program-transfor \
345   | --program-transfo | --program-transf \
346   | --program-trans | --program-tran \
347   | --progr-tra | --program-tr | --program-t)
348     ac_prev=program_transform_name ;;
349   -program-transform-name=* | --program-transform-name=* \
350   | --program-transform-nam=* | --program-transform-na=* \
351   | --program-transform-n=* | --program-transform-=* \
352   | --program-transform=* | --program-transfor=* \
353   | --program-transfo=* | --program-transf=* \
354   | --program-trans=* | --program-tran=* \
355   | --progr-tra=* | --program-tr=* | --program-t=*)
356     program_transform_name=$ac_optarg ;;
357
358   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
359   | -silent | --silent | --silen | --sile | --sil)
360     silent=yes ;;
361
362   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
363     ac_prev=sbindir ;;
364   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
365   | --sbi=* | --sb=*)
366     sbindir=$ac_optarg ;;
367
368   -sharedstatedir | --sharedstatedir | --sharedstatedi \
369   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
370   | --sharedst | --shareds | --shared | --share | --shar \
371   | --sha | --sh)
372     ac_prev=sharedstatedir ;;
373   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
374   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
375   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
376   | --sha=* | --sh=*)
377     sharedstatedir=$ac_optarg ;;
378
379   -site | --site | --sit)
380     ac_prev=site ;;
381   -site=* | --site=* | --sit=*)
382     site=$ac_optarg ;;
383
384   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
385     ac_prev=srcdir ;;
386   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
387     srcdir=$ac_optarg ;;
388
389   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
390   | --syscon | --sysco | --sysc | --sys | --sy)
391     ac_prev=sysconfdir ;;
392   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
393   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
394     sysconfdir=$ac_optarg ;;
395
396   -target | --target | --targe | --targ | --tar | --ta | --t)
397     ac_prev=target_alias ;;
398   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
399     target_alias=$ac_optarg ;;
400
401   -v | -verbose | --verbose | --verbos | --verbo | --verb)
402     verbose=yes ;;
403
404   -version | --version | --versio | --versi | --vers | -V)
405     ac_init_version=: ;;
406
407   -with-* | --with-*)
408     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
409     # Reject names that are not valid shell variable names.
410     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
411       { echo "$as_me: error: invalid package name: $ac_package" >&2
412    { (exit 1); exit 1; }; }
413     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
414     case "$ac_option" in
415       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
416       *) ac_optarg=yes ;;
417     esac
418     eval "with_$ac_package='$ac_optarg'" ;;
419
420   -without-* | --without-*)
421     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
422     # Reject names that are not valid shell variable names.
423     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
424       { echo "$as_me: error: invalid package name: $ac_package" >&2
425    { (exit 1); exit 1; }; }
426     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
427     eval "with_$ac_package=no" ;;
428
429   --x)
430     # Obsolete; use --with-x.
431     with_x=yes ;;
432
433   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
434   | --x-incl | --x-inc | --x-in | --x-i)
435     ac_prev=x_includes ;;
436   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
437   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
438     x_includes=$ac_optarg ;;
439
440   -x-libraries | --x-libraries | --x-librarie | --x-librari \
441   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
442     ac_prev=x_libraries ;;
443   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
444   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
445     x_libraries=$ac_optarg ;;
446
447   -*) { echo "$as_me: error: unrecognized option: $ac_option
448 Try \`$0 --help' for more information." >&2
449    { (exit 1); exit 1; }; }
450     ;;
451
452   *=*)
453     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
454     # Reject names that are not valid shell variable names.
455     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
456       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
457    { (exit 1); exit 1; }; }
458     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
459     eval "$ac_envvar='$ac_optarg'"
460     export "$ac_envvar" ;;
461
462   *)
463     # FIXME: should be removed in autoconf 3.0.
464     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
465     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
466       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
467     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
468     ;;
469
470   esac
471 done
472
473 if test -n "$ac_prev"; then
474   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
475   { echo "$as_me: error: missing argument to $ac_option" >&2
476    { (exit 1); exit 1; }; }
477 fi
478
479 # Be sure to have absolute paths.
480 for ac_var in exec_prefix prefix
481 do
482   eval ac_val=$`echo "$ac_var"`
483   case "$ac_val" in
484     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # Be sure to have absolute paths.
491 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
492               localstatedir libdir includedir oldincludedir infodir mandir
493 do
494   eval ac_val=$`echo "$ac_var"`
495   case "$ac_val" in
496     [\\/$]* | ?:[\\/]* ) ;;
497     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
498    { (exit 1); exit 1; }; };;
499   esac
500 done
501
502 # There might be people who depend on the old broken behavior: `$host'
503 # used to hold the argument of --host etc.
504 build=$build_alias
505 host=$host_alias
506 target=$target_alias
507
508 # FIXME: should be removed in autoconf 3.0.
509 if test "x$host_alias" != x; then
510   if test "x$build_alias" = x; then
511     cross_compiling=maybe
512     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
513     If a cross compiler is detected then cross compile mode will be used." >&2
514   elif test "x$build_alias" != "x$host_alias"; then
515     cross_compiling=yes
516   fi
517 fi
518
519 ac_tool_prefix=
520 test -n "$host_alias" && ac_tool_prefix=$host_alias-
521
522 test "$silent" = yes && exec 6>/dev/null
523
524 # Find the source files, if location was not specified.
525 if test -z "$srcdir"; then
526   ac_srcdir_defaulted=yes
527   # Try the directory containing this script, then its parent.
528   ac_prog=$0
529   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
530   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
531   srcdir=$ac_confdir
532   if test ! -r "$srcdir/$ac_unique_file"; then
533     srcdir=..
534   fi
535 else
536   ac_srcdir_defaulted=no
537 fi
538 if test ! -r "$srcdir/$ac_unique_file"; then
539   if test "$ac_srcdir_defaulted" = yes; then
540     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
541    { (exit 1); exit 1; }; }
542   else
543     { echo "$as_me: error: cannot find sources in $srcdir" >&2
544    { (exit 1); exit 1; }; }
545   fi
546 fi
547 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
548 ac_env_build_alias_set=${build_alias+set}
549 ac_env_build_alias_value=$build_alias
550 ac_cv_env_build_alias_set=${build_alias+set}
551 ac_cv_env_build_alias_value=$build_alias
552 ac_env_host_alias_set=${host_alias+set}
553 ac_env_host_alias_value=$host_alias
554 ac_cv_env_host_alias_set=${host_alias+set}
555 ac_cv_env_host_alias_value=$host_alias
556 ac_env_target_alias_set=${target_alias+set}
557 ac_env_target_alias_value=$target_alias
558 ac_cv_env_target_alias_set=${target_alias+set}
559 ac_cv_env_target_alias_value=$target_alias
560 ac_env_CC_set=${CC+set}
561 ac_env_CC_value=$CC
562 ac_cv_env_CC_set=${CC+set}
563 ac_cv_env_CC_value=$CC
564 ac_env_CFLAGS_set=${CFLAGS+set}
565 ac_env_CFLAGS_value=$CFLAGS
566 ac_cv_env_CFLAGS_set=${CFLAGS+set}
567 ac_cv_env_CFLAGS_value=$CFLAGS
568 ac_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_env_LDFLAGS_value=$LDFLAGS
570 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
571 ac_cv_env_LDFLAGS_value=$LDFLAGS
572 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_env_CPPFLAGS_value=$CPPFLAGS
574 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
575 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
576 ac_env_CPP_set=${CPP+set}
577 ac_env_CPP_value=$CPP
578 ac_cv_env_CPP_set=${CPP+set}
579 ac_cv_env_CPP_value=$CPP
580
581 #
582 # Report the --help message.
583 #
584 if test "$ac_init_help" = "long"; then
585   # Omit some internal or obsolete options to make the list less imposing.
586   # This message is too long to be a string in the A/UX 3.1 sh.
587   cat <<EOF
588 \`configure' configures this package to adapt to many kinds of systems.
589
590 Usage: $0 [OPTION]... [VAR=VALUE]...
591
592 To assign environment variables (e.g., CC, CFLAGS...), specify them as
593 VAR=VALUE.  See below for descriptions of some of the useful variables.
594
595 Defaults for the options are specified in brackets.
596
597 Configuration:
598   -h, --help              display this help and exit
599       --help=short        display options specific to this package
600       --help=recursive    display the short help of all the included packages
601   -V, --version           display version information and exit
602   -q, --quiet, --silent   do not print \`checking...' messages
603       --cache-file=FILE   cache test results in FILE [disabled]
604   -C, --config-cache      alias for \`--cache-file=config.cache'
605   -n, --no-create         do not create output files
606       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
607
608 EOF
609
610   cat <<EOF
611 Installation directories:
612   --prefix=PREFIX         install architecture-independent files in PREFIX
613                           [$ac_default_prefix]
614   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
615                           [PREFIX]
616
617 By default, \`make install' will install all the files in
618 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
619 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
620 for instance \`--prefix=\$HOME'.
621
622 For better control, use the options below.
623
624 Fine tuning of the installation directories:
625   --bindir=DIR            user executables [EPREFIX/bin]
626   --sbindir=DIR           system admin executables [EPREFIX/sbin]
627   --libexecdir=DIR        program executables [EPREFIX/libexec]
628   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
629   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
630   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
631   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
632   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
633   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
634   --libdir=DIR            object code libraries [EPREFIX/lib]
635   --includedir=DIR        C header files [PREFIX/include]
636   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
637   --infodir=DIR           info documentation [DATAROOTDIR/info]
638   --mandir=DIR            man documentation [DATAROOTDIR/man]
639 EOF
640
641   cat <<\EOF
642
643 Program names:
644   --program-prefix=PREFIX            prepend PREFIX to installed program names
645   --program-suffix=SUFFIX            append SUFFIX to installed program names
646   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
647
648 X features:
649   --x-includes=DIR    X include files are in DIR
650   --x-libraries=DIR   X library files are in DIR
651
652 System types:
653   --build=BUILD           configure for building on BUILD [guessed]
654   --host=HOST       build programs to run on HOST [BUILD]
655 EOF
656 fi
657
658 if test -n "$ac_init_help"; then
659
660   cat <<\EOF
661
662 Optional Features:
663   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
664   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
665
666 Optional Packages:
667   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
668   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
669
670 General Options:
671   --disable-stripping     do not strip (debug info) installed executables
672   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
673   --enable-string-hacks   work around bogus compiler/loader warnings
674   --with-pkg-config{=path} enable/disable use of pkg-config
675   --disable-echo          do not display "compiling" commands
676 Curses Version-dependent Options:
677   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
678   --disable-widec         disable checks for wide-character functions
679   --with-curses-dir=DIR   directory in which (n)curses is installed
680   --with-screen=XXX       use specified curses-libraries
681   --with-ncursesw         use wide ncurses-libraries
682   --with-ncurses          use ncurses-libraries
683   --with-pdcurses         compile/link with pdcurses X11 library
684   --with-curses-colr      compile/link with HPUX 10.x color-curses
685   --with-curses-5lib      compile/link with SunOS 5lib curses
686   --with-Xaw3d            link with Xaw 3d library
687   --with-Xaw3dxft         link with Xaw 3d xft library
688   --with-neXtaw           link with neXT Athena library
689   --with-XawPlus          link with Athena-Plus library
690   --with-x                use the X Window System
691   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
692   --with-form-libname=XXX override form basename of library
693   --with-menu-libname=XXX override menu basename of library
694   --with-panel-libname=XXX override panel basename of library
695   --disable-panel         disable checks for panel functions
696   --disable-menu          disable checks for menu functions
697   --disable-form          disable checks for form functions
698 Testing/development Options:
699   --enable-warnings       test: turn on gcc compiler warnings
700   --with-dmalloc          test: use Gray Watson's dmalloc library
701   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
702   --with-valgrind         test: use valgrind
703   --disable-leaks         test: free permanent memory, analyze leaks
704   --disable-rpath-hack    don't add rpath options for additional libraries
705
706 Some influential environment variables:
707   CC          C compiler command
708   CFLAGS      C compiler flags
709   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
710               nonstandard directory <lib dir>
711   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
712               headers in a nonstandard directory <include dir>
713   CPP         C preprocessor
714
715 Use these variables to override the choices made by `configure' or to help
716 it to find libraries and programs with nonstandard names/locations.
717
718 EOF
719 fi
720
721 if test "$ac_init_help" = "recursive"; then
722   # If there are subdirs, report their specific --help.
723   ac_popdir=`pwd`
724   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
725     cd "$ac_subdir"
726     # A "../" for each directory in /$ac_subdir.
727     ac_dots=`echo "$ac_subdir" |
728              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
729
730     case "$srcdir" in
731     .) # No --srcdir option.  We are building in place.
732       ac_sub_srcdir="$srcdir" ;;
733     [\\/]* | ?:[\\/]* ) # Absolute path.
734       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
735     *) # Relative path.
736       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
737     esac
738
739     # Check for guested configure; otherwise get Cygnus style configure.
740     if test -f "$ac_sub_srcdir/configure.gnu"; then
741       echo
742       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
743     elif test -f "$ac_sub_srcdir/configure"; then
744       echo
745       $SHELL "$ac_sub_srcdir/configure" --help=recursive
746     elif test -f "$ac_sub_srcdir/configure.ac" ||
747            test -f "$ac_sub_srcdir/configure.in"; then
748       echo
749       "$ac_configure" --help
750     else
751       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
752     fi
753     cd "$ac_popdir"
754   done
755 fi
756
757 test -n "$ac_init_help" && exit 0
758 if "$ac_init_version"; then
759   cat <<\EOF
760
761 Copyright 2003-2020,2021        Thomas E. Dickey
762 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
763 Free Software Foundation, Inc.
764 This configure script is free software; the Free Software Foundation
765 gives unlimited permission to copy, distribute and modify it.
766 EOF
767   exit 0
768 fi
769 exec 5>config.log
770 cat >&5 <<EOF
771 This file contains any messages produced by compilers while
772 running configure, to aid debugging if configure makes a mistake.
773
774 It was created by $as_me, which was
775 generated by GNU Autoconf 2.52.20210105.  Invocation command line was
776
777   $ $0 $@
778
779 EOF
780 {
781 cat <<_ASUNAME
782 ## ---------- ##
783 ## Platform.  ##
784 ## ---------- ##
785
786 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
787 uname -m = `(uname -m) 2>/dev/null || echo unknown`
788 uname -r = `(uname -r) 2>/dev/null || echo unknown`
789 uname -s = `(uname -s) 2>/dev/null || echo unknown`
790 uname -v = `(uname -v) 2>/dev/null || echo unknown`
791
792 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
793 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
794
795 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
796 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
797 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
798 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
799 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
800 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
801 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
802
803 PATH = $PATH
804
805 _ASUNAME
806 } >&5
807
808 cat >&5 <<EOF
809 ## ------------ ##
810 ## Core tests.  ##
811 ## ------------ ##
812
813 EOF
814
815 # Keep a trace of the command line.
816 # Strip out --no-create and --no-recursion so they do not pile up.
817 # Also quote any args containing shell meta-characters.
818 ac_configure_args=
819 ac_sep=
820 for ac_arg
821 do
822   case "$ac_arg" in
823   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
824   | --no-cr | --no-c) ;;
825   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
826   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
827   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
828     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
829     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
830     ac_sep=" " ;;
831   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
832      ac_sep=" " ;;
833   esac
834   # Get rid of the leading space.
835 done
836
837 # When interrupted or exit'd, cleanup temporary files, and complete
838 # config.log.  We remove comments because anyway the quotes in there
839 # would cause problems or look ugly.
840 trap 'exit_status=$?
841   # Save into config.log some information that might help in debugging.
842   echo >&5
843   echo "## ----------------- ##" >&5
844   echo "## Cache variables.  ##" >&5
845   echo "## ----------------- ##" >&5
846   echo >&5
847   # The following way of writing the cache mishandles newlines in values,
848 {
849   (set) 2>&1 |
850     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
851     *ac_space=\ *)
852       sed -n \
853         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
854           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
855       ;;
856     *)
857       sed -n \
858         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
859       ;;
860     esac;
861 } >&5
862   sed "/^$/d" confdefs.h >conftest.log
863   if test -s conftest.log; then
864     echo >&5
865     echo "## ------------ ##" >&5
866     echo "## confdefs.h.  ##" >&5
867     echo "## ------------ ##" >&5
868     echo >&5
869     cat conftest.log >&5
870   fi
871   (echo; echo) >&5
872   test "$ac_signal" != 0 &&
873     echo "$as_me: caught signal $ac_signal" >&5
874   echo "$as_me: exit $exit_status" >&5
875   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
876     exit $exit_status
877      ' 0
878 for ac_signal in 1 2 13 15; do
879   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
880 done
881 ac_signal=0
882
883 # confdefs.h avoids OS command line length limits that DEFS can exceed.
884 rm -rf conftest* confdefs.h
885 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
886 echo >confdefs.h
887
888 # Let the site file select an alternate cache file if it wants to.
889 # Prefer explicitly selected file to automatically selected ones.
890 if test -z "$CONFIG_SITE"; then
891   if test "x$prefix" != xNONE; then
892     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
893   else
894     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
895   fi
896 fi
897 for ac_site_file in $CONFIG_SITE; do
898   if test -r "$ac_site_file"; then
899     { echo "$as_me:899: loading site script $ac_site_file" >&5
900 echo "$as_me: loading site script $ac_site_file" >&6;}
901     cat "$ac_site_file" >&5
902     . "$ac_site_file"
903   fi
904 done
905
906 if test -r "$cache_file"; then
907   # Some versions of bash will fail to source /dev/null (special
908   # files actually), so we avoid doing that.
909   if test -f "$cache_file"; then
910     { echo "$as_me:910: loading cache $cache_file" >&5
911 echo "$as_me: loading cache $cache_file" >&6;}
912     case $cache_file in
913       [\\/]* | ?:[\\/]* ) . $cache_file;;
914       *)                      . ./$cache_file;;
915     esac
916   fi
917 else
918   { echo "$as_me:918: creating cache $cache_file" >&5
919 echo "$as_me: creating cache $cache_file" >&6;}
920   >$cache_file
921 fi
922
923 # Check that the precious variables saved in the cache have kept the same
924 # value.
925 ac_cache_corrupted=false
926 for ac_var in `(set) 2>&1 |
927                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
928   eval ac_old_set=\$ac_cv_env_${ac_var}_set
929   eval ac_new_set=\$ac_env_${ac_var}_set
930   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
931   eval ac_new_val="\$ac_env_${ac_var}_value"
932   case "$ac_old_set,$ac_new_set" in
933     set,)
934       { echo "$as_me:934: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
935 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
936       ac_cache_corrupted=: ;;
937     ,set)
938       { echo "$as_me:938: error: \`$ac_var' was not set in the previous run" >&5
939 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
940       ac_cache_corrupted=: ;;
941     ,);;
942     *)
943       if test "x$ac_old_val" != "x$ac_new_val"; then
944         { echo "$as_me:944: error: \`$ac_var' has changed since the previous run:" >&5
945 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
946         { echo "$as_me:946:   former value:  $ac_old_val" >&5
947 echo "$as_me:   former value:  $ac_old_val" >&2;}
948         { echo "$as_me:948:   current value: $ac_new_val" >&5
949 echo "$as_me:   current value: $ac_new_val" >&2;}
950         ac_cache_corrupted=:
951       fi;;
952   esac
953   # Pass precious variables to config.status.  It doesn't matter if
954   # we pass some twice (in addition to the command line arguments).
955   if test "$ac_new_set" = set; then
956     case "$ac_new_val" in
957     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
958       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
959       ac_configure_args="$ac_configure_args '$ac_arg'"
960       ;;
961     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
962        ;;
963     esac
964   fi
965 done
966 if "$ac_cache_corrupted"; then
967   { echo "$as_me:967: error: changes in the environment can compromise the build" >&5
968 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
969   { { echo "$as_me:969: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
970 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
971    { (exit 1); exit 1; }; }
972 fi
973
974 ac_ext=c
975 ac_cpp='$CPP $CPPFLAGS'
976 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
977 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
978 ac_compiler_gnu=$ac_cv_c_compiler_gnu
979 ac_main_return="return"
980
981 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
982   *c*,-n*) ECHO_N=
983            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
984            ECHO_T='     '
985            ;;
986   *c*,*  ) ECHO_N=-n
987            ECHO_C=
988            ECHO_T=
989            ;;
990   *)       ECHO_N=
991            ECHO_C='\c'
992            ECHO_T=
993            ;;
994 esac
995 echo "#! $SHELL" >conftest.sh
996 echo  "exit 0"   >>conftest.sh
997 chmod +x conftest.sh
998 if { (echo "$as_me:998: PATH=\".;.\"; conftest.sh") >&5
999   (PATH=".;."; conftest.sh) 2>&5
1000   ac_status=$?
1001   echo "$as_me:1001: \$? = $ac_status" >&5
1002   (exit "$ac_status"); }; then
1003   ac_path_separator=';'
1004 else
1005   ac_path_separator=:
1006 fi
1007 PATH_SEPARATOR="$ac_path_separator"
1008 rm -f conftest.sh
1009
1010 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
1011
1012 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
1013
1014 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1015
1016 ac_aux_dir=
1017 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1018   if test -f "$ac_dir/install-sh"; then
1019     ac_aux_dir=$ac_dir
1020     ac_install_sh="$ac_aux_dir/install-sh -c"
1021     break
1022   elif test -f "$ac_dir/install.sh"; then
1023     ac_aux_dir=$ac_dir
1024     ac_install_sh="$ac_aux_dir/install.sh -c"
1025     break
1026   elif test -f "$ac_dir/shtool"; then
1027     ac_aux_dir=$ac_dir
1028     ac_install_sh="$ac_aux_dir/shtool install -c"
1029     break
1030   fi
1031 done
1032 if test -z "$ac_aux_dir"; then
1033   { { echo "$as_me:1033: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1034 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1035    { (exit 1); exit 1; }; }
1036 fi
1037 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1038 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1039 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1040
1041 # Make sure we can run config.sub.
1042 $ac_config_sub sun4 >/dev/null 2>&1 ||
1043   { { echo "$as_me:1043: error: cannot run $ac_config_sub" >&5
1044 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1045    { (exit 1); exit 1; }; }
1046
1047 echo "$as_me:1047: checking build system type" >&5
1048 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1049 if test "${ac_cv_build+set}" = set; then
1050   echo $ECHO_N "(cached) $ECHO_C" >&6
1051 else
1052   ac_cv_build_alias=$build_alias
1053 test -z "$ac_cv_build_alias" &&
1054   ac_cv_build_alias=`$ac_config_guess`
1055 test -z "$ac_cv_build_alias" &&
1056   { { echo "$as_me:1056: error: cannot guess build type; you must specify one" >&5
1057 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1058    { (exit 1); exit 1; }; }
1059 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1060   { { echo "$as_me:1060: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1061 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1062    { (exit 1); exit 1; }; }
1063
1064 fi
1065 echo "$as_me:1065: result: $ac_cv_build" >&5
1066 echo "${ECHO_T}$ac_cv_build" >&6
1067 build=$ac_cv_build
1068 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1069 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1070 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1071
1072 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1073         echo "$as_me:1073: checking host system type" >&5
1074 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1075 if test "${ac_cv_host+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   ac_cv_host_alias=$host_alias
1079 test -z "$ac_cv_host_alias" &&
1080   ac_cv_host_alias=$ac_cv_build_alias
1081 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1082   { { echo "$as_me:1082: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1083 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1084    { (exit 1); exit 1; }; }
1085
1086 fi
1087 echo "$as_me:1087: result: $ac_cv_host" >&5
1088 echo "${ECHO_T}$ac_cv_host" >&6
1089 host=$ac_cv_host
1090 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1091 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1092 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1093
1094         system_name="$host_os"
1095 else
1096         system_name="`(uname -s -r) 2>/dev/null`"
1097         if test -z "$system_name" ; then
1098                 system_name="`(hostname) 2>/dev/null`"
1099         fi
1100 fi
1101 test -n "$system_name" &&
1102 cat >>confdefs.h <<EOF
1103 #define SYSTEM_NAME "$system_name"
1104 EOF
1105
1106 if test "${cf_cv_system_name+set}" = set; then
1107   echo $ECHO_N "(cached) $ECHO_C" >&6
1108 else
1109   cf_cv_system_name="$system_name"
1110 fi
1111
1112 test -z "$system_name" && system_name="$cf_cv_system_name"
1113 test -n "$cf_cv_system_name" && echo "$as_me:1113: result: Configuring for $cf_cv_system_name" >&5
1114 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1115
1116 if test ".$system_name" != ".$cf_cv_system_name" ; then
1117         echo "$as_me:1117: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1118 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1119         { { echo "$as_me:1119: error: \"Please remove config.cache and try again.\"" >&5
1120 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1121    { (exit 1); exit 1; }; }
1122 fi
1123
1124 test "$program_prefix" != NONE &&
1125   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1126 # Use a double $ so make ignores it.
1127 test "$program_suffix" != NONE &&
1128   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1129 # Double any \ or $.  echo might interpret backslashes.
1130 # By default was `s,x,x', remove it if useless.
1131 cat <<\_ACEOF >conftest.sed
1132 s/[\\$]/&&/g;s/;s,x,x,$//
1133 _ACEOF
1134 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1135 rm conftest.sed
1136
1137 echo "$as_me:1137: checking whether ${MAKE-make} sets \${MAKE}" >&5
1138 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1139 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1140 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1141   echo $ECHO_N "(cached) $ECHO_C" >&6
1142 else
1143   cat >conftest.make <<\EOF
1144 all:
1145         @echo 'ac_maketemp="${MAKE}"'
1146 EOF
1147 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1148 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1149 if test -n "$ac_maketemp"; then
1150   eval ac_cv_prog_make_${ac_make}_set=yes
1151 else
1152   eval ac_cv_prog_make_${ac_make}_set=no
1153 fi
1154 rm -f conftest.make
1155 fi
1156 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1157   echo "$as_me:1157: result: yes" >&5
1158 echo "${ECHO_T}yes" >&6
1159   SET_MAKE=
1160 else
1161   echo "$as_me:1161: result: no" >&5
1162 echo "${ECHO_T}no" >&6
1163   SET_MAKE="MAKE=${MAKE-make}"
1164 fi
1165
1166 ac_ext=c
1167 ac_cpp='$CPP $CPPFLAGS'
1168 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1169 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1170 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1171 ac_main_return="return"
1172 if test -n "$ac_tool_prefix"; then
1173   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1174 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1175 echo "$as_me:1175: checking for $ac_word" >&5
1176 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1177 if test "${ac_cv_prog_CC+set}" = set; then
1178   echo $ECHO_N "(cached) $ECHO_C" >&6
1179 else
1180   if test -n "$CC"; then
1181   ac_cv_prog_CC="$CC" # Let the user override the test.
1182 else
1183   ac_save_IFS=$IFS; IFS=$ac_path_separator
1184 ac_dummy="$PATH"
1185 for ac_dir in $ac_dummy; do
1186   IFS=$ac_save_IFS
1187   test -z "$ac_dir" && ac_dir=.
1188   $as_executable_p "$ac_dir/$ac_word" || continue
1189 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1190 echo "$as_me:1190: found $ac_dir/$ac_word" >&5
1191 break
1192 done
1193
1194 fi
1195 fi
1196 CC=$ac_cv_prog_CC
1197 if test -n "$CC"; then
1198   echo "$as_me:1198: result: $CC" >&5
1199 echo "${ECHO_T}$CC" >&6
1200 else
1201   echo "$as_me:1201: result: no" >&5
1202 echo "${ECHO_T}no" >&6
1203 fi
1204
1205 fi
1206 if test -z "$ac_cv_prog_CC"; then
1207   ac_ct_CC=$CC
1208   # Extract the first word of "gcc", so it can be a program name with args.
1209 set dummy gcc; ac_word=$2
1210 echo "$as_me:1210: checking for $ac_word" >&5
1211 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1212 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1213   echo $ECHO_N "(cached) $ECHO_C" >&6
1214 else
1215   if test -n "$ac_ct_CC"; then
1216   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1217 else
1218   ac_save_IFS=$IFS; IFS=$ac_path_separator
1219 ac_dummy="$PATH"
1220 for ac_dir in $ac_dummy; do
1221   IFS=$ac_save_IFS
1222   test -z "$ac_dir" && ac_dir=.
1223   $as_executable_p "$ac_dir/$ac_word" || continue
1224 ac_cv_prog_ac_ct_CC="gcc"
1225 echo "$as_me:1225: found $ac_dir/$ac_word" >&5
1226 break
1227 done
1228
1229 fi
1230 fi
1231 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1232 if test -n "$ac_ct_CC"; then
1233   echo "$as_me:1233: result: $ac_ct_CC" >&5
1234 echo "${ECHO_T}$ac_ct_CC" >&6
1235 else
1236   echo "$as_me:1236: result: no" >&5
1237 echo "${ECHO_T}no" >&6
1238 fi
1239
1240   CC=$ac_ct_CC
1241 else
1242   CC="$ac_cv_prog_CC"
1243 fi
1244
1245 if test -z "$CC"; then
1246   if test -n "$ac_tool_prefix"; then
1247   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1248 set dummy ${ac_tool_prefix}cc; ac_word=$2
1249 echo "$as_me:1249: checking for $ac_word" >&5
1250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1251 if test "${ac_cv_prog_CC+set}" = set; then
1252   echo $ECHO_N "(cached) $ECHO_C" >&6
1253 else
1254   if test -n "$CC"; then
1255   ac_cv_prog_CC="$CC" # Let the user override the test.
1256 else
1257   ac_save_IFS=$IFS; IFS=$ac_path_separator
1258 ac_dummy="$PATH"
1259 for ac_dir in $ac_dummy; do
1260   IFS=$ac_save_IFS
1261   test -z "$ac_dir" && ac_dir=.
1262   $as_executable_p "$ac_dir/$ac_word" || continue
1263 ac_cv_prog_CC="${ac_tool_prefix}cc"
1264 echo "$as_me:1264: found $ac_dir/$ac_word" >&5
1265 break
1266 done
1267
1268 fi
1269 fi
1270 CC=$ac_cv_prog_CC
1271 if test -n "$CC"; then
1272   echo "$as_me:1272: result: $CC" >&5
1273 echo "${ECHO_T}$CC" >&6
1274 else
1275   echo "$as_me:1275: result: no" >&5
1276 echo "${ECHO_T}no" >&6
1277 fi
1278
1279 fi
1280 if test -z "$ac_cv_prog_CC"; then
1281   ac_ct_CC=$CC
1282   # Extract the first word of "cc", so it can be a program name with args.
1283 set dummy cc; ac_word=$2
1284 echo "$as_me:1284: checking for $ac_word" >&5
1285 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1286 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1287   echo $ECHO_N "(cached) $ECHO_C" >&6
1288 else
1289   if test -n "$ac_ct_CC"; then
1290   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1291 else
1292   ac_save_IFS=$IFS; IFS=$ac_path_separator
1293 ac_dummy="$PATH"
1294 for ac_dir in $ac_dummy; do
1295   IFS=$ac_save_IFS
1296   test -z "$ac_dir" && ac_dir=.
1297   $as_executable_p "$ac_dir/$ac_word" || continue
1298 ac_cv_prog_ac_ct_CC="cc"
1299 echo "$as_me:1299: found $ac_dir/$ac_word" >&5
1300 break
1301 done
1302
1303 fi
1304 fi
1305 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1306 if test -n "$ac_ct_CC"; then
1307   echo "$as_me:1307: result: $ac_ct_CC" >&5
1308 echo "${ECHO_T}$ac_ct_CC" >&6
1309 else
1310   echo "$as_me:1310: result: no" >&5
1311 echo "${ECHO_T}no" >&6
1312 fi
1313
1314   CC=$ac_ct_CC
1315 else
1316   CC="$ac_cv_prog_CC"
1317 fi
1318
1319 fi
1320 if test -z "$CC"; then
1321   # Extract the first word of "cc", so it can be a program name with args.
1322 set dummy cc; ac_word=$2
1323 echo "$as_me:1323: checking for $ac_word" >&5
1324 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1325 if test "${ac_cv_prog_CC+set}" = set; then
1326   echo $ECHO_N "(cached) $ECHO_C" >&6
1327 else
1328   if test -n "$CC"; then
1329   ac_cv_prog_CC="$CC" # Let the user override the test.
1330 else
1331   ac_prog_rejected=no
1332   ac_save_IFS=$IFS; IFS=$ac_path_separator
1333 ac_dummy="$PATH"
1334 for ac_dir in $ac_dummy; do
1335   IFS=$ac_save_IFS
1336   test -z "$ac_dir" && ac_dir=.
1337   $as_executable_p "$ac_dir/$ac_word" || continue
1338 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1339   ac_prog_rejected=yes
1340   continue
1341 fi
1342 ac_cv_prog_CC="cc"
1343 echo "$as_me:1343: found $ac_dir/$ac_word" >&5
1344 break
1345 done
1346
1347 if test "$ac_prog_rejected" = yes; then
1348   # We found a bogon in the path, so make sure we never use it.
1349   set dummy $ac_cv_prog_CC
1350   shift
1351   if test $# != 0; then
1352     # We chose a different compiler from the bogus one.
1353     # However, it has the same basename, so the bogon will be chosen
1354     # first if we set CC to just the basename; use the full file name.
1355     shift
1356     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1357     shift
1358     ac_cv_prog_CC="$@"
1359   fi
1360 fi
1361 fi
1362 fi
1363 CC=$ac_cv_prog_CC
1364 if test -n "$CC"; then
1365   echo "$as_me:1365: result: $CC" >&5
1366 echo "${ECHO_T}$CC" >&6
1367 else
1368   echo "$as_me:1368: result: no" >&5
1369 echo "${ECHO_T}no" >&6
1370 fi
1371
1372 fi
1373 if test -z "$CC"; then
1374   if test -n "$ac_tool_prefix"; then
1375   for ac_prog in cl
1376   do
1377     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1378 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1379 echo "$as_me:1379: checking for $ac_word" >&5
1380 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1381 if test "${ac_cv_prog_CC+set}" = set; then
1382   echo $ECHO_N "(cached) $ECHO_C" >&6
1383 else
1384   if test -n "$CC"; then
1385   ac_cv_prog_CC="$CC" # Let the user override the test.
1386 else
1387   ac_save_IFS=$IFS; IFS=$ac_path_separator
1388 ac_dummy="$PATH"
1389 for ac_dir in $ac_dummy; do
1390   IFS=$ac_save_IFS
1391   test -z "$ac_dir" && ac_dir=.
1392   $as_executable_p "$ac_dir/$ac_word" || continue
1393 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1394 echo "$as_me:1394: found $ac_dir/$ac_word" >&5
1395 break
1396 done
1397
1398 fi
1399 fi
1400 CC=$ac_cv_prog_CC
1401 if test -n "$CC"; then
1402   echo "$as_me:1402: result: $CC" >&5
1403 echo "${ECHO_T}$CC" >&6
1404 else
1405   echo "$as_me:1405: result: no" >&5
1406 echo "${ECHO_T}no" >&6
1407 fi
1408
1409     test -n "$CC" && break
1410   done
1411 fi
1412 if test -z "$CC"; then
1413   ac_ct_CC=$CC
1414   for ac_prog in cl
1415 do
1416   # Extract the first word of "$ac_prog", so it can be a program name with args.
1417 set dummy $ac_prog; ac_word=$2
1418 echo "$as_me:1418: checking for $ac_word" >&5
1419 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1420 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1421   echo $ECHO_N "(cached) $ECHO_C" >&6
1422 else
1423   if test -n "$ac_ct_CC"; then
1424   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1425 else
1426   ac_save_IFS=$IFS; IFS=$ac_path_separator
1427 ac_dummy="$PATH"
1428 for ac_dir in $ac_dummy; do
1429   IFS=$ac_save_IFS
1430   test -z "$ac_dir" && ac_dir=.
1431   $as_executable_p "$ac_dir/$ac_word" || continue
1432 ac_cv_prog_ac_ct_CC="$ac_prog"
1433 echo "$as_me:1433: found $ac_dir/$ac_word" >&5
1434 break
1435 done
1436
1437 fi
1438 fi
1439 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1440 if test -n "$ac_ct_CC"; then
1441   echo "$as_me:1441: result: $ac_ct_CC" >&5
1442 echo "${ECHO_T}$ac_ct_CC" >&6
1443 else
1444   echo "$as_me:1444: result: no" >&5
1445 echo "${ECHO_T}no" >&6
1446 fi
1447
1448   test -n "$ac_ct_CC" && break
1449 done
1450
1451   CC=$ac_ct_CC
1452 fi
1453
1454 fi
1455
1456 test -z "$CC" && { { echo "$as_me:1456: error: no acceptable cc found in \$PATH" >&5
1457 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1458    { (exit 1); exit 1; }; }
1459
1460 # Provide some information about the compiler.
1461 echo "$as_me:1461:" \
1462      "checking for C compiler version" >&5
1463 ac_compiler=`set X $ac_compile; echo "$2"`
1464 { (eval echo "$as_me:1464: \"$ac_compiler --version </dev/null >&5\"") >&5
1465   (eval $ac_compiler --version </dev/null >&5) 2>&5
1466   ac_status=$?
1467   echo "$as_me:1467: \$? = $ac_status" >&5
1468   (exit "$ac_status"); }
1469 { (eval echo "$as_me:1469: \"$ac_compiler -v </dev/null >&5\"") >&5
1470   (eval $ac_compiler -v </dev/null >&5) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit "$ac_status"); }
1474 { (eval echo "$as_me:1474: \"$ac_compiler -V </dev/null >&5\"") >&5
1475   (eval $ac_compiler -V </dev/null >&5) 2>&5
1476   ac_status=$?
1477   echo "$as_me:1477: \$? = $ac_status" >&5
1478   (exit "$ac_status"); }
1479
1480 cat >"conftest.$ac_ext" <<_ACEOF
1481 #line 1481 "configure"
1482 #include "confdefs.h"
1483
1484 int
1485 main (void)
1486 {
1487
1488   ;
1489   return 0;
1490 }
1491 _ACEOF
1492 ac_clean_files_save=$ac_clean_files
1493 ac_clean_files="$ac_clean_files a.out a.exe"
1494 # Try to create an executable without -o first, disregard a.out.
1495 # It will help us diagnose broken compilers, and finding out an intuition
1496 # of exeext.
1497 echo "$as_me:1497: checking for C compiler default output" >&5
1498 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1499 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1500 if { (eval echo "$as_me:1500: \"$ac_link_default\"") >&5
1501   (eval $ac_link_default) 2>&5
1502   ac_status=$?
1503   echo "$as_me:1503: \$? = $ac_status" >&5
1504   (exit "$ac_status"); }; then
1505   # Find the output, starting from the most likely.  This scheme is
1506 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1507 # resort.
1508 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1509                 ls a.out conftest 2>/dev/null;
1510                 ls a.* conftest.* 2>/dev/null`; do
1511   case $ac_file in
1512     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1513     a.out ) # We found the default executable, but exeext='' is most
1514             # certainly right.
1515             break;;
1516     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1517           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1518           export ac_cv_exeext
1519           break;;
1520     * ) break;;
1521   esac
1522 done
1523 else
1524   echo "$as_me: failed program was:" >&5
1525 cat "conftest.$ac_ext" >&5
1526 { { echo "$as_me:1526: error: C compiler cannot create executables" >&5
1527 echo "$as_me: error: C compiler cannot create executables" >&2;}
1528    { (exit 77); exit 77; }; }
1529 fi
1530
1531 ac_exeext=$ac_cv_exeext
1532 echo "$as_me:1532: result: $ac_file" >&5
1533 echo "${ECHO_T}$ac_file" >&6
1534
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether the C compiler works" >&5
1538 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1539 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1540 # If not cross compiling, check that we can run a simple program.
1541 if test "$cross_compiling" != yes; then
1542   if { ac_try='./$ac_file'
1543   { (eval echo "$as_me:1543: \"$ac_try\"") >&5
1544   (eval $ac_try) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit "$ac_status"); }; }; then
1548     cross_compiling=no
1549   else
1550     if test "$cross_compiling" = maybe; then
1551         cross_compiling=yes
1552     else
1553         { { echo "$as_me:1553: error: cannot run C compiled programs.
1554 If you meant to cross compile, use \`--host'." >&5
1555 echo "$as_me: error: cannot run C compiled programs.
1556 If you meant to cross compile, use \`--host'." >&2;}
1557    { (exit 1); exit 1; }; }
1558     fi
1559   fi
1560 fi
1561 echo "$as_me:1561: result: yes" >&5
1562 echo "${ECHO_T}yes" >&6
1563
1564 rm -f a.out a.exe "conftest$ac_cv_exeext"
1565 ac_clean_files=$ac_clean_files_save
1566 # Check the compiler produces executables we can run.  If not, either
1567 # the compiler is broken, or we cross compile.
1568 echo "$as_me:1568: checking whether we are cross compiling" >&5
1569 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1570 echo "$as_me:1570: result: $cross_compiling" >&5
1571 echo "${ECHO_T}$cross_compiling" >&6
1572
1573 echo "$as_me:1573: checking for executable suffix" >&5
1574 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1575 if { (eval echo "$as_me:1575: \"$ac_link\"") >&5
1576   (eval $ac_link) 2>&5
1577   ac_status=$?
1578   echo "$as_me:1578: \$? = $ac_status" >&5
1579   (exit "$ac_status"); }; then
1580   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1581 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1582 # work properly (i.e., refer to `conftest.exe'), while it won't with
1583 # `rm'.
1584 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1585   case $ac_file in
1586     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1587     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1588           export ac_cv_exeext
1589           break;;
1590     * ) break;;
1591   esac
1592 done
1593 else
1594   { { echo "$as_me:1594: error: cannot compute EXEEXT: cannot compile and link" >&5
1595 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1596    { (exit 1); exit 1; }; }
1597 fi
1598
1599 rm -f "conftest$ac_cv_exeext"
1600 echo "$as_me:1600: result: $ac_cv_exeext" >&5
1601 echo "${ECHO_T}$ac_cv_exeext" >&6
1602
1603 rm -f "conftest.$ac_ext"
1604 EXEEXT=$ac_cv_exeext
1605 ac_exeext=$EXEEXT
1606 echo "$as_me:1606: checking for object suffix" >&5
1607 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1608 if test "${ac_cv_objext+set}" = set; then
1609   echo $ECHO_N "(cached) $ECHO_C" >&6
1610 else
1611   cat >"conftest.$ac_ext" <<_ACEOF
1612 #line 1612 "configure"
1613 #include "confdefs.h"
1614
1615 int
1616 main (void)
1617 {
1618
1619   ;
1620   return 0;
1621 }
1622 _ACEOF
1623 rm -f conftest.o conftest.obj
1624 if { (eval echo "$as_me:1624: \"$ac_compile\"") >&5
1625   (eval $ac_compile) 2>&5
1626   ac_status=$?
1627   echo "$as_me:1627: \$? = $ac_status" >&5
1628   (exit "$ac_status"); }; then
1629   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1630   case $ac_file in
1631     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1632     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1633        break;;
1634   esac
1635 done
1636 else
1637   echo "$as_me: failed program was:" >&5
1638 cat "conftest.$ac_ext" >&5
1639 { { echo "$as_me:1639: error: cannot compute OBJEXT: cannot compile" >&5
1640 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1641    { (exit 1); exit 1; }; }
1642 fi
1643
1644 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1645 fi
1646 echo "$as_me:1646: result: $ac_cv_objext" >&5
1647 echo "${ECHO_T}$ac_cv_objext" >&6
1648 OBJEXT=$ac_cv_objext
1649 ac_objext=$OBJEXT
1650 echo "$as_me:1650: checking whether we are using the GNU C compiler" >&5
1651 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1652 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1653   echo $ECHO_N "(cached) $ECHO_C" >&6
1654 else
1655   cat >"conftest.$ac_ext" <<_ACEOF
1656 #line 1656 "configure"
1657 #include "confdefs.h"
1658
1659 int
1660 main (void)
1661 {
1662 #ifndef __GNUC__
1663        choke me
1664 #endif
1665
1666   ;
1667   return 0;
1668 }
1669 _ACEOF
1670 rm -f "conftest.$ac_objext"
1671 if { (eval echo "$as_me:1671: \"$ac_compile\"") >&5
1672   (eval $ac_compile) 2>&5
1673   ac_status=$?
1674   echo "$as_me:1674: \$? = $ac_status" >&5
1675   (exit "$ac_status"); } &&
1676          { ac_try='test -s "conftest.$ac_objext"'
1677   { (eval echo "$as_me:1677: \"$ac_try\"") >&5
1678   (eval $ac_try) 2>&5
1679   ac_status=$?
1680   echo "$as_me:1680: \$? = $ac_status" >&5
1681   (exit "$ac_status"); }; }; then
1682   ac_compiler_gnu=yes
1683 else
1684   echo "$as_me: failed program was:" >&5
1685 cat "conftest.$ac_ext" >&5
1686 ac_compiler_gnu=no
1687 fi
1688 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1689 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1690
1691 fi
1692 echo "$as_me:1692: result: $ac_cv_c_compiler_gnu" >&5
1693 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1694 GCC=`test $ac_compiler_gnu = yes && echo yes`
1695 ac_test_CFLAGS=${CFLAGS+set}
1696 ac_save_CFLAGS=$CFLAGS
1697 CFLAGS="-g"
1698 echo "$as_me:1698: checking whether $CC accepts -g" >&5
1699 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1700 if test "${ac_cv_prog_cc_g+set}" = set; then
1701   echo $ECHO_N "(cached) $ECHO_C" >&6
1702 else
1703   cat >"conftest.$ac_ext" <<_ACEOF
1704 #line 1704 "configure"
1705 #include "confdefs.h"
1706
1707 int
1708 main (void)
1709 {
1710
1711   ;
1712   return 0;
1713 }
1714 _ACEOF
1715 rm -f "conftest.$ac_objext"
1716 if { (eval echo "$as_me:1716: \"$ac_compile\"") >&5
1717   (eval $ac_compile) 2>&5
1718   ac_status=$?
1719   echo "$as_me:1719: \$? = $ac_status" >&5
1720   (exit "$ac_status"); } &&
1721          { ac_try='test -s "conftest.$ac_objext"'
1722   { (eval echo "$as_me:1722: \"$ac_try\"") >&5
1723   (eval $ac_try) 2>&5
1724   ac_status=$?
1725   echo "$as_me:1725: \$? = $ac_status" >&5
1726   (exit "$ac_status"); }; }; then
1727   ac_cv_prog_cc_g=yes
1728 else
1729   echo "$as_me: failed program was:" >&5
1730 cat "conftest.$ac_ext" >&5
1731 ac_cv_prog_cc_g=no
1732 fi
1733 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1734 fi
1735 echo "$as_me:1735: result: $ac_cv_prog_cc_g" >&5
1736 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1737 if test "$ac_test_CFLAGS" = set; then
1738   CFLAGS=$ac_save_CFLAGS
1739 elif test $ac_cv_prog_cc_g = yes; then
1740   if test "$GCC" = yes; then
1741     CFLAGS="-g -O2"
1742   else
1743     CFLAGS="-g"
1744   fi
1745 else
1746   if test "$GCC" = yes; then
1747     CFLAGS="-O2"
1748   else
1749     CFLAGS=
1750   fi
1751 fi
1752 # Some people use a C++ compiler to compile C.  Since we use `exit',
1753 # in C++ we need to declare it.  In case someone uses the same compiler
1754 # for both compiling C and C++ we need to have the C++ compiler decide
1755 # the declaration of exit, since it's the most demanding environment.
1756 cat >"conftest.$ac_ext" <<_ACEOF
1757 #ifndef __cplusplus
1758   choke me
1759 #endif
1760 _ACEOF
1761 rm -f "conftest.$ac_objext"
1762 if { (eval echo "$as_me:1762: \"$ac_compile\"") >&5
1763   (eval $ac_compile) 2>&5
1764   ac_status=$?
1765   echo "$as_me:1765: \$? = $ac_status" >&5
1766   (exit "$ac_status"); } &&
1767          { ac_try='test -s "conftest.$ac_objext"'
1768   { (eval echo "$as_me:1768: \"$ac_try\"") >&5
1769   (eval $ac_try) 2>&5
1770   ac_status=$?
1771   echo "$as_me:1771: \$? = $ac_status" >&5
1772   (exit "$ac_status"); }; }; then
1773   for ac_declaration in \
1774    ''\
1775    '#include <stdlib.h>' \
1776    'extern "C" void std::exit (int) throw (); using std::exit;' \
1777    'extern "C" void std::exit (int); using std::exit;' \
1778    'extern "C" void exit (int) throw ();' \
1779    'extern "C" void exit (int);' \
1780    'void exit (int);'
1781 do
1782   cat >"conftest.$ac_ext" <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 #include <stdlib.h>
1786 $ac_declaration
1787 int
1788 main (void)
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f "conftest.$ac_objext"
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit "$ac_status"); } &&
1801          { ac_try='test -s "conftest.$ac_objext"'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit "$ac_status"); }; }; then
1807   :
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat "conftest.$ac_ext" >&5
1811 continue
1812 fi
1813 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1814   cat >"conftest.$ac_ext" <<_ACEOF
1815 #line 1815 "configure"
1816 #include "confdefs.h"
1817 $ac_declaration
1818 int
1819 main (void)
1820 {
1821 exit (42);
1822   ;
1823   return 0;
1824 }
1825 _ACEOF
1826 rm -f "conftest.$ac_objext"
1827 if { (eval echo "$as_me:1827: \"$ac_compile\"") >&5
1828   (eval $ac_compile) 2>&5
1829   ac_status=$?
1830   echo "$as_me:1830: \$? = $ac_status" >&5
1831   (exit "$ac_status"); } &&
1832          { ac_try='test -s "conftest.$ac_objext"'
1833   { (eval echo "$as_me:1833: \"$ac_try\"") >&5
1834   (eval $ac_try) 2>&5
1835   ac_status=$?
1836   echo "$as_me:1836: \$? = $ac_status" >&5
1837   (exit "$ac_status"); }; }; then
1838   break
1839 else
1840   echo "$as_me: failed program was:" >&5
1841 cat "conftest.$ac_ext" >&5
1842 fi
1843 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1844 done
1845 rm -rf conftest*
1846 if test -n "$ac_declaration"; then
1847   echo '#ifdef __cplusplus' >>confdefs.h
1848   echo "$ac_declaration"    >>confdefs.h
1849   echo '#endif'             >>confdefs.h
1850 fi
1851
1852 else
1853   echo "$as_me: failed program was:" >&5
1854 cat "conftest.$ac_ext" >&5
1855 fi
1856 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1857 ac_ext=c
1858 ac_cpp='$CPP $CPPFLAGS'
1859 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1860 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1861 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1862 ac_main_return="return"
1863
1864 GCC_VERSION=none
1865 if test "$GCC" = yes ; then
1866         echo "$as_me:1866: checking version of $CC" >&5
1867 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1868         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1869         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1870         echo "$as_me:1870: result: $GCC_VERSION" >&5
1871 echo "${ECHO_T}$GCC_VERSION" >&6
1872 fi
1873
1874 INTEL_COMPILER=no
1875
1876 if test "$GCC" = yes ; then
1877         case "$host_os" in
1878         (linux*|gnu*)
1879                 echo "$as_me:1879: checking if this is really Intel C compiler" >&5
1880 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1881                 cf_save_CFLAGS="$CFLAGS"
1882                 CFLAGS="$CFLAGS -no-gcc"
1883                 cat >"conftest.$ac_ext" <<_ACEOF
1884 #line 1884 "configure"
1885 #include "confdefs.h"
1886
1887 int
1888 main (void)
1889 {
1890
1891 #ifdef __INTEL_COMPILER
1892 #else
1893 make an error
1894 #endif
1895
1896   ;
1897   return 0;
1898 }
1899 _ACEOF
1900 rm -f "conftest.$ac_objext"
1901 if { (eval echo "$as_me:1901: \"$ac_compile\"") >&5
1902   (eval $ac_compile) 2>&5
1903   ac_status=$?
1904   echo "$as_me:1904: \$? = $ac_status" >&5
1905   (exit "$ac_status"); } &&
1906          { ac_try='test -s "conftest.$ac_objext"'
1907   { (eval echo "$as_me:1907: \"$ac_try\"") >&5
1908   (eval $ac_try) 2>&5
1909   ac_status=$?
1910   echo "$as_me:1910: \$? = $ac_status" >&5
1911   (exit "$ac_status"); }; }; then
1912   INTEL_COMPILER=yes
1913 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1914
1915 else
1916   echo "$as_me: failed program was:" >&5
1917 cat "conftest.$ac_ext" >&5
1918 fi
1919 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1920                 CFLAGS="$cf_save_CFLAGS"
1921                 echo "$as_me:1921: result: $INTEL_COMPILER" >&5
1922 echo "${ECHO_T}$INTEL_COMPILER" >&6
1923                 ;;
1924         esac
1925 fi
1926
1927 CLANG_COMPILER=no
1928
1929 if test "$GCC" = yes ; then
1930         echo "$as_me:1930: checking if this is really Clang C compiler" >&5
1931 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1932         cf_save_CFLAGS="$CFLAGS"
1933         cat >"conftest.$ac_ext" <<_ACEOF
1934 #line 1934 "configure"
1935 #include "confdefs.h"
1936
1937 int
1938 main (void)
1939 {
1940
1941 #ifdef __clang__
1942 #else
1943 make an error
1944 #endif
1945
1946   ;
1947   return 0;
1948 }
1949 _ACEOF
1950 rm -f "conftest.$ac_objext"
1951 if { (eval echo "$as_me:1951: \"$ac_compile\"") >&5
1952   (eval $ac_compile) 2>&5
1953   ac_status=$?
1954   echo "$as_me:1954: \$? = $ac_status" >&5
1955   (exit "$ac_status"); } &&
1956          { ac_try='test -s "conftest.$ac_objext"'
1957   { (eval echo "$as_me:1957: \"$ac_try\"") >&5
1958   (eval $ac_try) 2>&5
1959   ac_status=$?
1960   echo "$as_me:1960: \$? = $ac_status" >&5
1961   (exit "$ac_status"); }; }; then
1962   CLANG_COMPILER=yes
1963
1964 else
1965   echo "$as_me: failed program was:" >&5
1966 cat "conftest.$ac_ext" >&5
1967 fi
1968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1969         CFLAGS="$cf_save_CFLAGS"
1970         echo "$as_me:1970: result: $CLANG_COMPILER" >&5
1971 echo "${ECHO_T}$CLANG_COMPILER" >&6
1972 fi
1973
1974 CLANG_VERSION=none
1975
1976 if test "x$CLANG_COMPILER" = "xyes" ; then
1977         case "$CC" in
1978         (c[1-9][0-9]|*/c[1-9][0-9])
1979                 { echo "$as_me:1979: WARNING: replacing broken compiler alias $CC" >&5
1980 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1981                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1982                 CC=clang
1983                 ;;
1984         esac
1985
1986         echo "$as_me:1986: checking version of $CC" >&5
1987 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1988         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1989         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1990         echo "$as_me:1990: result: $CLANG_VERSION" >&5
1991 echo "${ECHO_T}$CLANG_VERSION" >&6
1992
1993         for cf_clang_opt in \
1994                 -Qunused-arguments \
1995                 -Wno-error=implicit-function-declaration
1996         do
1997                 echo "$as_me:1997: checking if option $cf_clang_opt works" >&5
1998 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1999                 cf_save_CFLAGS="$CFLAGS"
2000                 CFLAGS="$CFLAGS $cf_clang_opt"
2001                 cat >"conftest.$ac_ext" <<_ACEOF
2002 #line 2002 "configure"
2003 #include "confdefs.h"
2004
2005                         #include <stdio.h>
2006 int
2007 main (void)
2008 {
2009
2010                         printf("hello!\\n");
2011   ;
2012   return 0;
2013 }
2014 _ACEOF
2015 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2016 if { (eval echo "$as_me:2016: \"$ac_link\"") >&5
2017   (eval $ac_link) 2>&5
2018   ac_status=$?
2019   echo "$as_me:2019: \$? = $ac_status" >&5
2020   (exit "$ac_status"); } &&
2021          { ac_try='test -s "conftest$ac_exeext"'
2022   { (eval echo "$as_me:2022: \"$ac_try\"") >&5
2023   (eval $ac_try) 2>&5
2024   ac_status=$?
2025   echo "$as_me:2025: \$? = $ac_status" >&5
2026   (exit "$ac_status"); }; }; then
2027
2028                         cf_clang_optok=yes
2029 else
2030   echo "$as_me: failed program was:" >&5
2031 cat "conftest.$ac_ext" >&5
2032
2033                         cf_clang_optok=no
2034 fi
2035 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2036                 echo "$as_me:2036: result: $cf_clang_optok" >&5
2037 echo "${ECHO_T}$cf_clang_optok" >&6
2038                 CFLAGS="$cf_save_CFLAGS"
2039                 if test "$cf_clang_optok" = yes; then
2040                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2041
2042 echo "${as_me:-configure}:2042: testing adding option $cf_clang_opt ..." 1>&5
2043
2044         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2045         CFLAGS="${CFLAGS}$cf_clang_opt"
2046
2047                 fi
2048         done
2049 fi
2050
2051 echo "$as_me:2051: checking for $CC option to accept ANSI C" >&5
2052 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2053 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2054   echo $ECHO_N "(cached) $ECHO_C" >&6
2055 else
2056   ac_cv_prog_cc_stdc=no
2057 ac_save_CC=$CC
2058 cat >"conftest.$ac_ext" <<_ACEOF
2059 #line 2059 "configure"
2060 #include "confdefs.h"
2061 #include <stdarg.h>
2062 #include <stdio.h>
2063 #include <sys/types.h>
2064 #include <sys/stat.h>
2065 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2066 struct buf { int x; };
2067 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2068 static char *e (p, i)
2069      char **p;
2070      int i;
2071 {
2072   return p[i];
2073 }
2074 static char *f (char * (*g) (char **, int), char **p, ...)
2075 {
2076   char *s;
2077   va_list v;
2078   va_start (v,p);
2079   s = g (p, va_arg (v,int));
2080   va_end (v);
2081   return s;
2082 }
2083 int test (int i, double x);
2084 struct s1 {int (*f) (int a);};
2085 struct s2 {int (*f) (double a);};
2086 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2087 int argc;
2088 char **argv;
2089 int
2090 main (void)
2091 {
2092 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2093   ;
2094   return 0;
2095 }
2096 _ACEOF
2097 # Don't try gcc -ansi; that turns off useful extensions and
2098 # breaks some systems' header files.
2099 # AIX                   -qlanglvl=ansi
2100 # Ultrix and OSF/1      -std1
2101 # HP-UX 10.20 and later -Ae
2102 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2103 # SVR4                  -Xc -D__EXTENSIONS__
2104 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2105 do
2106   CC="$ac_save_CC $ac_arg"
2107   rm -f "conftest.$ac_objext"
2108 if { (eval echo "$as_me:2108: \"$ac_compile\"") >&5
2109   (eval $ac_compile) 2>&5
2110   ac_status=$?
2111   echo "$as_me:2111: \$? = $ac_status" >&5
2112   (exit "$ac_status"); } &&
2113          { ac_try='test -s "conftest.$ac_objext"'
2114   { (eval echo "$as_me:2114: \"$ac_try\"") >&5
2115   (eval $ac_try) 2>&5
2116   ac_status=$?
2117   echo "$as_me:2117: \$? = $ac_status" >&5
2118   (exit "$ac_status"); }; }; then
2119   ac_cv_prog_cc_stdc=$ac_arg
2120 break
2121 else
2122   echo "$as_me: failed program was:" >&5
2123 cat "conftest.$ac_ext" >&5
2124 fi
2125 rm -f "conftest.$ac_objext"
2126 done
2127 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2128 CC=$ac_save_CC
2129
2130 fi
2131
2132 case "x$ac_cv_prog_cc_stdc" in
2133   x|xno)
2134     echo "$as_me:2134: result: none needed" >&5
2135 echo "${ECHO_T}none needed" >&6 ;;
2136   *)
2137     echo "$as_me:2137: result: $ac_cv_prog_cc_stdc" >&5
2138 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2139     CC="$CC $ac_cv_prog_cc_stdc" ;;
2140 esac
2141
2142 # This should have been defined by AC_PROG_CC
2143 : "${CC:=cc}"
2144
2145 echo "$as_me:2145: checking \$CFLAGS variable" >&5
2146 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2147 case "x$CFLAGS" in
2148 (*-[IUD]*)
2149         echo "$as_me:2149: result: broken" >&5
2150 echo "${ECHO_T}broken" >&6
2151         { echo "$as_me:2151: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2152 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2153         cf_flags="$CFLAGS"
2154         CFLAGS=
2155         for cf_arg in $cf_flags
2156         do
2157
2158 cf_fix_cppflags=no
2159 cf_new_cflags=
2160 cf_new_cppflags=
2161 cf_new_extra_cppflags=
2162
2163 for cf_add_cflags in $cf_arg
2164 do
2165 case "$cf_fix_cppflags" in
2166 (no)
2167         case "$cf_add_cflags" in
2168         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2169                 case "$cf_add_cflags" in
2170                 (-D*)
2171                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2172
2173                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2174                                 && test -z "${cf_tst_cflags}" \
2175                                 && cf_fix_cppflags=yes
2176
2177                         if test "$cf_fix_cppflags" = yes ; then
2178
2179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2181
2182                                 continue
2183                         elif test "${cf_tst_cflags}" = "\"'" ; then
2184
2185         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2186         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2187
2188                                 continue
2189                         fi
2190                         ;;
2191                 esac
2192                 case "$CPPFLAGS" in
2193                 (*$cf_add_cflags)
2194                         ;;
2195                 (*)
2196                         case "$cf_add_cflags" in
2197                         (-D*)
2198                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2199
2200 CPPFLAGS=`echo "$CPPFLAGS" | \
2201         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2202                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2203
2204                                 ;;
2205                         esac
2206
2207         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2208         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2209
2210                         ;;
2211                 esac
2212                 ;;
2213         (*)
2214
2215         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2216         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2217
2218                 ;;
2219         esac
2220         ;;
2221 (yes)
2222
2223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2225
2226         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2227
2228         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2229                 && test -z "${cf_tst_cflags}" \
2230                 && cf_fix_cppflags=no
2231         ;;
2232 esac
2233 done
2234
2235 if test -n "$cf_new_cflags" ; then
2236
2237         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2238         CFLAGS="${CFLAGS}$cf_new_cflags"
2239
2240 fi
2241
2242 if test -n "$cf_new_cppflags" ; then
2243
2244         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2245         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2246
2247 fi
2248
2249 if test -n "$cf_new_extra_cppflags" ; then
2250
2251         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2252         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2253
2254 fi
2255
2256         done
2257         ;;
2258 (*)
2259         echo "$as_me:2259: result: ok" >&5
2260 echo "${ECHO_T}ok" >&6
2261         ;;
2262 esac
2263
2264 echo "$as_me:2264: checking \$CC variable" >&5
2265 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2266 case "$CC" in
2267 (*[\ \  ]-*)
2268         echo "$as_me:2268: result: broken" >&5
2269 echo "${ECHO_T}broken" >&6
2270         { echo "$as_me:2270: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2271 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2272         # humor him...
2273         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2274         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2275         CC="$cf_prog"
2276         for cf_arg in $cf_flags
2277         do
2278                 case "x$cf_arg" in
2279                 (x-[IUDfgOW]*)
2280
2281 cf_fix_cppflags=no
2282 cf_new_cflags=
2283 cf_new_cppflags=
2284 cf_new_extra_cppflags=
2285
2286 for cf_add_cflags in $cf_arg
2287 do
2288 case "$cf_fix_cppflags" in
2289 (no)
2290         case "$cf_add_cflags" in
2291         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2292                 case "$cf_add_cflags" in
2293                 (-D*)
2294                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2295
2296                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2297                                 && test -z "${cf_tst_cflags}" \
2298                                 && cf_fix_cppflags=yes
2299
2300                         if test "$cf_fix_cppflags" = yes ; then
2301
2302         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2303         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2304
2305                                 continue
2306                         elif test "${cf_tst_cflags}" = "\"'" ; then
2307
2308         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2309         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2310
2311                                 continue
2312                         fi
2313                         ;;
2314                 esac
2315                 case "$CPPFLAGS" in
2316                 (*$cf_add_cflags)
2317                         ;;
2318                 (*)
2319                         case "$cf_add_cflags" in
2320                         (-D*)
2321                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2322
2323 CPPFLAGS=`echo "$CPPFLAGS" | \
2324         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2325                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2326
2327                                 ;;
2328                         esac
2329
2330         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2331         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2332
2333                         ;;
2334                 esac
2335                 ;;
2336         (*)
2337
2338         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2339         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2340
2341                 ;;
2342         esac
2343         ;;
2344 (yes)
2345
2346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2348
2349         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2350
2351         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2352                 && test -z "${cf_tst_cflags}" \
2353                 && cf_fix_cppflags=no
2354         ;;
2355 esac
2356 done
2357
2358 if test -n "$cf_new_cflags" ; then
2359
2360         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2361         CFLAGS="${CFLAGS}$cf_new_cflags"
2362
2363 fi
2364
2365 if test -n "$cf_new_cppflags" ; then
2366
2367         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2368         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2369
2370 fi
2371
2372 if test -n "$cf_new_extra_cppflags" ; then
2373
2374         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2375         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2376
2377 fi
2378
2379                         ;;
2380                 (*)
2381                         CC="$CC $cf_arg"
2382                         ;;
2383                 esac
2384         done
2385         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2386
2387 echo "${as_me:-configure}:2387: testing resulting CC: '$CC' ..." 1>&5
2388
2389         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2390
2391 echo "${as_me:-configure}:2391: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2392
2393         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2394
2395 echo "${as_me:-configure}:2395: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2396
2397         ;;
2398 (*)
2399         echo "$as_me:2399: result: ok" >&5
2400 echo "${ECHO_T}ok" >&6
2401         ;;
2402 esac
2403
2404 echo "$as_me:2404: checking for inline" >&5
2405 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2406 if test "${ac_cv_c_inline+set}" = set; then
2407   echo $ECHO_N "(cached) $ECHO_C" >&6
2408 else
2409   ac_cv_c_inline=no
2410 for ac_kw in inline __inline__ __inline; do
2411   cat >"conftest.$ac_ext" <<_ACEOF
2412 #line 2412 "configure"
2413 #include "confdefs.h"
2414 #ifndef __cplusplus
2415 static $ac_kw int static_foo () {return 0; }
2416 $ac_kw int foo () {return 0; }
2417 #endif
2418
2419 _ACEOF
2420 rm -f "conftest.$ac_objext"
2421 if { (eval echo "$as_me:2421: \"$ac_compile\"") >&5
2422   (eval $ac_compile) 2>&5
2423   ac_status=$?
2424   echo "$as_me:2424: \$? = $ac_status" >&5
2425   (exit "$ac_status"); } &&
2426          { ac_try='test -s "conftest.$ac_objext"'
2427   { (eval echo "$as_me:2427: \"$ac_try\"") >&5
2428   (eval $ac_try) 2>&5
2429   ac_status=$?
2430   echo "$as_me:2430: \$? = $ac_status" >&5
2431   (exit "$ac_status"); }; }; then
2432   ac_cv_c_inline=$ac_kw; break
2433 else
2434   echo "$as_me: failed program was:" >&5
2435 cat "conftest.$ac_ext" >&5
2436 fi
2437 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2438 done
2439
2440 fi
2441 echo "$as_me:2441: result: $ac_cv_c_inline" >&5
2442 echo "${ECHO_T}$ac_cv_c_inline" >&6
2443 case $ac_cv_c_inline in
2444   inline | yes) ;;
2445   no)
2446 cat >>confdefs.h <<\EOF
2447 #define inline
2448 EOF
2449  ;;
2450   *)  cat >>confdefs.h <<EOF
2451 #define inline $ac_cv_c_inline
2452 EOF
2453  ;;
2454 esac
2455
2456 for ac_prog in ggrep grep
2457 do
2458   # Extract the first word of "$ac_prog", so it can be a program name with args.
2459 set dummy $ac_prog; ac_word=$2
2460 echo "$as_me:2460: checking for $ac_word" >&5
2461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2462 if test "${ac_cv_prog_GREP+set}" = set; then
2463   echo $ECHO_N "(cached) $ECHO_C" >&6
2464 else
2465   if test -n "$GREP"; then
2466   ac_cv_prog_GREP="$GREP" # Let the user override the test.
2467 else
2468   ac_save_IFS=$IFS; IFS=$ac_path_separator
2469 ac_dummy="$PATH"
2470 for ac_dir in $ac_dummy; do
2471   IFS=$ac_save_IFS
2472   test -z "$ac_dir" && ac_dir=.
2473   $as_executable_p "$ac_dir/$ac_word" || continue
2474 ac_cv_prog_GREP="$ac_prog"
2475 echo "$as_me:2475: found $ac_dir/$ac_word" >&5
2476 break
2477 done
2478
2479 fi
2480 fi
2481 GREP=$ac_cv_prog_GREP
2482 if test -n "$GREP"; then
2483   echo "$as_me:2483: result: $GREP" >&5
2484 echo "${ECHO_T}$GREP" >&6
2485 else
2486   echo "$as_me:2486: result: no" >&5
2487 echo "${ECHO_T}no" >&6
2488 fi
2489
2490   test -n "$GREP" && break
2491 done
2492 test -n "$GREP" || GREP=": "
2493
2494 echo "$as_me:2494: checking for egrep" >&5
2495 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2496 if test "${ac_cv_path_EGREP+set}" = set; then
2497   echo $ECHO_N "(cached) $ECHO_C" >&6
2498 else
2499   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2500    then ac_cv_path_EGREP="$GREP -E"
2501    else
2502      for ac_prog in gegrep egrep
2503 do
2504   # Extract the first word of "$ac_prog", so it can be a program name with args.
2505 set dummy $ac_prog; ac_word=$2
2506 echo "$as_me:2506: checking for $ac_word" >&5
2507 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2508 if test "${ac_cv_path_EGREP+set}" = set; then
2509   echo $ECHO_N "(cached) $ECHO_C" >&6
2510 else
2511   case $EGREP in
2512   [\\/]* | ?:[\\/]*)
2513   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2514   ;;
2515   *)
2516   ac_save_IFS=$IFS; IFS=$ac_path_separator
2517 ac_dummy="$PATH"
2518 for ac_dir in $ac_dummy; do
2519   IFS=$ac_save_IFS
2520   test -z "$ac_dir" && ac_dir=.
2521   if $as_executable_p "$ac_dir/$ac_word"; then
2522    ac_cv_path_EGREP="$ac_dir/$ac_word"
2523    echo "$as_me:2523: found $ac_dir/$ac_word" >&5
2524    break
2525 fi
2526 done
2527
2528   ;;
2529 esac
2530 fi
2531 EGREP=$ac_cv_path_EGREP
2532
2533 if test -n "$EGREP"; then
2534   echo "$as_me:2534: result: $EGREP" >&5
2535 echo "${ECHO_T}$EGREP" >&6
2536 else
2537   echo "$as_me:2537: result: no" >&5
2538 echo "${ECHO_T}no" >&6
2539 fi
2540
2541   test -n "$EGREP" && break
2542 done
2543 test -n "$EGREP" || EGREP=": "
2544
2545      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2545: error: cannot find workable egrep" >&5
2546 echo "$as_me: error: cannot find workable egrep" >&2;}
2547    { (exit 1); exit 1; }; }
2548    fi
2549 fi
2550 echo "$as_me:2550: result: $ac_cv_path_EGREP" >&5
2551 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2552  EGREP="$ac_cv_path_EGREP"
2553
2554 ac_ext=c
2555 ac_cpp='$CPP $CPPFLAGS'
2556 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2557 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2558 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2559 ac_main_return="return"
2560 echo "$as_me:2560: checking how to run the C preprocessor" >&5
2561 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2562 # On Suns, sometimes $CPP names a directory.
2563 if test -n "$CPP" && test -d "$CPP"; then
2564   CPP=
2565 fi
2566 if test -z "$CPP"; then
2567   if test "${ac_cv_prog_CPP+set}" = set; then
2568   echo $ECHO_N "(cached) $ECHO_C" >&6
2569 else
2570       # Double quotes because CPP needs to be expanded
2571     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2572     do
2573       ac_preproc_ok=false
2574 for ac_c_preproc_warn_flag in '' yes
2575 do
2576   # Use a header file that comes with gcc, so configuring glibc
2577   # with a fresh cross-compiler works.
2578   # On the NeXT, cc -E runs the code through the compiler's parser,
2579   # not just through cpp. "Syntax error" is here to catch this case.
2580   cat >"conftest.$ac_ext" <<_ACEOF
2581 #line 2581 "configure"
2582 #include "confdefs.h"
2583 #include <assert.h>
2584                      Syntax error
2585 _ACEOF
2586 if { (eval echo "$as_me:2586: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2587   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2588   ac_status=$?
2589   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2590   rm -f conftest.er1
2591   cat conftest.err >&5
2592   echo "$as_me:2592: \$? = $ac_status" >&5
2593   (exit "$ac_status"); } >/dev/null; then
2594   if test -s conftest.err; then
2595     ac_cpp_err=$ac_c_preproc_warn_flag
2596   else
2597     ac_cpp_err=
2598   fi
2599 else
2600   ac_cpp_err=yes
2601 fi
2602 if test -z "$ac_cpp_err"; then
2603   :
2604 else
2605   echo "$as_me: failed program was:" >&5
2606   cat "conftest.$ac_ext" >&5
2607   # Broken: fails on valid input.
2608 continue
2609 fi
2610 rm -f conftest.err "conftest.$ac_ext"
2611
2612   # OK, works on sane cases.  Now check whether non-existent headers
2613   # can be detected and how.
2614   cat >"conftest.$ac_ext" <<_ACEOF
2615 #line 2615 "configure"
2616 #include "confdefs.h"
2617 #include <ac_nonexistent.h>
2618 _ACEOF
2619 if { (eval echo "$as_me:2619: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2620   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2621   ac_status=$?
2622   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2623   rm -f conftest.er1
2624   cat conftest.err >&5
2625   echo "$as_me:2625: \$? = $ac_status" >&5
2626   (exit "$ac_status"); } >/dev/null; then
2627   if test -s conftest.err; then
2628     ac_cpp_err=$ac_c_preproc_warn_flag
2629   else
2630     ac_cpp_err=
2631   fi
2632 else
2633   ac_cpp_err=yes
2634 fi
2635 if test -z "$ac_cpp_err"; then
2636   # Broken: success on invalid input.
2637 continue
2638 else
2639   echo "$as_me: failed program was:" >&5
2640   cat "conftest.$ac_ext" >&5
2641   # Passes both tests.
2642 ac_preproc_ok=:
2643 break
2644 fi
2645 rm -f conftest.err "conftest.$ac_ext"
2646
2647 done
2648 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2649 rm -f conftest.err "conftest.$ac_ext"
2650 if $ac_preproc_ok; then
2651   break
2652 fi
2653
2654     done
2655     ac_cv_prog_CPP=$CPP
2656
2657 fi
2658   CPP=$ac_cv_prog_CPP
2659 else
2660   ac_cv_prog_CPP=$CPP
2661 fi
2662 echo "$as_me:2662: result: $CPP" >&5
2663 echo "${ECHO_T}$CPP" >&6
2664 ac_preproc_ok=false
2665 for ac_c_preproc_warn_flag in '' yes
2666 do
2667   # Use a header file that comes with gcc, so configuring glibc
2668   # with a fresh cross-compiler works.
2669   # On the NeXT, cc -E runs the code through the compiler's parser,
2670   # not just through cpp. "Syntax error" is here to catch this case.
2671   cat >"conftest.$ac_ext" <<_ACEOF
2672 #line 2672 "configure"
2673 #include "confdefs.h"
2674 #include <assert.h>
2675                      Syntax error
2676 _ACEOF
2677 if { (eval echo "$as_me:2677: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2678   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2679   ac_status=$?
2680   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2681   rm -f conftest.er1
2682   cat conftest.err >&5
2683   echo "$as_me:2683: \$? = $ac_status" >&5
2684   (exit "$ac_status"); } >/dev/null; then
2685   if test -s conftest.err; then
2686     ac_cpp_err=$ac_c_preproc_warn_flag
2687   else
2688     ac_cpp_err=
2689   fi
2690 else
2691   ac_cpp_err=yes
2692 fi
2693 if test -z "$ac_cpp_err"; then
2694   :
2695 else
2696   echo "$as_me: failed program was:" >&5
2697   cat "conftest.$ac_ext" >&5
2698   # Broken: fails on valid input.
2699 continue
2700 fi
2701 rm -f conftest.err "conftest.$ac_ext"
2702
2703   # OK, works on sane cases.  Now check whether non-existent headers
2704   # can be detected and how.
2705   cat >"conftest.$ac_ext" <<_ACEOF
2706 #line 2706 "configure"
2707 #include "confdefs.h"
2708 #include <ac_nonexistent.h>
2709 _ACEOF
2710 if { (eval echo "$as_me:2710: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2711   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2712   ac_status=$?
2713   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2714   rm -f conftest.er1
2715   cat conftest.err >&5
2716   echo "$as_me:2716: \$? = $ac_status" >&5
2717   (exit "$ac_status"); } >/dev/null; then
2718   if test -s conftest.err; then
2719     ac_cpp_err=$ac_c_preproc_warn_flag
2720   else
2721     ac_cpp_err=
2722   fi
2723 else
2724   ac_cpp_err=yes
2725 fi
2726 if test -z "$ac_cpp_err"; then
2727   # Broken: success on invalid input.
2728 continue
2729 else
2730   echo "$as_me: failed program was:" >&5
2731   cat "conftest.$ac_ext" >&5
2732   # Passes both tests.
2733 ac_preproc_ok=:
2734 break
2735 fi
2736 rm -f conftest.err "conftest.$ac_ext"
2737
2738 done
2739 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2740 rm -f conftest.err "conftest.$ac_ext"
2741 if $ac_preproc_ok; then
2742   :
2743 else
2744   { { echo "$as_me:2744: error: C preprocessor \"$CPP\" fails sanity check" >&5
2745 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2746    { (exit 1); exit 1; }; }
2747 fi
2748
2749 ac_ext=c
2750 ac_cpp='$CPP $CPPFLAGS'
2751 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2752 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2753 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2754 ac_main_return="return"
2755
2756 for ac_prog in mawk gawk nawk awk
2757 do
2758   # Extract the first word of "$ac_prog", so it can be a program name with args.
2759 set dummy $ac_prog; ac_word=$2
2760 echo "$as_me:2760: checking for $ac_word" >&5
2761 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2762 if test "${ac_cv_prog_AWK+set}" = set; then
2763   echo $ECHO_N "(cached) $ECHO_C" >&6
2764 else
2765   if test -n "$AWK"; then
2766   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2767 else
2768   ac_save_IFS=$IFS; IFS=$ac_path_separator
2769 ac_dummy="$PATH"
2770 for ac_dir in $ac_dummy; do
2771   IFS=$ac_save_IFS
2772   test -z "$ac_dir" && ac_dir=.
2773   $as_executable_p "$ac_dir/$ac_word" || continue
2774 ac_cv_prog_AWK="$ac_prog"
2775 echo "$as_me:2775: found $ac_dir/$ac_word" >&5
2776 break
2777 done
2778
2779 fi
2780 fi
2781 AWK=$ac_cv_prog_AWK
2782 if test -n "$AWK"; then
2783   echo "$as_me:2783: result: $AWK" >&5
2784 echo "${ECHO_T}$AWK" >&6
2785 else
2786   echo "$as_me:2786: result: no" >&5
2787 echo "${ECHO_T}no" >&6
2788 fi
2789
2790   test -n "$AWK" && break
2791 done
2792
2793 # Find a good install program.  We prefer a C program (faster),
2794 # so one script is as good as another.  But avoid the broken or
2795 # incompatible versions:
2796 # SysV /etc/install, /usr/sbin/install
2797 # SunOS /usr/etc/install
2798 # IRIX /sbin/install
2799 # AIX /bin/install
2800 # AmigaOS /C/install, which installs bootblocks on floppy discs
2801 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2802 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2803 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2804 # ./install, which can be erroneously created by make from ./install.sh.
2805 echo "$as_me:2805: checking for a BSD compatible install" >&5
2806 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2807 if test -z "$INSTALL"; then
2808 if test "${ac_cv_path_install+set}" = set; then
2809   echo $ECHO_N "(cached) $ECHO_C" >&6
2810 else
2811     ac_save_IFS=$IFS; IFS=$ac_path_separator
2812   for ac_dir in $PATH; do
2813     IFS=$ac_save_IFS
2814     # Account for people who put trailing slashes in PATH elements.
2815     case $ac_dir/ in
2816     / | ./ | .// | /cC/* \
2817     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2818     | /usr/ucb/* ) ;;
2819     *)
2820       # OSF1 and SCO ODT 3.0 have their own names for install.
2821       # Don't use installbsd from OSF since it installs stuff as root
2822       # by default.
2823       for ac_prog in ginstall scoinst install; do
2824         if $as_executable_p "$ac_dir/$ac_prog"; then
2825           if test $ac_prog = install &&
2826             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2827             # AIX install.  It has an incompatible calling convention.
2828             :
2829           elif test $ac_prog = install &&
2830             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2831             # program-specific install script used by HP pwplus--don't use.
2832             :
2833           else
2834             ac_cv_path_install="$ac_dir/$ac_prog -c"
2835             break 2
2836           fi
2837         fi
2838       done
2839       ;;
2840     esac
2841   done
2842
2843 fi
2844   if test "${ac_cv_path_install+set}" = set; then
2845     INSTALL=$ac_cv_path_install
2846   else
2847     # As a last resort, use the slow shell script.  We don't cache a
2848     # path for INSTALL within a source directory, because that will
2849     # break other packages using the cache if that directory is
2850     # removed, or if the path is relative.
2851     INSTALL=$ac_install_sh
2852   fi
2853 fi
2854 echo "$as_me:2854: result: $INSTALL" >&5
2855 echo "${ECHO_T}$INSTALL" >&6
2856
2857 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2858 # It thinks the first close brace ends the variable substitution.
2859 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2860
2861 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2862
2863 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2864
2865 case $INSTALL in
2866 (/*)
2867         ;;
2868 (*)
2869         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2870         test -z "$cf_dir" && cf_dir=.
2871         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2872         ;;
2873 esac
2874
2875 echo "$as_me:2875: checking if you want to install stripped executables" >&5
2876 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2877
2878 # Check whether --enable-stripping or --disable-stripping was given.
2879 if test "${enable_stripping+set}" = set; then
2880   enableval="$enable_stripping"
2881   test "$enableval" != no && enableval=yes
2882         if test "$enableval" != "yes" ; then
2883     enable_stripping=no
2884         else
2885                 enable_stripping=yes
2886         fi
2887 else
2888   enableval=yes
2889         enable_stripping=yes
2890
2891 fi;
2892 echo "$as_me:2892: result: $enable_stripping" >&5
2893 echo "${ECHO_T}$enable_stripping" >&6
2894
2895 if test "$enable_stripping" = yes
2896 then
2897         INSTALL_OPT_S="-s"
2898 else
2899         INSTALL_OPT_S=
2900 fi
2901
2902 : "${INSTALL:=install}"
2903 echo "$as_me:2903: checking if install accepts -p option" >&5
2904 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2905 if test "${cf_cv_install_p+set}" = set; then
2906   echo $ECHO_N "(cached) $ECHO_C" >&6
2907 else
2908
2909         rm -rf ./conftest*
2910         date >conftest.in
2911         mkdir conftest.out
2912         sleep 3
2913         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2914         then
2915                 if test -f conftest.out/conftest.in
2916                 then
2917                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2918                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2919                         if test -s conftest.err
2920                         then
2921                                 cf_cv_install_p=no
2922                         else
2923                                 cf_cv_install_p=yes
2924                         fi
2925                 else
2926                         cf_cv_install_p=no
2927                 fi
2928         else
2929                 cf_cv_install_p=no
2930         fi
2931         rm -rf ./conftest*
2932
2933 fi
2934 echo "$as_me:2934: result: $cf_cv_install_p" >&5
2935 echo "${ECHO_T}$cf_cv_install_p" >&6
2936
2937 echo "$as_me:2937: checking if install needs to be told about ownership" >&5
2938 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2939 case `$ac_config_guess` in
2940 (*minix)
2941         with_install_o=yes
2942         ;;
2943 (*)
2944         with_install_o=no
2945         ;;
2946 esac
2947
2948 echo "$as_me:2948: result: $with_install_o" >&5
2949 echo "${ECHO_T}$with_install_o" >&6
2950 if test "x$with_install_o" = xyes
2951 then
2952         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
2953 else
2954         INSTALL_OPT_O=
2955 fi
2956
2957 for ac_prog in lint cppcheck splint
2958 do
2959   # Extract the first word of "$ac_prog", so it can be a program name with args.
2960 set dummy $ac_prog; ac_word=$2
2961 echo "$as_me:2961: checking for $ac_word" >&5
2962 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2963 if test "${ac_cv_prog_LINT+set}" = set; then
2964   echo $ECHO_N "(cached) $ECHO_C" >&6
2965 else
2966   if test -n "$LINT"; then
2967   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2968 else
2969   ac_save_IFS=$IFS; IFS=$ac_path_separator
2970 ac_dummy="$PATH"
2971 for ac_dir in $ac_dummy; do
2972   IFS=$ac_save_IFS
2973   test -z "$ac_dir" && ac_dir=.
2974   $as_executable_p "$ac_dir/$ac_word" || continue
2975 ac_cv_prog_LINT="$ac_prog"
2976 echo "$as_me:2976: found $ac_dir/$ac_word" >&5
2977 break
2978 done
2979
2980 fi
2981 fi
2982 LINT=$ac_cv_prog_LINT
2983 if test -n "$LINT"; then
2984   echo "$as_me:2984: result: $LINT" >&5
2985 echo "${ECHO_T}$LINT" >&6
2986 else
2987   echo "$as_me:2987: result: no" >&5
2988 echo "${ECHO_T}no" >&6
2989 fi
2990
2991   test -n "$LINT" && break
2992 done
2993
2994 case "x$LINT" in
2995 (xcppcheck|x*/cppcheck)
2996         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2997         ;;
2998 esac
2999
3000 echo "$as_me:3000: checking if filesystem supports mixed-case filenames" >&5
3001 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3002 if test "${cf_cv_mixedcase+set}" = set; then
3003   echo $ECHO_N "(cached) $ECHO_C" >&6
3004 else
3005
3006 if test "$cross_compiling" = yes ; then
3007         case "$target_alias" in
3008         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3009                 cf_cv_mixedcase=no
3010                 ;;
3011         (*)
3012                 cf_cv_mixedcase=yes
3013                 ;;
3014         esac
3015 else
3016         rm -f conftest CONFTEST
3017         echo test >conftest
3018         if test -f CONFTEST ; then
3019                 cf_cv_mixedcase=no
3020         else
3021                 cf_cv_mixedcase=yes
3022         fi
3023         rm -f conftest CONFTEST
3024 fi
3025
3026 fi
3027 echo "$as_me:3027: result: $cf_cv_mixedcase" >&5
3028 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3029 test "$cf_cv_mixedcase" = yes &&
3030 cat >>confdefs.h <<\EOF
3031 #define MIXEDCASE_FILENAMES 1
3032 EOF
3033
3034 for ac_prog in exctags ctags
3035 do
3036   # Extract the first word of "$ac_prog", so it can be a program name with args.
3037 set dummy $ac_prog; ac_word=$2
3038 echo "$as_me:3038: checking for $ac_word" >&5
3039 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3040 if test "${ac_cv_prog_CTAGS+set}" = set; then
3041   echo $ECHO_N "(cached) $ECHO_C" >&6
3042 else
3043   if test -n "$CTAGS"; then
3044   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3045 else
3046   ac_save_IFS=$IFS; IFS=$ac_path_separator
3047 ac_dummy="$PATH"
3048 for ac_dir in $ac_dummy; do
3049   IFS=$ac_save_IFS
3050   test -z "$ac_dir" && ac_dir=.
3051   $as_executable_p "$ac_dir/$ac_word" || continue
3052 ac_cv_prog_CTAGS="$ac_prog"
3053 echo "$as_me:3053: found $ac_dir/$ac_word" >&5
3054 break
3055 done
3056
3057 fi
3058 fi
3059 CTAGS=$ac_cv_prog_CTAGS
3060 if test -n "$CTAGS"; then
3061   echo "$as_me:3061: result: $CTAGS" >&5
3062 echo "${ECHO_T}$CTAGS" >&6
3063 else
3064   echo "$as_me:3064: result: no" >&5
3065 echo "${ECHO_T}no" >&6
3066 fi
3067
3068   test -n "$CTAGS" && break
3069 done
3070
3071 for ac_prog in exetags etags
3072 do
3073   # Extract the first word of "$ac_prog", so it can be a program name with args.
3074 set dummy $ac_prog; ac_word=$2
3075 echo "$as_me:3075: checking for $ac_word" >&5
3076 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3077 if test "${ac_cv_prog_ETAGS+set}" = set; then
3078   echo $ECHO_N "(cached) $ECHO_C" >&6
3079 else
3080   if test -n "$ETAGS"; then
3081   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3082 else
3083   ac_save_IFS=$IFS; IFS=$ac_path_separator
3084 ac_dummy="$PATH"
3085 for ac_dir in $ac_dummy; do
3086   IFS=$ac_save_IFS
3087   test -z "$ac_dir" && ac_dir=.
3088   $as_executable_p "$ac_dir/$ac_word" || continue
3089 ac_cv_prog_ETAGS="$ac_prog"
3090 echo "$as_me:3090: found $ac_dir/$ac_word" >&5
3091 break
3092 done
3093
3094 fi
3095 fi
3096 ETAGS=$ac_cv_prog_ETAGS
3097 if test -n "$ETAGS"; then
3098   echo "$as_me:3098: result: $ETAGS" >&5
3099 echo "${ECHO_T}$ETAGS" >&6
3100 else
3101   echo "$as_me:3101: result: no" >&5
3102 echo "${ECHO_T}no" >&6
3103 fi
3104
3105   test -n "$ETAGS" && break
3106 done
3107
3108 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3109 set dummy ${CTAGS:-ctags}; ac_word=$2
3110 echo "$as_me:3110: checking for $ac_word" >&5
3111 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3112 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3113   echo $ECHO_N "(cached) $ECHO_C" >&6
3114 else
3115   if test -n "$MAKE_LOWER_TAGS"; then
3116   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3117 else
3118   ac_save_IFS=$IFS; IFS=$ac_path_separator
3119 ac_dummy="$PATH"
3120 for ac_dir in $ac_dummy; do
3121   IFS=$ac_save_IFS
3122   test -z "$ac_dir" && ac_dir=.
3123   $as_executable_p "$ac_dir/$ac_word" || continue
3124 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3125 echo "$as_me:3125: found $ac_dir/$ac_word" >&5
3126 break
3127 done
3128
3129   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3130 fi
3131 fi
3132 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3133 if test -n "$MAKE_LOWER_TAGS"; then
3134   echo "$as_me:3134: result: $MAKE_LOWER_TAGS" >&5
3135 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3136 else
3137   echo "$as_me:3137: result: no" >&5
3138 echo "${ECHO_T}no" >&6
3139 fi
3140
3141 if test "$cf_cv_mixedcase" = yes ; then
3142         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3143 set dummy ${ETAGS:-etags}; ac_word=$2
3144 echo "$as_me:3144: checking for $ac_word" >&5
3145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3146 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3147   echo $ECHO_N "(cached) $ECHO_C" >&6
3148 else
3149   if test -n "$MAKE_UPPER_TAGS"; then
3150   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3151 else
3152   ac_save_IFS=$IFS; IFS=$ac_path_separator
3153 ac_dummy="$PATH"
3154 for ac_dir in $ac_dummy; do
3155   IFS=$ac_save_IFS
3156   test -z "$ac_dir" && ac_dir=.
3157   $as_executable_p "$ac_dir/$ac_word" || continue
3158 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3159 echo "$as_me:3159: found $ac_dir/$ac_word" >&5
3160 break
3161 done
3162
3163   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3164 fi
3165 fi
3166 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3167 if test -n "$MAKE_UPPER_TAGS"; then
3168   echo "$as_me:3168: result: $MAKE_UPPER_TAGS" >&5
3169 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3170 else
3171   echo "$as_me:3171: result: no" >&5
3172 echo "${ECHO_T}no" >&6
3173 fi
3174
3175 else
3176         MAKE_UPPER_TAGS=no
3177 fi
3178
3179 if test "$MAKE_UPPER_TAGS" = yes ; then
3180         MAKE_UPPER_TAGS=
3181 else
3182         MAKE_UPPER_TAGS="#"
3183 fi
3184
3185 if test "$MAKE_LOWER_TAGS" = yes ; then
3186         MAKE_LOWER_TAGS=
3187 else
3188         MAKE_LOWER_TAGS="#"
3189 fi
3190
3191 echo "$as_me:3191: checking if -lm needed for math functions" >&5
3192 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3193 if test "${cf_cv_need_libm+set}" = set; then
3194   echo $ECHO_N "(cached) $ECHO_C" >&6
3195 else
3196
3197         cat >"conftest.$ac_ext" <<_ACEOF
3198 #line 3198 "configure"
3199 #include "confdefs.h"
3200
3201         #include <stdio.h>
3202         #include <stdlib.h>
3203         #include <math.h>
3204
3205 int
3206 main (void)
3207 {
3208 double x = rand(); printf("result = %g\\n", pow(sin(x),x))
3209   ;
3210   return 0;
3211 }
3212 _ACEOF
3213 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3214 if { (eval echo "$as_me:3214: \"$ac_link\"") >&5
3215   (eval $ac_link) 2>&5
3216   ac_status=$?
3217   echo "$as_me:3217: \$? = $ac_status" >&5
3218   (exit "$ac_status"); } &&
3219          { ac_try='test -s "conftest$ac_exeext"'
3220   { (eval echo "$as_me:3220: \"$ac_try\"") >&5
3221   (eval $ac_try) 2>&5
3222   ac_status=$?
3223   echo "$as_me:3223: \$? = $ac_status" >&5
3224   (exit "$ac_status"); }; }; then
3225   cf_cv_need_libm=no
3226 else
3227   echo "$as_me: failed program was:" >&5
3228 cat "conftest.$ac_ext" >&5
3229 cf_cv_need_libm=yes
3230 fi
3231 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3232 fi
3233 echo "$as_me:3233: result: $cf_cv_need_libm" >&5
3234 echo "${ECHO_T}$cf_cv_need_libm" >&6
3235 if test "$cf_cv_need_libm" = yes
3236 then
3237 MATH_LIB=-lm
3238 fi
3239
3240 top_builddir=`pwd`
3241
3242 CC_G_OPT="-g"
3243 CC_SHARED_OPTS=unknown
3244 CPPFLAGS="$CPPFLAGS"
3245 DFT_DEP_SUFFIX=""
3246 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3247 DFT_UPR_MODEL="NORMAL"
3248 LD="ld"
3249 LDFLAGS_SHARED=""
3250 LDFLAGS_STATIC=""
3251 LD_MODEL=""
3252 LD_SHARED_OPTS=""
3253 LIBTOOL=""
3254 LIBTOOL_OPTS=""
3255 LIB_CLEAN=""
3256 LIB_COMPILE=""
3257 LIB_LINK='${CC}'
3258 LINK_TESTS=""
3259 LOCAL_LDFLAGS=""
3260 PACKAGE="ncurses-examples"
3261 PTHREAD="-lm"
3262 TEST_ARGS=""
3263 TEST_DEPS=""
3264 TEST_LIBS=""
3265 TINFO_LDFLAGS=''
3266 TINFO_LIBS='$(LIBS_CURSES)'
3267 cf_cv_abi_version=""
3268 cf_cv_rel_version=""
3269 includesubdir=""
3270
3271 cf_cv_screen=curses
3272 cf_cv_libtype=
3273
3274 echo "$as_me:3274: checking for fgrep" >&5
3275 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
3276 if test "${ac_cv_path_FGREP+set}" = set; then
3277   echo $ECHO_N "(cached) $ECHO_C" >&6
3278 else
3279   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
3280    then ac_cv_path_FGREP="$GREP -F"
3281    else
3282      for ac_prog in gfgrep fgrep
3283 do
3284   # Extract the first word of "$ac_prog", so it can be a program name with args.
3285 set dummy $ac_prog; ac_word=$2
3286 echo "$as_me:3286: checking for $ac_word" >&5
3287 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3288 if test "${ac_cv_path_FGREP+set}" = set; then
3289   echo $ECHO_N "(cached) $ECHO_C" >&6
3290 else
3291   case $FGREP in
3292   [\\/]* | ?:[\\/]*)
3293   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
3294   ;;
3295   *)
3296   ac_save_IFS=$IFS; IFS=$ac_path_separator
3297 ac_dummy="$PATH"
3298 for ac_dir in $ac_dummy; do
3299   IFS=$ac_save_IFS
3300   test -z "$ac_dir" && ac_dir=.
3301   if $as_executable_p "$ac_dir/$ac_word"; then
3302    ac_cv_path_FGREP="$ac_dir/$ac_word"
3303    echo "$as_me:3303: found $ac_dir/$ac_word" >&5
3304    break
3305 fi
3306 done
3307
3308   ;;
3309 esac
3310 fi
3311 FGREP=$ac_cv_path_FGREP
3312
3313 if test -n "$FGREP"; then
3314   echo "$as_me:3314: result: $FGREP" >&5
3315 echo "${ECHO_T}$FGREP" >&6
3316 else
3317   echo "$as_me:3317: result: no" >&5
3318 echo "${ECHO_T}no" >&6
3319 fi
3320
3321   test -n "$FGREP" && break
3322 done
3323 test -n "$FGREP" || FGREP=": "
3324
3325      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:3325: error: cannot find workable fgrep" >&5
3326 echo "$as_me: error: cannot find workable fgrep" >&2;}
3327    { (exit 1); exit 1; }; }
3328    fi
3329 fi
3330 echo "$as_me:3330: result: $ac_cv_path_FGREP" >&5
3331 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
3332  FGREP="$ac_cv_path_FGREP"
3333
3334 echo "$as_me:3334: checking if you want to use C11 _Noreturn feature" >&5
3335 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
3336
3337 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
3338 if test "${enable_stdnoreturn+set}" = set; then
3339   enableval="$enable_stdnoreturn"
3340   test "$enableval" != yes && enableval=no
3341         if test "$enableval" != "no" ; then
3342     enable_stdnoreturn=yes
3343         else
3344                 enable_stdnoreturn=no
3345         fi
3346 else
3347   enableval=no
3348         enable_stdnoreturn=no
3349
3350 fi;
3351 echo "$as_me:3351: result: $enable_stdnoreturn" >&5
3352 echo "${ECHO_T}$enable_stdnoreturn" >&6
3353
3354 if test $enable_stdnoreturn = yes; then
3355 echo "$as_me:3355: checking for C11 _Noreturn feature" >&5
3356 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
3357 if test "${cf_cv_c11_noreturn+set}" = set; then
3358   echo $ECHO_N "(cached) $ECHO_C" >&6
3359 else
3360   cat >"conftest.$ac_ext" <<_ACEOF
3361 #line 3361 "configure"
3362 #include "confdefs.h"
3363
3364 #include <stdio.h>
3365 #include <stdlib.h>
3366 #include <stdnoreturn.h>
3367 static _Noreturn void giveup(void) { exit(0); }
3368
3369 int
3370 main (void)
3371 {
3372 if (feof(stdin)) giveup()
3373   ;
3374   return 0;
3375 }
3376 _ACEOF
3377 rm -f "conftest.$ac_objext"
3378 if { (eval echo "$as_me:3378: \"$ac_compile\"") >&5
3379   (eval $ac_compile) 2>&5
3380   ac_status=$?
3381   echo "$as_me:3381: \$? = $ac_status" >&5
3382   (exit "$ac_status"); } &&
3383          { ac_try='test -s "conftest.$ac_objext"'
3384   { (eval echo "$as_me:3384: \"$ac_try\"") >&5
3385   (eval $ac_try) 2>&5
3386   ac_status=$?
3387   echo "$as_me:3387: \$? = $ac_status" >&5
3388   (exit "$ac_status"); }; }; then
3389   cf_cv_c11_noreturn=yes
3390 else
3391   echo "$as_me: failed program was:" >&5
3392 cat "conftest.$ac_ext" >&5
3393 cf_cv_c11_noreturn=no
3394 fi
3395 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3396
3397 fi
3398 echo "$as_me:3398: result: $cf_cv_c11_noreturn" >&5
3399 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
3400 else
3401         cf_cv_c11_noreturn=no,
3402 fi
3403
3404 if test "$cf_cv_c11_noreturn" = yes; then
3405
3406 cat >>confdefs.h <<\EOF
3407 #define HAVE_STDNORETURN_H 1
3408 EOF
3409
3410 cat >>confdefs.h <<EOF
3411 #define STDC_NORETURN _Noreturn
3412 EOF
3413
3414         HAVE_STDNORETURN_H=1
3415 else
3416         HAVE_STDNORETURN_H=0
3417 fi
3418
3419 if test "$GCC" = yes || test "$GXX" = yes
3420 then
3421 cat > conftest.i <<EOF
3422 #ifndef GCC_PRINTF
3423 #define GCC_PRINTF 0
3424 #endif
3425 #ifndef GCC_SCANF
3426 #define GCC_SCANF 0
3427 #endif
3428 #ifndef GCC_NORETURN
3429 #define GCC_NORETURN /* nothing */
3430 #endif
3431 #ifndef GCC_UNUSED
3432 #define GCC_UNUSED /* nothing */
3433 #endif
3434 EOF
3435 if test "$GCC" = yes
3436 then
3437         { echo "$as_me:3437: checking for $CC __attribute__ directives..." >&5
3438 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3439 cat > "conftest.$ac_ext" <<EOF
3440 #line 3440 "${as_me:-configure}"
3441 #include "confdefs.h"
3442 #include "conftest.h"
3443 #include "conftest.i"
3444 #if     GCC_PRINTF
3445 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3446 #else
3447 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3448 #endif
3449 #if     GCC_SCANF
3450 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3451 #else
3452 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3453 #endif
3454 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3455 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
3456 extern GCC_NORETURN void foo(void);
3457 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3458 EOF
3459         cf_printf_attribute=no
3460         cf_scanf_attribute=no
3461         for cf_attribute in scanf printf unused noreturn
3462         do
3463
3464 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3465
3466                 cf_directive="__attribute__(($cf_attribute))"
3467                 echo "checking for $CC $cf_directive" 1>&5
3468
3469                 case "$cf_attribute" in
3470                 (printf)
3471                         cf_printf_attribute=yes
3472                         cat >conftest.h <<EOF
3473 #define GCC_$cf_ATTRIBUTE 1
3474 EOF
3475                         ;;
3476                 (scanf)
3477                         cf_scanf_attribute=yes
3478                         cat >conftest.h <<EOF
3479 #define GCC_$cf_ATTRIBUTE 1
3480 EOF
3481                         ;;
3482                 (*)
3483                         cat >conftest.h <<EOF
3484 #define GCC_$cf_ATTRIBUTE $cf_directive
3485 EOF
3486                         ;;
3487                 esac
3488
3489                 if { (eval echo "$as_me:3489: \"$ac_compile\"") >&5
3490   (eval $ac_compile) 2>&5
3491   ac_status=$?
3492   echo "$as_me:3492: \$? = $ac_status" >&5
3493   (exit "$ac_status"); }; then
3494                         test -n "$verbose" && echo "$as_me:3494: result: ... $cf_attribute" >&5
3495 echo "${ECHO_T}... $cf_attribute" >&6
3496                         cat conftest.h >>confdefs.h
3497                         case "$cf_attribute" in
3498                         (noreturn)
3499
3500 cat >>confdefs.h <<EOF
3501 #define GCC_NORETURN $cf_directive
3502 EOF
3503
3504                                 ;;
3505                         (printf)
3506                                 cf_value='/* nothing */'
3507                                 if test "$cf_printf_attribute" != no ; then
3508                                         cf_value='__attribute__((format(printf,fmt,var)))'
3509
3510 cat >>confdefs.h <<\EOF
3511 #define GCC_PRINTF 1
3512 EOF
3513
3514                                 fi
3515
3516 cat >>confdefs.h <<EOF
3517 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3518 EOF
3519
3520                                 ;;
3521                         (scanf)
3522                                 cf_value='/* nothing */'
3523                                 if test "$cf_scanf_attribute" != no ; then
3524                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3525
3526 cat >>confdefs.h <<\EOF
3527 #define GCC_SCANF 1
3528 EOF
3529
3530                                 fi
3531
3532 cat >>confdefs.h <<EOF
3533 #define GCC_SCANFLIKE(fmt,var) $cf_value
3534 EOF
3535
3536                                 ;;
3537                         (unused)
3538
3539 cat >>confdefs.h <<EOF
3540 #define GCC_UNUSED $cf_directive
3541 EOF
3542
3543                                 ;;
3544                         esac
3545                 fi
3546         done
3547 else
3548         ${FGREP-fgrep} define conftest.i >>confdefs.h
3549 fi
3550 rm -rf ./conftest*
3551 fi
3552
3553 echo "$as_me:3553: checking if you want to work around bogus compiler/loader warnings" >&5
3554 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3555
3556 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3557 if test "${enable_string_hacks+set}" = set; then
3558   enableval="$enable_string_hacks"
3559   enable_string_hacks=$enableval
3560 else
3561   enable_string_hacks=no
3562 fi;
3563 echo "$as_me:3563: result: $enable_string_hacks" >&5
3564 echo "${ECHO_T}$enable_string_hacks" >&6
3565
3566 if test "x$enable_string_hacks" = "xyes"; then
3567
3568 cat >>confdefs.h <<\EOF
3569 #define USE_STRING_HACKS 1
3570 EOF
3571
3572         { echo "$as_me:3572: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3573 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3574         echo "$as_me:3574: checking for strlcat" >&5
3575 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3576 if test "${ac_cv_func_strlcat+set}" = set; then
3577   echo $ECHO_N "(cached) $ECHO_C" >&6
3578 else
3579   cat >"conftest.$ac_ext" <<_ACEOF
3580 #line 3580 "configure"
3581 #include "confdefs.h"
3582 #define strlcat autoconf_temporary
3583 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3584 #undef strlcat
3585
3586 #ifdef __cplusplus
3587 extern "C"
3588 #endif
3589
3590 /* We use char because int might match the return type of a gcc2
3591    builtin and then its argument prototype would still apply.  */
3592 char strlcat (void);
3593
3594 int
3595 main (void)
3596 {
3597
3598 /* The GNU C library defines stubs for functions which it implements
3599     to always fail with ENOSYS.  Some functions are actually named
3600     something starting with __ and the normal name is an alias.  */
3601 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3602 #error found stub for strlcat
3603 #endif
3604
3605         return strlcat ();
3606   ;
3607   return 0;
3608 }
3609 _ACEOF
3610 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3611 if { (eval echo "$as_me:3611: \"$ac_link\"") >&5
3612   (eval $ac_link) 2>&5
3613   ac_status=$?
3614   echo "$as_me:3614: \$? = $ac_status" >&5
3615   (exit "$ac_status"); } &&
3616          { ac_try='test -s "conftest$ac_exeext"'
3617   { (eval echo "$as_me:3617: \"$ac_try\"") >&5
3618   (eval $ac_try) 2>&5
3619   ac_status=$?
3620   echo "$as_me:3620: \$? = $ac_status" >&5
3621   (exit "$ac_status"); }; }; then
3622   ac_cv_func_strlcat=yes
3623 else
3624   echo "$as_me: failed program was:" >&5
3625 cat "conftest.$ac_ext" >&5
3626 ac_cv_func_strlcat=no
3627 fi
3628 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3629 fi
3630 echo "$as_me:3630: result: $ac_cv_func_strlcat" >&5
3631 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3632 if test "$ac_cv_func_strlcat" = yes; then
3633
3634 cat >>confdefs.h <<\EOF
3635 #define HAVE_STRLCAT 1
3636 EOF
3637
3638 else
3639
3640                 echo "$as_me:3640: checking for strlcat in -lbsd" >&5
3641 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3642 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3643   echo $ECHO_N "(cached) $ECHO_C" >&6
3644 else
3645   ac_check_lib_save_LIBS=$LIBS
3646 LIBS="-lbsd  $LIBS"
3647 cat >"conftest.$ac_ext" <<_ACEOF
3648 #line 3648 "configure"
3649 #include "confdefs.h"
3650
3651 /* Override any gcc2 internal prototype to avoid an error.  */
3652 #ifdef __cplusplus
3653 extern "C"
3654 #endif
3655 /* We use char because int might match the return type of a gcc2
3656    builtin and then its argument prototype would still apply.  */
3657 char strlcat ();
3658 int
3659 main (void)
3660 {
3661 strlcat ();
3662   ;
3663   return 0;
3664 }
3665 _ACEOF
3666 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3667 if { (eval echo "$as_me:3667: \"$ac_link\"") >&5
3668   (eval $ac_link) 2>&5
3669   ac_status=$?
3670   echo "$as_me:3670: \$? = $ac_status" >&5
3671   (exit "$ac_status"); } &&
3672          { ac_try='test -s "conftest$ac_exeext"'
3673   { (eval echo "$as_me:3673: \"$ac_try\"") >&5
3674   (eval $ac_try) 2>&5
3675   ac_status=$?
3676   echo "$as_me:3676: \$? = $ac_status" >&5
3677   (exit "$ac_status"); }; }; then
3678   ac_cv_lib_bsd_strlcat=yes
3679 else
3680   echo "$as_me: failed program was:" >&5
3681 cat "conftest.$ac_ext" >&5
3682 ac_cv_lib_bsd_strlcat=no
3683 fi
3684 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3685 LIBS=$ac_check_lib_save_LIBS
3686 fi
3687 echo "$as_me:3687: result: $ac_cv_lib_bsd_strlcat" >&5
3688 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3689 if test "$ac_cv_lib_bsd_strlcat" = yes; then
3690
3691 cf_add_libs="$LIBS"
3692 # reverse order
3693 cf_add_0lib=
3694 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3695 # filter duplicates
3696 for cf_add_1lib in $cf_add_0lib; do
3697         for cf_add_2lib in $cf_add_libs; do
3698                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3699                         cf_add_1lib=
3700                         break
3701                 fi
3702         done
3703         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3704 done
3705 LIBS="$cf_add_libs"
3706
3707 for ac_header in bsd/string.h
3708 do
3709 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3710 echo "$as_me:3710: checking for $ac_header" >&5
3711 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3712 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3713   echo $ECHO_N "(cached) $ECHO_C" >&6
3714 else
3715   cat >"conftest.$ac_ext" <<_ACEOF
3716 #line 3716 "configure"
3717 #include "confdefs.h"
3718 #include <$ac_header>
3719 _ACEOF
3720 if { (eval echo "$as_me:3720: \"$ac_cpp "conftest.$ac_ext"\"") >&5
3721   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
3722   ac_status=$?
3723   $EGREP -v '^ *\+' conftest.er1 >conftest.err
3724   rm -f conftest.er1
3725   cat conftest.err >&5
3726   echo "$as_me:3726: \$? = $ac_status" >&5
3727   (exit "$ac_status"); } >/dev/null; then
3728   if test -s conftest.err; then
3729     ac_cpp_err=$ac_c_preproc_warn_flag
3730   else
3731     ac_cpp_err=
3732   fi
3733 else
3734   ac_cpp_err=yes
3735 fi
3736 if test -z "$ac_cpp_err"; then
3737   eval "$as_ac_Header=yes"
3738 else
3739   echo "$as_me: failed program was:" >&5
3740   cat "conftest.$ac_ext" >&5
3741   eval "$as_ac_Header=no"
3742 fi
3743 rm -f conftest.err "conftest.$ac_ext"
3744 fi
3745 echo "$as_me:3745: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
3746 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
3747 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
3748   cat >>confdefs.h <<EOF
3749 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3750 EOF
3751
3752 fi
3753 done
3754
3755 cat >>confdefs.h <<\EOF
3756 #define HAVE_STRLCAT 1
3757 EOF
3758
3759 fi
3760
3761 fi
3762
3763 for ac_func in strlcpy snprintf
3764 do
3765 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3766 echo "$as_me:3766: checking for $ac_func" >&5
3767 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3768 if eval "test \"\${$as_ac_var+set}\" = set"; then
3769   echo $ECHO_N "(cached) $ECHO_C" >&6
3770 else
3771   cat >"conftest.$ac_ext" <<_ACEOF
3772 #line 3772 "configure"
3773 #include "confdefs.h"
3774 #define $ac_func autoconf_temporary
3775 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3776 #undef $ac_func
3777
3778 #ifdef __cplusplus
3779 extern "C"
3780 #endif
3781
3782 /* We use char because int might match the return type of a gcc2
3783    builtin and then its argument prototype would still apply.  */
3784 char $ac_func (void);
3785
3786 int
3787 main (void)
3788 {
3789
3790 /* The GNU C library defines stubs for functions which it implements
3791     to always fail with ENOSYS.  Some functions are actually named
3792     something starting with __ and the normal name is an alias.  */
3793 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3794 #error found stub for $ac_func
3795 #endif
3796
3797         return $ac_func ();
3798   ;
3799   return 0;
3800 }
3801 _ACEOF
3802 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
3803 if { (eval echo "$as_me:3803: \"$ac_link\"") >&5
3804   (eval $ac_link) 2>&5
3805   ac_status=$?
3806   echo "$as_me:3806: \$? = $ac_status" >&5
3807   (exit "$ac_status"); } &&
3808          { ac_try='test -s "conftest$ac_exeext"'
3809   { (eval echo "$as_me:3809: \"$ac_try\"") >&5
3810   (eval $ac_try) 2>&5
3811   ac_status=$?
3812   echo "$as_me:3812: \$? = $ac_status" >&5
3813   (exit "$ac_status"); }; }; then
3814   eval "$as_ac_var=yes"
3815 else
3816   echo "$as_me: failed program was:" >&5
3817 cat "conftest.$ac_ext" >&5
3818 eval "$as_ac_var=no"
3819 fi
3820 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
3821 fi
3822 echo "$as_me:3822: result: `eval echo '${'"$as_ac_var"'}'`" >&5
3823 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
3824 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
3825   cat >>confdefs.h <<EOF
3826 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3827 EOF
3828
3829 fi
3830 done
3831
3832 fi
3833
3834 echo "$as_me:3834: checking if the POSIX test-macros are already defined" >&5
3835 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3836 if test "${cf_cv_posix_visible+set}" = set; then
3837   echo $ECHO_N "(cached) $ECHO_C" >&6
3838 else
3839
3840 cat >"conftest.$ac_ext" <<_ACEOF
3841 #line 3841 "configure"
3842 #include "confdefs.h"
3843 #include <stdio.h>
3844 int
3845 main (void)
3846 {
3847
3848 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3849         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3850         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3851         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3852 #error conflicting symbols found
3853 #endif
3854
3855   ;
3856   return 0;
3857 }
3858 _ACEOF
3859 rm -f "conftest.$ac_objext"
3860 if { (eval echo "$as_me:3860: \"$ac_compile\"") >&5
3861   (eval $ac_compile) 2>&5
3862   ac_status=$?
3863   echo "$as_me:3863: \$? = $ac_status" >&5
3864   (exit "$ac_status"); } &&
3865          { ac_try='test -s "conftest.$ac_objext"'
3866   { (eval echo "$as_me:3866: \"$ac_try\"") >&5
3867   (eval $ac_try) 2>&5
3868   ac_status=$?
3869   echo "$as_me:3869: \$? = $ac_status" >&5
3870   (exit "$ac_status"); }; }; then
3871   cf_cv_posix_visible=no
3872 else
3873   echo "$as_me: failed program was:" >&5
3874 cat "conftest.$ac_ext" >&5
3875 cf_cv_posix_visible=yes
3876 fi
3877 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3878
3879 fi
3880 echo "$as_me:3880: result: $cf_cv_posix_visible" >&5
3881 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3882
3883 if test "$cf_cv_posix_visible" = no; then
3884
3885 cf_XOPEN_SOURCE=600
3886 cf_POSIX_C_SOURCE=199506L
3887 cf_xopen_source=
3888
3889 case "$host_os" in
3890 (aix[4-7]*)
3891         cf_xopen_source="-D_ALL_SOURCE"
3892         ;;
3893 (msys)
3894         cf_XOPEN_SOURCE=600
3895         ;;
3896 (darwin[0-8].*)
3897         cf_xopen_source="-D_APPLE_C_SOURCE"
3898         ;;
3899 (darwin*)
3900         cf_xopen_source="-D_DARWIN_C_SOURCE"
3901         cf_XOPEN_SOURCE=
3902         ;;
3903 (freebsd*|dragonfly*|midnightbsd*)
3904         # 5.x headers associate
3905         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3906         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3907         cf_POSIX_C_SOURCE=200112L
3908         cf_XOPEN_SOURCE=600
3909         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3910         ;;
3911 (hpux11*)
3912         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3913         ;;
3914 (hpux*)
3915         cf_xopen_source="-D_HPUX_SOURCE"
3916         ;;
3917 (irix[56].*)
3918         cf_xopen_source="-D_SGI_SOURCE"
3919         cf_XOPEN_SOURCE=
3920         ;;
3921 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3922
3923 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3924
3925 echo "$as_me:3925: checking if this is the GNU C library" >&5
3926 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3927 if test "${cf_cv_gnu_library+set}" = set; then
3928   echo $ECHO_N "(cached) $ECHO_C" >&6
3929 else
3930
3931 cat >"conftest.$ac_ext" <<_ACEOF
3932 #line 3932 "configure"
3933 #include "confdefs.h"
3934 #include <sys/types.h>
3935 int
3936 main (void)
3937 {
3938
3939         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3940                 return 0;
3941         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3942                 return 0;
3943         #else
3944         #       error not GNU C library
3945         #endif
3946   ;
3947   return 0;
3948 }
3949 _ACEOF
3950 rm -f "conftest.$ac_objext"
3951 if { (eval echo "$as_me:3951: \"$ac_compile\"") >&5
3952   (eval $ac_compile) 2>&5
3953   ac_status=$?
3954   echo "$as_me:3954: \$? = $ac_status" >&5
3955   (exit "$ac_status"); } &&
3956          { ac_try='test -s "conftest.$ac_objext"'
3957   { (eval echo "$as_me:3957: \"$ac_try\"") >&5
3958   (eval $ac_try) 2>&5
3959   ac_status=$?
3960   echo "$as_me:3960: \$? = $ac_status" >&5
3961   (exit "$ac_status"); }; }; then
3962   cf_cv_gnu_library=yes
3963 else
3964   echo "$as_me: failed program was:" >&5
3965 cat "conftest.$ac_ext" >&5
3966 cf_cv_gnu_library=no
3967 fi
3968 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
3969
3970 fi
3971 echo "$as_me:3971: result: $cf_cv_gnu_library" >&5
3972 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3973
3974 if test x$cf_cv_gnu_library = xyes; then
3975
3976         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3977         # was changed to help a little.  newlib incorporated the change about 4
3978         # years later.
3979         echo "$as_me:3979: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3980 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3981 if test "${cf_cv_gnu_library_219+set}" = set; then
3982   echo $ECHO_N "(cached) $ECHO_C" >&6
3983 else
3984
3985                 cf_save="$CPPFLAGS"
3986
3987         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3988         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3989
3990                 cat >"conftest.$ac_ext" <<_ACEOF
3991 #line 3991 "configure"
3992 #include "confdefs.h"
3993 #include <sys/types.h>
3994 int
3995 main (void)
3996 {
3997
3998                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3999                                 return 0;
4000                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
4001                                 return 0;
4002                         #else
4003                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
4004                         #endif
4005   ;
4006   return 0;
4007 }
4008 _ACEOF
4009 rm -f "conftest.$ac_objext"
4010 if { (eval echo "$as_me:4010: \"$ac_compile\"") >&5
4011   (eval $ac_compile) 2>&5
4012   ac_status=$?
4013   echo "$as_me:4013: \$? = $ac_status" >&5
4014   (exit "$ac_status"); } &&
4015          { ac_try='test -s "conftest.$ac_objext"'
4016   { (eval echo "$as_me:4016: \"$ac_try\"") >&5
4017   (eval $ac_try) 2>&5
4018   ac_status=$?
4019   echo "$as_me:4019: \$? = $ac_status" >&5
4020   (exit "$ac_status"); }; }; then
4021   cf_cv_gnu_library_219=yes
4022 else
4023   echo "$as_me: failed program was:" >&5
4024 cat "conftest.$ac_ext" >&5
4025 cf_cv_gnu_library_219=no
4026 fi
4027 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4028                 CPPFLAGS="$cf_save"
4029
4030 fi
4031 echo "$as_me:4031: result: $cf_cv_gnu_library_219" >&5
4032 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
4033
4034         if test "x$cf_cv_gnu_library_219" = xyes; then
4035                 cf_save="$CPPFLAGS"
4036                 echo "$as_me:4036: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
4037 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
4038 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
4039   echo $ECHO_N "(cached) $ECHO_C" >&6
4040 else
4041
4042 cf_fix_cppflags=no
4043 cf_new_cflags=
4044 cf_new_cppflags=
4045 cf_new_extra_cppflags=
4046
4047 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
4048 do
4049 case "$cf_fix_cppflags" in
4050 (no)
4051         case "$cf_add_cflags" in
4052         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4053                 case "$cf_add_cflags" in
4054                 (-D*)
4055                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4056
4057                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4058                                 && test -z "${cf_tst_cflags}" \
4059                                 && cf_fix_cppflags=yes
4060
4061                         if test "$cf_fix_cppflags" = yes ; then
4062
4063         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4064         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4065
4066                                 continue
4067                         elif test "${cf_tst_cflags}" = "\"'" ; then
4068
4069         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4070         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4071
4072                                 continue
4073                         fi
4074                         ;;
4075                 esac
4076                 case "$CPPFLAGS" in
4077                 (*$cf_add_cflags)
4078                         ;;
4079                 (*)
4080                         case "$cf_add_cflags" in
4081                         (-D*)
4082                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4083
4084 CPPFLAGS=`echo "$CPPFLAGS" | \
4085         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4086                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4087
4088                                 ;;
4089                         esac
4090
4091         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4092         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4093
4094                         ;;
4095                 esac
4096                 ;;
4097         (*)
4098
4099         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4100         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4101
4102                 ;;
4103         esac
4104         ;;
4105 (yes)
4106
4107         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4108         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4109
4110         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4111
4112         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4113                 && test -z "${cf_tst_cflags}" \
4114                 && cf_fix_cppflags=no
4115         ;;
4116 esac
4117 done
4118
4119 if test -n "$cf_new_cflags" ; then
4120
4121         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4122         CFLAGS="${CFLAGS}$cf_new_cflags"
4123
4124 fi
4125
4126 if test -n "$cf_new_cppflags" ; then
4127
4128         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4129         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4130
4131 fi
4132
4133 if test -n "$cf_new_extra_cppflags" ; then
4134
4135         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4136         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4137
4138 fi
4139
4140                         cat >"conftest.$ac_ext" <<_ACEOF
4141 #line 4141 "configure"
4142 #include "confdefs.h"
4143
4144                                 #include <limits.h>
4145                                 #include <sys/types.h>
4146
4147 int
4148 main (void)
4149 {
4150
4151                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
4152                                         return 0;
4153                                 #else
4154                                 #       error GNU C library is too old
4155                                 #endif
4156   ;
4157   return 0;
4158 }
4159 _ACEOF
4160 rm -f "conftest.$ac_objext"
4161 if { (eval echo "$as_me:4161: \"$ac_compile\"") >&5
4162   (eval $ac_compile) 2>&5
4163   ac_status=$?
4164   echo "$as_me:4164: \$? = $ac_status" >&5
4165   (exit "$ac_status"); } &&
4166          { ac_try='test -s "conftest.$ac_objext"'
4167   { (eval echo "$as_me:4167: \"$ac_try\"") >&5
4168   (eval $ac_try) 2>&5
4169   ac_status=$?
4170   echo "$as_me:4170: \$? = $ac_status" >&5
4171   (exit "$ac_status"); }; }; then
4172   cf_cv_gnu_dftsrc_219=yes
4173 else
4174   echo "$as_me: failed program was:" >&5
4175 cat "conftest.$ac_ext" >&5
4176 cf_cv_gnu_dftsrc_219=no
4177 fi
4178 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4179
4180 fi
4181 echo "$as_me:4181: result: $cf_cv_gnu_dftsrc_219" >&5
4182 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
4183                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
4184         else
4185                 cf_cv_gnu_dftsrc_219=maybe
4186         fi
4187
4188         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
4189
4190                 echo "$as_me:4190: checking if we must define _GNU_SOURCE" >&5
4191 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
4192 if test "${cf_cv_gnu_source+set}" = set; then
4193   echo $ECHO_N "(cached) $ECHO_C" >&6
4194 else
4195
4196                 cat >"conftest.$ac_ext" <<_ACEOF
4197 #line 4197 "configure"
4198 #include "confdefs.h"
4199 #include <sys/types.h>
4200 int
4201 main (void)
4202 {
4203
4204                         #ifndef _XOPEN_SOURCE
4205                         #error  expected _XOPEN_SOURCE to be defined
4206                         #endif
4207   ;
4208   return 0;
4209 }
4210 _ACEOF
4211 rm -f "conftest.$ac_objext"
4212 if { (eval echo "$as_me:4212: \"$ac_compile\"") >&5
4213   (eval $ac_compile) 2>&5
4214   ac_status=$?
4215   echo "$as_me:4215: \$? = $ac_status" >&5
4216   (exit "$ac_status"); } &&
4217          { ac_try='test -s "conftest.$ac_objext"'
4218   { (eval echo "$as_me:4218: \"$ac_try\"") >&5
4219   (eval $ac_try) 2>&5
4220   ac_status=$?
4221   echo "$as_me:4221: \$? = $ac_status" >&5
4222   (exit "$ac_status"); }; }; then
4223   cf_cv_gnu_source=no
4224 else
4225   echo "$as_me: failed program was:" >&5
4226 cat "conftest.$ac_ext" >&5
4227 cf_save="$CPPFLAGS"
4228
4229 cf_fix_cppflags=no
4230 cf_new_cflags=
4231 cf_new_cppflags=
4232 cf_new_extra_cppflags=
4233
4234 for cf_add_cflags in -D_GNU_SOURCE
4235 do
4236 case "$cf_fix_cppflags" in
4237 (no)
4238         case "$cf_add_cflags" in
4239         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4240                 case "$cf_add_cflags" in
4241                 (-D*)
4242                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4243
4244                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4245                                 && test -z "${cf_tst_cflags}" \
4246                                 && cf_fix_cppflags=yes
4247
4248                         if test "$cf_fix_cppflags" = yes ; then
4249
4250         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4251         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4252
4253                                 continue
4254                         elif test "${cf_tst_cflags}" = "\"'" ; then
4255
4256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4258
4259                                 continue
4260                         fi
4261                         ;;
4262                 esac
4263                 case "$CPPFLAGS" in
4264                 (*$cf_add_cflags)
4265                         ;;
4266                 (*)
4267                         case "$cf_add_cflags" in
4268                         (-D*)
4269                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4270
4271 CPPFLAGS=`echo "$CPPFLAGS" | \
4272         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4273                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4274
4275                                 ;;
4276                         esac
4277
4278         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4279         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4280
4281                         ;;
4282                 esac
4283                 ;;
4284         (*)
4285
4286         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4287         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4288
4289                 ;;
4290         esac
4291         ;;
4292 (yes)
4293
4294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4296
4297         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4298
4299         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4300                 && test -z "${cf_tst_cflags}" \
4301                 && cf_fix_cppflags=no
4302         ;;
4303 esac
4304 done
4305
4306 if test -n "$cf_new_cflags" ; then
4307
4308         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4309         CFLAGS="${CFLAGS}$cf_new_cflags"
4310
4311 fi
4312
4313 if test -n "$cf_new_cppflags" ; then
4314
4315         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4316         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4317
4318 fi
4319
4320 if test -n "$cf_new_extra_cppflags" ; then
4321
4322         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4323         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4324
4325 fi
4326
4327                          cat >"conftest.$ac_ext" <<_ACEOF
4328 #line 4328 "configure"
4329 #include "confdefs.h"
4330 #include <sys/types.h>
4331 int
4332 main (void)
4333 {
4334
4335                                 #ifdef _XOPEN_SOURCE
4336                                 #error  expected _XOPEN_SOURCE to be undefined
4337                                 #endif
4338   ;
4339   return 0;
4340 }
4341 _ACEOF
4342 rm -f "conftest.$ac_objext"
4343 if { (eval echo "$as_me:4343: \"$ac_compile\"") >&5
4344   (eval $ac_compile) 2>&5
4345   ac_status=$?
4346   echo "$as_me:4346: \$? = $ac_status" >&5
4347   (exit "$ac_status"); } &&
4348          { ac_try='test -s "conftest.$ac_objext"'
4349   { (eval echo "$as_me:4349: \"$ac_try\"") >&5
4350   (eval $ac_try) 2>&5
4351   ac_status=$?
4352   echo "$as_me:4352: \$? = $ac_status" >&5
4353   (exit "$ac_status"); }; }; then
4354   cf_cv_gnu_source=no
4355 else
4356   echo "$as_me: failed program was:" >&5
4357 cat "conftest.$ac_ext" >&5
4358 cf_cv_gnu_source=yes
4359 fi
4360 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4361                         CPPFLAGS="$cf_save"
4362
4363 fi
4364 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4365
4366 fi
4367 echo "$as_me:4367: result: $cf_cv_gnu_source" >&5
4368 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4369
4370                 if test "$cf_cv_gnu_source" = yes
4371                 then
4372                 echo "$as_me:4372: checking if we should also define _DEFAULT_SOURCE" >&5
4373 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4374 if test "${cf_cv_default_source+set}" = set; then
4375   echo $ECHO_N "(cached) $ECHO_C" >&6
4376 else
4377
4378         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4379         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4380
4381                         cat >"conftest.$ac_ext" <<_ACEOF
4382 #line 4382 "configure"
4383 #include "confdefs.h"
4384 #include <sys/types.h>
4385 int
4386 main (void)
4387 {
4388
4389                                 #ifdef _DEFAULT_SOURCE
4390                                 #error  expected _DEFAULT_SOURCE to be undefined
4391                                 #endif
4392   ;
4393   return 0;
4394 }
4395 _ACEOF
4396 rm -f "conftest.$ac_objext"
4397 if { (eval echo "$as_me:4397: \"$ac_compile\"") >&5
4398   (eval $ac_compile) 2>&5
4399   ac_status=$?
4400   echo "$as_me:4400: \$? = $ac_status" >&5
4401   (exit "$ac_status"); } &&
4402          { ac_try='test -s "conftest.$ac_objext"'
4403   { (eval echo "$as_me:4403: \"$ac_try\"") >&5
4404   (eval $ac_try) 2>&5
4405   ac_status=$?
4406   echo "$as_me:4406: \$? = $ac_status" >&5
4407   (exit "$ac_status"); }; }; then
4408   cf_cv_default_source=no
4409 else
4410   echo "$as_me: failed program was:" >&5
4411 cat "conftest.$ac_ext" >&5
4412 cf_cv_default_source=yes
4413 fi
4414 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4415
4416 fi
4417 echo "$as_me:4417: result: $cf_cv_default_source" >&5
4418 echo "${ECHO_T}$cf_cv_default_source" >&6
4419                         if test "$cf_cv_default_source" = yes
4420                         then
4421
4422         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4423         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4424
4425                         fi
4426                 fi
4427         fi
4428
4429 fi
4430
4431         ;;
4432 (minix*)
4433         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4434         ;;
4435 (mirbsd*)
4436         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4437         cf_XOPEN_SOURCE=
4438
4439 if test "$cf_cv_posix_visible" = no; then
4440
4441 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4442
4443 cf_save_CFLAGS="$CFLAGS"
4444 cf_save_CPPFLAGS="$CPPFLAGS"
4445
4446 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4447         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4448                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4449
4450 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4451         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4452                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4453
4454 echo "$as_me:4454: checking if we should define _POSIX_C_SOURCE" >&5
4455 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4456 if test "${cf_cv_posix_c_source+set}" = set; then
4457   echo $ECHO_N "(cached) $ECHO_C" >&6
4458 else
4459
4460 echo "${as_me:-configure}:4460: testing if the symbol is already defined go no further ..." 1>&5
4461
4462         cat >"conftest.$ac_ext" <<_ACEOF
4463 #line 4463 "configure"
4464 #include "confdefs.h"
4465 #include <sys/types.h>
4466 int
4467 main (void)
4468 {
4469
4470 #ifndef _POSIX_C_SOURCE
4471 make an error
4472 #endif
4473   ;
4474   return 0;
4475 }
4476 _ACEOF
4477 rm -f "conftest.$ac_objext"
4478 if { (eval echo "$as_me:4478: \"$ac_compile\"") >&5
4479   (eval $ac_compile) 2>&5
4480   ac_status=$?
4481   echo "$as_me:4481: \$? = $ac_status" >&5
4482   (exit "$ac_status"); } &&
4483          { ac_try='test -s "conftest.$ac_objext"'
4484   { (eval echo "$as_me:4484: \"$ac_try\"") >&5
4485   (eval $ac_try) 2>&5
4486   ac_status=$?
4487   echo "$as_me:4487: \$? = $ac_status" >&5
4488   (exit "$ac_status"); }; }; then
4489   cf_cv_posix_c_source=no
4490 else
4491   echo "$as_me: failed program was:" >&5
4492 cat "conftest.$ac_ext" >&5
4493 cf_want_posix_source=no
4494          case .$cf_POSIX_C_SOURCE in
4495          (.[12]??*)
4496                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4497                 ;;
4498          (.2)
4499                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4500                 cf_want_posix_source=yes
4501                 ;;
4502          (.*)
4503                 cf_want_posix_source=yes
4504                 ;;
4505          esac
4506          if test "$cf_want_posix_source" = yes ; then
4507                 cat >"conftest.$ac_ext" <<_ACEOF
4508 #line 4508 "configure"
4509 #include "confdefs.h"
4510 #include <sys/types.h>
4511 int
4512 main (void)
4513 {
4514
4515 #ifdef _POSIX_SOURCE
4516 make an error
4517 #endif
4518   ;
4519   return 0;
4520 }
4521 _ACEOF
4522 rm -f "conftest.$ac_objext"
4523 if { (eval echo "$as_me:4523: \"$ac_compile\"") >&5
4524   (eval $ac_compile) 2>&5
4525   ac_status=$?
4526   echo "$as_me:4526: \$? = $ac_status" >&5
4527   (exit "$ac_status"); } &&
4528          { ac_try='test -s "conftest.$ac_objext"'
4529   { (eval echo "$as_me:4529: \"$ac_try\"") >&5
4530   (eval $ac_try) 2>&5
4531   ac_status=$?
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit "$ac_status"); }; }; then
4534   :
4535 else
4536   echo "$as_me: failed program was:" >&5
4537 cat "conftest.$ac_ext" >&5
4538 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4539 fi
4540 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4541          fi
4542
4543 echo "${as_me:-configure}:4543: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4544
4545          CFLAGS="$cf_trim_CFLAGS"
4546          CPPFLAGS="$cf_trim_CPPFLAGS"
4547
4548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4549         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4550
4551 echo "${as_me:-configure}:4551: testing if the second compile does not leave our definition intact error ..." 1>&5
4552
4553          cat >"conftest.$ac_ext" <<_ACEOF
4554 #line 4554 "configure"
4555 #include "confdefs.h"
4556 #include <sys/types.h>
4557 int
4558 main (void)
4559 {
4560
4561 #ifndef _POSIX_C_SOURCE
4562 make an error
4563 #endif
4564   ;
4565   return 0;
4566 }
4567 _ACEOF
4568 rm -f "conftest.$ac_objext"
4569 if { (eval echo "$as_me:4569: \"$ac_compile\"") >&5
4570   (eval $ac_compile) 2>&5
4571   ac_status=$?
4572   echo "$as_me:4572: \$? = $ac_status" >&5
4573   (exit "$ac_status"); } &&
4574          { ac_try='test -s "conftest.$ac_objext"'
4575   { (eval echo "$as_me:4575: \"$ac_try\"") >&5
4576   (eval $ac_try) 2>&5
4577   ac_status=$?
4578   echo "$as_me:4578: \$? = $ac_status" >&5
4579   (exit "$ac_status"); }; }; then
4580   :
4581 else
4582   echo "$as_me: failed program was:" >&5
4583 cat "conftest.$ac_ext" >&5
4584 cf_cv_posix_c_source=no
4585 fi
4586 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4587          CFLAGS="$cf_save_CFLAGS"
4588          CPPFLAGS="$cf_save_CPPFLAGS"
4589
4590 fi
4591 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4592
4593 fi
4594 echo "$as_me:4594: result: $cf_cv_posix_c_source" >&5
4595 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4596
4597 if test "$cf_cv_posix_c_source" != no ; then
4598         CFLAGS="$cf_trim_CFLAGS"
4599         CPPFLAGS="$cf_trim_CPPFLAGS"
4600
4601 cf_fix_cppflags=no
4602 cf_new_cflags=
4603 cf_new_cppflags=
4604 cf_new_extra_cppflags=
4605
4606 for cf_add_cflags in $cf_cv_posix_c_source
4607 do
4608 case "$cf_fix_cppflags" in
4609 (no)
4610         case "$cf_add_cflags" in
4611         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4612                 case "$cf_add_cflags" in
4613                 (-D*)
4614                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4615
4616                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4617                                 && test -z "${cf_tst_cflags}" \
4618                                 && cf_fix_cppflags=yes
4619
4620                         if test "$cf_fix_cppflags" = yes ; then
4621
4622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4624
4625                                 continue
4626                         elif test "${cf_tst_cflags}" = "\"'" ; then
4627
4628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4630
4631                                 continue
4632                         fi
4633                         ;;
4634                 esac
4635                 case "$CPPFLAGS" in
4636                 (*$cf_add_cflags)
4637                         ;;
4638                 (*)
4639                         case "$cf_add_cflags" in
4640                         (-D*)
4641                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4642
4643 CPPFLAGS=`echo "$CPPFLAGS" | \
4644         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4645                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4646
4647                                 ;;
4648                         esac
4649
4650         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4651         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4652
4653                         ;;
4654                 esac
4655                 ;;
4656         (*)
4657
4658         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4659         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4660
4661                 ;;
4662         esac
4663         ;;
4664 (yes)
4665
4666         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4667         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4668
4669         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4670
4671         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4672                 && test -z "${cf_tst_cflags}" \
4673                 && cf_fix_cppflags=no
4674         ;;
4675 esac
4676 done
4677
4678 if test -n "$cf_new_cflags" ; then
4679
4680         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4681         CFLAGS="${CFLAGS}$cf_new_cflags"
4682
4683 fi
4684
4685 if test -n "$cf_new_cppflags" ; then
4686
4687         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4688         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4689
4690 fi
4691
4692 if test -n "$cf_new_extra_cppflags" ; then
4693
4694         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4695         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4696
4697 fi
4698
4699 fi
4700
4701 fi # cf_cv_posix_visible
4702
4703         ;;
4704 (netbsd*)
4705         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4706         ;;
4707 (openbsd[4-9]*)
4708         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4709         cf_xopen_source="-D_BSD_SOURCE"
4710         cf_XOPEN_SOURCE=600
4711         ;;
4712 (openbsd*)
4713         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4714         ;;
4715 (osf[45]*)
4716         cf_xopen_source="-D_OSF_SOURCE"
4717         ;;
4718 (nto-qnx*)
4719         cf_xopen_source="-D_QNX_SOURCE"
4720         ;;
4721 (sco*)
4722         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4723         ;;
4724 (solaris2.*)
4725         cf_xopen_source="-D__EXTENSIONS__"
4726         cf_cv_xopen_source=broken
4727         ;;
4728 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4729         cf_XOPEN_SOURCE=
4730         cf_POSIX_C_SOURCE=
4731         ;;
4732 (*)
4733
4734 echo "$as_me:4734: checking if we should define _XOPEN_SOURCE" >&5
4735 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4736 if test "${cf_cv_xopen_source+set}" = set; then
4737   echo $ECHO_N "(cached) $ECHO_C" >&6
4738 else
4739
4740         cat >"conftest.$ac_ext" <<_ACEOF
4741 #line 4741 "configure"
4742 #include "confdefs.h"
4743
4744 #include <stdlib.h>
4745 #include <string.h>
4746 #include <sys/types.h>
4747
4748 int
4749 main (void)
4750 {
4751
4752 #ifndef _XOPEN_SOURCE
4753 make an error
4754 #endif
4755   ;
4756   return 0;
4757 }
4758 _ACEOF
4759 rm -f "conftest.$ac_objext"
4760 if { (eval echo "$as_me:4760: \"$ac_compile\"") >&5
4761   (eval $ac_compile) 2>&5
4762   ac_status=$?
4763   echo "$as_me:4763: \$? = $ac_status" >&5
4764   (exit "$ac_status"); } &&
4765          { ac_try='test -s "conftest.$ac_objext"'
4766   { (eval echo "$as_me:4766: \"$ac_try\"") >&5
4767   (eval $ac_try) 2>&5
4768   ac_status=$?
4769   echo "$as_me:4769: \$? = $ac_status" >&5
4770   (exit "$ac_status"); }; }; then
4771   cf_cv_xopen_source=no
4772 else
4773   echo "$as_me: failed program was:" >&5
4774 cat "conftest.$ac_ext" >&5
4775 cf_save="$CPPFLAGS"
4776
4777         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4778         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4779
4780          cat >"conftest.$ac_ext" <<_ACEOF
4781 #line 4781 "configure"
4782 #include "confdefs.h"
4783
4784 #include <stdlib.h>
4785 #include <string.h>
4786 #include <sys/types.h>
4787
4788 int
4789 main (void)
4790 {
4791
4792 #ifdef _XOPEN_SOURCE
4793 make an error
4794 #endif
4795   ;
4796   return 0;
4797 }
4798 _ACEOF
4799 rm -f "conftest.$ac_objext"
4800 if { (eval echo "$as_me:4800: \"$ac_compile\"") >&5
4801   (eval $ac_compile) 2>&5
4802   ac_status=$?
4803   echo "$as_me:4803: \$? = $ac_status" >&5
4804   (exit "$ac_status"); } &&
4805          { ac_try='test -s "conftest.$ac_objext"'
4806   { (eval echo "$as_me:4806: \"$ac_try\"") >&5
4807   (eval $ac_try) 2>&5
4808   ac_status=$?
4809   echo "$as_me:4809: \$? = $ac_status" >&5
4810   (exit "$ac_status"); }; }; then
4811   cf_cv_xopen_source=no
4812 else
4813   echo "$as_me: failed program was:" >&5
4814 cat "conftest.$ac_ext" >&5
4815 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4816 fi
4817 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4818         CPPFLAGS="$cf_save"
4819
4820 fi
4821 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4822
4823 fi
4824 echo "$as_me:4824: result: $cf_cv_xopen_source" >&5
4825 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4826
4827 if test "$cf_cv_xopen_source" != no ; then
4828
4829 CFLAGS=`echo "$CFLAGS" | \
4830         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4831                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4832
4833 CPPFLAGS=`echo "$CPPFLAGS" | \
4834         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4835                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4836
4837         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4838
4839 cf_fix_cppflags=no
4840 cf_new_cflags=
4841 cf_new_cppflags=
4842 cf_new_extra_cppflags=
4843
4844 for cf_add_cflags in $cf_temp_xopen_source
4845 do
4846 case "$cf_fix_cppflags" in
4847 (no)
4848         case "$cf_add_cflags" in
4849         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4850                 case "$cf_add_cflags" in
4851                 (-D*)
4852                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4853
4854                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4855                                 && test -z "${cf_tst_cflags}" \
4856                                 && cf_fix_cppflags=yes
4857
4858                         if test "$cf_fix_cppflags" = yes ; then
4859
4860         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4861         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4862
4863                                 continue
4864                         elif test "${cf_tst_cflags}" = "\"'" ; then
4865
4866         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4867         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4868
4869                                 continue
4870                         fi
4871                         ;;
4872                 esac
4873                 case "$CPPFLAGS" in
4874                 (*$cf_add_cflags)
4875                         ;;
4876                 (*)
4877                         case "$cf_add_cflags" in
4878                         (-D*)
4879                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4880
4881 CPPFLAGS=`echo "$CPPFLAGS" | \
4882         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4883                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4884
4885                                 ;;
4886                         esac
4887
4888         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4889         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4890
4891                         ;;
4892                 esac
4893                 ;;
4894         (*)
4895
4896         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4897         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4898
4899                 ;;
4900         esac
4901         ;;
4902 (yes)
4903
4904         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4905         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4906
4907         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4908
4909         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4910                 && test -z "${cf_tst_cflags}" \
4911                 && cf_fix_cppflags=no
4912         ;;
4913 esac
4914 done
4915
4916 if test -n "$cf_new_cflags" ; then
4917
4918         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4919         CFLAGS="${CFLAGS}$cf_new_cflags"
4920
4921 fi
4922
4923 if test -n "$cf_new_cppflags" ; then
4924
4925         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4926         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4927
4928 fi
4929
4930 if test -n "$cf_new_extra_cppflags" ; then
4931
4932         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4933         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4934
4935 fi
4936
4937 fi
4938
4939 if test "$cf_cv_posix_visible" = no; then
4940
4941 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4942
4943 cf_save_CFLAGS="$CFLAGS"
4944 cf_save_CPPFLAGS="$CPPFLAGS"
4945
4946 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4947         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4948                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4949
4950 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4951         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4952                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4953
4954 echo "$as_me:4954: checking if we should define _POSIX_C_SOURCE" >&5
4955 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4956 if test "${cf_cv_posix_c_source+set}" = set; then
4957   echo $ECHO_N "(cached) $ECHO_C" >&6
4958 else
4959
4960 echo "${as_me:-configure}:4960: testing if the symbol is already defined go no further ..." 1>&5
4961
4962         cat >"conftest.$ac_ext" <<_ACEOF
4963 #line 4963 "configure"
4964 #include "confdefs.h"
4965 #include <sys/types.h>
4966 int
4967 main (void)
4968 {
4969
4970 #ifndef _POSIX_C_SOURCE
4971 make an error
4972 #endif
4973   ;
4974   return 0;
4975 }
4976 _ACEOF
4977 rm -f "conftest.$ac_objext"
4978 if { (eval echo "$as_me:4978: \"$ac_compile\"") >&5
4979   (eval $ac_compile) 2>&5
4980   ac_status=$?
4981   echo "$as_me:4981: \$? = $ac_status" >&5
4982   (exit "$ac_status"); } &&
4983          { ac_try='test -s "conftest.$ac_objext"'
4984   { (eval echo "$as_me:4984: \"$ac_try\"") >&5
4985   (eval $ac_try) 2>&5
4986   ac_status=$?
4987   echo "$as_me:4987: \$? = $ac_status" >&5
4988   (exit "$ac_status"); }; }; then
4989   cf_cv_posix_c_source=no
4990 else
4991   echo "$as_me: failed program was:" >&5
4992 cat "conftest.$ac_ext" >&5
4993 cf_want_posix_source=no
4994          case .$cf_POSIX_C_SOURCE in
4995          (.[12]??*)
4996                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4997                 ;;
4998          (.2)
4999                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
5000                 cf_want_posix_source=yes
5001                 ;;
5002          (.*)
5003                 cf_want_posix_source=yes
5004                 ;;
5005          esac
5006          if test "$cf_want_posix_source" = yes ; then
5007                 cat >"conftest.$ac_ext" <<_ACEOF
5008 #line 5008 "configure"
5009 #include "confdefs.h"
5010 #include <sys/types.h>
5011 int
5012 main (void)
5013 {
5014
5015 #ifdef _POSIX_SOURCE
5016 make an error
5017 #endif
5018   ;
5019   return 0;
5020 }
5021 _ACEOF
5022 rm -f "conftest.$ac_objext"
5023 if { (eval echo "$as_me:5023: \"$ac_compile\"") >&5
5024   (eval $ac_compile) 2>&5
5025   ac_status=$?
5026   echo "$as_me:5026: \$? = $ac_status" >&5
5027   (exit "$ac_status"); } &&
5028          { ac_try='test -s "conftest.$ac_objext"'
5029   { (eval echo "$as_me:5029: \"$ac_try\"") >&5
5030   (eval $ac_try) 2>&5
5031   ac_status=$?
5032   echo "$as_me:5032: \$? = $ac_status" >&5
5033   (exit "$ac_status"); }; }; then
5034   :
5035 else
5036   echo "$as_me: failed program was:" >&5
5037 cat "conftest.$ac_ext" >&5
5038 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
5039 fi
5040 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5041          fi
5042
5043 echo "${as_me:-configure}:5043: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
5044
5045          CFLAGS="$cf_trim_CFLAGS"
5046          CPPFLAGS="$cf_trim_CPPFLAGS"
5047
5048         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5049         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
5050
5051 echo "${as_me:-configure}:5051: testing if the second compile does not leave our definition intact error ..." 1>&5
5052
5053          cat >"conftest.$ac_ext" <<_ACEOF
5054 #line 5054 "configure"
5055 #include "confdefs.h"
5056 #include <sys/types.h>
5057 int
5058 main (void)
5059 {
5060
5061 #ifndef _POSIX_C_SOURCE
5062 make an error
5063 #endif
5064   ;
5065   return 0;
5066 }
5067 _ACEOF
5068 rm -f "conftest.$ac_objext"
5069 if { (eval echo "$as_me:5069: \"$ac_compile\"") >&5
5070   (eval $ac_compile) 2>&5
5071   ac_status=$?
5072   echo "$as_me:5072: \$? = $ac_status" >&5
5073   (exit "$ac_status"); } &&
5074          { ac_try='test -s "conftest.$ac_objext"'
5075   { (eval echo "$as_me:5075: \"$ac_try\"") >&5
5076   (eval $ac_try) 2>&5
5077   ac_status=$?
5078   echo "$as_me:5078: \$? = $ac_status" >&5
5079   (exit "$ac_status"); }; }; then
5080   :
5081 else
5082   echo "$as_me: failed program was:" >&5
5083 cat "conftest.$ac_ext" >&5
5084 cf_cv_posix_c_source=no
5085 fi
5086 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5087          CFLAGS="$cf_save_CFLAGS"
5088          CPPFLAGS="$cf_save_CPPFLAGS"
5089
5090 fi
5091 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5092
5093 fi
5094 echo "$as_me:5094: result: $cf_cv_posix_c_source" >&5
5095 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
5096
5097 if test "$cf_cv_posix_c_source" != no ; then
5098         CFLAGS="$cf_trim_CFLAGS"
5099         CPPFLAGS="$cf_trim_CPPFLAGS"
5100
5101 cf_fix_cppflags=no
5102 cf_new_cflags=
5103 cf_new_cppflags=
5104 cf_new_extra_cppflags=
5105
5106 for cf_add_cflags in $cf_cv_posix_c_source
5107 do
5108 case "$cf_fix_cppflags" in
5109 (no)
5110         case "$cf_add_cflags" in
5111         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5112                 case "$cf_add_cflags" in
5113                 (-D*)
5114                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5115
5116                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5117                                 && test -z "${cf_tst_cflags}" \
5118                                 && cf_fix_cppflags=yes
5119
5120                         if test "$cf_fix_cppflags" = yes ; then
5121
5122         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5123         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5124
5125                                 continue
5126                         elif test "${cf_tst_cflags}" = "\"'" ; then
5127
5128         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5129         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5130
5131                                 continue
5132                         fi
5133                         ;;
5134                 esac
5135                 case "$CPPFLAGS" in
5136                 (*$cf_add_cflags)
5137                         ;;
5138                 (*)
5139                         case "$cf_add_cflags" in
5140                         (-D*)
5141                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5142
5143 CPPFLAGS=`echo "$CPPFLAGS" | \
5144         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5145                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5146
5147                                 ;;
5148                         esac
5149
5150         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5151         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5152
5153                         ;;
5154                 esac
5155                 ;;
5156         (*)
5157
5158         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5159         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5160
5161                 ;;
5162         esac
5163         ;;
5164 (yes)
5165
5166         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5167         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5168
5169         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5170
5171         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5172                 && test -z "${cf_tst_cflags}" \
5173                 && cf_fix_cppflags=no
5174         ;;
5175 esac
5176 done
5177
5178 if test -n "$cf_new_cflags" ; then
5179
5180         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5181         CFLAGS="${CFLAGS}$cf_new_cflags"
5182
5183 fi
5184
5185 if test -n "$cf_new_cppflags" ; then
5186
5187         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5188         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5189
5190 fi
5191
5192 if test -n "$cf_new_extra_cppflags" ; then
5193
5194         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5195         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5196
5197 fi
5198
5199 fi
5200
5201 fi # cf_cv_posix_visible
5202
5203         ;;
5204 esac
5205
5206 if test -n "$cf_xopen_source" ; then
5207
5208 cf_fix_cppflags=no
5209 cf_new_cflags=
5210 cf_new_cppflags=
5211 cf_new_extra_cppflags=
5212
5213 for cf_add_cflags in $cf_xopen_source
5214 do
5215 case "$cf_fix_cppflags" in
5216 (no)
5217         case "$cf_add_cflags" in
5218         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5219                 case "$cf_add_cflags" in
5220                 (-D*)
5221                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5222
5223                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5224                                 && test -z "${cf_tst_cflags}" \
5225                                 && cf_fix_cppflags=yes
5226
5227                         if test "$cf_fix_cppflags" = yes ; then
5228
5229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5231
5232                                 continue
5233                         elif test "${cf_tst_cflags}" = "\"'" ; then
5234
5235         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5236         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5237
5238                                 continue
5239                         fi
5240                         ;;
5241                 esac
5242                 case "$CPPFLAGS" in
5243                 (*$cf_add_cflags)
5244                         ;;
5245                 (*)
5246                         case "$cf_add_cflags" in
5247                         (-D*)
5248                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5249
5250 CPPFLAGS=`echo "$CPPFLAGS" | \
5251         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5252                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5253
5254                                 ;;
5255                         esac
5256
5257         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5258         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5259
5260                         ;;
5261                 esac
5262                 ;;
5263         (*)
5264
5265         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5266         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5267
5268                 ;;
5269         esac
5270         ;;
5271 (yes)
5272
5273         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5274         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5275
5276         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5277
5278         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5279                 && test -z "${cf_tst_cflags}" \
5280                 && cf_fix_cppflags=no
5281         ;;
5282 esac
5283 done
5284
5285 if test -n "$cf_new_cflags" ; then
5286         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5287
5288 echo "${as_me:-configure}:5288: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5289
5290         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5291         CFLAGS="${CFLAGS}$cf_new_cflags"
5292
5293 fi
5294
5295 if test -n "$cf_new_cppflags" ; then
5296         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5297
5298 echo "${as_me:-configure}:5298: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5299
5300         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5301         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5302
5303 fi
5304
5305 if test -n "$cf_new_extra_cppflags" ; then
5306         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5307
5308 echo "${as_me:-configure}:5308: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5309
5310         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5311         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5312
5313 fi
5314
5315 fi
5316
5317 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5318         echo "$as_me:5318: checking if _XOPEN_SOURCE really is set" >&5
5319 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5320         cat >"conftest.$ac_ext" <<_ACEOF
5321 #line 5321 "configure"
5322 #include "confdefs.h"
5323 #include <stdlib.h>
5324 int
5325 main (void)
5326 {
5327
5328 #ifndef _XOPEN_SOURCE
5329 make an error
5330 #endif
5331   ;
5332   return 0;
5333 }
5334 _ACEOF
5335 rm -f "conftest.$ac_objext"
5336 if { (eval echo "$as_me:5336: \"$ac_compile\"") >&5
5337   (eval $ac_compile) 2>&5
5338   ac_status=$?
5339   echo "$as_me:5339: \$? = $ac_status" >&5
5340   (exit "$ac_status"); } &&
5341          { ac_try='test -s "conftest.$ac_objext"'
5342   { (eval echo "$as_me:5342: \"$ac_try\"") >&5
5343   (eval $ac_try) 2>&5
5344   ac_status=$?
5345   echo "$as_me:5345: \$? = $ac_status" >&5
5346   (exit "$ac_status"); }; }; then
5347   cf_XOPEN_SOURCE_set=yes
5348 else
5349   echo "$as_me: failed program was:" >&5
5350 cat "conftest.$ac_ext" >&5
5351 cf_XOPEN_SOURCE_set=no
5352 fi
5353 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5354         echo "$as_me:5354: result: $cf_XOPEN_SOURCE_set" >&5
5355 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5356         if test "$cf_XOPEN_SOURCE_set" = yes
5357         then
5358                 cat >"conftest.$ac_ext" <<_ACEOF
5359 #line 5359 "configure"
5360 #include "confdefs.h"
5361 #include <stdlib.h>
5362 int
5363 main (void)
5364 {
5365
5366 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5367 make an error
5368 #endif
5369   ;
5370   return 0;
5371 }
5372 _ACEOF
5373 rm -f "conftest.$ac_objext"
5374 if { (eval echo "$as_me:5374: \"$ac_compile\"") >&5
5375   (eval $ac_compile) 2>&5
5376   ac_status=$?
5377   echo "$as_me:5377: \$? = $ac_status" >&5
5378   (exit "$ac_status"); } &&
5379          { ac_try='test -s "conftest.$ac_objext"'
5380   { (eval echo "$as_me:5380: \"$ac_try\"") >&5
5381   (eval $ac_try) 2>&5
5382   ac_status=$?
5383   echo "$as_me:5383: \$? = $ac_status" >&5
5384   (exit "$ac_status"); }; }; then
5385   cf_XOPEN_SOURCE_set_ok=yes
5386 else
5387   echo "$as_me: failed program was:" >&5
5388 cat "conftest.$ac_ext" >&5
5389 cf_XOPEN_SOURCE_set_ok=no
5390 fi
5391 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5392                 if test "$cf_XOPEN_SOURCE_set_ok" = no
5393                 then
5394                         { echo "$as_me:5394: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5395 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5396                 fi
5397         else
5398
5399 echo "$as_me:5399: checking if we should define _XOPEN_SOURCE" >&5
5400 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5401 if test "${cf_cv_xopen_source+set}" = set; then
5402   echo $ECHO_N "(cached) $ECHO_C" >&6
5403 else
5404
5405         cat >"conftest.$ac_ext" <<_ACEOF
5406 #line 5406 "configure"
5407 #include "confdefs.h"
5408
5409 #include <stdlib.h>
5410 #include <string.h>
5411 #include <sys/types.h>
5412
5413 int
5414 main (void)
5415 {
5416
5417 #ifndef _XOPEN_SOURCE
5418 make an error
5419 #endif
5420   ;
5421   return 0;
5422 }
5423 _ACEOF
5424 rm -f "conftest.$ac_objext"
5425 if { (eval echo "$as_me:5425: \"$ac_compile\"") >&5
5426   (eval $ac_compile) 2>&5
5427   ac_status=$?
5428   echo "$as_me:5428: \$? = $ac_status" >&5
5429   (exit "$ac_status"); } &&
5430          { ac_try='test -s "conftest.$ac_objext"'
5431   { (eval echo "$as_me:5431: \"$ac_try\"") >&5
5432   (eval $ac_try) 2>&5
5433   ac_status=$?
5434   echo "$as_me:5434: \$? = $ac_status" >&5
5435   (exit "$ac_status"); }; }; then
5436   cf_cv_xopen_source=no
5437 else
5438   echo "$as_me: failed program was:" >&5
5439 cat "conftest.$ac_ext" >&5
5440 cf_save="$CPPFLAGS"
5441
5442         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5443         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5444
5445          cat >"conftest.$ac_ext" <<_ACEOF
5446 #line 5446 "configure"
5447 #include "confdefs.h"
5448
5449 #include <stdlib.h>
5450 #include <string.h>
5451 #include <sys/types.h>
5452
5453 int
5454 main (void)
5455 {
5456
5457 #ifdef _XOPEN_SOURCE
5458 make an error
5459 #endif
5460   ;
5461   return 0;
5462 }
5463 _ACEOF
5464 rm -f "conftest.$ac_objext"
5465 if { (eval echo "$as_me:5465: \"$ac_compile\"") >&5
5466   (eval $ac_compile) 2>&5
5467   ac_status=$?
5468   echo "$as_me:5468: \$? = $ac_status" >&5
5469   (exit "$ac_status"); } &&
5470          { ac_try='test -s "conftest.$ac_objext"'
5471   { (eval echo "$as_me:5471: \"$ac_try\"") >&5
5472   (eval $ac_try) 2>&5
5473   ac_status=$?
5474   echo "$as_me:5474: \$? = $ac_status" >&5
5475   (exit "$ac_status"); }; }; then
5476   cf_cv_xopen_source=no
5477 else
5478   echo "$as_me: failed program was:" >&5
5479 cat "conftest.$ac_ext" >&5
5480 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5481 fi
5482 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5483         CPPFLAGS="$cf_save"
5484
5485 fi
5486 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5487
5488 fi
5489 echo "$as_me:5489: result: $cf_cv_xopen_source" >&5
5490 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5491
5492 if test "$cf_cv_xopen_source" != no ; then
5493
5494 CFLAGS=`echo "$CFLAGS" | \
5495         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5496                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5497
5498 CPPFLAGS=`echo "$CPPFLAGS" | \
5499         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5500                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5501
5502         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5503
5504 cf_fix_cppflags=no
5505 cf_new_cflags=
5506 cf_new_cppflags=
5507 cf_new_extra_cppflags=
5508
5509 for cf_add_cflags in $cf_temp_xopen_source
5510 do
5511 case "$cf_fix_cppflags" in
5512 (no)
5513         case "$cf_add_cflags" in
5514         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5515                 case "$cf_add_cflags" in
5516                 (-D*)
5517                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5518
5519                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5520                                 && test -z "${cf_tst_cflags}" \
5521                                 && cf_fix_cppflags=yes
5522
5523                         if test "$cf_fix_cppflags" = yes ; then
5524
5525         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5526         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5527
5528                                 continue
5529                         elif test "${cf_tst_cflags}" = "\"'" ; then
5530
5531         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5532         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5533
5534                                 continue
5535                         fi
5536                         ;;
5537                 esac
5538                 case "$CPPFLAGS" in
5539                 (*$cf_add_cflags)
5540                         ;;
5541                 (*)
5542                         case "$cf_add_cflags" in
5543                         (-D*)
5544                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5545
5546 CPPFLAGS=`echo "$CPPFLAGS" | \
5547         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5548                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5549
5550                                 ;;
5551                         esac
5552
5553         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5554         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5555
5556                         ;;
5557                 esac
5558                 ;;
5559         (*)
5560
5561         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5562         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5563
5564                 ;;
5565         esac
5566         ;;
5567 (yes)
5568
5569         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5570         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5571
5572         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5573
5574         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5575                 && test -z "${cf_tst_cflags}" \
5576                 && cf_fix_cppflags=no
5577         ;;
5578 esac
5579 done
5580
5581 if test -n "$cf_new_cflags" ; then
5582
5583         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5584         CFLAGS="${CFLAGS}$cf_new_cflags"
5585
5586 fi
5587
5588 if test -n "$cf_new_cppflags" ; then
5589
5590         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5591         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5592
5593 fi
5594
5595 if test -n "$cf_new_extra_cppflags" ; then
5596
5597         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5598         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5599
5600 fi
5601
5602 fi
5603
5604         fi
5605 fi
5606 fi # cf_cv_posix_visible
5607
5608 echo "$as_me:5608: checking for signal global datatype" >&5
5609 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5610 if test "${cf_cv_sig_atomic_t+set}" = set; then
5611   echo $ECHO_N "(cached) $ECHO_C" >&6
5612 else
5613
5614         for cf_type in \
5615                 "volatile sig_atomic_t" \
5616                 "sig_atomic_t" \
5617                 "int"
5618         do
5619         cat >"conftest.$ac_ext" <<_ACEOF
5620 #line 5620 "configure"
5621 #include "confdefs.h"
5622
5623 #include <sys/types.h>
5624 #include <signal.h>
5625 #include <stdio.h>
5626
5627 extern $cf_type x;
5628 $cf_type x;
5629 static void handler(int sig)
5630 {
5631         (void)sig;
5632         x = 5;
5633 }
5634 int
5635 main (void)
5636 {
5637 signal(SIGINT, handler);
5638                  x = 1
5639   ;
5640   return 0;
5641 }
5642 _ACEOF
5643 rm -f "conftest.$ac_objext"
5644 if { (eval echo "$as_me:5644: \"$ac_compile\"") >&5
5645   (eval $ac_compile) 2>&5
5646   ac_status=$?
5647   echo "$as_me:5647: \$? = $ac_status" >&5
5648   (exit "$ac_status"); } &&
5649          { ac_try='test -s "conftest.$ac_objext"'
5650   { (eval echo "$as_me:5650: \"$ac_try\"") >&5
5651   (eval $ac_try) 2>&5
5652   ac_status=$?
5653   echo "$as_me:5653: \$? = $ac_status" >&5
5654   (exit "$ac_status"); }; }; then
5655   cf_cv_sig_atomic_t=$cf_type
5656 else
5657   echo "$as_me: failed program was:" >&5
5658 cat "conftest.$ac_ext" >&5
5659 cf_cv_sig_atomic_t=no
5660 fi
5661 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5662                 test "$cf_cv_sig_atomic_t" != no && break
5663         done
5664
5665 fi
5666
5667 echo "$as_me:5667: result: $cf_cv_sig_atomic_t" >&5
5668 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5669 test "$cf_cv_sig_atomic_t" != no &&
5670 cat >>confdefs.h <<EOF
5671 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5672 EOF
5673
5674 # Work around breakage on OS X
5675
5676 echo "$as_me:5676: checking if SIGWINCH is defined" >&5
5677 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5678 if test "${cf_cv_define_sigwinch+set}" = set; then
5679   echo $ECHO_N "(cached) $ECHO_C" >&6
5680 else
5681
5682         cat >"conftest.$ac_ext" <<_ACEOF
5683 #line 5683 "configure"
5684 #include "confdefs.h"
5685
5686 #include <sys/types.h>
5687 #include <sys/signal.h>
5688
5689 int
5690 main (void)
5691 {
5692 int x = SIGWINCH; (void)x
5693   ;
5694   return 0;
5695 }
5696 _ACEOF
5697 rm -f "conftest.$ac_objext"
5698 if { (eval echo "$as_me:5698: \"$ac_compile\"") >&5
5699   (eval $ac_compile) 2>&5
5700   ac_status=$?
5701   echo "$as_me:5701: \$? = $ac_status" >&5
5702   (exit "$ac_status"); } &&
5703          { ac_try='test -s "conftest.$ac_objext"'
5704   { (eval echo "$as_me:5704: \"$ac_try\"") >&5
5705   (eval $ac_try) 2>&5
5706   ac_status=$?
5707   echo "$as_me:5707: \$? = $ac_status" >&5
5708   (exit "$ac_status"); }; }; then
5709   cf_cv_define_sigwinch=yes
5710 else
5711   echo "$as_me: failed program was:" >&5
5712 cat "conftest.$ac_ext" >&5
5713 cat >"conftest.$ac_ext" <<_ACEOF
5714 #line 5714 "configure"
5715 #include "confdefs.h"
5716
5717 #undef _XOPEN_SOURCE
5718 #undef _POSIX_SOURCE
5719 #undef _POSIX_C_SOURCE
5720 #include <sys/types.h>
5721 #include <sys/signal.h>
5722
5723 int
5724 main (void)
5725 {
5726 int x = SIGWINCH; (void)x
5727   ;
5728   return 0;
5729 }
5730 _ACEOF
5731 rm -f "conftest.$ac_objext"
5732 if { (eval echo "$as_me:5732: \"$ac_compile\"") >&5
5733   (eval $ac_compile) 2>&5
5734   ac_status=$?
5735   echo "$as_me:5735: \$? = $ac_status" >&5
5736   (exit "$ac_status"); } &&
5737          { ac_try='test -s "conftest.$ac_objext"'
5738   { (eval echo "$as_me:5738: \"$ac_try\"") >&5
5739   (eval $ac_try) 2>&5
5740   ac_status=$?
5741   echo "$as_me:5741: \$? = $ac_status" >&5
5742   (exit "$ac_status"); }; }; then
5743   cf_cv_define_sigwinch=maybe
5744 else
5745   echo "$as_me: failed program was:" >&5
5746 cat "conftest.$ac_ext" >&5
5747 cf_cv_define_sigwinch=no
5748 fi
5749 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5750
5751 fi
5752 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5753
5754 fi
5755 echo "$as_me:5755: result: $cf_cv_define_sigwinch" >&5
5756 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5757
5758 if test "$cf_cv_define_sigwinch" = maybe ; then
5759 echo "$as_me:5759: checking for actual SIGWINCH definition" >&5
5760 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5761 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5762   echo $ECHO_N "(cached) $ECHO_C" >&6
5763 else
5764
5765 cf_cv_fixup_sigwinch=unknown
5766 cf_sigwinch=32
5767 while test "$cf_sigwinch" != 1
5768 do
5769         cat >"conftest.$ac_ext" <<_ACEOF
5770 #line 5770 "configure"
5771 #include "confdefs.h"
5772
5773 #undef _XOPEN_SOURCE
5774 #undef _POSIX_SOURCE
5775 #undef _POSIX_C_SOURCE
5776 #include <sys/types.h>
5777 #include <sys/signal.h>
5778
5779 int
5780 main (void)
5781 {
5782
5783 #if SIGWINCH != $cf_sigwinch
5784 make an error
5785 #endif
5786 int x = SIGWINCH; (void)x
5787   ;
5788   return 0;
5789 }
5790 _ACEOF
5791 rm -f "conftest.$ac_objext"
5792 if { (eval echo "$as_me:5792: \"$ac_compile\"") >&5
5793   (eval $ac_compile) 2>&5
5794   ac_status=$?
5795   echo "$as_me:5795: \$? = $ac_status" >&5
5796   (exit "$ac_status"); } &&
5797          { ac_try='test -s "conftest.$ac_objext"'
5798   { (eval echo "$as_me:5798: \"$ac_try\"") >&5
5799   (eval $ac_try) 2>&5
5800   ac_status=$?
5801   echo "$as_me:5801: \$? = $ac_status" >&5
5802   (exit "$ac_status"); }; }; then
5803   cf_cv_fixup_sigwinch=$cf_sigwinch
5804          break
5805 else
5806   echo "$as_me: failed program was:" >&5
5807 cat "conftest.$ac_ext" >&5
5808 fi
5809 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5810
5811 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
5812 done
5813
5814 fi
5815 echo "$as_me:5815: result: $cf_cv_fixup_sigwinch" >&5
5816 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5817
5818         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5819                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5820         fi
5821 fi
5822
5823 # Checks for CODESET support.
5824
5825 echo "$as_me:5825: checking for nl_langinfo and CODESET" >&5
5826 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5827 if test "${am_cv_langinfo_codeset+set}" = set; then
5828   echo $ECHO_N "(cached) $ECHO_C" >&6
5829 else
5830   cat >"conftest.$ac_ext" <<_ACEOF
5831 #line 5831 "configure"
5832 #include "confdefs.h"
5833 #include <langinfo.h>
5834 int
5835 main (void)
5836 {
5837 char* cs = nl_langinfo(CODESET); (void)cs
5838   ;
5839   return 0;
5840 }
5841 _ACEOF
5842 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5843 if { (eval echo "$as_me:5843: \"$ac_link\"") >&5
5844   (eval $ac_link) 2>&5
5845   ac_status=$?
5846   echo "$as_me:5846: \$? = $ac_status" >&5
5847   (exit "$ac_status"); } &&
5848          { ac_try='test -s "conftest$ac_exeext"'
5849   { (eval echo "$as_me:5849: \"$ac_try\"") >&5
5850   (eval $ac_try) 2>&5
5851   ac_status=$?
5852   echo "$as_me:5852: \$? = $ac_status" >&5
5853   (exit "$ac_status"); }; }; then
5854   am_cv_langinfo_codeset=yes
5855 else
5856   echo "$as_me: failed program was:" >&5
5857 cat "conftest.$ac_ext" >&5
5858 am_cv_langinfo_codeset=no
5859 fi
5860 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5861
5862 fi
5863 echo "$as_me:5863: result: $am_cv_langinfo_codeset" >&5
5864 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5865         if test "$am_cv_langinfo_codeset" = yes; then
5866
5867 cat >>confdefs.h <<\EOF
5868 #define HAVE_LANGINFO_CODESET 1
5869 EOF
5870
5871         fi
5872
5873 echo "$as_me:5873: checking if you want to use pkg-config" >&5
5874 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5875
5876 # Check whether --with-pkg-config or --without-pkg-config was given.
5877 if test "${with_pkg_config+set}" = set; then
5878   withval="$with_pkg_config"
5879   cf_pkg_config=$withval
5880 else
5881   cf_pkg_config=yes
5882 fi;
5883 echo "$as_me:5883: result: $cf_pkg_config" >&5
5884 echo "${ECHO_T}$cf_pkg_config" >&6
5885
5886 case "$cf_pkg_config" in
5887 (no)
5888         PKG_CONFIG=none
5889         ;;
5890 (yes)
5891
5892 if test -n "$ac_tool_prefix"; then
5893   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5894 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5895 echo "$as_me:5895: checking for $ac_word" >&5
5896 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5897 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5898   echo $ECHO_N "(cached) $ECHO_C" >&6
5899 else
5900   case $PKG_CONFIG in
5901   [\\/]* | ?:[\\/]*)
5902   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5903   ;;
5904   *)
5905   ac_save_IFS=$IFS; IFS=$ac_path_separator
5906 ac_dummy="$PATH"
5907 for ac_dir in $ac_dummy; do
5908   IFS=$ac_save_IFS
5909   test -z "$ac_dir" && ac_dir=.
5910   if $as_executable_p "$ac_dir/$ac_word"; then
5911    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5912    echo "$as_me:5912: found $ac_dir/$ac_word" >&5
5913    break
5914 fi
5915 done
5916
5917   ;;
5918 esac
5919 fi
5920 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5921
5922 if test -n "$PKG_CONFIG"; then
5923   echo "$as_me:5923: result: $PKG_CONFIG" >&5
5924 echo "${ECHO_T}$PKG_CONFIG" >&6
5925 else
5926   echo "$as_me:5926: result: no" >&5
5927 echo "${ECHO_T}no" >&6
5928 fi
5929
5930 fi
5931 if test -z "$ac_cv_path_PKG_CONFIG"; then
5932   ac_pt_PKG_CONFIG=$PKG_CONFIG
5933   # Extract the first word of "pkg-config", so it can be a program name with args.
5934 set dummy pkg-config; ac_word=$2
5935 echo "$as_me:5935: checking for $ac_word" >&5
5936 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5937 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5938   echo $ECHO_N "(cached) $ECHO_C" >&6
5939 else
5940   case $ac_pt_PKG_CONFIG in
5941   [\\/]* | ?:[\\/]*)
5942   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5943   ;;
5944   *)
5945   ac_save_IFS=$IFS; IFS=$ac_path_separator
5946 ac_dummy="$PATH"
5947 for ac_dir in $ac_dummy; do
5948   IFS=$ac_save_IFS
5949   test -z "$ac_dir" && ac_dir=.
5950   if $as_executable_p "$ac_dir/$ac_word"; then
5951    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5952    echo "$as_me:5952: found $ac_dir/$ac_word" >&5
5953    break
5954 fi
5955 done
5956
5957   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5958   ;;
5959 esac
5960 fi
5961 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5962
5963 if test -n "$ac_pt_PKG_CONFIG"; then
5964   echo "$as_me:5964: result: $ac_pt_PKG_CONFIG" >&5
5965 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5966 else
5967   echo "$as_me:5967: result: no" >&5
5968 echo "${ECHO_T}no" >&6
5969 fi
5970
5971   PKG_CONFIG=$ac_pt_PKG_CONFIG
5972 else
5973   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5974 fi
5975
5976         ;;
5977 (*)
5978         PKG_CONFIG=$withval
5979         ;;
5980 esac
5981
5982 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5983 if test "$PKG_CONFIG" != none ; then
5984
5985 if test "x$prefix" != xNONE; then
5986         cf_path_syntax="$prefix"
5987 else
5988         cf_path_syntax="$ac_default_prefix"
5989 fi
5990
5991 case ".$PKG_CONFIG" in
5992 (.\$\(*\)*|.\'*\'*)
5993         ;;
5994 (..|./*|.\\*)
5995         ;;
5996 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5997         ;;
5998 (.\$\{*prefix\}*|.\$\{*dir\}*)
5999         eval PKG_CONFIG="$PKG_CONFIG"
6000         case ".$PKG_CONFIG" in
6001         (.NONE/*)
6002                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6003                 ;;
6004         esac
6005         ;;
6006 (.no|.NONE/*)
6007         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
6008         ;;
6009 (*)
6010         { { echo "$as_me:6010: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
6011 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
6012    { (exit 1); exit 1; }; }
6013         ;;
6014 esac
6015
6016 elif test "x$cf_pkg_config" != xno ; then
6017         { echo "$as_me:6017: WARNING: pkg-config is not installed" >&5
6018 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
6019 fi
6020
6021 echo "$as_me:6021: checking if you want to see long compiling messages" >&5
6022 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
6023
6024 # Check whether --enable-echo or --disable-echo was given.
6025 if test "${enable_echo+set}" = set; then
6026   enableval="$enable_echo"
6027   test "$enableval" != no && enableval=yes
6028         if test "$enableval" != "yes" ; then
6029
6030         ECHO_LT='--silent'
6031         ECHO_LD='@echo linking $@;'
6032         RULE_CC='@echo compiling $<'
6033         SHOW_CC='@echo compiling $@'
6034         ECHO_CC='@'
6035
6036         else
6037
6038         ECHO_LT=''
6039         ECHO_LD=''
6040         RULE_CC=''
6041         SHOW_CC=''
6042         ECHO_CC=''
6043
6044         fi
6045 else
6046   enableval=yes
6047
6048         ECHO_LT=''
6049         ECHO_LD=''
6050         RULE_CC=''
6051         SHOW_CC=''
6052         ECHO_CC=''
6053
6054 fi;
6055 echo "$as_me:6055: result: $enableval" >&5
6056 echo "${ECHO_T}$enableval" >&6
6057
6058 echo "$as_me:6058: checking for ncurses wrap-prefix" >&5
6059 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
6060
6061 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
6062 if test "${with_ncurses_wrap_prefix+set}" = set; then
6063   withval="$with_ncurses_wrap_prefix"
6064   NCURSES_WRAP_PREFIX=$withval
6065 else
6066   NCURSES_WRAP_PREFIX=_nc_
6067 fi;
6068 echo "$as_me:6068: result: $NCURSES_WRAP_PREFIX" >&5
6069 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
6070
6071 echo "$as_me:6071: checking if you want to check for wide-character functions" >&5
6072 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
6073
6074 # Check whether --enable-widec or --disable-widec was given.
6075 if test "${enable_widec+set}" = set; then
6076   enableval="$enable_widec"
6077   test "$enableval" != no && enableval=yes
6078         if test "$enableval" != "yes" ; then
6079     cf_enable_widec=no
6080         else
6081                 cf_enable_widec=yes
6082         fi
6083 else
6084   enableval=yes
6085         cf_enable_widec=yes
6086
6087 fi;
6088 echo "$as_me:6088: result: $cf_enable_widec" >&5
6089 echo "${ECHO_T}$cf_enable_widec" >&6
6090
6091 echo "$as_me:6091: checking for specific curses-directory" >&5
6092 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
6093
6094 # Check whether --with-curses-dir or --without-curses-dir was given.
6095 if test "${with_curses_dir+set}" = set; then
6096   withval="$with_curses_dir"
6097   cf_cv_curses_dir=$withval
6098 else
6099   cf_cv_curses_dir=no
6100 fi;
6101 echo "$as_me:6101: result: $cf_cv_curses_dir" >&5
6102 echo "${ECHO_T}$cf_cv_curses_dir" >&6
6103
6104 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6105 then
6106
6107 if test "x$prefix" != xNONE; then
6108         cf_path_syntax="$prefix"
6109 else
6110         cf_path_syntax="$ac_default_prefix"
6111 fi
6112
6113 case ".$withval" in
6114 (.\$\(*\)*|.\'*\'*)
6115         ;;
6116 (..|./*|.\\*)
6117         ;;
6118 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
6119         ;;
6120 (.\$\{*prefix\}*|.\$\{*dir\}*)
6121         eval withval="$withval"
6122         case ".$withval" in
6123         (.NONE/*)
6124                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6125                 ;;
6126         esac
6127         ;;
6128 (.no|.NONE/*)
6129         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
6130         ;;
6131 (*)
6132         { { echo "$as_me:6132: error: expected a pathname, not \"$withval\"" >&5
6133 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
6134    { (exit 1); exit 1; }; }
6135         ;;
6136 esac
6137
6138         if test -d "$cf_cv_curses_dir"
6139         then
6140
6141 if test -n "$cf_cv_curses_dir/include" ; then
6142   for cf_add_incdir in $cf_cv_curses_dir/include
6143   do
6144         while test "$cf_add_incdir" != /usr/include
6145         do
6146           if test -d "$cf_add_incdir"
6147           then
6148                 cf_have_incdir=no
6149                 if test -n "$CFLAGS$CPPFLAGS" ; then
6150                   # a loop is needed to ensure we can add subdirs of existing dirs
6151                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6152                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6153                           cf_have_incdir=yes; break
6154                         fi
6155                   done
6156                 fi
6157
6158                 if test "$cf_have_incdir" = no ; then
6159                   if test "$cf_add_incdir" = /usr/local/include ; then
6160                         if test "$GCC" = yes
6161                         then
6162                           cf_save_CPPFLAGS=$CPPFLAGS
6163
6164         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6165         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6166
6167                           cat >"conftest.$ac_ext" <<_ACEOF
6168 #line 6168 "configure"
6169 #include "confdefs.h"
6170 #include <stdio.h>
6171 int
6172 main (void)
6173 {
6174 printf("Hello")
6175   ;
6176   return 0;
6177 }
6178 _ACEOF
6179 rm -f "conftest.$ac_objext"
6180 if { (eval echo "$as_me:6180: \"$ac_compile\"") >&5
6181   (eval $ac_compile) 2>&5
6182   ac_status=$?
6183   echo "$as_me:6183: \$? = $ac_status" >&5
6184   (exit "$ac_status"); } &&
6185          { ac_try='test -s "conftest.$ac_objext"'
6186   { (eval echo "$as_me:6186: \"$ac_try\"") >&5
6187   (eval $ac_try) 2>&5
6188   ac_status=$?
6189   echo "$as_me:6189: \$? = $ac_status" >&5
6190   (exit "$ac_status"); }; }; then
6191   :
6192 else
6193   echo "$as_me: failed program was:" >&5
6194 cat "conftest.$ac_ext" >&5
6195 cf_have_incdir=yes
6196 fi
6197 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6198                           CPPFLAGS=$cf_save_CPPFLAGS
6199                         fi
6200                   fi
6201                 fi
6202
6203                 if test "$cf_have_incdir" = no ; then
6204                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6205
6206 echo "${as_me:-configure}:6206: testing adding $cf_add_incdir to include-path ..." 1>&5
6207
6208                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6209
6210                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6211                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6212                   cf_add_incdir="$cf_top_incdir"
6213                 else
6214                   break
6215                 fi
6216           else
6217                 break
6218           fi
6219         done
6220   done
6221 fi
6222
6223 if test -n "$cf_cv_curses_dir/lib" ; then
6224         for cf_add_libdir in $cf_cv_curses_dir/lib
6225         do
6226                 if test "$cf_add_libdir" = /usr/lib ; then
6227                         :
6228                 elif test -d "$cf_add_libdir"
6229                 then
6230                         cf_have_libdir=no
6231                         if test -n "$LDFLAGS$LIBS" ; then
6232                                 # a loop is needed to ensure we can add subdirs of existing dirs
6233                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6234                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6235                                                 cf_have_libdir=yes; break
6236                                         fi
6237                                 done
6238                         fi
6239                         if test "$cf_have_libdir" = no ; then
6240                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6241
6242 echo "${as_me:-configure}:6242: testing adding $cf_add_libdir to library-path ..." 1>&5
6243
6244                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6245                         fi
6246                 fi
6247         done
6248 fi
6249
6250         fi
6251 fi
6252
6253 cf_cv_screen=curses
6254
6255 echo "$as_me:6255: checking for specified curses library type" >&5
6256 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
6257
6258 # Check whether --with-screen or --without-screen was given.
6259 if test "${with_screen+set}" = set; then
6260   withval="$with_screen"
6261   cf_cv_screen=$withval
6262 else
6263
6264 # Check whether --with-ncursesw or --without-ncursesw was given.
6265 if test "${with_ncursesw+set}" = set; then
6266   withval="$with_ncursesw"
6267   cf_cv_screen=ncursesw
6268 else
6269
6270 # Check whether --with-ncurses or --without-ncurses was given.
6271 if test "${with_ncurses+set}" = set; then
6272   withval="$with_ncurses"
6273   cf_cv_screen=ncurses
6274 else
6275
6276 # Check whether --with-pdcurses or --without-pdcurses was given.
6277 if test "${with_pdcurses+set}" = set; then
6278   withval="$with_pdcurses"
6279   cf_cv_screen=pdcurses
6280 else
6281
6282 # Check whether --with-curses-colr or --without-curses-colr was given.
6283 if test "${with_curses_colr+set}" = set; then
6284   withval="$with_curses_colr"
6285   cf_cv_screen=curses_colr
6286 else
6287
6288 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6289 if test "${with_curses_5lib+set}" = set; then
6290   withval="$with_curses_5lib"
6291   cf_cv_screen=curses_5lib
6292 fi;
6293 fi;
6294 fi;
6295 fi;
6296 fi;
6297 fi;
6298
6299 echo "$as_me:6299: result: $cf_cv_screen" >&5
6300 echo "${ECHO_T}$cf_cv_screen" >&6
6301
6302 case $cf_cv_screen in
6303 (curses|curses_*)
6304
6305 echo "$as_me:6305: checking for extra include directories" >&5
6306 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6307 if test "${cf_cv_curses_incdir+set}" = set; then
6308   echo $ECHO_N "(cached) $ECHO_C" >&6
6309 else
6310
6311 cf_cv_curses_incdir=no
6312 case "$host_os" in
6313 (hpux10.*)
6314         if test "x$cf_cv_screen" = "xcurses_colr"
6315         then
6316                 test -d /usr/include/curses_colr && \
6317                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6318         fi
6319         ;;
6320 (sunos3*|sunos4*)
6321         if test "x$cf_cv_screen" = "xcurses_5lib"
6322         then
6323                 test -d /usr/5lib && \
6324                 test -d /usr/5include && \
6325                 cf_cv_curses_incdir="-I/usr/5include"
6326         fi
6327         ;;
6328 esac
6329
6330 fi
6331 echo "$as_me:6331: result: $cf_cv_curses_incdir" >&5
6332 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6333 if test "$cf_cv_curses_incdir" != no
6334 then
6335
6336         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6337         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6338
6339 fi
6340
6341 echo "$as_me:6341: checking if we have identified curses headers" >&5
6342 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6343 if test "${cf_cv_ncurses_header+set}" = set; then
6344   echo $ECHO_N "(cached) $ECHO_C" >&6
6345 else
6346
6347 cf_cv_ncurses_header=none
6348 for cf_header in \
6349         ncurses.h  \
6350         curses.h  ncurses/ncurses.h ncurses/curses.h
6351 do
6352 cat >"conftest.$ac_ext" <<_ACEOF
6353 #line 6353 "configure"
6354 #include "confdefs.h"
6355 #include <${cf_header}>
6356 int
6357 main (void)
6358 {
6359 initscr(); tgoto("?", 0,0)
6360   ;
6361   return 0;
6362 }
6363 _ACEOF
6364 rm -f "conftest.$ac_objext"
6365 if { (eval echo "$as_me:6365: \"$ac_compile\"") >&5
6366   (eval $ac_compile) 2>&5
6367   ac_status=$?
6368   echo "$as_me:6368: \$? = $ac_status" >&5
6369   (exit "$ac_status"); } &&
6370          { ac_try='test -s "conftest.$ac_objext"'
6371   { (eval echo "$as_me:6371: \"$ac_try\"") >&5
6372   (eval $ac_try) 2>&5
6373   ac_status=$?
6374   echo "$as_me:6374: \$? = $ac_status" >&5
6375   (exit "$ac_status"); }; }; then
6376   cf_cv_ncurses_header=$cf_header; break
6377 else
6378   echo "$as_me: failed program was:" >&5
6379 cat "conftest.$ac_ext" >&5
6380 fi
6381 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6382 done
6383
6384 fi
6385 echo "$as_me:6385: result: $cf_cv_ncurses_header" >&5
6386 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6387
6388 if test "$cf_cv_ncurses_header" = none ; then
6389         { { echo "$as_me:6389: error: No curses header-files found" >&5
6390 echo "$as_me: error: No curses header-files found" >&2;}
6391    { (exit 1); exit 1; }; }
6392 fi
6393
6394 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6395
6396 for ac_header in $cf_cv_ncurses_header
6397 do
6398 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6399 echo "$as_me:6399: checking for $ac_header" >&5
6400 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6401 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6402   echo $ECHO_N "(cached) $ECHO_C" >&6
6403 else
6404   cat >"conftest.$ac_ext" <<_ACEOF
6405 #line 6405 "configure"
6406 #include "confdefs.h"
6407 #include <$ac_header>
6408 _ACEOF
6409 if { (eval echo "$as_me:6409: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6410   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6411   ac_status=$?
6412   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6413   rm -f conftest.er1
6414   cat conftest.err >&5
6415   echo "$as_me:6415: \$? = $ac_status" >&5
6416   (exit "$ac_status"); } >/dev/null; then
6417   if test -s conftest.err; then
6418     ac_cpp_err=$ac_c_preproc_warn_flag
6419   else
6420     ac_cpp_err=
6421   fi
6422 else
6423   ac_cpp_err=yes
6424 fi
6425 if test -z "$ac_cpp_err"; then
6426   eval "$as_ac_Header=yes"
6427 else
6428   echo "$as_me: failed program was:" >&5
6429   cat "conftest.$ac_ext" >&5
6430   eval "$as_ac_Header=no"
6431 fi
6432 rm -f conftest.err "conftest.$ac_ext"
6433 fi
6434 echo "$as_me:6434: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6435 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6436 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6437   cat >>confdefs.h <<EOF
6438 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6439 EOF
6440
6441 fi
6442 done
6443
6444 echo "$as_me:6444: checking for terminfo header" >&5
6445 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6446 if test "${cf_cv_term_header+set}" = set; then
6447   echo $ECHO_N "(cached) $ECHO_C" >&6
6448 else
6449
6450 case "${cf_cv_ncurses_header}" in
6451 (*/ncurses.h|*/ncursesw.h)
6452         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6453         ;;
6454 (*)
6455         cf_term_header=term.h
6456         ;;
6457 esac
6458
6459 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6460 do
6461 cat >"conftest.$ac_ext" <<_ACEOF
6462 #line 6462 "configure"
6463 #include "confdefs.h"
6464 #include <stdio.h>
6465 #include <${cf_cv_ncurses_header:-curses.h}>
6466 #include <$cf_test>
6467
6468 int
6469 main (void)
6470 {
6471 int x = auto_left_margin; (void)x
6472   ;
6473   return 0;
6474 }
6475 _ACEOF
6476 rm -f "conftest.$ac_objext"
6477 if { (eval echo "$as_me:6477: \"$ac_compile\"") >&5
6478   (eval $ac_compile) 2>&5
6479   ac_status=$?
6480   echo "$as_me:6480: \$? = $ac_status" >&5
6481   (exit "$ac_status"); } &&
6482          { ac_try='test -s "conftest.$ac_objext"'
6483   { (eval echo "$as_me:6483: \"$ac_try\"") >&5
6484   (eval $ac_try) 2>&5
6485   ac_status=$?
6486   echo "$as_me:6486: \$? = $ac_status" >&5
6487   (exit "$ac_status"); }; }; then
6488
6489         cf_cv_term_header="$cf_test"
6490 else
6491   echo "$as_me: failed program was:" >&5
6492 cat "conftest.$ac_ext" >&5
6493
6494         cf_cv_term_header=unknown
6495
6496 fi
6497 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6498         test "$cf_cv_term_header" != unknown && break
6499 done
6500
6501 fi
6502 echo "$as_me:6502: result: $cf_cv_term_header" >&5
6503 echo "${ECHO_T}$cf_cv_term_header" >&6
6504
6505 # Set definitions to allow ifdef'ing to accommodate subdirectories
6506
6507 case "$cf_cv_term_header" in
6508 (*term.h)
6509
6510 cat >>confdefs.h <<\EOF
6511 #define HAVE_TERM_H 1
6512 EOF
6513
6514         ;;
6515 esac
6516
6517 case "$cf_cv_term_header" in
6518 (ncurses/term.h)
6519
6520 cat >>confdefs.h <<\EOF
6521 #define HAVE_NCURSES_TERM_H 1
6522 EOF
6523
6524         ;;
6525 (ncursesw/term.h)
6526
6527 cat >>confdefs.h <<\EOF
6528 #define HAVE_NCURSESW_TERM_H 1
6529 EOF
6530
6531         ;;
6532 esac
6533
6534 echo "$as_me:6534: checking for ncurses version" >&5
6535 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6536 if test "${cf_cv_ncurses_version+set}" = set; then
6537   echo $ECHO_N "(cached) $ECHO_C" >&6
6538 else
6539
6540         cf_cv_ncurses_version=no
6541         cf_tempfile=out$$
6542         rm -f "$cf_tempfile"
6543         if test "$cross_compiling" = yes; then
6544
6545         # This will not work if the preprocessor splits the line after the
6546         # Autoconf token.  The 'unproto' program does that.
6547         cat > "conftest.$ac_ext" <<EOF
6548 #include <${cf_cv_ncurses_header:-curses.h}>
6549 #undef Autoconf
6550 #ifdef NCURSES_VERSION
6551 Autoconf NCURSES_VERSION
6552 #else
6553 #ifdef __NCURSES_H
6554 Autoconf "old"
6555 #endif
6556 ;
6557 #endif
6558 EOF
6559         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6560         { (eval echo "$as_me:6560: \"$cf_try\"") >&5
6561   (eval $cf_try) 2>&5
6562   ac_status=$?
6563   echo "$as_me:6563: \$? = $ac_status" >&5
6564   (exit "$ac_status"); }
6565         if test -f conftest.out ; then
6566                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6567                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6568                 rm -f conftest.out
6569         fi
6570
6571 else
6572   cat >"conftest.$ac_ext" <<_ACEOF
6573 #line 6573 "configure"
6574 #include "confdefs.h"
6575
6576 #include <${cf_cv_ncurses_header:-curses.h}>
6577 #include <stdio.h>
6578 int main(void)
6579 {
6580         FILE *fp = fopen("$cf_tempfile", "w");
6581 #ifdef NCURSES_VERSION
6582 # ifdef NCURSES_VERSION_PATCH
6583         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6584 # else
6585         fprintf(fp, "%s\\n", NCURSES_VERSION);
6586 # endif
6587 #else
6588 # ifdef __NCURSES_H
6589         fprintf(fp, "old\\n");
6590 # else
6591         make an error
6592 # endif
6593 #endif
6594         ${cf_cv_main_return:-return}(0);
6595 }
6596 _ACEOF
6597 rm -f "conftest$ac_exeext"
6598 if { (eval echo "$as_me:6598: \"$ac_link\"") >&5
6599   (eval $ac_link) 2>&5
6600   ac_status=$?
6601   echo "$as_me:6601: \$? = $ac_status" >&5
6602   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6603   { (eval echo "$as_me:6603: \"$ac_try\"") >&5
6604   (eval $ac_try) 2>&5
6605   ac_status=$?
6606   echo "$as_me:6606: \$? = $ac_status" >&5
6607   (exit "$ac_status"); }; }; then
6608
6609         cf_cv_ncurses_version=`cat $cf_tempfile`
6610 else
6611   echo "$as_me: program exited with status $ac_status" >&5
6612 echo "$as_me: failed program was:" >&5
6613 cat "conftest.$ac_ext" >&5
6614 fi
6615 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6616 fi
6617         rm -f "$cf_tempfile"
6618
6619 fi
6620 echo "$as_me:6620: result: $cf_cv_ncurses_version" >&5
6621 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6622 test "$cf_cv_ncurses_version" = no ||
6623 cat >>confdefs.h <<\EOF
6624 #define NCURSES 1
6625 EOF
6626
6627 echo "$as_me:6627: checking if we have identified curses libraries" >&5
6628 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6629 cat >"conftest.$ac_ext" <<_ACEOF
6630 #line 6630 "configure"
6631 #include "confdefs.h"
6632 #include <${cf_cv_ncurses_header:-curses.h}>
6633 int
6634 main (void)
6635 {
6636 initscr(); tgoto("?", 0,0)
6637   ;
6638   return 0;
6639 }
6640 _ACEOF
6641 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6642 if { (eval echo "$as_me:6642: \"$ac_link\"") >&5
6643   (eval $ac_link) 2>&5
6644   ac_status=$?
6645   echo "$as_me:6645: \$? = $ac_status" >&5
6646   (exit "$ac_status"); } &&
6647          { ac_try='test -s "conftest$ac_exeext"'
6648   { (eval echo "$as_me:6648: \"$ac_try\"") >&5
6649   (eval $ac_try) 2>&5
6650   ac_status=$?
6651   echo "$as_me:6651: \$? = $ac_status" >&5
6652   (exit "$ac_status"); }; }; then
6653   cf_result=yes
6654 else
6655   echo "$as_me: failed program was:" >&5
6656 cat "conftest.$ac_ext" >&5
6657 cf_result=no
6658 fi
6659 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6660 echo "$as_me:6660: result: $cf_result" >&5
6661 echo "${ECHO_T}$cf_result" >&6
6662
6663 if test "$cf_result" = no ; then
6664 case "$host_os" in
6665 (freebsd*)
6666         echo "$as_me:6666: checking for tgoto in -lmytinfo" >&5
6667 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6668 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6669   echo $ECHO_N "(cached) $ECHO_C" >&6
6670 else
6671   ac_check_lib_save_LIBS=$LIBS
6672 LIBS="-lmytinfo  $LIBS"
6673 cat >"conftest.$ac_ext" <<_ACEOF
6674 #line 6674 "configure"
6675 #include "confdefs.h"
6676
6677 /* Override any gcc2 internal prototype to avoid an error.  */
6678 #ifdef __cplusplus
6679 extern "C"
6680 #endif
6681 /* We use char because int might match the return type of a gcc2
6682    builtin and then its argument prototype would still apply.  */
6683 char tgoto ();
6684 int
6685 main (void)
6686 {
6687 tgoto ();
6688   ;
6689   return 0;
6690 }
6691 _ACEOF
6692 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6693 if { (eval echo "$as_me:6693: \"$ac_link\"") >&5
6694   (eval $ac_link) 2>&5
6695   ac_status=$?
6696   echo "$as_me:6696: \$? = $ac_status" >&5
6697   (exit "$ac_status"); } &&
6698          { ac_try='test -s "conftest$ac_exeext"'
6699   { (eval echo "$as_me:6699: \"$ac_try\"") >&5
6700   (eval $ac_try) 2>&5
6701   ac_status=$?
6702   echo "$as_me:6702: \$? = $ac_status" >&5
6703   (exit "$ac_status"); }; }; then
6704   ac_cv_lib_mytinfo_tgoto=yes
6705 else
6706   echo "$as_me: failed program was:" >&5
6707 cat "conftest.$ac_ext" >&5
6708 ac_cv_lib_mytinfo_tgoto=no
6709 fi
6710 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6711 LIBS=$ac_check_lib_save_LIBS
6712 fi
6713 echo "$as_me:6713: result: $ac_cv_lib_mytinfo_tgoto" >&5
6714 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6715 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6716
6717 cf_add_libs="$LIBS"
6718 # reverse order
6719 cf_add_0lib=
6720 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6721 # filter duplicates
6722 for cf_add_1lib in $cf_add_0lib; do
6723         for cf_add_2lib in $cf_add_libs; do
6724                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6725                         cf_add_1lib=
6726                         break
6727                 fi
6728         done
6729         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6730 done
6731 LIBS="$cf_add_libs"
6732
6733 fi
6734
6735         ;;
6736 (hpux10.*)
6737         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6738         # next (1998), and xcurses "newer" (2000).  There is no header file for
6739         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6740         # term.h) for cur_colr
6741         if test "x$cf_cv_screen" = "xcurses_colr"
6742         then
6743                 echo "$as_me:6743: checking for initscr in -lcur_colr" >&5
6744 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6745 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6746   echo $ECHO_N "(cached) $ECHO_C" >&6
6747 else
6748   ac_check_lib_save_LIBS=$LIBS
6749 LIBS="-lcur_colr  $LIBS"
6750 cat >"conftest.$ac_ext" <<_ACEOF
6751 #line 6751 "configure"
6752 #include "confdefs.h"
6753
6754 /* Override any gcc2 internal prototype to avoid an error.  */
6755 #ifdef __cplusplus
6756 extern "C"
6757 #endif
6758 /* We use char because int might match the return type of a gcc2
6759    builtin and then its argument prototype would still apply.  */
6760 char initscr ();
6761 int
6762 main (void)
6763 {
6764 initscr ();
6765   ;
6766   return 0;
6767 }
6768 _ACEOF
6769 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6770 if { (eval echo "$as_me:6770: \"$ac_link\"") >&5
6771   (eval $ac_link) 2>&5
6772   ac_status=$?
6773   echo "$as_me:6773: \$? = $ac_status" >&5
6774   (exit "$ac_status"); } &&
6775          { ac_try='test -s "conftest$ac_exeext"'
6776   { (eval echo "$as_me:6776: \"$ac_try\"") >&5
6777   (eval $ac_try) 2>&5
6778   ac_status=$?
6779   echo "$as_me:6779: \$? = $ac_status" >&5
6780   (exit "$ac_status"); }; }; then
6781   ac_cv_lib_cur_colr_initscr=yes
6782 else
6783   echo "$as_me: failed program was:" >&5
6784 cat "conftest.$ac_ext" >&5
6785 ac_cv_lib_cur_colr_initscr=no
6786 fi
6787 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6788 LIBS=$ac_check_lib_save_LIBS
6789 fi
6790 echo "$as_me:6790: result: $ac_cv_lib_cur_colr_initscr" >&5
6791 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6792 if test "$ac_cv_lib_cur_colr_initscr" = yes; then
6793
6794 cf_add_libs="$LIBS"
6795 # reverse order
6796 cf_add_0lib=
6797 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6798 # filter duplicates
6799 for cf_add_1lib in $cf_add_0lib; do
6800         for cf_add_2lib in $cf_add_libs; do
6801                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6802                         cf_add_1lib=
6803                         break
6804                 fi
6805         done
6806         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6807 done
6808 LIBS="$cf_add_libs"
6809
6810                         ac_cv_func_initscr=yes
6811
6812 else
6813
6814                 echo "$as_me:6814: checking for initscr in -lHcurses" >&5
6815 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6816 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6817   echo $ECHO_N "(cached) $ECHO_C" >&6
6818 else
6819   ac_check_lib_save_LIBS=$LIBS
6820 LIBS="-lHcurses  $LIBS"
6821 cat >"conftest.$ac_ext" <<_ACEOF
6822 #line 6822 "configure"
6823 #include "confdefs.h"
6824
6825 /* Override any gcc2 internal prototype to avoid an error.  */
6826 #ifdef __cplusplus
6827 extern "C"
6828 #endif
6829 /* We use char because int might match the return type of a gcc2
6830    builtin and then its argument prototype would still apply.  */
6831 char initscr ();
6832 int
6833 main (void)
6834 {
6835 initscr ();
6836   ;
6837   return 0;
6838 }
6839 _ACEOF
6840 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6841 if { (eval echo "$as_me:6841: \"$ac_link\"") >&5
6842   (eval $ac_link) 2>&5
6843   ac_status=$?
6844   echo "$as_me:6844: \$? = $ac_status" >&5
6845   (exit "$ac_status"); } &&
6846          { ac_try='test -s "conftest$ac_exeext"'
6847   { (eval echo "$as_me:6847: \"$ac_try\"") >&5
6848   (eval $ac_try) 2>&5
6849   ac_status=$?
6850   echo "$as_me:6850: \$? = $ac_status" >&5
6851   (exit "$ac_status"); }; }; then
6852   ac_cv_lib_Hcurses_initscr=yes
6853 else
6854   echo "$as_me: failed program was:" >&5
6855 cat "conftest.$ac_ext" >&5
6856 ac_cv_lib_Hcurses_initscr=no
6857 fi
6858 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6859 LIBS=$ac_check_lib_save_LIBS
6860 fi
6861 echo "$as_me:6861: result: $ac_cv_lib_Hcurses_initscr" >&5
6862 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6863 if test "$ac_cv_lib_Hcurses_initscr" = yes; then
6864
6865                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6866
6867 cf_add_libs="$LIBS"
6868 # reverse order
6869 cf_add_0lib=
6870 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6871 # filter duplicates
6872 for cf_add_1lib in $cf_add_0lib; do
6873         for cf_add_2lib in $cf_add_libs; do
6874                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6875                         cf_add_1lib=
6876                         break
6877                 fi
6878         done
6879         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6880 done
6881 LIBS="$cf_add_libs"
6882
6883         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6884         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6885
6886                         ac_cv_func_initscr=yes
6887
6888 fi
6889
6890 fi
6891
6892         fi
6893         ;;
6894 (linux*)
6895         case `arch 2>/dev/null` in
6896         (x86_64)
6897                 if test -d /lib64
6898                 then
6899
6900 if test -n "/lib64" ; then
6901         for cf_add_libdir in /lib64
6902         do
6903                 if test "$cf_add_libdir" = /usr/lib ; then
6904                         :
6905                 elif test -d "$cf_add_libdir"
6906                 then
6907                         cf_have_libdir=no
6908                         if test -n "$LDFLAGS$LIBS" ; then
6909                                 # a loop is needed to ensure we can add subdirs of existing dirs
6910                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6911                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6912                                                 cf_have_libdir=yes; break
6913                                         fi
6914                                 done
6915                         fi
6916                         if test "$cf_have_libdir" = no ; then
6917                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6918
6919 echo "${as_me:-configure}:6919: testing adding $cf_add_libdir to library-path ..." 1>&5
6920
6921                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6922                         fi
6923                 fi
6924         done
6925 fi
6926
6927                 else
6928
6929 if test -n "/lib" ; then
6930         for cf_add_libdir in /lib
6931         do
6932                 if test "$cf_add_libdir" = /usr/lib ; then
6933                         :
6934                 elif test -d "$cf_add_libdir"
6935                 then
6936                         cf_have_libdir=no
6937                         if test -n "$LDFLAGS$LIBS" ; then
6938                                 # a loop is needed to ensure we can add subdirs of existing dirs
6939                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6940                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6941                                                 cf_have_libdir=yes; break
6942                                         fi
6943                                 done
6944                         fi
6945                         if test "$cf_have_libdir" = no ; then
6946                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6947
6948 echo "${as_me:-configure}:6948: testing adding $cf_add_libdir to library-path ..." 1>&5
6949
6950                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6951                         fi
6952                 fi
6953         done
6954 fi
6955
6956                 fi
6957                 ;;
6958         (*)
6959
6960 if test -n "/lib" ; then
6961         for cf_add_libdir in /lib
6962         do
6963                 if test "$cf_add_libdir" = /usr/lib ; then
6964                         :
6965                 elif test -d "$cf_add_libdir"
6966                 then
6967                         cf_have_libdir=no
6968                         if test -n "$LDFLAGS$LIBS" ; then
6969                                 # a loop is needed to ensure we can add subdirs of existing dirs
6970                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6971                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6972                                                 cf_have_libdir=yes; break
6973                                         fi
6974                                 done
6975                         fi
6976                         if test "$cf_have_libdir" = no ; then
6977                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6978
6979 echo "${as_me:-configure}:6979: testing adding $cf_add_libdir to library-path ..." 1>&5
6980
6981                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6982                         fi
6983                 fi
6984         done
6985 fi
6986
6987                 ;;
6988         esac
6989         ;;
6990 (sunos3*|sunos4*)
6991         if test "x$cf_cv_screen" = "xcurses_5lib"
6992         then
6993                 if test -d /usr/5lib ; then
6994
6995 if test -n "/usr/5lib" ; then
6996         for cf_add_libdir in /usr/5lib
6997         do
6998                 if test "$cf_add_libdir" = /usr/lib ; then
6999                         :
7000                 elif test -d "$cf_add_libdir"
7001                 then
7002                         cf_have_libdir=no
7003                         if test -n "$LDFLAGS$LIBS" ; then
7004                                 # a loop is needed to ensure we can add subdirs of existing dirs
7005                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7006                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7007                                                 cf_have_libdir=yes; break
7008                                         fi
7009                                 done
7010                         fi
7011                         if test "$cf_have_libdir" = no ; then
7012                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7013
7014 echo "${as_me:-configure}:7014: testing adding $cf_add_libdir to library-path ..." 1>&5
7015
7016                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7017                         fi
7018                 fi
7019         done
7020 fi
7021
7022 cf_add_libs="$LIBS"
7023 # reverse order
7024 cf_add_0lib=
7025 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7026 # filter duplicates
7027 for cf_add_1lib in $cf_add_0lib; do
7028         for cf_add_2lib in $cf_add_libs; do
7029                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7030                         cf_add_1lib=
7031                         break
7032                 fi
7033         done
7034         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7035 done
7036 LIBS="$cf_add_libs"
7037
7038                 fi
7039         fi
7040         ac_cv_func_initscr=yes
7041         ;;
7042 esac
7043
7044 if test ".$ac_cv_func_initscr" != .yes ; then
7045         cf_save_LIBS="$LIBS"
7046
7047         if test ".${cf_cv_ncurses_version:-no}" != .no
7048         then
7049                 cf_check_list="ncurses curses cursesX"
7050         else
7051                 cf_check_list="cursesX curses ncurses"
7052         fi
7053
7054         # Check for library containing tgoto.  Do this before curses library
7055         # because it may be needed to link the test-case for initscr.
7056         if test "x$cf_term_lib" = x
7057         then
7058                 echo "$as_me:7058: checking for tgoto" >&5
7059 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
7060 if test "${ac_cv_func_tgoto+set}" = set; then
7061   echo $ECHO_N "(cached) $ECHO_C" >&6
7062 else
7063   cat >"conftest.$ac_ext" <<_ACEOF
7064 #line 7064 "configure"
7065 #include "confdefs.h"
7066 #define tgoto autoconf_temporary
7067 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
7068 #undef tgoto
7069
7070 #ifdef __cplusplus
7071 extern "C"
7072 #endif
7073
7074 /* We use char because int might match the return type of a gcc2
7075    builtin and then its argument prototype would still apply.  */
7076 char tgoto (void);
7077
7078 int
7079 main (void)
7080 {
7081
7082 /* The GNU C library defines stubs for functions which it implements
7083     to always fail with ENOSYS.  Some functions are actually named
7084     something starting with __ and the normal name is an alias.  */
7085 #if defined (__stub_tgoto) || defined (__stub___tgoto)
7086 #error found stub for tgoto
7087 #endif
7088
7089         return tgoto ();
7090   ;
7091   return 0;
7092 }
7093 _ACEOF
7094 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7095 if { (eval echo "$as_me:7095: \"$ac_link\"") >&5
7096   (eval $ac_link) 2>&5
7097   ac_status=$?
7098   echo "$as_me:7098: \$? = $ac_status" >&5
7099   (exit "$ac_status"); } &&
7100          { ac_try='test -s "conftest$ac_exeext"'
7101   { (eval echo "$as_me:7101: \"$ac_try\"") >&5
7102   (eval $ac_try) 2>&5
7103   ac_status=$?
7104   echo "$as_me:7104: \$? = $ac_status" >&5
7105   (exit "$ac_status"); }; }; then
7106   ac_cv_func_tgoto=yes
7107 else
7108   echo "$as_me: failed program was:" >&5
7109 cat "conftest.$ac_ext" >&5
7110 ac_cv_func_tgoto=no
7111 fi
7112 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7113 fi
7114 echo "$as_me:7114: result: $ac_cv_func_tgoto" >&5
7115 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
7116 if test "$ac_cv_func_tgoto" = yes; then
7117   cf_term_lib=predefined
7118 else
7119
7120                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
7121                         do
7122                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
7123 echo "$as_me:7123: checking for tgoto in -l$cf_term_lib" >&5
7124 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
7125 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
7126   echo $ECHO_N "(cached) $ECHO_C" >&6
7127 else
7128   ac_check_lib_save_LIBS=$LIBS
7129 LIBS="-l$cf_term_lib  $LIBS"
7130 cat >"conftest.$ac_ext" <<_ACEOF
7131 #line 7131 "configure"
7132 #include "confdefs.h"
7133
7134 /* Override any gcc2 internal prototype to avoid an error.  */
7135 #ifdef __cplusplus
7136 extern "C"
7137 #endif
7138 /* We use char because int might match the return type of a gcc2
7139    builtin and then its argument prototype would still apply.  */
7140 char tgoto ();
7141 int
7142 main (void)
7143 {
7144 tgoto ();
7145   ;
7146   return 0;
7147 }
7148 _ACEOF
7149 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7150 if { (eval echo "$as_me:7150: \"$ac_link\"") >&5
7151   (eval $ac_link) 2>&5
7152   ac_status=$?
7153   echo "$as_me:7153: \$? = $ac_status" >&5
7154   (exit "$ac_status"); } &&
7155          { ac_try='test -s "conftest$ac_exeext"'
7156   { (eval echo "$as_me:7156: \"$ac_try\"") >&5
7157   (eval $ac_try) 2>&5
7158   ac_status=$?
7159   echo "$as_me:7159: \$? = $ac_status" >&5
7160   (exit "$ac_status"); }; }; then
7161   eval "$as_ac_Lib=yes"
7162 else
7163   echo "$as_me: failed program was:" >&5
7164 cat "conftest.$ac_ext" >&5
7165 eval "$as_ac_Lib=no"
7166 fi
7167 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7168 LIBS=$ac_check_lib_save_LIBS
7169 fi
7170 echo "$as_me:7170: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
7171 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
7172 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
7173
7174                                         : "${cf_nculib_root:=$cf_term_lib}"
7175                                         break
7176
7177 fi
7178
7179                         done
7180
7181 fi
7182
7183         fi
7184
7185         # Check for library containing initscr
7186         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
7187         if test "x$cf_curs_lib" = x
7188         then
7189                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
7190                 do
7191                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
7192                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
7193                                 echo "$as_me:7193: checking if we can link with $cf_curs_lib library" >&5
7194 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
7195                                 cat >"conftest.$ac_ext" <<_ACEOF
7196 #line 7196 "configure"
7197 #include "confdefs.h"
7198 #include <${cf_cv_ncurses_header:-curses.h}>
7199 int
7200 main (void)
7201 {
7202 initscr()
7203   ;
7204   return 0;
7205 }
7206 _ACEOF
7207 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7208 if { (eval echo "$as_me:7208: \"$ac_link\"") >&5
7209   (eval $ac_link) 2>&5
7210   ac_status=$?
7211   echo "$as_me:7211: \$? = $ac_status" >&5
7212   (exit "$ac_status"); } &&
7213          { ac_try='test -s "conftest$ac_exeext"'
7214   { (eval echo "$as_me:7214: \"$ac_try\"") >&5
7215   (eval $ac_try) 2>&5
7216   ac_status=$?
7217   echo "$as_me:7217: \$? = $ac_status" >&5
7218   (exit "$ac_status"); }; }; then
7219   cf_result=yes
7220 else
7221   echo "$as_me: failed program was:" >&5
7222 cat "conftest.$ac_ext" >&5
7223 cf_result=no
7224 fi
7225 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7226                                 echo "$as_me:7226: result: $cf_result" >&5
7227 echo "${ECHO_T}$cf_result" >&6
7228                                 test "$cf_result" = yes && break
7229                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
7230                                 cf_result=no
7231                         elif test "$cf_term_lib" != predefined ; then
7232                                 echo "$as_me:7232: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
7233 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
7234                                 cat >"conftest.$ac_ext" <<_ACEOF
7235 #line 7235 "configure"
7236 #include "confdefs.h"
7237 #include <${cf_cv_ncurses_header:-curses.h}>
7238 int
7239 main (void)
7240 {
7241 initscr(); tgoto((char *)0, 0, 0);
7242   ;
7243   return 0;
7244 }
7245 _ACEOF
7246 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7247 if { (eval echo "$as_me:7247: \"$ac_link\"") >&5
7248   (eval $ac_link) 2>&5
7249   ac_status=$?
7250   echo "$as_me:7250: \$? = $ac_status" >&5
7251   (exit "$ac_status"); } &&
7252          { ac_try='test -s "conftest$ac_exeext"'
7253   { (eval echo "$as_me:7253: \"$ac_try\"") >&5
7254   (eval $ac_try) 2>&5
7255   ac_status=$?
7256   echo "$as_me:7256: \$? = $ac_status" >&5
7257   (exit "$ac_status"); }; }; then
7258   cf_result=no
7259 else
7260   echo "$as_me: failed program was:" >&5
7261 cat "conftest.$ac_ext" >&5
7262
7263                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
7264                                         cat >"conftest.$ac_ext" <<_ACEOF
7265 #line 7265 "configure"
7266 #include "confdefs.h"
7267 #include <${cf_cv_ncurses_header:-curses.h}>
7268 int
7269 main (void)
7270 {
7271 initscr()
7272   ;
7273   return 0;
7274 }
7275 _ACEOF
7276 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7277 if { (eval echo "$as_me:7277: \"$ac_link\"") >&5
7278   (eval $ac_link) 2>&5
7279   ac_status=$?
7280   echo "$as_me:7280: \$? = $ac_status" >&5
7281   (exit "$ac_status"); } &&
7282          { ac_try='test -s "conftest$ac_exeext"'
7283   { (eval echo "$as_me:7283: \"$ac_try\"") >&5
7284   (eval $ac_try) 2>&5
7285   ac_status=$?
7286   echo "$as_me:7286: \$? = $ac_status" >&5
7287   (exit "$ac_status"); }; }; then
7288   cf_result=yes
7289 else
7290   echo "$as_me: failed program was:" >&5
7291 cat "conftest.$ac_ext" >&5
7292 cf_result=error
7293 fi
7294 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7295
7296 fi
7297 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7298                                 echo "$as_me:7298: result: $cf_result" >&5
7299 echo "${ECHO_T}$cf_result" >&6
7300                                 test "$cf_result" != error && break
7301                         fi
7302                 done
7303         fi
7304         test "$cf_curs_lib" = unknown && { { echo "$as_me:7304: error: no curses library found" >&5
7305 echo "$as_me: error: no curses library found" >&2;}
7306    { (exit 1); exit 1; }; }
7307 fi
7308 fi
7309
7310         ;;
7311 (ncursesw*)
7312
7313 echo "$as_me:7313: checking for multibyte character support" >&5
7314 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7315 if test "${cf_cv_utf8_lib+set}" = set; then
7316   echo $ECHO_N "(cached) $ECHO_C" >&6
7317 else
7318
7319         cf_save_LIBS="$LIBS"
7320         cat >"conftest.$ac_ext" <<_ACEOF
7321 #line 7321 "configure"
7322 #include "confdefs.h"
7323
7324 #include <stdlib.h>
7325 int
7326 main (void)
7327 {
7328 putwc(0,0);
7329   ;
7330   return 0;
7331 }
7332 _ACEOF
7333 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7334 if { (eval echo "$as_me:7334: \"$ac_link\"") >&5
7335   (eval $ac_link) 2>&5
7336   ac_status=$?
7337   echo "$as_me:7337: \$? = $ac_status" >&5
7338   (exit "$ac_status"); } &&
7339          { ac_try='test -s "conftest$ac_exeext"'
7340   { (eval echo "$as_me:7340: \"$ac_try\"") >&5
7341   (eval $ac_try) 2>&5
7342   ac_status=$?
7343   echo "$as_me:7343: \$? = $ac_status" >&5
7344   (exit "$ac_status"); }; }; then
7345   cf_cv_utf8_lib=yes
7346 else
7347   echo "$as_me: failed program was:" >&5
7348 cat "conftest.$ac_ext" >&5
7349
7350 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7351 # will be set on completion of the AC_TRY_LINK below.
7352 cf_cv_header_path_utf8=
7353 cf_cv_library_path_utf8=
7354
7355 echo "${as_me:-configure}:7355: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7356
7357 cf_save_LIBS="$LIBS"
7358
7359 cat >"conftest.$ac_ext" <<_ACEOF
7360 #line 7360 "configure"
7361 #include "confdefs.h"
7362
7363 #include <libutf8.h>
7364 int
7365 main (void)
7366 {
7367 putwc(0,0);
7368   ;
7369   return 0;
7370 }
7371 _ACEOF
7372 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7373 if { (eval echo "$as_me:7373: \"$ac_link\"") >&5
7374   (eval $ac_link) 2>&5
7375   ac_status=$?
7376   echo "$as_me:7376: \$? = $ac_status" >&5
7377   (exit "$ac_status"); } &&
7378          { ac_try='test -s "conftest$ac_exeext"'
7379   { (eval echo "$as_me:7379: \"$ac_try\"") >&5
7380   (eval $ac_try) 2>&5
7381   ac_status=$?
7382   echo "$as_me:7382: \$? = $ac_status" >&5
7383   (exit "$ac_status"); }; }; then
7384
7385         cf_cv_find_linkage_utf8=yes
7386         cf_cv_header_path_utf8=/usr/include
7387         cf_cv_library_path_utf8=/usr/lib
7388
7389 else
7390   echo "$as_me: failed program was:" >&5
7391 cat "conftest.$ac_ext" >&5
7392
7393 LIBS="-lutf8  $cf_save_LIBS"
7394
7395 cat >"conftest.$ac_ext" <<_ACEOF
7396 #line 7396 "configure"
7397 #include "confdefs.h"
7398
7399 #include <libutf8.h>
7400 int
7401 main (void)
7402 {
7403 putwc(0,0);
7404   ;
7405   return 0;
7406 }
7407 _ACEOF
7408 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7409 if { (eval echo "$as_me:7409: \"$ac_link\"") >&5
7410   (eval $ac_link) 2>&5
7411   ac_status=$?
7412   echo "$as_me:7412: \$? = $ac_status" >&5
7413   (exit "$ac_status"); } &&
7414          { ac_try='test -s "conftest$ac_exeext"'
7415   { (eval echo "$as_me:7415: \"$ac_try\"") >&5
7416   (eval $ac_try) 2>&5
7417   ac_status=$?
7418   echo "$as_me:7418: \$? = $ac_status" >&5
7419   (exit "$ac_status"); }; }; then
7420
7421         cf_cv_find_linkage_utf8=yes
7422         cf_cv_header_path_utf8=/usr/include
7423         cf_cv_library_path_utf8=/usr/lib
7424         cf_cv_library_file_utf8="-lutf8"
7425
7426 else
7427   echo "$as_me: failed program was:" >&5
7428 cat "conftest.$ac_ext" >&5
7429
7430         cf_cv_find_linkage_utf8=no
7431         LIBS="$cf_save_LIBS"
7432
7433         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7434
7435 echo "${as_me:-configure}:7435: testing find linkage for utf8 library ..." 1>&5
7436
7437 echo "${as_me:-configure}:7437: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7438
7439         cf_save_CPPFLAGS="$CPPFLAGS"
7440         cf_test_CPPFLAGS="$CPPFLAGS"
7441
7442 cf_search=
7443
7444 # collect the current set of include-directories from compiler flags
7445 cf_header_path_list=""
7446 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7447         for cf_header_path in $CPPFLAGS $CFLAGS
7448         do
7449                 case "$cf_header_path" in
7450                 (-I*)
7451                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7452
7453 test "x$cf_header_path" != "xNONE" && \
7454 test -d "$cf_header_path" && \
7455  {
7456         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7457         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7458         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7459         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7460         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7461         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7462 }
7463
7464                         cf_header_path_list="$cf_header_path_list $cf_search"
7465                         ;;
7466                 esac
7467         done
7468 fi
7469
7470 # add the variations for the package we are looking for
7471
7472 cf_search=
7473
7474 test "x$prefix" != "xNONE" && \
7475 test -d "$prefix" && \
7476  {
7477         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7478         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7479         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7480         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7481         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7482         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7483 }
7484
7485 for cf_subdir_prefix in \
7486         /usr \
7487         /usr/local \
7488         /usr/pkg \
7489         /opt \
7490         /opt/local \
7491         $HOME
7492 do
7493
7494 test "x$cf_subdir_prefix" != "x$prefix" && \
7495 test -d "$cf_subdir_prefix" && \
7496 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7497         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7498         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7499         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7500         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7501         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7502         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7503 }
7504
7505 done
7506
7507 test "$includedir" != NONE && \
7508 test "$includedir" != "/usr/include" && \
7509 test -d "$includedir" && {
7510         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7511         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7512 }
7513
7514 test "$oldincludedir" != NONE && \
7515 test "$oldincludedir" != "/usr/include" && \
7516 test -d "$oldincludedir" && {
7517         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7518         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7519 }
7520
7521 cf_search="$cf_search $cf_header_path_list"
7522
7523         for cf_cv_header_path_utf8 in $cf_search
7524         do
7525                 if test -d "$cf_cv_header_path_utf8" ; then
7526                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7527
7528 echo "${as_me:-configure}:7528: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7529
7530                         CPPFLAGS="$cf_save_CPPFLAGS"
7531
7532         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7533         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7534
7535                         cat >"conftest.$ac_ext" <<_ACEOF
7536 #line 7536 "configure"
7537 #include "confdefs.h"
7538
7539 #include <libutf8.h>
7540 int
7541 main (void)
7542 {
7543 putwc(0,0);
7544   ;
7545   return 0;
7546 }
7547 _ACEOF
7548 rm -f "conftest.$ac_objext"
7549 if { (eval echo "$as_me:7549: \"$ac_compile\"") >&5
7550   (eval $ac_compile) 2>&5
7551   ac_status=$?
7552   echo "$as_me:7552: \$? = $ac_status" >&5
7553   (exit "$ac_status"); } &&
7554          { ac_try='test -s "conftest.$ac_objext"'
7555   { (eval echo "$as_me:7555: \"$ac_try\"") >&5
7556   (eval $ac_try) 2>&5
7557   ac_status=$?
7558   echo "$as_me:7558: \$? = $ac_status" >&5
7559   (exit "$ac_status"); }; }; then
7560
7561                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7562
7563 echo "${as_me:-configure}:7563: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7564
7565                                 cf_cv_find_linkage_utf8=maybe
7566                                 cf_test_CPPFLAGS="$CPPFLAGS"
7567                                 break
7568 else
7569   echo "$as_me: failed program was:" >&5
7570 cat "conftest.$ac_ext" >&5
7571
7572                                 CPPFLAGS="$cf_save_CPPFLAGS"
7573
7574 fi
7575 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7576                 fi
7577         done
7578
7579         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7580
7581 echo "${as_me:-configure}:7581: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7582
7583                 cf_save_LIBS="$LIBS"
7584                 cf_save_LDFLAGS="$LDFLAGS"
7585
7586                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7587
7588 cf_search=
7589 cf_library_path_list=""
7590 if test -n "${LDFLAGS}${LIBS}" ; then
7591         for cf_library_path in $LDFLAGS $LIBS
7592         do
7593                 case "$cf_library_path" in
7594                 (-L*)
7595                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7596
7597 test "x$cf_library_path" != "xNONE" && \
7598 test -d "$cf_library_path" && \
7599  {
7600         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7601         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7602         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7603         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7604         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7605         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7606 }
7607
7608                         cf_library_path_list="$cf_library_path_list $cf_search"
7609                         ;;
7610                 esac
7611         done
7612 fi
7613
7614 cf_search=
7615
7616 test "x$prefix" != "xNONE" && \
7617 test -d "$prefix" && \
7618  {
7619         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7620         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7621         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7622         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7623         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7624         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7625 }
7626
7627 for cf_subdir_prefix in \
7628         /usr \
7629         /usr/local \
7630         /usr/pkg \
7631         /opt \
7632         /opt/local \
7633         $HOME
7634 do
7635
7636 test "x$cf_subdir_prefix" != "x$prefix" && \
7637 test -d "$cf_subdir_prefix" && \
7638 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7639         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7640         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7641         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7642         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7643         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7644         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7645 }
7646
7647 done
7648
7649 cf_search="$cf_library_path_list $cf_search"
7650
7651                         for cf_cv_library_path_utf8 in $cf_search
7652                         do
7653                                 if test -d "$cf_cv_library_path_utf8" ; then
7654                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7655
7656 echo "${as_me:-configure}:7656: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7657
7658                                         CPPFLAGS="$cf_test_CPPFLAGS"
7659                                         LIBS="-lutf8  $cf_save_LIBS"
7660                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7661                                         cat >"conftest.$ac_ext" <<_ACEOF
7662 #line 7662 "configure"
7663 #include "confdefs.h"
7664
7665 #include <libutf8.h>
7666 int
7667 main (void)
7668 {
7669 putwc(0,0);
7670   ;
7671   return 0;
7672 }
7673 _ACEOF
7674 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7675 if { (eval echo "$as_me:7675: \"$ac_link\"") >&5
7676   (eval $ac_link) 2>&5
7677   ac_status=$?
7678   echo "$as_me:7678: \$? = $ac_status" >&5
7679   (exit "$ac_status"); } &&
7680          { ac_try='test -s "conftest$ac_exeext"'
7681   { (eval echo "$as_me:7681: \"$ac_try\"") >&5
7682   (eval $ac_try) 2>&5
7683   ac_status=$?
7684   echo "$as_me:7684: \$? = $ac_status" >&5
7685   (exit "$ac_status"); }; }; then
7686
7687                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7688
7689 echo "${as_me:-configure}:7689: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7690
7691                                         cf_cv_find_linkage_utf8=yes
7692                                         cf_cv_library_file_utf8="-lutf8"
7693                                         break
7694 else
7695   echo "$as_me: failed program was:" >&5
7696 cat "conftest.$ac_ext" >&5
7697
7698                                         CPPFLAGS="$cf_save_CPPFLAGS"
7699                                         LIBS="$cf_save_LIBS"
7700                                         LDFLAGS="$cf_save_LDFLAGS"
7701
7702 fi
7703 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7704                                 fi
7705                         done
7706                         CPPFLAGS="$cf_save_CPPFLAGS"
7707                         LDFLAGS="$cf_save_LDFLAGS"
7708                 fi
7709
7710         else
7711                 cf_cv_find_linkage_utf8=no
7712         fi
7713
7714 fi
7715 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7716
7717 fi
7718 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7719
7720 LIBS="$cf_save_LIBS"
7721
7722 if test "$cf_cv_find_linkage_utf8" = yes ; then
7723 cf_cv_utf8_lib=add-on
7724 else
7725 cf_cv_utf8_lib=no
7726 fi
7727
7728 fi
7729 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7730 fi
7731 echo "$as_me:7731: result: $cf_cv_utf8_lib" >&5
7732 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7733
7734 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7735 # ncurses/ncursesw:
7736 if test "$cf_cv_utf8_lib" = "add-on" ; then
7737
7738 cat >>confdefs.h <<\EOF
7739 #define HAVE_LIBUTF8_H 1
7740 EOF
7741
7742 if test -n "$cf_cv_header_path_utf8" ; then
7743   for cf_add_incdir in $cf_cv_header_path_utf8
7744   do
7745         while test "$cf_add_incdir" != /usr/include
7746         do
7747           if test -d "$cf_add_incdir"
7748           then
7749                 cf_have_incdir=no
7750                 if test -n "$CFLAGS$CPPFLAGS" ; then
7751                   # a loop is needed to ensure we can add subdirs of existing dirs
7752                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7753                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7754                           cf_have_incdir=yes; break
7755                         fi
7756                   done
7757                 fi
7758
7759                 if test "$cf_have_incdir" = no ; then
7760                   if test "$cf_add_incdir" = /usr/local/include ; then
7761                         if test "$GCC" = yes
7762                         then
7763                           cf_save_CPPFLAGS=$CPPFLAGS
7764
7765         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7766         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7767
7768                           cat >"conftest.$ac_ext" <<_ACEOF
7769 #line 7769 "configure"
7770 #include "confdefs.h"
7771 #include <stdio.h>
7772 int
7773 main (void)
7774 {
7775 printf("Hello")
7776   ;
7777   return 0;
7778 }
7779 _ACEOF
7780 rm -f "conftest.$ac_objext"
7781 if { (eval echo "$as_me:7781: \"$ac_compile\"") >&5
7782   (eval $ac_compile) 2>&5
7783   ac_status=$?
7784   echo "$as_me:7784: \$? = $ac_status" >&5
7785   (exit "$ac_status"); } &&
7786          { ac_try='test -s "conftest.$ac_objext"'
7787   { (eval echo "$as_me:7787: \"$ac_try\"") >&5
7788   (eval $ac_try) 2>&5
7789   ac_status=$?
7790   echo "$as_me:7790: \$? = $ac_status" >&5
7791   (exit "$ac_status"); }; }; then
7792   :
7793 else
7794   echo "$as_me: failed program was:" >&5
7795 cat "conftest.$ac_ext" >&5
7796 cf_have_incdir=yes
7797 fi
7798 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7799                           CPPFLAGS=$cf_save_CPPFLAGS
7800                         fi
7801                   fi
7802                 fi
7803
7804                 if test "$cf_have_incdir" = no ; then
7805                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7806
7807 echo "${as_me:-configure}:7807: testing adding $cf_add_incdir to include-path ..." 1>&5
7808
7809                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7810
7811                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7812                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7813                   cf_add_incdir="$cf_top_incdir"
7814                 else
7815                   break
7816                 fi
7817           else
7818                 break
7819           fi
7820         done
7821   done
7822 fi
7823
7824 if test -n "$cf_cv_library_path_utf8" ; then
7825         for cf_add_libdir in $cf_cv_library_path_utf8
7826         do
7827                 if test "$cf_add_libdir" = /usr/lib ; then
7828                         :
7829                 elif test -d "$cf_add_libdir"
7830                 then
7831                         cf_have_libdir=no
7832                         if test -n "$LDFLAGS$LIBS" ; then
7833                                 # a loop is needed to ensure we can add subdirs of existing dirs
7834                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7835                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7836                                                 cf_have_libdir=yes; break
7837                                         fi
7838                                 done
7839                         fi
7840                         if test "$cf_have_libdir" = no ; then
7841                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7842
7843 echo "${as_me:-configure}:7843: testing adding $cf_add_libdir to library-path ..." 1>&5
7844
7845                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7846                         fi
7847                 fi
7848         done
7849 fi
7850
7851 cf_add_libs="$LIBS"
7852 # reverse order
7853 cf_add_0lib=
7854 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7855 # filter duplicates
7856 for cf_add_1lib in $cf_add_0lib; do
7857         for cf_add_2lib in $cf_add_libs; do
7858                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7859                         cf_add_1lib=
7860                         break
7861                 fi
7862         done
7863         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7864 done
7865 LIBS="$cf_add_libs"
7866
7867 fi
7868
7869 cf_ncuconfig_root=$cf_cv_screen
7870 cf_have_ncuconfig=no
7871
7872 if test "x${PKG_CONFIG:=none}" != xnone; then
7873         echo "$as_me:7873: checking pkg-config for $cf_ncuconfig_root" >&5
7874 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7875         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7876                 echo "$as_me:7876: result: yes" >&5
7877 echo "${ECHO_T}yes" >&6
7878
7879                 echo "$as_me:7879: checking if the $cf_ncuconfig_root package files work" >&5
7880 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7881                 cf_have_ncuconfig=unknown
7882
7883                 cf_save_CFLAGS="$CFLAGS"
7884                 cf_save_CPPFLAGS="$CPPFLAGS"
7885                 cf_save_LIBS="$LIBS"
7886
7887                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7888                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7889
7890                 # while -W for passing linker flags is prevalent, it is not "standard".
7891                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7892                 # incompatible _and_ non-standard -W option which gives an error.  Work
7893                 # around that pitfall.
7894                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7895                 (x*c[89]9@@*-W*)
7896
7897 cf_fix_cppflags=no
7898 cf_new_cflags=
7899 cf_new_cppflags=
7900 cf_new_extra_cppflags=
7901
7902 for cf_add_cflags in $cf_pkg_cflags
7903 do
7904 case "$cf_fix_cppflags" in
7905 (no)
7906         case "$cf_add_cflags" in
7907         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7908                 case "$cf_add_cflags" in
7909                 (-D*)
7910                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7911
7912                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7913                                 && test -z "${cf_tst_cflags}" \
7914                                 && cf_fix_cppflags=yes
7915
7916                         if test "$cf_fix_cppflags" = yes ; then
7917
7918         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7919         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7920
7921                                 continue
7922                         elif test "${cf_tst_cflags}" = "\"'" ; then
7923
7924         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7925         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7926
7927                                 continue
7928                         fi
7929                         ;;
7930                 esac
7931                 case "$CPPFLAGS" in
7932                 (*$cf_add_cflags)
7933                         ;;
7934                 (*)
7935                         case "$cf_add_cflags" in
7936                         (-D*)
7937                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7938
7939 CPPFLAGS=`echo "$CPPFLAGS" | \
7940         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7941                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7942
7943                                 ;;
7944                         esac
7945
7946         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7947         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7948
7949                         ;;
7950                 esac
7951                 ;;
7952         (*)
7953
7954         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7955         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7956
7957                 ;;
7958         esac
7959         ;;
7960 (yes)
7961
7962         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7963         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7964
7965         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7966
7967         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7968                 && test -z "${cf_tst_cflags}" \
7969                 && cf_fix_cppflags=no
7970         ;;
7971 esac
7972 done
7973
7974 if test -n "$cf_new_cflags" ; then
7975
7976         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7977         CFLAGS="${CFLAGS}$cf_new_cflags"
7978
7979 fi
7980
7981 if test -n "$cf_new_cppflags" ; then
7982
7983         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7984         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7985
7986 fi
7987
7988 if test -n "$cf_new_extra_cppflags" ; then
7989
7990         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7991         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7992
7993 fi
7994
7995 cf_add_libs="$LIBS"
7996 # reverse order
7997 cf_add_0lib=
7998 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7999 # filter duplicates
8000 for cf_add_1lib in $cf_add_0lib; do
8001         for cf_add_2lib in $cf_add_libs; do
8002                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8003                         cf_add_1lib=
8004                         break
8005                 fi
8006         done
8007         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8008 done
8009 LIBS="$cf_add_libs"
8010
8011                         cat >"conftest.$ac_ext" <<_ACEOF
8012 #line 8012 "configure"
8013 #include "confdefs.h"
8014 #include <${cf_cv_ncurses_header:-curses.h}>
8015 int
8016 main (void)
8017 {
8018 initscr(); mousemask(0,0); tigetstr((char *)0);
8019   ;
8020   return 0;
8021 }
8022 _ACEOF
8023 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8024 if { (eval echo "$as_me:8024: \"$ac_link\"") >&5
8025   (eval $ac_link) 2>&5
8026   ac_status=$?
8027   echo "$as_me:8027: \$? = $ac_status" >&5
8028   (exit "$ac_status"); } &&
8029          { ac_try='test -s "conftest$ac_exeext"'
8030   { (eval echo "$as_me:8030: \"$ac_try\"") >&5
8031   (eval $ac_try) 2>&5
8032   ac_status=$?
8033   echo "$as_me:8033: \$? = $ac_status" >&5
8034   (exit "$ac_status"); }; }; then
8035   if test "$cross_compiling" = yes; then
8036   cf_test_ncuconfig=maybe
8037 else
8038   cat >"conftest.$ac_ext" <<_ACEOF
8039 #line 8039 "configure"
8040 #include "confdefs.h"
8041 #include <${cf_cv_ncurses_header:-curses.h}>
8042                                         int main(void)
8043                                         { char *xx = curses_version(); return (xx == 0); }
8044 _ACEOF
8045 rm -f "conftest$ac_exeext"
8046 if { (eval echo "$as_me:8046: \"$ac_link\"") >&5
8047   (eval $ac_link) 2>&5
8048   ac_status=$?
8049   echo "$as_me:8049: \$? = $ac_status" >&5
8050   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8051   { (eval echo "$as_me:8051: \"$ac_try\"") >&5
8052   (eval $ac_try) 2>&5
8053   ac_status=$?
8054   echo "$as_me:8054: \$? = $ac_status" >&5
8055   (exit "$ac_status"); }; }; then
8056   cf_test_ncuconfig=yes
8057 else
8058   echo "$as_me: program exited with status $ac_status" >&5
8059 echo "$as_me: failed program was:" >&5
8060 cat "conftest.$ac_ext" >&5
8061 cf_test_ncuconfig=no
8062 fi
8063 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8064 fi
8065 else
8066   echo "$as_me: failed program was:" >&5
8067 cat "conftest.$ac_ext" >&5
8068 cf_test_ncuconfig=no
8069 fi
8070 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8071
8072                         CFLAGS="$cf_save_CFLAGS"
8073                         CPPFLAGS="$cf_save_CPPFLAGS"
8074                         LIBS="$cf_save_LIBS"
8075
8076                         if test "x$cf_test_ncuconfig" != xyes; then
8077                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
8078                                 cf_pkg_cflags="$cf_temp"
8079                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
8080                                 cf_pkg_libs="$cf_temp"
8081                         fi
8082                         ;;
8083                 esac
8084
8085 cf_fix_cppflags=no
8086 cf_new_cflags=
8087 cf_new_cppflags=
8088 cf_new_extra_cppflags=
8089
8090 for cf_add_cflags in $cf_pkg_cflags
8091 do
8092 case "$cf_fix_cppflags" in
8093 (no)
8094         case "$cf_add_cflags" in
8095         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8096                 case "$cf_add_cflags" in
8097                 (-D*)
8098                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8099
8100                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8101                                 && test -z "${cf_tst_cflags}" \
8102                                 && cf_fix_cppflags=yes
8103
8104                         if test "$cf_fix_cppflags" = yes ; then
8105
8106         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8107         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8108
8109                                 continue
8110                         elif test "${cf_tst_cflags}" = "\"'" ; then
8111
8112         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8113         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8114
8115                                 continue
8116                         fi
8117                         ;;
8118                 esac
8119                 case "$CPPFLAGS" in
8120                 (*$cf_add_cflags)
8121                         ;;
8122                 (*)
8123                         case "$cf_add_cflags" in
8124                         (-D*)
8125                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8126
8127 CPPFLAGS=`echo "$CPPFLAGS" | \
8128         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8129                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8130
8131                                 ;;
8132                         esac
8133
8134         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8135         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8136
8137                         ;;
8138                 esac
8139                 ;;
8140         (*)
8141
8142         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8143         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8144
8145                 ;;
8146         esac
8147         ;;
8148 (yes)
8149
8150         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8151         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8152
8153         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8154
8155         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8156                 && test -z "${cf_tst_cflags}" \
8157                 && cf_fix_cppflags=no
8158         ;;
8159 esac
8160 done
8161
8162 if test -n "$cf_new_cflags" ; then
8163
8164         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8165         CFLAGS="${CFLAGS}$cf_new_cflags"
8166
8167 fi
8168
8169 if test -n "$cf_new_cppflags" ; then
8170
8171         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8172         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8173
8174 fi
8175
8176 if test -n "$cf_new_extra_cppflags" ; then
8177
8178         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8179         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8180
8181 fi
8182
8183 cf_add_libs="$LIBS"
8184 # reverse order
8185 cf_add_0lib=
8186 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8187 # filter duplicates
8188 for cf_add_1lib in $cf_add_0lib; do
8189         for cf_add_2lib in $cf_add_libs; do
8190                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8191                         cf_add_1lib=
8192                         break
8193                 fi
8194         done
8195         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8196 done
8197 LIBS="$cf_add_libs"
8198
8199                 cat >"conftest.$ac_ext" <<_ACEOF
8200 #line 8200 "configure"
8201 #include "confdefs.h"
8202 #include <${cf_cv_ncurses_header:-curses.h}>
8203 int
8204 main (void)
8205 {
8206 initscr(); mousemask(0,0); tigetstr((char *)0);
8207   ;
8208   return 0;
8209 }
8210 _ACEOF
8211 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8212 if { (eval echo "$as_me:8212: \"$ac_link\"") >&5
8213   (eval $ac_link) 2>&5
8214   ac_status=$?
8215   echo "$as_me:8215: \$? = $ac_status" >&5
8216   (exit "$ac_status"); } &&
8217          { ac_try='test -s "conftest$ac_exeext"'
8218   { (eval echo "$as_me:8218: \"$ac_try\"") >&5
8219   (eval $ac_try) 2>&5
8220   ac_status=$?
8221   echo "$as_me:8221: \$? = $ac_status" >&5
8222   (exit "$ac_status"); }; }; then
8223   if test "$cross_compiling" = yes; then
8224   cf_have_ncuconfig=maybe
8225 else
8226   cat >"conftest.$ac_ext" <<_ACEOF
8227 #line 8227 "configure"
8228 #include "confdefs.h"
8229 #include <${cf_cv_ncurses_header:-curses.h}>
8230                                 int main(void)
8231                                 { char *xx = curses_version(); return (xx == 0); }
8232 _ACEOF
8233 rm -f "conftest$ac_exeext"
8234 if { (eval echo "$as_me:8234: \"$ac_link\"") >&5
8235   (eval $ac_link) 2>&5
8236   ac_status=$?
8237   echo "$as_me:8237: \$? = $ac_status" >&5
8238   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8239   { (eval echo "$as_me:8239: \"$ac_try\"") >&5
8240   (eval $ac_try) 2>&5
8241   ac_status=$?
8242   echo "$as_me:8242: \$? = $ac_status" >&5
8243   (exit "$ac_status"); }; }; then
8244   cf_have_ncuconfig=yes
8245 else
8246   echo "$as_me: program exited with status $ac_status" >&5
8247 echo "$as_me: failed program was:" >&5
8248 cat "conftest.$ac_ext" >&5
8249 cf_have_ncuconfig=no
8250 fi
8251 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8252 fi
8253 else
8254   echo "$as_me: failed program was:" >&5
8255 cat "conftest.$ac_ext" >&5
8256 cf_have_ncuconfig=no
8257 fi
8258 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8259                 echo "$as_me:8259: result: $cf_have_ncuconfig" >&5
8260 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8261                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8262                 if test "$cf_have_ncuconfig" != "yes"
8263                 then
8264                         CPPFLAGS="$cf_save_CPPFLAGS"
8265                         LIBS="$cf_save_LIBS"
8266                         NCURSES_CONFIG_PKG=none
8267                 else
8268
8269 cat >>confdefs.h <<\EOF
8270 #define NCURSES 1
8271 EOF
8272
8273                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8274
8275 echo "$as_me:8275: checking for terminfo header" >&5
8276 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8277 if test "${cf_cv_term_header+set}" = set; then
8278   echo $ECHO_N "(cached) $ECHO_C" >&6
8279 else
8280
8281 case "${cf_cv_ncurses_header}" in
8282 (*/ncurses.h|*/ncursesw.h)
8283         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8284         ;;
8285 (*)
8286         cf_term_header=term.h
8287         ;;
8288 esac
8289
8290 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8291 do
8292 cat >"conftest.$ac_ext" <<_ACEOF
8293 #line 8293 "configure"
8294 #include "confdefs.h"
8295 #include <stdio.h>
8296 #include <${cf_cv_ncurses_header:-curses.h}>
8297 #include <$cf_test>
8298
8299 int
8300 main (void)
8301 {
8302 int x = auto_left_margin; (void)x
8303   ;
8304   return 0;
8305 }
8306 _ACEOF
8307 rm -f "conftest.$ac_objext"
8308 if { (eval echo "$as_me:8308: \"$ac_compile\"") >&5
8309   (eval $ac_compile) 2>&5
8310   ac_status=$?
8311   echo "$as_me:8311: \$? = $ac_status" >&5
8312   (exit "$ac_status"); } &&
8313          { ac_try='test -s "conftest.$ac_objext"'
8314   { (eval echo "$as_me:8314: \"$ac_try\"") >&5
8315   (eval $ac_try) 2>&5
8316   ac_status=$?
8317   echo "$as_me:8317: \$? = $ac_status" >&5
8318   (exit "$ac_status"); }; }; then
8319
8320         cf_cv_term_header="$cf_test"
8321 else
8322   echo "$as_me: failed program was:" >&5
8323 cat "conftest.$ac_ext" >&5
8324
8325         cf_cv_term_header=unknown
8326
8327 fi
8328 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8329         test "$cf_cv_term_header" != unknown && break
8330 done
8331
8332 fi
8333 echo "$as_me:8333: result: $cf_cv_term_header" >&5
8334 echo "${ECHO_T}$cf_cv_term_header" >&6
8335
8336 # Set definitions to allow ifdef'ing to accommodate subdirectories
8337
8338 case "$cf_cv_term_header" in
8339 (*term.h)
8340
8341 cat >>confdefs.h <<\EOF
8342 #define HAVE_TERM_H 1
8343 EOF
8344
8345         ;;
8346 esac
8347
8348 case "$cf_cv_term_header" in
8349 (ncurses/term.h)
8350
8351 cat >>confdefs.h <<\EOF
8352 #define HAVE_NCURSES_TERM_H 1
8353 EOF
8354
8355         ;;
8356 (ncursesw/term.h)
8357
8358 cat >>confdefs.h <<\EOF
8359 #define HAVE_NCURSESW_TERM_H 1
8360 EOF
8361
8362         ;;
8363 esac
8364
8365                 fi
8366
8367         else
8368                 echo "$as_me:8368: result: no" >&5
8369 echo "${ECHO_T}no" >&6
8370                 NCURSES_CONFIG_PKG=none
8371         fi
8372 else
8373         NCURSES_CONFIG_PKG=none
8374 fi
8375
8376 if test "x$cf_have_ncuconfig" = "xno"; then
8377         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8378
8379 if test -n "$ac_tool_prefix"; then
8380   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8381   do
8382     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8383 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8384 echo "$as_me:8384: checking for $ac_word" >&5
8385 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8386 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8387   echo $ECHO_N "(cached) $ECHO_C" >&6
8388 else
8389   if test -n "$NCURSES_CONFIG"; then
8390   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8391 else
8392   ac_save_IFS=$IFS; IFS=$ac_path_separator
8393 ac_dummy="$PATH"
8394 for ac_dir in $ac_dummy; do
8395   IFS=$ac_save_IFS
8396   test -z "$ac_dir" && ac_dir=.
8397   $as_executable_p "$ac_dir/$ac_word" || continue
8398 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8399 echo "$as_me:8399: found $ac_dir/$ac_word" >&5
8400 break
8401 done
8402
8403 fi
8404 fi
8405 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8406 if test -n "$NCURSES_CONFIG"; then
8407   echo "$as_me:8407: result: $NCURSES_CONFIG" >&5
8408 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8409 else
8410   echo "$as_me:8410: result: no" >&5
8411 echo "${ECHO_T}no" >&6
8412 fi
8413
8414     test -n "$NCURSES_CONFIG" && break
8415   done
8416 fi
8417 if test -z "$NCURSES_CONFIG"; then
8418   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8419   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8420 do
8421   # Extract the first word of "$ac_prog", so it can be a program name with args.
8422 set dummy $ac_prog; ac_word=$2
8423 echo "$as_me:8423: checking for $ac_word" >&5
8424 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8425 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8426   echo $ECHO_N "(cached) $ECHO_C" >&6
8427 else
8428   if test -n "$ac_ct_NCURSES_CONFIG"; then
8429   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8430 else
8431   ac_save_IFS=$IFS; IFS=$ac_path_separator
8432 ac_dummy="$PATH"
8433 for ac_dir in $ac_dummy; do
8434   IFS=$ac_save_IFS
8435   test -z "$ac_dir" && ac_dir=.
8436   $as_executable_p "$ac_dir/$ac_word" || continue
8437 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8438 echo "$as_me:8438: found $ac_dir/$ac_word" >&5
8439 break
8440 done
8441
8442 fi
8443 fi
8444 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8445 if test -n "$ac_ct_NCURSES_CONFIG"; then
8446   echo "$as_me:8446: result: $ac_ct_NCURSES_CONFIG" >&5
8447 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8448 else
8449   echo "$as_me:8449: result: no" >&5
8450 echo "${ECHO_T}no" >&6
8451 fi
8452
8453   test -n "$ac_ct_NCURSES_CONFIG" && break
8454 done
8455 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8456
8457   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8458 fi
8459
8460         if test "$NCURSES_CONFIG" != none ; then
8461
8462 cf_fix_cppflags=no
8463 cf_new_cflags=
8464 cf_new_cppflags=
8465 cf_new_extra_cppflags=
8466
8467 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8468 do
8469 case "$cf_fix_cppflags" in
8470 (no)
8471         case "$cf_add_cflags" in
8472         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8473                 case "$cf_add_cflags" in
8474                 (-D*)
8475                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8476
8477                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8478                                 && test -z "${cf_tst_cflags}" \
8479                                 && cf_fix_cppflags=yes
8480
8481                         if test "$cf_fix_cppflags" = yes ; then
8482
8483         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8484         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8485
8486                                 continue
8487                         elif test "${cf_tst_cflags}" = "\"'" ; then
8488
8489         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8490         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8491
8492                                 continue
8493                         fi
8494                         ;;
8495                 esac
8496                 case "$CPPFLAGS" in
8497                 (*$cf_add_cflags)
8498                         ;;
8499                 (*)
8500                         case "$cf_add_cflags" in
8501                         (-D*)
8502                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8503
8504 CPPFLAGS=`echo "$CPPFLAGS" | \
8505         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8506                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8507
8508                                 ;;
8509                         esac
8510
8511         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8512         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8513
8514                         ;;
8515                 esac
8516                 ;;
8517         (*)
8518
8519         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8520         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8521
8522                 ;;
8523         esac
8524         ;;
8525 (yes)
8526
8527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8529
8530         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8531
8532         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8533                 && test -z "${cf_tst_cflags}" \
8534                 && cf_fix_cppflags=no
8535         ;;
8536 esac
8537 done
8538
8539 if test -n "$cf_new_cflags" ; then
8540
8541         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8542         CFLAGS="${CFLAGS}$cf_new_cflags"
8543
8544 fi
8545
8546 if test -n "$cf_new_cppflags" ; then
8547
8548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8549         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8550
8551 fi
8552
8553 if test -n "$cf_new_extra_cppflags" ; then
8554
8555         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8556         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8557
8558 fi
8559
8560 cf_add_libs="$LIBS"
8561 # reverse order
8562 cf_add_0lib=
8563 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8564 # filter duplicates
8565 for cf_add_1lib in $cf_add_0lib; do
8566         for cf_add_2lib in $cf_add_libs; do
8567                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8568                         cf_add_1lib=
8569                         break
8570                 fi
8571         done
8572         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8573 done
8574 LIBS="$cf_add_libs"
8575
8576                 # even with config script, some packages use no-override for curses.h
8577
8578 echo "$as_me:8578: checking if we have identified curses headers" >&5
8579 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8580 if test "${cf_cv_ncurses_header+set}" = set; then
8581   echo $ECHO_N "(cached) $ECHO_C" >&6
8582 else
8583
8584 cf_cv_ncurses_header=none
8585 for cf_header in \
8586         ncurses.h $cf_cv_screen/ncurses.h \
8587         curses.h $cf_cv_screen/curses.h
8588 do
8589 cat >"conftest.$ac_ext" <<_ACEOF
8590 #line 8590 "configure"
8591 #include "confdefs.h"
8592 #include <${cf_header}>
8593 int
8594 main (void)
8595 {
8596 initscr(); tgoto("?", 0,0)
8597   ;
8598   return 0;
8599 }
8600 _ACEOF
8601 rm -f "conftest.$ac_objext"
8602 if { (eval echo "$as_me:8602: \"$ac_compile\"") >&5
8603   (eval $ac_compile) 2>&5
8604   ac_status=$?
8605   echo "$as_me:8605: \$? = $ac_status" >&5
8606   (exit "$ac_status"); } &&
8607          { ac_try='test -s "conftest.$ac_objext"'
8608   { (eval echo "$as_me:8608: \"$ac_try\"") >&5
8609   (eval $ac_try) 2>&5
8610   ac_status=$?
8611   echo "$as_me:8611: \$? = $ac_status" >&5
8612   (exit "$ac_status"); }; }; then
8613   cf_cv_ncurses_header=$cf_header; break
8614 else
8615   echo "$as_me: failed program was:" >&5
8616 cat "conftest.$ac_ext" >&5
8617 fi
8618 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8619 done
8620
8621 fi
8622 echo "$as_me:8622: result: $cf_cv_ncurses_header" >&5
8623 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8624
8625 if test "$cf_cv_ncurses_header" = none ; then
8626         { { echo "$as_me:8626: error: No curses header-files found" >&5
8627 echo "$as_me: error: No curses header-files found" >&2;}
8628    { (exit 1); exit 1; }; }
8629 fi
8630
8631 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8632
8633 for ac_header in $cf_cv_ncurses_header
8634 do
8635 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8636 echo "$as_me:8636: checking for $ac_header" >&5
8637 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8638 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8639   echo $ECHO_N "(cached) $ECHO_C" >&6
8640 else
8641   cat >"conftest.$ac_ext" <<_ACEOF
8642 #line 8642 "configure"
8643 #include "confdefs.h"
8644 #include <$ac_header>
8645 _ACEOF
8646 if { (eval echo "$as_me:8646: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8647   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8648   ac_status=$?
8649   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8650   rm -f conftest.er1
8651   cat conftest.err >&5
8652   echo "$as_me:8652: \$? = $ac_status" >&5
8653   (exit "$ac_status"); } >/dev/null; then
8654   if test -s conftest.err; then
8655     ac_cpp_err=$ac_c_preproc_warn_flag
8656   else
8657     ac_cpp_err=
8658   fi
8659 else
8660   ac_cpp_err=yes
8661 fi
8662 if test -z "$ac_cpp_err"; then
8663   eval "$as_ac_Header=yes"
8664 else
8665   echo "$as_me: failed program was:" >&5
8666   cat "conftest.$ac_ext" >&5
8667   eval "$as_ac_Header=no"
8668 fi
8669 rm -f conftest.err "conftest.$ac_ext"
8670 fi
8671 echo "$as_me:8671: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8672 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8673 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8674   cat >>confdefs.h <<EOF
8675 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8676 EOF
8677
8678 fi
8679 done
8680
8681 cat >>confdefs.h <<\EOF
8682 #define NCURSES 1
8683 EOF
8684
8685 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8686
8687                 cat >>confdefs.h <<EOF
8688 #define $cf_nculib_ROOT 1
8689 EOF
8690
8691                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8692
8693         else
8694
8695 cf_ncuhdr_root=$cf_cv_screen
8696
8697 test -n "$cf_cv_curses_dir" && \
8698 test "$cf_cv_curses_dir" != "no" && { \
8699
8700 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8701   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8702   do
8703         while test "$cf_add_incdir" != /usr/include
8704         do
8705           if test -d "$cf_add_incdir"
8706           then
8707                 cf_have_incdir=no
8708                 if test -n "$CFLAGS$CPPFLAGS" ; then
8709                   # a loop is needed to ensure we can add subdirs of existing dirs
8710                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8711                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8712                           cf_have_incdir=yes; break
8713                         fi
8714                   done
8715                 fi
8716
8717                 if test "$cf_have_incdir" = no ; then
8718                   if test "$cf_add_incdir" = /usr/local/include ; then
8719                         if test "$GCC" = yes
8720                         then
8721                           cf_save_CPPFLAGS=$CPPFLAGS
8722
8723         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8724         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8725
8726                           cat >"conftest.$ac_ext" <<_ACEOF
8727 #line 8727 "configure"
8728 #include "confdefs.h"
8729 #include <stdio.h>
8730 int
8731 main (void)
8732 {
8733 printf("Hello")
8734   ;
8735   return 0;
8736 }
8737 _ACEOF
8738 rm -f "conftest.$ac_objext"
8739 if { (eval echo "$as_me:8739: \"$ac_compile\"") >&5
8740   (eval $ac_compile) 2>&5
8741   ac_status=$?
8742   echo "$as_me:8742: \$? = $ac_status" >&5
8743   (exit "$ac_status"); } &&
8744          { ac_try='test -s "conftest.$ac_objext"'
8745   { (eval echo "$as_me:8745: \"$ac_try\"") >&5
8746   (eval $ac_try) 2>&5
8747   ac_status=$?
8748   echo "$as_me:8748: \$? = $ac_status" >&5
8749   (exit "$ac_status"); }; }; then
8750   :
8751 else
8752   echo "$as_me: failed program was:" >&5
8753 cat "conftest.$ac_ext" >&5
8754 cf_have_incdir=yes
8755 fi
8756 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8757                           CPPFLAGS=$cf_save_CPPFLAGS
8758                         fi
8759                   fi
8760                 fi
8761
8762                 if test "$cf_have_incdir" = no ; then
8763                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8764
8765 echo "${as_me:-configure}:8765: testing adding $cf_add_incdir to include-path ..." 1>&5
8766
8767                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8768
8769                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8770                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8771                   cf_add_incdir="$cf_top_incdir"
8772                 else
8773                   break
8774                 fi
8775           else
8776                 break
8777           fi
8778         done
8779   done
8780 fi
8781
8782 }
8783
8784 echo "$as_me:8784: checking for $cf_ncuhdr_root header in include-path" >&5
8785 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8786 if test "${cf_cv_ncurses_h+set}" = set; then
8787   echo $ECHO_N "(cached) $ECHO_C" >&6
8788 else
8789
8790         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8791         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8792         for cf_header in $cf_header_list
8793         do
8794
8795         cat >"conftest.$ac_ext" <<_ACEOF
8796 #line 8796 "configure"
8797 #include "confdefs.h"
8798
8799 #include <$cf_header>
8800 int
8801 main (void)
8802 {
8803
8804 #ifdef NCURSES_VERSION
8805
8806 printf("%s\\n", NCURSES_VERSION);
8807 #else
8808 #ifdef __NCURSES_H
8809 printf("old\\n");
8810 #else
8811         make an error
8812 #endif
8813 #endif
8814
8815   ;
8816   return 0;
8817 }
8818 _ACEOF
8819 rm -f "conftest.$ac_objext"
8820 if { (eval echo "$as_me:8820: \"$ac_compile\"") >&5
8821   (eval $ac_compile) 2>&5
8822   ac_status=$?
8823   echo "$as_me:8823: \$? = $ac_status" >&5
8824   (exit "$ac_status"); } &&
8825          { ac_try='test -s "conftest.$ac_objext"'
8826   { (eval echo "$as_me:8826: \"$ac_try\"") >&5
8827   (eval $ac_try) 2>&5
8828   ac_status=$?
8829   echo "$as_me:8829: \$? = $ac_status" >&5
8830   (exit "$ac_status"); }; }; then
8831   cf_cv_ncurses_h=$cf_header
8832
8833 else
8834   echo "$as_me: failed program was:" >&5
8835 cat "conftest.$ac_ext" >&5
8836 cf_cv_ncurses_h=no
8837 fi
8838 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8839
8840                 test "$cf_cv_ncurses_h" != no && break
8841         done
8842
8843 fi
8844 echo "$as_me:8844: result: $cf_cv_ncurses_h" >&5
8845 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8846
8847 if test "$cf_cv_ncurses_h" != no ; then
8848         cf_cv_ncurses_header=$cf_cv_ncurses_h
8849 else
8850
8851 echo "$as_me:8851: checking for $cf_ncuhdr_root include-path" >&5
8852 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8853 if test "${cf_cv_ncurses_h2+set}" = set; then
8854   echo $ECHO_N "(cached) $ECHO_C" >&6
8855 else
8856
8857         test -n "$verbose" && echo
8858
8859 cf_search=
8860
8861 # collect the current set of include-directories from compiler flags
8862 cf_header_path_list=""
8863 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8864         for cf_header_path in $CPPFLAGS $CFLAGS
8865         do
8866                 case "$cf_header_path" in
8867                 (-I*)
8868                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8869
8870 test "x$cf_header_path" != "xNONE" && \
8871 test -d "$cf_header_path" && \
8872  {
8873         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8874         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8875         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8876         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8877         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8878         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"
8879 }
8880
8881                         cf_header_path_list="$cf_header_path_list $cf_search"
8882                         ;;
8883                 esac
8884         done
8885 fi
8886
8887 # add the variations for the package we are looking for
8888
8889 cf_search=
8890
8891 test "x$prefix" != "xNONE" && \
8892 test -d "$prefix" && \
8893  {
8894         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8895         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8896         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8897         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8898         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8899         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8900 }
8901
8902 for cf_subdir_prefix in \
8903         /usr \
8904         /usr/local \
8905         /usr/pkg \
8906         /opt \
8907         /opt/local \
8908         $HOME
8909 do
8910
8911 test "x$cf_subdir_prefix" != "x$prefix" && \
8912 test -d "$cf_subdir_prefix" && \
8913 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8914         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8915         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8916         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8917         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8918         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8919         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"
8920 }
8921
8922 done
8923
8924 test "$includedir" != NONE && \
8925 test "$includedir" != "/usr/include" && \
8926 test -d "$includedir" && {
8927         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8928         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8929 }
8930
8931 test "$oldincludedir" != NONE && \
8932 test "$oldincludedir" != "/usr/include" && \
8933 test -d "$oldincludedir" && {
8934         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8935         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8936 }
8937
8938 cf_search="$cf_search $cf_header_path_list"
8939
8940         test -n "$verbose" && echo "search path $cf_search"
8941         cf_save2_CPPFLAGS="$CPPFLAGS"
8942         for cf_incdir in $cf_search
8943         do
8944
8945 if test -n "$cf_incdir" ; then
8946   for cf_add_incdir in $cf_incdir
8947   do
8948         while test "$cf_add_incdir" != /usr/include
8949         do
8950           if test -d "$cf_add_incdir"
8951           then
8952                 cf_have_incdir=no
8953                 if test -n "$CFLAGS$CPPFLAGS" ; then
8954                   # a loop is needed to ensure we can add subdirs of existing dirs
8955                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8956                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8957                           cf_have_incdir=yes; break
8958                         fi
8959                   done
8960                 fi
8961
8962                 if test "$cf_have_incdir" = no ; then
8963                   if test "$cf_add_incdir" = /usr/local/include ; then
8964                         if test "$GCC" = yes
8965                         then
8966                           cf_save_CPPFLAGS=$CPPFLAGS
8967
8968         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8969         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8970
8971                           cat >"conftest.$ac_ext" <<_ACEOF
8972 #line 8972 "configure"
8973 #include "confdefs.h"
8974 #include <stdio.h>
8975 int
8976 main (void)
8977 {
8978 printf("Hello")
8979   ;
8980   return 0;
8981 }
8982 _ACEOF
8983 rm -f "conftest.$ac_objext"
8984 if { (eval echo "$as_me:8984: \"$ac_compile\"") >&5
8985   (eval $ac_compile) 2>&5
8986   ac_status=$?
8987   echo "$as_me:8987: \$? = $ac_status" >&5
8988   (exit "$ac_status"); } &&
8989          { ac_try='test -s "conftest.$ac_objext"'
8990   { (eval echo "$as_me:8990: \"$ac_try\"") >&5
8991   (eval $ac_try) 2>&5
8992   ac_status=$?
8993   echo "$as_me:8993: \$? = $ac_status" >&5
8994   (exit "$ac_status"); }; }; then
8995   :
8996 else
8997   echo "$as_me: failed program was:" >&5
8998 cat "conftest.$ac_ext" >&5
8999 cf_have_incdir=yes
9000 fi
9001 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9002                           CPPFLAGS=$cf_save_CPPFLAGS
9003                         fi
9004                   fi
9005                 fi
9006
9007                 if test "$cf_have_incdir" = no ; then
9008                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9009
9010 echo "${as_me:-configure}:9010: testing adding $cf_add_incdir to include-path ..." 1>&5
9011
9012                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9013
9014                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9015                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9016                   cf_add_incdir="$cf_top_incdir"
9017                 else
9018                   break
9019                 fi
9020           else
9021                 break
9022           fi
9023         done
9024   done
9025 fi
9026
9027                 for cf_header in \
9028                         ncurses.h \
9029                         curses.h
9030                 do
9031
9032         cat >"conftest.$ac_ext" <<_ACEOF
9033 #line 9033 "configure"
9034 #include "confdefs.h"
9035
9036 #include <$cf_header>
9037 int
9038 main (void)
9039 {
9040
9041 #ifdef NCURSES_VERSION
9042
9043 printf("%s\\n", NCURSES_VERSION);
9044 #else
9045 #ifdef __NCURSES_H
9046 printf("old\\n");
9047 #else
9048         make an error
9049 #endif
9050 #endif
9051
9052   ;
9053   return 0;
9054 }
9055 _ACEOF
9056 rm -f "conftest.$ac_objext"
9057 if { (eval echo "$as_me:9057: \"$ac_compile\"") >&5
9058   (eval $ac_compile) 2>&5
9059   ac_status=$?
9060   echo "$as_me:9060: \$? = $ac_status" >&5
9061   (exit "$ac_status"); } &&
9062          { ac_try='test -s "conftest.$ac_objext"'
9063   { (eval echo "$as_me:9063: \"$ac_try\"") >&5
9064   (eval $ac_try) 2>&5
9065   ac_status=$?
9066   echo "$as_me:9066: \$? = $ac_status" >&5
9067   (exit "$ac_status"); }; }; then
9068   cf_cv_ncurses_h2=$cf_header
9069
9070 else
9071   echo "$as_me: failed program was:" >&5
9072 cat "conftest.$ac_ext" >&5
9073 cf_cv_ncurses_h2=no
9074 fi
9075 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9076
9077                         if test "$cf_cv_ncurses_h2" != no ; then
9078                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9079                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
9080                                 break
9081                         fi
9082                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9083                 done
9084                 CPPFLAGS="$cf_save2_CPPFLAGS"
9085                 test "$cf_cv_ncurses_h2" != no && break
9086         done
9087         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9087: error: not found" >&5
9088 echo "$as_me: error: not found" >&2;}
9089    { (exit 1); exit 1; }; }
9090
9091 fi
9092 echo "$as_me:9092: result: $cf_cv_ncurses_h2" >&5
9093 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9094
9095         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
9096         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
9097         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
9098                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
9099         fi
9100
9101 if test -n "$cf_1st_incdir" ; then
9102   for cf_add_incdir in $cf_1st_incdir
9103   do
9104         while test "$cf_add_incdir" != /usr/include
9105         do
9106           if test -d "$cf_add_incdir"
9107           then
9108                 cf_have_incdir=no
9109                 if test -n "$CFLAGS$CPPFLAGS" ; then
9110                   # a loop is needed to ensure we can add subdirs of existing dirs
9111                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9112                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9113                           cf_have_incdir=yes; break
9114                         fi
9115                   done
9116                 fi
9117
9118                 if test "$cf_have_incdir" = no ; then
9119                   if test "$cf_add_incdir" = /usr/local/include ; then
9120                         if test "$GCC" = yes
9121                         then
9122                           cf_save_CPPFLAGS=$CPPFLAGS
9123
9124         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9125         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9126
9127                           cat >"conftest.$ac_ext" <<_ACEOF
9128 #line 9128 "configure"
9129 #include "confdefs.h"
9130 #include <stdio.h>
9131 int
9132 main (void)
9133 {
9134 printf("Hello")
9135   ;
9136   return 0;
9137 }
9138 _ACEOF
9139 rm -f "conftest.$ac_objext"
9140 if { (eval echo "$as_me:9140: \"$ac_compile\"") >&5
9141   (eval $ac_compile) 2>&5
9142   ac_status=$?
9143   echo "$as_me:9143: \$? = $ac_status" >&5
9144   (exit "$ac_status"); } &&
9145          { ac_try='test -s "conftest.$ac_objext"'
9146   { (eval echo "$as_me:9146: \"$ac_try\"") >&5
9147   (eval $ac_try) 2>&5
9148   ac_status=$?
9149   echo "$as_me:9149: \$? = $ac_status" >&5
9150   (exit "$ac_status"); }; }; then
9151   :
9152 else
9153   echo "$as_me: failed program was:" >&5
9154 cat "conftest.$ac_ext" >&5
9155 cf_have_incdir=yes
9156 fi
9157 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9158                           CPPFLAGS=$cf_save_CPPFLAGS
9159                         fi
9160                   fi
9161                 fi
9162
9163                 if test "$cf_have_incdir" = no ; then
9164                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9165
9166 echo "${as_me:-configure}:9166: testing adding $cf_add_incdir to include-path ..." 1>&5
9167
9168                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9169
9170                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9171                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9172                   cf_add_incdir="$cf_top_incdir"
9173                 else
9174                   break
9175                 fi
9176           else
9177                 break
9178           fi
9179         done
9180   done
9181 fi
9182
9183 fi
9184
9185 # Set definitions to allow ifdef'ing for ncurses.h
9186
9187 case "$cf_cv_ncurses_header" in
9188 (*ncurses.h)
9189
9190 cat >>confdefs.h <<\EOF
9191 #define HAVE_NCURSES_H 1
9192 EOF
9193
9194         ;;
9195 esac
9196
9197 case "$cf_cv_ncurses_header" in
9198 (ncurses/curses.h|ncurses/ncurses.h)
9199
9200 cat >>confdefs.h <<\EOF
9201 #define HAVE_NCURSES_NCURSES_H 1
9202 EOF
9203
9204         ;;
9205 (ncursesw/curses.h|ncursesw/ncurses.h)
9206
9207 cat >>confdefs.h <<\EOF
9208 #define HAVE_NCURSESW_NCURSES_H 1
9209 EOF
9210
9211         ;;
9212 esac
9213
9214 echo "$as_me:9214: checking for terminfo header" >&5
9215 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9216 if test "${cf_cv_term_header+set}" = set; then
9217   echo $ECHO_N "(cached) $ECHO_C" >&6
9218 else
9219
9220 case "${cf_cv_ncurses_header}" in
9221 (*/ncurses.h|*/ncursesw.h)
9222         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9223         ;;
9224 (*)
9225         cf_term_header=term.h
9226         ;;
9227 esac
9228
9229 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9230 do
9231 cat >"conftest.$ac_ext" <<_ACEOF
9232 #line 9232 "configure"
9233 #include "confdefs.h"
9234 #include <stdio.h>
9235 #include <${cf_cv_ncurses_header:-curses.h}>
9236 #include <$cf_test>
9237
9238 int
9239 main (void)
9240 {
9241 int x = auto_left_margin; (void)x
9242   ;
9243   return 0;
9244 }
9245 _ACEOF
9246 rm -f "conftest.$ac_objext"
9247 if { (eval echo "$as_me:9247: \"$ac_compile\"") >&5
9248   (eval $ac_compile) 2>&5
9249   ac_status=$?
9250   echo "$as_me:9250: \$? = $ac_status" >&5
9251   (exit "$ac_status"); } &&
9252          { ac_try='test -s "conftest.$ac_objext"'
9253   { (eval echo "$as_me:9253: \"$ac_try\"") >&5
9254   (eval $ac_try) 2>&5
9255   ac_status=$?
9256   echo "$as_me:9256: \$? = $ac_status" >&5
9257   (exit "$ac_status"); }; }; then
9258
9259         cf_cv_term_header="$cf_test"
9260 else
9261   echo "$as_me: failed program was:" >&5
9262 cat "conftest.$ac_ext" >&5
9263
9264         cf_cv_term_header=unknown
9265
9266 fi
9267 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9268         test "$cf_cv_term_header" != unknown && break
9269 done
9270
9271 fi
9272 echo "$as_me:9272: result: $cf_cv_term_header" >&5
9273 echo "${ECHO_T}$cf_cv_term_header" >&6
9274
9275 # Set definitions to allow ifdef'ing to accommodate subdirectories
9276
9277 case "$cf_cv_term_header" in
9278 (*term.h)
9279
9280 cat >>confdefs.h <<\EOF
9281 #define HAVE_TERM_H 1
9282 EOF
9283
9284         ;;
9285 esac
9286
9287 case "$cf_cv_term_header" in
9288 (ncurses/term.h)
9289
9290 cat >>confdefs.h <<\EOF
9291 #define HAVE_NCURSES_TERM_H 1
9292 EOF
9293
9294         ;;
9295 (ncursesw/term.h)
9296
9297 cat >>confdefs.h <<\EOF
9298 #define HAVE_NCURSESW_TERM_H 1
9299 EOF
9300
9301         ;;
9302 esac
9303
9304 # some applications need this, but should check for NCURSES_VERSION
9305
9306 cat >>confdefs.h <<\EOF
9307 #define NCURSES 1
9308 EOF
9309
9310 echo "$as_me:9310: checking for ncurses version" >&5
9311 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9312 if test "${cf_cv_ncurses_version+set}" = set; then
9313   echo $ECHO_N "(cached) $ECHO_C" >&6
9314 else
9315
9316         cf_cv_ncurses_version=no
9317         cf_tempfile=out$$
9318         rm -f "$cf_tempfile"
9319         if test "$cross_compiling" = yes; then
9320
9321         # This will not work if the preprocessor splits the line after the
9322         # Autoconf token.  The 'unproto' program does that.
9323         cat > "conftest.$ac_ext" <<EOF
9324 #include <${cf_cv_ncurses_header:-curses.h}>
9325 #undef Autoconf
9326 #ifdef NCURSES_VERSION
9327 Autoconf NCURSES_VERSION
9328 #else
9329 #ifdef __NCURSES_H
9330 Autoconf "old"
9331 #endif
9332 ;
9333 #endif
9334 EOF
9335         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9336         { (eval echo "$as_me:9336: \"$cf_try\"") >&5
9337   (eval $cf_try) 2>&5
9338   ac_status=$?
9339   echo "$as_me:9339: \$? = $ac_status" >&5
9340   (exit "$ac_status"); }
9341         if test -f conftest.out ; then
9342                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9343                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9344                 rm -f conftest.out
9345         fi
9346
9347 else
9348   cat >"conftest.$ac_ext" <<_ACEOF
9349 #line 9349 "configure"
9350 #include "confdefs.h"
9351
9352 #include <${cf_cv_ncurses_header:-curses.h}>
9353 #include <stdio.h>
9354 int main(void)
9355 {
9356         FILE *fp = fopen("$cf_tempfile", "w");
9357 #ifdef NCURSES_VERSION
9358 # ifdef NCURSES_VERSION_PATCH
9359         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9360 # else
9361         fprintf(fp, "%s\\n", NCURSES_VERSION);
9362 # endif
9363 #else
9364 # ifdef __NCURSES_H
9365         fprintf(fp, "old\\n");
9366 # else
9367         make an error
9368 # endif
9369 #endif
9370         ${cf_cv_main_return:-return}(0);
9371 }
9372 _ACEOF
9373 rm -f "conftest$ac_exeext"
9374 if { (eval echo "$as_me:9374: \"$ac_link\"") >&5
9375   (eval $ac_link) 2>&5
9376   ac_status=$?
9377   echo "$as_me:9377: \$? = $ac_status" >&5
9378   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9379   { (eval echo "$as_me:9379: \"$ac_try\"") >&5
9380   (eval $ac_try) 2>&5
9381   ac_status=$?
9382   echo "$as_me:9382: \$? = $ac_status" >&5
9383   (exit "$ac_status"); }; }; then
9384
9385         cf_cv_ncurses_version=`cat $cf_tempfile`
9386 else
9387   echo "$as_me: program exited with status $ac_status" >&5
9388 echo "$as_me: failed program was:" >&5
9389 cat "conftest.$ac_ext" >&5
9390 fi
9391 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9392 fi
9393         rm -f "$cf_tempfile"
9394
9395 fi
9396 echo "$as_me:9396: result: $cf_cv_ncurses_version" >&5
9397 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9398 test "$cf_cv_ncurses_version" = no ||
9399 cat >>confdefs.h <<\EOF
9400 #define NCURSES 1
9401 EOF
9402
9403 cf_nculib_root=$cf_cv_screen
9404         # This works, except for the special case where we find gpm, but
9405         # ncurses is in a nonstandard location via $LIBS, and we really want
9406         # to link gpm.
9407 cf_ncurses_LIBS=""
9408 cf_ncurses_SAVE="$LIBS"
9409 echo "$as_me:9409: checking for Gpm_Open in -lgpm" >&5
9410 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9411 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9412   echo $ECHO_N "(cached) $ECHO_C" >&6
9413 else
9414   ac_check_lib_save_LIBS=$LIBS
9415 LIBS="-lgpm  $LIBS"
9416 cat >"conftest.$ac_ext" <<_ACEOF
9417 #line 9417 "configure"
9418 #include "confdefs.h"
9419
9420 /* Override any gcc2 internal prototype to avoid an error.  */
9421 #ifdef __cplusplus
9422 extern "C"
9423 #endif
9424 /* We use char because int might match the return type of a gcc2
9425    builtin and then its argument prototype would still apply.  */
9426 char Gpm_Open ();
9427 int
9428 main (void)
9429 {
9430 Gpm_Open ();
9431   ;
9432   return 0;
9433 }
9434 _ACEOF
9435 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9436 if { (eval echo "$as_me:9436: \"$ac_link\"") >&5
9437   (eval $ac_link) 2>&5
9438   ac_status=$?
9439   echo "$as_me:9439: \$? = $ac_status" >&5
9440   (exit "$ac_status"); } &&
9441          { ac_try='test -s "conftest$ac_exeext"'
9442   { (eval echo "$as_me:9442: \"$ac_try\"") >&5
9443   (eval $ac_try) 2>&5
9444   ac_status=$?
9445   echo "$as_me:9445: \$? = $ac_status" >&5
9446   (exit "$ac_status"); }; }; then
9447   ac_cv_lib_gpm_Gpm_Open=yes
9448 else
9449   echo "$as_me: failed program was:" >&5
9450 cat "conftest.$ac_ext" >&5
9451 ac_cv_lib_gpm_Gpm_Open=no
9452 fi
9453 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9454 LIBS=$ac_check_lib_save_LIBS
9455 fi
9456 echo "$as_me:9456: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9457 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9458 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9459   echo "$as_me:9459: checking for initscr in -lgpm" >&5
9460 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9461 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9462   echo $ECHO_N "(cached) $ECHO_C" >&6
9463 else
9464   ac_check_lib_save_LIBS=$LIBS
9465 LIBS="-lgpm  $LIBS"
9466 cat >"conftest.$ac_ext" <<_ACEOF
9467 #line 9467 "configure"
9468 #include "confdefs.h"
9469
9470 /* Override any gcc2 internal prototype to avoid an error.  */
9471 #ifdef __cplusplus
9472 extern "C"
9473 #endif
9474 /* We use char because int might match the return type of a gcc2
9475    builtin and then its argument prototype would still apply.  */
9476 char initscr ();
9477 int
9478 main (void)
9479 {
9480 initscr ();
9481   ;
9482   return 0;
9483 }
9484 _ACEOF
9485 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9486 if { (eval echo "$as_me:9486: \"$ac_link\"") >&5
9487   (eval $ac_link) 2>&5
9488   ac_status=$?
9489   echo "$as_me:9489: \$? = $ac_status" >&5
9490   (exit "$ac_status"); } &&
9491          { ac_try='test -s "conftest$ac_exeext"'
9492   { (eval echo "$as_me:9492: \"$ac_try\"") >&5
9493   (eval $ac_try) 2>&5
9494   ac_status=$?
9495   echo "$as_me:9495: \$? = $ac_status" >&5
9496   (exit "$ac_status"); }; }; then
9497   ac_cv_lib_gpm_initscr=yes
9498 else
9499   echo "$as_me: failed program was:" >&5
9500 cat "conftest.$ac_ext" >&5
9501 ac_cv_lib_gpm_initscr=no
9502 fi
9503 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9504 LIBS=$ac_check_lib_save_LIBS
9505 fi
9506 echo "$as_me:9506: result: $ac_cv_lib_gpm_initscr" >&5
9507 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9508 if test "$ac_cv_lib_gpm_initscr" = yes; then
9509   LIBS="$cf_ncurses_SAVE"
9510 else
9511   cf_ncurses_LIBS="-lgpm"
9512 fi
9513
9514 fi
9515
9516 case "$host_os" in
9517 (freebsd*)
9518         # This is only necessary if you are linking against an obsolete
9519         # version of ncurses (but it should do no harm, since it's static).
9520         if test "$cf_nculib_root" = ncurses ; then
9521                 echo "$as_me:9521: checking for tgoto in -lmytinfo" >&5
9522 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9523 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9524   echo $ECHO_N "(cached) $ECHO_C" >&6
9525 else
9526   ac_check_lib_save_LIBS=$LIBS
9527 LIBS="-lmytinfo  $LIBS"
9528 cat >"conftest.$ac_ext" <<_ACEOF
9529 #line 9529 "configure"
9530 #include "confdefs.h"
9531
9532 /* Override any gcc2 internal prototype to avoid an error.  */
9533 #ifdef __cplusplus
9534 extern "C"
9535 #endif
9536 /* We use char because int might match the return type of a gcc2
9537    builtin and then its argument prototype would still apply.  */
9538 char tgoto ();
9539 int
9540 main (void)
9541 {
9542 tgoto ();
9543   ;
9544   return 0;
9545 }
9546 _ACEOF
9547 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9548 if { (eval echo "$as_me:9548: \"$ac_link\"") >&5
9549   (eval $ac_link) 2>&5
9550   ac_status=$?
9551   echo "$as_me:9551: \$? = $ac_status" >&5
9552   (exit "$ac_status"); } &&
9553          { ac_try='test -s "conftest$ac_exeext"'
9554   { (eval echo "$as_me:9554: \"$ac_try\"") >&5
9555   (eval $ac_try) 2>&5
9556   ac_status=$?
9557   echo "$as_me:9557: \$? = $ac_status" >&5
9558   (exit "$ac_status"); }; }; then
9559   ac_cv_lib_mytinfo_tgoto=yes
9560 else
9561   echo "$as_me: failed program was:" >&5
9562 cat "conftest.$ac_ext" >&5
9563 ac_cv_lib_mytinfo_tgoto=no
9564 fi
9565 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9566 LIBS=$ac_check_lib_save_LIBS
9567 fi
9568 echo "$as_me:9568: result: $ac_cv_lib_mytinfo_tgoto" >&5
9569 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9570 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9571   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9572 fi
9573
9574         fi
9575         ;;
9576 esac
9577
9578 cf_add_libs="$LIBS"
9579 # reverse order
9580 cf_add_0lib=
9581 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9582 # filter duplicates
9583 for cf_add_1lib in $cf_add_0lib; do
9584         for cf_add_2lib in $cf_add_libs; do
9585                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9586                         cf_add_1lib=
9587                         break
9588                 fi
9589         done
9590         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9591 done
9592 LIBS="$cf_add_libs"
9593
9594 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9595 then
9596
9597 cf_add_libs="$LIBS"
9598 # reverse order
9599 cf_add_0lib=
9600 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9601 # filter duplicates
9602 for cf_add_1lib in $cf_add_0lib; do
9603         for cf_add_2lib in $cf_add_libs; do
9604                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9605                         cf_add_1lib=
9606                         break
9607                 fi
9608         done
9609         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9610 done
9611 LIBS="$cf_add_libs"
9612
9613 else
9614
9615         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9616         cf_libdir=""
9617         echo "$as_me:9617: checking for initscr" >&5
9618 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9619 if test "${ac_cv_func_initscr+set}" = set; then
9620   echo $ECHO_N "(cached) $ECHO_C" >&6
9621 else
9622   cat >"conftest.$ac_ext" <<_ACEOF
9623 #line 9623 "configure"
9624 #include "confdefs.h"
9625 #define initscr autoconf_temporary
9626 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9627 #undef initscr
9628
9629 #ifdef __cplusplus
9630 extern "C"
9631 #endif
9632
9633 /* We use char because int might match the return type of a gcc2
9634    builtin and then its argument prototype would still apply.  */
9635 char initscr (void);
9636
9637 int
9638 main (void)
9639 {
9640
9641 /* The GNU C library defines stubs for functions which it implements
9642     to always fail with ENOSYS.  Some functions are actually named
9643     something starting with __ and the normal name is an alias.  */
9644 #if defined (__stub_initscr) || defined (__stub___initscr)
9645 #error found stub for initscr
9646 #endif
9647
9648         return initscr ();
9649   ;
9650   return 0;
9651 }
9652 _ACEOF
9653 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9654 if { (eval echo "$as_me:9654: \"$ac_link\"") >&5
9655   (eval $ac_link) 2>&5
9656   ac_status=$?
9657   echo "$as_me:9657: \$? = $ac_status" >&5
9658   (exit "$ac_status"); } &&
9659          { ac_try='test -s "conftest$ac_exeext"'
9660   { (eval echo "$as_me:9660: \"$ac_try\"") >&5
9661   (eval $ac_try) 2>&5
9662   ac_status=$?
9663   echo "$as_me:9663: \$? = $ac_status" >&5
9664   (exit "$ac_status"); }; }; then
9665   ac_cv_func_initscr=yes
9666 else
9667   echo "$as_me: failed program was:" >&5
9668 cat "conftest.$ac_ext" >&5
9669 ac_cv_func_initscr=no
9670 fi
9671 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9672 fi
9673 echo "$as_me:9673: result: $ac_cv_func_initscr" >&5
9674 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9675 if test "$ac_cv_func_initscr" = yes; then
9676   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9677 else
9678
9679                 cf_save_LIBS="$LIBS"
9680                 echo "$as_me:9680: checking for initscr in -l$cf_nculib_root" >&5
9681 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9682                 LIBS="-l$cf_nculib_root $LIBS"
9683                 cat >"conftest.$ac_ext" <<_ACEOF
9684 #line 9684 "configure"
9685 #include "confdefs.h"
9686 #include <${cf_cv_ncurses_header:-curses.h}>
9687 int
9688 main (void)
9689 {
9690 initscr()
9691   ;
9692   return 0;
9693 }
9694 _ACEOF
9695 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9696 if { (eval echo "$as_me:9696: \"$ac_link\"") >&5
9697   (eval $ac_link) 2>&5
9698   ac_status=$?
9699   echo "$as_me:9699: \$? = $ac_status" >&5
9700   (exit "$ac_status"); } &&
9701          { ac_try='test -s "conftest$ac_exeext"'
9702   { (eval echo "$as_me:9702: \"$ac_try\"") >&5
9703   (eval $ac_try) 2>&5
9704   ac_status=$?
9705   echo "$as_me:9705: \$? = $ac_status" >&5
9706   (exit "$ac_status"); }; }; then
9707   echo "$as_me:9707: result: yes" >&5
9708 echo "${ECHO_T}yes" >&6
9709                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9710
9711 else
9712   echo "$as_me: failed program was:" >&5
9713 cat "conftest.$ac_ext" >&5
9714 echo "$as_me:9714: result: no" >&5
9715 echo "${ECHO_T}no" >&6
9716
9717 cf_search=
9718 cf_library_path_list=""
9719 if test -n "${LDFLAGS}${LIBS}" ; then
9720         for cf_library_path in $LDFLAGS $LIBS
9721         do
9722                 case "$cf_library_path" in
9723                 (-L*)
9724                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9725
9726 test "x$cf_library_path" != "xNONE" && \
9727 test -d "$cf_library_path" && \
9728  {
9729         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9730         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9731         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9732         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9733         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9734         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"
9735 }
9736
9737                         cf_library_path_list="$cf_library_path_list $cf_search"
9738                         ;;
9739                 esac
9740         done
9741 fi
9742
9743 cf_search=
9744
9745 test "x$prefix" != "xNONE" && \
9746 test -d "$prefix" && \
9747  {
9748         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9749         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9750         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9751         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9752         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9753         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9754 }
9755
9756 for cf_subdir_prefix in \
9757         /usr \
9758         /usr/local \
9759         /usr/pkg \
9760         /opt \
9761         /opt/local \
9762         $HOME
9763 do
9764
9765 test "x$cf_subdir_prefix" != "x$prefix" && \
9766 test -d "$cf_subdir_prefix" && \
9767 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9768         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9769         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9770         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9771         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9772         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9773         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"
9774 }
9775
9776 done
9777
9778 cf_search="$cf_library_path_list $cf_search"
9779
9780                         for cf_libdir in $cf_search
9781                         do
9782                                 echo "$as_me:9782: checking for -l$cf_nculib_root in $cf_libdir" >&5
9783 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9784                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9785                                 cat >"conftest.$ac_ext" <<_ACEOF
9786 #line 9786 "configure"
9787 #include "confdefs.h"
9788 #include <${cf_cv_ncurses_header:-curses.h}>
9789 int
9790 main (void)
9791 {
9792 initscr()
9793   ;
9794   return 0;
9795 }
9796 _ACEOF
9797 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9798 if { (eval echo "$as_me:9798: \"$ac_link\"") >&5
9799   (eval $ac_link) 2>&5
9800   ac_status=$?
9801   echo "$as_me:9801: \$? = $ac_status" >&5
9802   (exit "$ac_status"); } &&
9803          { ac_try='test -s "conftest$ac_exeext"'
9804   { (eval echo "$as_me:9804: \"$ac_try\"") >&5
9805   (eval $ac_try) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit "$ac_status"); }; }; then
9809   echo "$as_me:9809: result: yes" >&5
9810 echo "${ECHO_T}yes" >&6
9811                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9812                                          break
9813 else
9814   echo "$as_me: failed program was:" >&5
9815 cat "conftest.$ac_ext" >&5
9816 echo "$as_me:9816: result: no" >&5
9817 echo "${ECHO_T}no" >&6
9818                                          LIBS="$cf_save_LIBS"
9819 fi
9820 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9821                         done
9822
9823 fi
9824 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9825
9826 fi
9827
9828 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9829
9830 if test "$cf_found_library" = no ; then
9831         { { echo "$as_me:9831: error: Cannot link $cf_nculib_root library" >&5
9832 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9833    { (exit 1); exit 1; }; }
9834 fi
9835
9836 fi
9837
9838 if test -n "$cf_ncurses_LIBS" ; then
9839         echo "$as_me:9839: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9840 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9841         cf_ncurses_SAVE="$LIBS"
9842         for p in $cf_ncurses_LIBS ; do
9843                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9844                 if test "$q" != "$LIBS" ; then
9845                         LIBS="$q"
9846                 fi
9847         done
9848         cat >"conftest.$ac_ext" <<_ACEOF
9849 #line 9849 "configure"
9850 #include "confdefs.h"
9851 #include <${cf_cv_ncurses_header:-curses.h}>
9852 int
9853 main (void)
9854 {
9855 initscr(); mousemask(0,0); tigetstr((char *)0);
9856   ;
9857   return 0;
9858 }
9859 _ACEOF
9860 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9861 if { (eval echo "$as_me:9861: \"$ac_link\"") >&5
9862   (eval $ac_link) 2>&5
9863   ac_status=$?
9864   echo "$as_me:9864: \$? = $ac_status" >&5
9865   (exit "$ac_status"); } &&
9866          { ac_try='test -s "conftest$ac_exeext"'
9867   { (eval echo "$as_me:9867: \"$ac_try\"") >&5
9868   (eval $ac_try) 2>&5
9869   ac_status=$?
9870   echo "$as_me:9870: \$? = $ac_status" >&5
9871   (exit "$ac_status"); }; }; then
9872   echo "$as_me:9872: result: yes" >&5
9873 echo "${ECHO_T}yes" >&6
9874 else
9875   echo "$as_me: failed program was:" >&5
9876 cat "conftest.$ac_ext" >&5
9877 echo "$as_me:9877: result: no" >&5
9878 echo "${ECHO_T}no" >&6
9879                  LIBS="$cf_ncurses_SAVE"
9880 fi
9881 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9882 fi
9883
9884 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9885
9886 cat >>confdefs.h <<EOF
9887 #define $cf_nculib_ROOT 1
9888 EOF
9889
9890         fi
9891 else
9892         NCURSES_CONFIG=none
9893 fi
9894
9895         ;;
9896 (ncurses*)
9897
9898 cf_ncuconfig_root=$cf_cv_screen
9899 cf_have_ncuconfig=no
9900
9901 if test "x${PKG_CONFIG:=none}" != xnone; then
9902         echo "$as_me:9902: checking pkg-config for $cf_ncuconfig_root" >&5
9903 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9904         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9905                 echo "$as_me:9905: result: yes" >&5
9906 echo "${ECHO_T}yes" >&6
9907
9908                 echo "$as_me:9908: checking if the $cf_ncuconfig_root package files work" >&5
9909 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9910                 cf_have_ncuconfig=unknown
9911
9912                 cf_save_CFLAGS="$CFLAGS"
9913                 cf_save_CPPFLAGS="$CPPFLAGS"
9914                 cf_save_LIBS="$LIBS"
9915
9916                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9917                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9918
9919                 # while -W for passing linker flags is prevalent, it is not "standard".
9920                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9921                 # incompatible _and_ non-standard -W option which gives an error.  Work
9922                 # around that pitfall.
9923                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9924                 (x*c[89]9@@*-W*)
9925
9926 cf_fix_cppflags=no
9927 cf_new_cflags=
9928 cf_new_cppflags=
9929 cf_new_extra_cppflags=
9930
9931 for cf_add_cflags in $cf_pkg_cflags
9932 do
9933 case "$cf_fix_cppflags" in
9934 (no)
9935         case "$cf_add_cflags" in
9936         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9937                 case "$cf_add_cflags" in
9938                 (-D*)
9939                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9940
9941                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9942                                 && test -z "${cf_tst_cflags}" \
9943                                 && cf_fix_cppflags=yes
9944
9945                         if test "$cf_fix_cppflags" = yes ; then
9946
9947         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9948         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9949
9950                                 continue
9951                         elif test "${cf_tst_cflags}" = "\"'" ; then
9952
9953         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9954         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9955
9956                                 continue
9957                         fi
9958                         ;;
9959                 esac
9960                 case "$CPPFLAGS" in
9961                 (*$cf_add_cflags)
9962                         ;;
9963                 (*)
9964                         case "$cf_add_cflags" in
9965                         (-D*)
9966                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9967
9968 CPPFLAGS=`echo "$CPPFLAGS" | \
9969         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9970                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9971
9972                                 ;;
9973                         esac
9974
9975         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9976         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9977
9978                         ;;
9979                 esac
9980                 ;;
9981         (*)
9982
9983         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9984         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9985
9986                 ;;
9987         esac
9988         ;;
9989 (yes)
9990
9991         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9992         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9993
9994         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9995
9996         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9997                 && test -z "${cf_tst_cflags}" \
9998                 && cf_fix_cppflags=no
9999         ;;
10000 esac
10001 done
10002
10003 if test -n "$cf_new_cflags" ; then
10004
10005         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10006         CFLAGS="${CFLAGS}$cf_new_cflags"
10007
10008 fi
10009
10010 if test -n "$cf_new_cppflags" ; then
10011
10012         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10013         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10014
10015 fi
10016
10017 if test -n "$cf_new_extra_cppflags" ; then
10018
10019         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10020         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10021
10022 fi
10023
10024 cf_add_libs="$LIBS"
10025 # reverse order
10026 cf_add_0lib=
10027 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10028 # filter duplicates
10029 for cf_add_1lib in $cf_add_0lib; do
10030         for cf_add_2lib in $cf_add_libs; do
10031                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10032                         cf_add_1lib=
10033                         break
10034                 fi
10035         done
10036         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10037 done
10038 LIBS="$cf_add_libs"
10039
10040                         cat >"conftest.$ac_ext" <<_ACEOF
10041 #line 10041 "configure"
10042 #include "confdefs.h"
10043 #include <${cf_cv_ncurses_header:-curses.h}>
10044 int
10045 main (void)
10046 {
10047 initscr(); mousemask(0,0); tigetstr((char *)0);
10048   ;
10049   return 0;
10050 }
10051 _ACEOF
10052 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10053 if { (eval echo "$as_me:10053: \"$ac_link\"") >&5
10054   (eval $ac_link) 2>&5
10055   ac_status=$?
10056   echo "$as_me:10056: \$? = $ac_status" >&5
10057   (exit "$ac_status"); } &&
10058          { ac_try='test -s "conftest$ac_exeext"'
10059   { (eval echo "$as_me:10059: \"$ac_try\"") >&5
10060   (eval $ac_try) 2>&5
10061   ac_status=$?
10062   echo "$as_me:10062: \$? = $ac_status" >&5
10063   (exit "$ac_status"); }; }; then
10064   if test "$cross_compiling" = yes; then
10065   cf_test_ncuconfig=maybe
10066 else
10067   cat >"conftest.$ac_ext" <<_ACEOF
10068 #line 10068 "configure"
10069 #include "confdefs.h"
10070 #include <${cf_cv_ncurses_header:-curses.h}>
10071                                         int main(void)
10072                                         { char *xx = curses_version(); return (xx == 0); }
10073 _ACEOF
10074 rm -f "conftest$ac_exeext"
10075 if { (eval echo "$as_me:10075: \"$ac_link\"") >&5
10076   (eval $ac_link) 2>&5
10077   ac_status=$?
10078   echo "$as_me:10078: \$? = $ac_status" >&5
10079   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10080   { (eval echo "$as_me:10080: \"$ac_try\"") >&5
10081   (eval $ac_try) 2>&5
10082   ac_status=$?
10083   echo "$as_me:10083: \$? = $ac_status" >&5
10084   (exit "$ac_status"); }; }; then
10085   cf_test_ncuconfig=yes
10086 else
10087   echo "$as_me: program exited with status $ac_status" >&5
10088 echo "$as_me: failed program was:" >&5
10089 cat "conftest.$ac_ext" >&5
10090 cf_test_ncuconfig=no
10091 fi
10092 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10093 fi
10094 else
10095   echo "$as_me: failed program was:" >&5
10096 cat "conftest.$ac_ext" >&5
10097 cf_test_ncuconfig=no
10098 fi
10099 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10100
10101                         CFLAGS="$cf_save_CFLAGS"
10102                         CPPFLAGS="$cf_save_CPPFLAGS"
10103                         LIBS="$cf_save_LIBS"
10104
10105                         if test "x$cf_test_ncuconfig" != xyes; then
10106                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
10107                                 cf_pkg_cflags="$cf_temp"
10108                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
10109                                 cf_pkg_libs="$cf_temp"
10110                         fi
10111                         ;;
10112                 esac
10113
10114 cf_fix_cppflags=no
10115 cf_new_cflags=
10116 cf_new_cppflags=
10117 cf_new_extra_cppflags=
10118
10119 for cf_add_cflags in $cf_pkg_cflags
10120 do
10121 case "$cf_fix_cppflags" in
10122 (no)
10123         case "$cf_add_cflags" in
10124         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10125                 case "$cf_add_cflags" in
10126                 (-D*)
10127                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10128
10129                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10130                                 && test -z "${cf_tst_cflags}" \
10131                                 && cf_fix_cppflags=yes
10132
10133                         if test "$cf_fix_cppflags" = yes ; then
10134
10135         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10136         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10137
10138                                 continue
10139                         elif test "${cf_tst_cflags}" = "\"'" ; then
10140
10141         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10142         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10143
10144                                 continue
10145                         fi
10146                         ;;
10147                 esac
10148                 case "$CPPFLAGS" in
10149                 (*$cf_add_cflags)
10150                         ;;
10151                 (*)
10152                         case "$cf_add_cflags" in
10153                         (-D*)
10154                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10155
10156 CPPFLAGS=`echo "$CPPFLAGS" | \
10157         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10158                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10159
10160                                 ;;
10161                         esac
10162
10163         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10164         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10165
10166                         ;;
10167                 esac
10168                 ;;
10169         (*)
10170
10171         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10172         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10173
10174                 ;;
10175         esac
10176         ;;
10177 (yes)
10178
10179         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10180         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10181
10182         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10183
10184         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10185                 && test -z "${cf_tst_cflags}" \
10186                 && cf_fix_cppflags=no
10187         ;;
10188 esac
10189 done
10190
10191 if test -n "$cf_new_cflags" ; then
10192
10193         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10194         CFLAGS="${CFLAGS}$cf_new_cflags"
10195
10196 fi
10197
10198 if test -n "$cf_new_cppflags" ; then
10199
10200         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10201         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10202
10203 fi
10204
10205 if test -n "$cf_new_extra_cppflags" ; then
10206
10207         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10208         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10209
10210 fi
10211
10212 cf_add_libs="$LIBS"
10213 # reverse order
10214 cf_add_0lib=
10215 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10216 # filter duplicates
10217 for cf_add_1lib in $cf_add_0lib; do
10218         for cf_add_2lib in $cf_add_libs; do
10219                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10220                         cf_add_1lib=
10221                         break
10222                 fi
10223         done
10224         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10225 done
10226 LIBS="$cf_add_libs"
10227
10228                 cat >"conftest.$ac_ext" <<_ACEOF
10229 #line 10229 "configure"
10230 #include "confdefs.h"
10231 #include <${cf_cv_ncurses_header:-curses.h}>
10232 int
10233 main (void)
10234 {
10235 initscr(); mousemask(0,0); tigetstr((char *)0);
10236   ;
10237   return 0;
10238 }
10239 _ACEOF
10240 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10241 if { (eval echo "$as_me:10241: \"$ac_link\"") >&5
10242   (eval $ac_link) 2>&5
10243   ac_status=$?
10244   echo "$as_me:10244: \$? = $ac_status" >&5
10245   (exit "$ac_status"); } &&
10246          { ac_try='test -s "conftest$ac_exeext"'
10247   { (eval echo "$as_me:10247: \"$ac_try\"") >&5
10248   (eval $ac_try) 2>&5
10249   ac_status=$?
10250   echo "$as_me:10250: \$? = $ac_status" >&5
10251   (exit "$ac_status"); }; }; then
10252   if test "$cross_compiling" = yes; then
10253   cf_have_ncuconfig=maybe
10254 else
10255   cat >"conftest.$ac_ext" <<_ACEOF
10256 #line 10256 "configure"
10257 #include "confdefs.h"
10258 #include <${cf_cv_ncurses_header:-curses.h}>
10259                                 int main(void)
10260                                 { char *xx = curses_version(); return (xx == 0); }
10261 _ACEOF
10262 rm -f "conftest$ac_exeext"
10263 if { (eval echo "$as_me:10263: \"$ac_link\"") >&5
10264   (eval $ac_link) 2>&5
10265   ac_status=$?
10266   echo "$as_me:10266: \$? = $ac_status" >&5
10267   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10268   { (eval echo "$as_me:10268: \"$ac_try\"") >&5
10269   (eval $ac_try) 2>&5
10270   ac_status=$?
10271   echo "$as_me:10271: \$? = $ac_status" >&5
10272   (exit "$ac_status"); }; }; then
10273   cf_have_ncuconfig=yes
10274 else
10275   echo "$as_me: program exited with status $ac_status" >&5
10276 echo "$as_me: failed program was:" >&5
10277 cat "conftest.$ac_ext" >&5
10278 cf_have_ncuconfig=no
10279 fi
10280 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10281 fi
10282 else
10283   echo "$as_me: failed program was:" >&5
10284 cat "conftest.$ac_ext" >&5
10285 cf_have_ncuconfig=no
10286 fi
10287 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10288                 echo "$as_me:10288: result: $cf_have_ncuconfig" >&5
10289 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10290                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10291                 if test "$cf_have_ncuconfig" != "yes"
10292                 then
10293                         CPPFLAGS="$cf_save_CPPFLAGS"
10294                         LIBS="$cf_save_LIBS"
10295                         NCURSES_CONFIG_PKG=none
10296                 else
10297
10298 cat >>confdefs.h <<\EOF
10299 #define NCURSES 1
10300 EOF
10301
10302                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10303
10304 echo "$as_me:10304: checking for terminfo header" >&5
10305 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10306 if test "${cf_cv_term_header+set}" = set; then
10307   echo $ECHO_N "(cached) $ECHO_C" >&6
10308 else
10309
10310 case "${cf_cv_ncurses_header}" in
10311 (*/ncurses.h|*/ncursesw.h)
10312         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10313         ;;
10314 (*)
10315         cf_term_header=term.h
10316         ;;
10317 esac
10318
10319 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10320 do
10321 cat >"conftest.$ac_ext" <<_ACEOF
10322 #line 10322 "configure"
10323 #include "confdefs.h"
10324 #include <stdio.h>
10325 #include <${cf_cv_ncurses_header:-curses.h}>
10326 #include <$cf_test>
10327
10328 int
10329 main (void)
10330 {
10331 int x = auto_left_margin; (void)x
10332   ;
10333   return 0;
10334 }
10335 _ACEOF
10336 rm -f "conftest.$ac_objext"
10337 if { (eval echo "$as_me:10337: \"$ac_compile\"") >&5
10338   (eval $ac_compile) 2>&5
10339   ac_status=$?
10340   echo "$as_me:10340: \$? = $ac_status" >&5
10341   (exit "$ac_status"); } &&
10342          { ac_try='test -s "conftest.$ac_objext"'
10343   { (eval echo "$as_me:10343: \"$ac_try\"") >&5
10344   (eval $ac_try) 2>&5
10345   ac_status=$?
10346   echo "$as_me:10346: \$? = $ac_status" >&5
10347   (exit "$ac_status"); }; }; then
10348
10349         cf_cv_term_header="$cf_test"
10350 else
10351   echo "$as_me: failed program was:" >&5
10352 cat "conftest.$ac_ext" >&5
10353
10354         cf_cv_term_header=unknown
10355
10356 fi
10357 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10358         test "$cf_cv_term_header" != unknown && break
10359 done
10360
10361 fi
10362 echo "$as_me:10362: result: $cf_cv_term_header" >&5
10363 echo "${ECHO_T}$cf_cv_term_header" >&6
10364
10365 # Set definitions to allow ifdef'ing to accommodate subdirectories
10366
10367 case "$cf_cv_term_header" in
10368 (*term.h)
10369
10370 cat >>confdefs.h <<\EOF
10371 #define HAVE_TERM_H 1
10372 EOF
10373
10374         ;;
10375 esac
10376
10377 case "$cf_cv_term_header" in
10378 (ncurses/term.h)
10379
10380 cat >>confdefs.h <<\EOF
10381 #define HAVE_NCURSES_TERM_H 1
10382 EOF
10383
10384         ;;
10385 (ncursesw/term.h)
10386
10387 cat >>confdefs.h <<\EOF
10388 #define HAVE_NCURSESW_TERM_H 1
10389 EOF
10390
10391         ;;
10392 esac
10393
10394                 fi
10395
10396         else
10397                 echo "$as_me:10397: result: no" >&5
10398 echo "${ECHO_T}no" >&6
10399                 NCURSES_CONFIG_PKG=none
10400         fi
10401 else
10402         NCURSES_CONFIG_PKG=none
10403 fi
10404
10405 if test "x$cf_have_ncuconfig" = "xno"; then
10406         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10407
10408 if test -n "$ac_tool_prefix"; then
10409   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10410   do
10411     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10412 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10413 echo "$as_me:10413: checking for $ac_word" >&5
10414 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10415 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10416   echo $ECHO_N "(cached) $ECHO_C" >&6
10417 else
10418   if test -n "$NCURSES_CONFIG"; then
10419   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10420 else
10421   ac_save_IFS=$IFS; IFS=$ac_path_separator
10422 ac_dummy="$PATH"
10423 for ac_dir in $ac_dummy; do
10424   IFS=$ac_save_IFS
10425   test -z "$ac_dir" && ac_dir=.
10426   $as_executable_p "$ac_dir/$ac_word" || continue
10427 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10428 echo "$as_me:10428: found $ac_dir/$ac_word" >&5
10429 break
10430 done
10431
10432 fi
10433 fi
10434 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10435 if test -n "$NCURSES_CONFIG"; then
10436   echo "$as_me:10436: result: $NCURSES_CONFIG" >&5
10437 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10438 else
10439   echo "$as_me:10439: result: no" >&5
10440 echo "${ECHO_T}no" >&6
10441 fi
10442
10443     test -n "$NCURSES_CONFIG" && break
10444   done
10445 fi
10446 if test -z "$NCURSES_CONFIG"; then
10447   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10448   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10449 do
10450   # Extract the first word of "$ac_prog", so it can be a program name with args.
10451 set dummy $ac_prog; ac_word=$2
10452 echo "$as_me:10452: checking for $ac_word" >&5
10453 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10454 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10455   echo $ECHO_N "(cached) $ECHO_C" >&6
10456 else
10457   if test -n "$ac_ct_NCURSES_CONFIG"; then
10458   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10459 else
10460   ac_save_IFS=$IFS; IFS=$ac_path_separator
10461 ac_dummy="$PATH"
10462 for ac_dir in $ac_dummy; do
10463   IFS=$ac_save_IFS
10464   test -z "$ac_dir" && ac_dir=.
10465   $as_executable_p "$ac_dir/$ac_word" || continue
10466 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10467 echo "$as_me:10467: found $ac_dir/$ac_word" >&5
10468 break
10469 done
10470
10471 fi
10472 fi
10473 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10474 if test -n "$ac_ct_NCURSES_CONFIG"; then
10475   echo "$as_me:10475: result: $ac_ct_NCURSES_CONFIG" >&5
10476 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10477 else
10478   echo "$as_me:10478: result: no" >&5
10479 echo "${ECHO_T}no" >&6
10480 fi
10481
10482   test -n "$ac_ct_NCURSES_CONFIG" && break
10483 done
10484 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10485
10486   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10487 fi
10488
10489         if test "$NCURSES_CONFIG" != none ; then
10490
10491 cf_fix_cppflags=no
10492 cf_new_cflags=
10493 cf_new_cppflags=
10494 cf_new_extra_cppflags=
10495
10496 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10497 do
10498 case "$cf_fix_cppflags" in
10499 (no)
10500         case "$cf_add_cflags" in
10501         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10502                 case "$cf_add_cflags" in
10503                 (-D*)
10504                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10505
10506                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10507                                 && test -z "${cf_tst_cflags}" \
10508                                 && cf_fix_cppflags=yes
10509
10510                         if test "$cf_fix_cppflags" = yes ; then
10511
10512         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10513         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10514
10515                                 continue
10516                         elif test "${cf_tst_cflags}" = "\"'" ; then
10517
10518         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10519         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10520
10521                                 continue
10522                         fi
10523                         ;;
10524                 esac
10525                 case "$CPPFLAGS" in
10526                 (*$cf_add_cflags)
10527                         ;;
10528                 (*)
10529                         case "$cf_add_cflags" in
10530                         (-D*)
10531                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10532
10533 CPPFLAGS=`echo "$CPPFLAGS" | \
10534         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10535                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10536
10537                                 ;;
10538                         esac
10539
10540         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10541         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10542
10543                         ;;
10544                 esac
10545                 ;;
10546         (*)
10547
10548         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10549         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10550
10551                 ;;
10552         esac
10553         ;;
10554 (yes)
10555
10556         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10557         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10558
10559         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10560
10561         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10562                 && test -z "${cf_tst_cflags}" \
10563                 && cf_fix_cppflags=no
10564         ;;
10565 esac
10566 done
10567
10568 if test -n "$cf_new_cflags" ; then
10569
10570         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10571         CFLAGS="${CFLAGS}$cf_new_cflags"
10572
10573 fi
10574
10575 if test -n "$cf_new_cppflags" ; then
10576
10577         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10578         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10579
10580 fi
10581
10582 if test -n "$cf_new_extra_cppflags" ; then
10583
10584         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10585         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10586
10587 fi
10588
10589 cf_add_libs="$LIBS"
10590 # reverse order
10591 cf_add_0lib=
10592 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10593 # filter duplicates
10594 for cf_add_1lib in $cf_add_0lib; do
10595         for cf_add_2lib in $cf_add_libs; do
10596                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10597                         cf_add_1lib=
10598                         break
10599                 fi
10600         done
10601         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10602 done
10603 LIBS="$cf_add_libs"
10604
10605                 # even with config script, some packages use no-override for curses.h
10606
10607 echo "$as_me:10607: checking if we have identified curses headers" >&5
10608 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10609 if test "${cf_cv_ncurses_header+set}" = set; then
10610   echo $ECHO_N "(cached) $ECHO_C" >&6
10611 else
10612
10613 cf_cv_ncurses_header=none
10614 for cf_header in \
10615         ncurses.h $cf_cv_screen/ncurses.h \
10616         curses.h $cf_cv_screen/curses.h
10617 do
10618 cat >"conftest.$ac_ext" <<_ACEOF
10619 #line 10619 "configure"
10620 #include "confdefs.h"
10621 #include <${cf_header}>
10622 int
10623 main (void)
10624 {
10625 initscr(); tgoto("?", 0,0)
10626   ;
10627   return 0;
10628 }
10629 _ACEOF
10630 rm -f "conftest.$ac_objext"
10631 if { (eval echo "$as_me:10631: \"$ac_compile\"") >&5
10632   (eval $ac_compile) 2>&5
10633   ac_status=$?
10634   echo "$as_me:10634: \$? = $ac_status" >&5
10635   (exit "$ac_status"); } &&
10636          { ac_try='test -s "conftest.$ac_objext"'
10637   { (eval echo "$as_me:10637: \"$ac_try\"") >&5
10638   (eval $ac_try) 2>&5
10639   ac_status=$?
10640   echo "$as_me:10640: \$? = $ac_status" >&5
10641   (exit "$ac_status"); }; }; then
10642   cf_cv_ncurses_header=$cf_header; break
10643 else
10644   echo "$as_me: failed program was:" >&5
10645 cat "conftest.$ac_ext" >&5
10646 fi
10647 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10648 done
10649
10650 fi
10651 echo "$as_me:10651: result: $cf_cv_ncurses_header" >&5
10652 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10653
10654 if test "$cf_cv_ncurses_header" = none ; then
10655         { { echo "$as_me:10655: error: No curses header-files found" >&5
10656 echo "$as_me: error: No curses header-files found" >&2;}
10657    { (exit 1); exit 1; }; }
10658 fi
10659
10660 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10661
10662 for ac_header in $cf_cv_ncurses_header
10663 do
10664 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10665 echo "$as_me:10665: checking for $ac_header" >&5
10666 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10667 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10668   echo $ECHO_N "(cached) $ECHO_C" >&6
10669 else
10670   cat >"conftest.$ac_ext" <<_ACEOF
10671 #line 10671 "configure"
10672 #include "confdefs.h"
10673 #include <$ac_header>
10674 _ACEOF
10675 if { (eval echo "$as_me:10675: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10676   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10677   ac_status=$?
10678   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10679   rm -f conftest.er1
10680   cat conftest.err >&5
10681   echo "$as_me:10681: \$? = $ac_status" >&5
10682   (exit "$ac_status"); } >/dev/null; then
10683   if test -s conftest.err; then
10684     ac_cpp_err=$ac_c_preproc_warn_flag
10685   else
10686     ac_cpp_err=
10687   fi
10688 else
10689   ac_cpp_err=yes
10690 fi
10691 if test -z "$ac_cpp_err"; then
10692   eval "$as_ac_Header=yes"
10693 else
10694   echo "$as_me: failed program was:" >&5
10695   cat "conftest.$ac_ext" >&5
10696   eval "$as_ac_Header=no"
10697 fi
10698 rm -f conftest.err "conftest.$ac_ext"
10699 fi
10700 echo "$as_me:10700: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10701 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10702 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10703   cat >>confdefs.h <<EOF
10704 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10705 EOF
10706
10707 fi
10708 done
10709
10710 cat >>confdefs.h <<\EOF
10711 #define NCURSES 1
10712 EOF
10713
10714 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10715
10716                 cat >>confdefs.h <<EOF
10717 #define $cf_nculib_ROOT 1
10718 EOF
10719
10720                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10721
10722         else
10723
10724 cf_ncuhdr_root=$cf_cv_screen
10725
10726 test -n "$cf_cv_curses_dir" && \
10727 test "$cf_cv_curses_dir" != "no" && { \
10728
10729 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10730   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10731   do
10732         while test "$cf_add_incdir" != /usr/include
10733         do
10734           if test -d "$cf_add_incdir"
10735           then
10736                 cf_have_incdir=no
10737                 if test -n "$CFLAGS$CPPFLAGS" ; then
10738                   # a loop is needed to ensure we can add subdirs of existing dirs
10739                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10740                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10741                           cf_have_incdir=yes; break
10742                         fi
10743                   done
10744                 fi
10745
10746                 if test "$cf_have_incdir" = no ; then
10747                   if test "$cf_add_incdir" = /usr/local/include ; then
10748                         if test "$GCC" = yes
10749                         then
10750                           cf_save_CPPFLAGS=$CPPFLAGS
10751
10752         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10753         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10754
10755                           cat >"conftest.$ac_ext" <<_ACEOF
10756 #line 10756 "configure"
10757 #include "confdefs.h"
10758 #include <stdio.h>
10759 int
10760 main (void)
10761 {
10762 printf("Hello")
10763   ;
10764   return 0;
10765 }
10766 _ACEOF
10767 rm -f "conftest.$ac_objext"
10768 if { (eval echo "$as_me:10768: \"$ac_compile\"") >&5
10769   (eval $ac_compile) 2>&5
10770   ac_status=$?
10771   echo "$as_me:10771: \$? = $ac_status" >&5
10772   (exit "$ac_status"); } &&
10773          { ac_try='test -s "conftest.$ac_objext"'
10774   { (eval echo "$as_me:10774: \"$ac_try\"") >&5
10775   (eval $ac_try) 2>&5
10776   ac_status=$?
10777   echo "$as_me:10777: \$? = $ac_status" >&5
10778   (exit "$ac_status"); }; }; then
10779   :
10780 else
10781   echo "$as_me: failed program was:" >&5
10782 cat "conftest.$ac_ext" >&5
10783 cf_have_incdir=yes
10784 fi
10785 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10786                           CPPFLAGS=$cf_save_CPPFLAGS
10787                         fi
10788                   fi
10789                 fi
10790
10791                 if test "$cf_have_incdir" = no ; then
10792                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10793
10794 echo "${as_me:-configure}:10794: testing adding $cf_add_incdir to include-path ..." 1>&5
10795
10796                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10797
10798                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10799                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10800                   cf_add_incdir="$cf_top_incdir"
10801                 else
10802                   break
10803                 fi
10804           else
10805                 break
10806           fi
10807         done
10808   done
10809 fi
10810
10811 }
10812
10813 echo "$as_me:10813: checking for $cf_ncuhdr_root header in include-path" >&5
10814 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10815 if test "${cf_cv_ncurses_h+set}" = set; then
10816   echo $ECHO_N "(cached) $ECHO_C" >&6
10817 else
10818
10819         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10820         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10821         for cf_header in $cf_header_list
10822         do
10823
10824         cat >"conftest.$ac_ext" <<_ACEOF
10825 #line 10825 "configure"
10826 #include "confdefs.h"
10827
10828 #include <$cf_header>
10829 int
10830 main (void)
10831 {
10832
10833 #ifdef NCURSES_VERSION
10834
10835 printf("%s\\n", NCURSES_VERSION);
10836 #else
10837 #ifdef __NCURSES_H
10838 printf("old\\n");
10839 #else
10840         make an error
10841 #endif
10842 #endif
10843
10844   ;
10845   return 0;
10846 }
10847 _ACEOF
10848 rm -f "conftest.$ac_objext"
10849 if { (eval echo "$as_me:10849: \"$ac_compile\"") >&5
10850   (eval $ac_compile) 2>&5
10851   ac_status=$?
10852   echo "$as_me:10852: \$? = $ac_status" >&5
10853   (exit "$ac_status"); } &&
10854          { ac_try='test -s "conftest.$ac_objext"'
10855   { (eval echo "$as_me:10855: \"$ac_try\"") >&5
10856   (eval $ac_try) 2>&5
10857   ac_status=$?
10858   echo "$as_me:10858: \$? = $ac_status" >&5
10859   (exit "$ac_status"); }; }; then
10860   cf_cv_ncurses_h=$cf_header
10861
10862 else
10863   echo "$as_me: failed program was:" >&5
10864 cat "conftest.$ac_ext" >&5
10865 cf_cv_ncurses_h=no
10866 fi
10867 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10868
10869                 test "$cf_cv_ncurses_h" != no && break
10870         done
10871
10872 fi
10873 echo "$as_me:10873: result: $cf_cv_ncurses_h" >&5
10874 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10875
10876 if test "$cf_cv_ncurses_h" != no ; then
10877         cf_cv_ncurses_header=$cf_cv_ncurses_h
10878 else
10879
10880 echo "$as_me:10880: checking for $cf_ncuhdr_root include-path" >&5
10881 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10882 if test "${cf_cv_ncurses_h2+set}" = set; then
10883   echo $ECHO_N "(cached) $ECHO_C" >&6
10884 else
10885
10886         test -n "$verbose" && echo
10887
10888 cf_search=
10889
10890 # collect the current set of include-directories from compiler flags
10891 cf_header_path_list=""
10892 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10893         for cf_header_path in $CPPFLAGS $CFLAGS
10894         do
10895                 case "$cf_header_path" in
10896                 (-I*)
10897                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10898
10899 test "x$cf_header_path" != "xNONE" && \
10900 test -d "$cf_header_path" && \
10901  {
10902         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10903         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10904         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10905         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10906         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10907         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"
10908 }
10909
10910                         cf_header_path_list="$cf_header_path_list $cf_search"
10911                         ;;
10912                 esac
10913         done
10914 fi
10915
10916 # add the variations for the package we are looking for
10917
10918 cf_search=
10919
10920 test "x$prefix" != "xNONE" && \
10921 test -d "$prefix" && \
10922  {
10923         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10924         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10925         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10926         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10927         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10928         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10929 }
10930
10931 for cf_subdir_prefix in \
10932         /usr \
10933         /usr/local \
10934         /usr/pkg \
10935         /opt \
10936         /opt/local \
10937         $HOME
10938 do
10939
10940 test "x$cf_subdir_prefix" != "x$prefix" && \
10941 test -d "$cf_subdir_prefix" && \
10942 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10943         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10944         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10945         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10946         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10947         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10948         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"
10949 }
10950
10951 done
10952
10953 test "$includedir" != NONE && \
10954 test "$includedir" != "/usr/include" && \
10955 test -d "$includedir" && {
10956         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10957         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10958 }
10959
10960 test "$oldincludedir" != NONE && \
10961 test "$oldincludedir" != "/usr/include" && \
10962 test -d "$oldincludedir" && {
10963         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10964         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10965 }
10966
10967 cf_search="$cf_search $cf_header_path_list"
10968
10969         test -n "$verbose" && echo "search path $cf_search"
10970         cf_save2_CPPFLAGS="$CPPFLAGS"
10971         for cf_incdir in $cf_search
10972         do
10973
10974 if test -n "$cf_incdir" ; then
10975   for cf_add_incdir in $cf_incdir
10976   do
10977         while test "$cf_add_incdir" != /usr/include
10978         do
10979           if test -d "$cf_add_incdir"
10980           then
10981                 cf_have_incdir=no
10982                 if test -n "$CFLAGS$CPPFLAGS" ; then
10983                   # a loop is needed to ensure we can add subdirs of existing dirs
10984                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10985                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10986                           cf_have_incdir=yes; break
10987                         fi
10988                   done
10989                 fi
10990
10991                 if test "$cf_have_incdir" = no ; then
10992                   if test "$cf_add_incdir" = /usr/local/include ; then
10993                         if test "$GCC" = yes
10994                         then
10995                           cf_save_CPPFLAGS=$CPPFLAGS
10996
10997         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10998         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10999
11000                           cat >"conftest.$ac_ext" <<_ACEOF
11001 #line 11001 "configure"
11002 #include "confdefs.h"
11003 #include <stdio.h>
11004 int
11005 main (void)
11006 {
11007 printf("Hello")
11008   ;
11009   return 0;
11010 }
11011 _ACEOF
11012 rm -f "conftest.$ac_objext"
11013 if { (eval echo "$as_me:11013: \"$ac_compile\"") >&5
11014   (eval $ac_compile) 2>&5
11015   ac_status=$?
11016   echo "$as_me:11016: \$? = $ac_status" >&5
11017   (exit "$ac_status"); } &&
11018          { ac_try='test -s "conftest.$ac_objext"'
11019   { (eval echo "$as_me:11019: \"$ac_try\"") >&5
11020   (eval $ac_try) 2>&5
11021   ac_status=$?
11022   echo "$as_me:11022: \$? = $ac_status" >&5
11023   (exit "$ac_status"); }; }; then
11024   :
11025 else
11026   echo "$as_me: failed program was:" >&5
11027 cat "conftest.$ac_ext" >&5
11028 cf_have_incdir=yes
11029 fi
11030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11031                           CPPFLAGS=$cf_save_CPPFLAGS
11032                         fi
11033                   fi
11034                 fi
11035
11036                 if test "$cf_have_incdir" = no ; then
11037                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11038
11039 echo "${as_me:-configure}:11039: testing adding $cf_add_incdir to include-path ..." 1>&5
11040
11041                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11042
11043                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11044                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11045                   cf_add_incdir="$cf_top_incdir"
11046                 else
11047                   break
11048                 fi
11049           else
11050                 break
11051           fi
11052         done
11053   done
11054 fi
11055
11056                 for cf_header in \
11057                         ncurses.h \
11058                         curses.h
11059                 do
11060
11061         cat >"conftest.$ac_ext" <<_ACEOF
11062 #line 11062 "configure"
11063 #include "confdefs.h"
11064
11065 #include <$cf_header>
11066 int
11067 main (void)
11068 {
11069
11070 #ifdef NCURSES_VERSION
11071
11072 printf("%s\\n", NCURSES_VERSION);
11073 #else
11074 #ifdef __NCURSES_H
11075 printf("old\\n");
11076 #else
11077         make an error
11078 #endif
11079 #endif
11080
11081   ;
11082   return 0;
11083 }
11084 _ACEOF
11085 rm -f "conftest.$ac_objext"
11086 if { (eval echo "$as_me:11086: \"$ac_compile\"") >&5
11087   (eval $ac_compile) 2>&5
11088   ac_status=$?
11089   echo "$as_me:11089: \$? = $ac_status" >&5
11090   (exit "$ac_status"); } &&
11091          { ac_try='test -s "conftest.$ac_objext"'
11092   { (eval echo "$as_me:11092: \"$ac_try\"") >&5
11093   (eval $ac_try) 2>&5
11094   ac_status=$?
11095   echo "$as_me:11095: \$? = $ac_status" >&5
11096   (exit "$ac_status"); }; }; then
11097   cf_cv_ncurses_h2=$cf_header
11098
11099 else
11100   echo "$as_me: failed program was:" >&5
11101 cat "conftest.$ac_ext" >&5
11102 cf_cv_ncurses_h2=no
11103 fi
11104 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11105
11106                         if test "$cf_cv_ncurses_h2" != no ; then
11107                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11108                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11109                                 break
11110                         fi
11111                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11112                 done
11113                 CPPFLAGS="$cf_save2_CPPFLAGS"
11114                 test "$cf_cv_ncurses_h2" != no && break
11115         done
11116         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11116: error: not found" >&5
11117 echo "$as_me: error: not found" >&2;}
11118    { (exit 1); exit 1; }; }
11119
11120 fi
11121 echo "$as_me:11121: result: $cf_cv_ncurses_h2" >&5
11122 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11123
11124         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11125         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11126         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11127                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11128         fi
11129
11130 if test -n "$cf_1st_incdir" ; then
11131   for cf_add_incdir in $cf_1st_incdir
11132   do
11133         while test "$cf_add_incdir" != /usr/include
11134         do
11135           if test -d "$cf_add_incdir"
11136           then
11137                 cf_have_incdir=no
11138                 if test -n "$CFLAGS$CPPFLAGS" ; then
11139                   # a loop is needed to ensure we can add subdirs of existing dirs
11140                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11141                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11142                           cf_have_incdir=yes; break
11143                         fi
11144                   done
11145                 fi
11146
11147                 if test "$cf_have_incdir" = no ; then
11148                   if test "$cf_add_incdir" = /usr/local/include ; then
11149                         if test "$GCC" = yes
11150                         then
11151                           cf_save_CPPFLAGS=$CPPFLAGS
11152
11153         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11154         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11155
11156                           cat >"conftest.$ac_ext" <<_ACEOF
11157 #line 11157 "configure"
11158 #include "confdefs.h"
11159 #include <stdio.h>
11160 int
11161 main (void)
11162 {
11163 printf("Hello")
11164   ;
11165   return 0;
11166 }
11167 _ACEOF
11168 rm -f "conftest.$ac_objext"
11169 if { (eval echo "$as_me:11169: \"$ac_compile\"") >&5
11170   (eval $ac_compile) 2>&5
11171   ac_status=$?
11172   echo "$as_me:11172: \$? = $ac_status" >&5
11173   (exit "$ac_status"); } &&
11174          { ac_try='test -s "conftest.$ac_objext"'
11175   { (eval echo "$as_me:11175: \"$ac_try\"") >&5
11176   (eval $ac_try) 2>&5
11177   ac_status=$?
11178   echo "$as_me:11178: \$? = $ac_status" >&5
11179   (exit "$ac_status"); }; }; then
11180   :
11181 else
11182   echo "$as_me: failed program was:" >&5
11183 cat "conftest.$ac_ext" >&5
11184 cf_have_incdir=yes
11185 fi
11186 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11187                           CPPFLAGS=$cf_save_CPPFLAGS
11188                         fi
11189                   fi
11190                 fi
11191
11192                 if test "$cf_have_incdir" = no ; then
11193                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11194
11195 echo "${as_me:-configure}:11195: testing adding $cf_add_incdir to include-path ..." 1>&5
11196
11197                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11198
11199                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11200                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11201                   cf_add_incdir="$cf_top_incdir"
11202                 else
11203                   break
11204                 fi
11205           else
11206                 break
11207           fi
11208         done
11209   done
11210 fi
11211
11212 fi
11213
11214 # Set definitions to allow ifdef'ing for ncurses.h
11215
11216 case "$cf_cv_ncurses_header" in
11217 (*ncurses.h)
11218
11219 cat >>confdefs.h <<\EOF
11220 #define HAVE_NCURSES_H 1
11221 EOF
11222
11223         ;;
11224 esac
11225
11226 case "$cf_cv_ncurses_header" in
11227 (ncurses/curses.h|ncurses/ncurses.h)
11228
11229 cat >>confdefs.h <<\EOF
11230 #define HAVE_NCURSES_NCURSES_H 1
11231 EOF
11232
11233         ;;
11234 (ncursesw/curses.h|ncursesw/ncurses.h)
11235
11236 cat >>confdefs.h <<\EOF
11237 #define HAVE_NCURSESW_NCURSES_H 1
11238 EOF
11239
11240         ;;
11241 esac
11242
11243 echo "$as_me:11243: checking for terminfo header" >&5
11244 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11245 if test "${cf_cv_term_header+set}" = set; then
11246   echo $ECHO_N "(cached) $ECHO_C" >&6
11247 else
11248
11249 case "${cf_cv_ncurses_header}" in
11250 (*/ncurses.h|*/ncursesw.h)
11251         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11252         ;;
11253 (*)
11254         cf_term_header=term.h
11255         ;;
11256 esac
11257
11258 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11259 do
11260 cat >"conftest.$ac_ext" <<_ACEOF
11261 #line 11261 "configure"
11262 #include "confdefs.h"
11263 #include <stdio.h>
11264 #include <${cf_cv_ncurses_header:-curses.h}>
11265 #include <$cf_test>
11266
11267 int
11268 main (void)
11269 {
11270 int x = auto_left_margin; (void)x
11271   ;
11272   return 0;
11273 }
11274 _ACEOF
11275 rm -f "conftest.$ac_objext"
11276 if { (eval echo "$as_me:11276: \"$ac_compile\"") >&5
11277   (eval $ac_compile) 2>&5
11278   ac_status=$?
11279   echo "$as_me:11279: \$? = $ac_status" >&5
11280   (exit "$ac_status"); } &&
11281          { ac_try='test -s "conftest.$ac_objext"'
11282   { (eval echo "$as_me:11282: \"$ac_try\"") >&5
11283   (eval $ac_try) 2>&5
11284   ac_status=$?
11285   echo "$as_me:11285: \$? = $ac_status" >&5
11286   (exit "$ac_status"); }; }; then
11287
11288         cf_cv_term_header="$cf_test"
11289 else
11290   echo "$as_me: failed program was:" >&5
11291 cat "conftest.$ac_ext" >&5
11292
11293         cf_cv_term_header=unknown
11294
11295 fi
11296 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11297         test "$cf_cv_term_header" != unknown && break
11298 done
11299
11300 fi
11301 echo "$as_me:11301: result: $cf_cv_term_header" >&5
11302 echo "${ECHO_T}$cf_cv_term_header" >&6
11303
11304 # Set definitions to allow ifdef'ing to accommodate subdirectories
11305
11306 case "$cf_cv_term_header" in
11307 (*term.h)
11308
11309 cat >>confdefs.h <<\EOF
11310 #define HAVE_TERM_H 1
11311 EOF
11312
11313         ;;
11314 esac
11315
11316 case "$cf_cv_term_header" in
11317 (ncurses/term.h)
11318
11319 cat >>confdefs.h <<\EOF
11320 #define HAVE_NCURSES_TERM_H 1
11321 EOF
11322
11323         ;;
11324 (ncursesw/term.h)
11325
11326 cat >>confdefs.h <<\EOF
11327 #define HAVE_NCURSESW_TERM_H 1
11328 EOF
11329
11330         ;;
11331 esac
11332
11333 # some applications need this, but should check for NCURSES_VERSION
11334
11335 cat >>confdefs.h <<\EOF
11336 #define NCURSES 1
11337 EOF
11338
11339 echo "$as_me:11339: checking for ncurses version" >&5
11340 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11341 if test "${cf_cv_ncurses_version+set}" = set; then
11342   echo $ECHO_N "(cached) $ECHO_C" >&6
11343 else
11344
11345         cf_cv_ncurses_version=no
11346         cf_tempfile=out$$
11347         rm -f "$cf_tempfile"
11348         if test "$cross_compiling" = yes; then
11349
11350         # This will not work if the preprocessor splits the line after the
11351         # Autoconf token.  The 'unproto' program does that.
11352         cat > "conftest.$ac_ext" <<EOF
11353 #include <${cf_cv_ncurses_header:-curses.h}>
11354 #undef Autoconf
11355 #ifdef NCURSES_VERSION
11356 Autoconf NCURSES_VERSION
11357 #else
11358 #ifdef __NCURSES_H
11359 Autoconf "old"
11360 #endif
11361 ;
11362 #endif
11363 EOF
11364         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11365         { (eval echo "$as_me:11365: \"$cf_try\"") >&5
11366   (eval $cf_try) 2>&5
11367   ac_status=$?
11368   echo "$as_me:11368: \$? = $ac_status" >&5
11369   (exit "$ac_status"); }
11370         if test -f conftest.out ; then
11371                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11372                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11373                 rm -f conftest.out
11374         fi
11375
11376 else
11377   cat >"conftest.$ac_ext" <<_ACEOF
11378 #line 11378 "configure"
11379 #include "confdefs.h"
11380
11381 #include <${cf_cv_ncurses_header:-curses.h}>
11382 #include <stdio.h>
11383 int main(void)
11384 {
11385         FILE *fp = fopen("$cf_tempfile", "w");
11386 #ifdef NCURSES_VERSION
11387 # ifdef NCURSES_VERSION_PATCH
11388         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11389 # else
11390         fprintf(fp, "%s\\n", NCURSES_VERSION);
11391 # endif
11392 #else
11393 # ifdef __NCURSES_H
11394         fprintf(fp, "old\\n");
11395 # else
11396         make an error
11397 # endif
11398 #endif
11399         ${cf_cv_main_return:-return}(0);
11400 }
11401 _ACEOF
11402 rm -f "conftest$ac_exeext"
11403 if { (eval echo "$as_me:11403: \"$ac_link\"") >&5
11404   (eval $ac_link) 2>&5
11405   ac_status=$?
11406   echo "$as_me:11406: \$? = $ac_status" >&5
11407   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11408   { (eval echo "$as_me:11408: \"$ac_try\"") >&5
11409   (eval $ac_try) 2>&5
11410   ac_status=$?
11411   echo "$as_me:11411: \$? = $ac_status" >&5
11412   (exit "$ac_status"); }; }; then
11413
11414         cf_cv_ncurses_version=`cat $cf_tempfile`
11415 else
11416   echo "$as_me: program exited with status $ac_status" >&5
11417 echo "$as_me: failed program was:" >&5
11418 cat "conftest.$ac_ext" >&5
11419 fi
11420 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11421 fi
11422         rm -f "$cf_tempfile"
11423
11424 fi
11425 echo "$as_me:11425: result: $cf_cv_ncurses_version" >&5
11426 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11427 test "$cf_cv_ncurses_version" = no ||
11428 cat >>confdefs.h <<\EOF
11429 #define NCURSES 1
11430 EOF
11431
11432 cf_nculib_root=$cf_cv_screen
11433         # This works, except for the special case where we find gpm, but
11434         # ncurses is in a nonstandard location via $LIBS, and we really want
11435         # to link gpm.
11436 cf_ncurses_LIBS=""
11437 cf_ncurses_SAVE="$LIBS"
11438 echo "$as_me:11438: checking for Gpm_Open in -lgpm" >&5
11439 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11440 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11441   echo $ECHO_N "(cached) $ECHO_C" >&6
11442 else
11443   ac_check_lib_save_LIBS=$LIBS
11444 LIBS="-lgpm  $LIBS"
11445 cat >"conftest.$ac_ext" <<_ACEOF
11446 #line 11446 "configure"
11447 #include "confdefs.h"
11448
11449 /* Override any gcc2 internal prototype to avoid an error.  */
11450 #ifdef __cplusplus
11451 extern "C"
11452 #endif
11453 /* We use char because int might match the return type of a gcc2
11454    builtin and then its argument prototype would still apply.  */
11455 char Gpm_Open ();
11456 int
11457 main (void)
11458 {
11459 Gpm_Open ();
11460   ;
11461   return 0;
11462 }
11463 _ACEOF
11464 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11465 if { (eval echo "$as_me:11465: \"$ac_link\"") >&5
11466   (eval $ac_link) 2>&5
11467   ac_status=$?
11468   echo "$as_me:11468: \$? = $ac_status" >&5
11469   (exit "$ac_status"); } &&
11470          { ac_try='test -s "conftest$ac_exeext"'
11471   { (eval echo "$as_me:11471: \"$ac_try\"") >&5
11472   (eval $ac_try) 2>&5
11473   ac_status=$?
11474   echo "$as_me:11474: \$? = $ac_status" >&5
11475   (exit "$ac_status"); }; }; then
11476   ac_cv_lib_gpm_Gpm_Open=yes
11477 else
11478   echo "$as_me: failed program was:" >&5
11479 cat "conftest.$ac_ext" >&5
11480 ac_cv_lib_gpm_Gpm_Open=no
11481 fi
11482 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11483 LIBS=$ac_check_lib_save_LIBS
11484 fi
11485 echo "$as_me:11485: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11486 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11487 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11488   echo "$as_me:11488: checking for initscr in -lgpm" >&5
11489 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11490 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11491   echo $ECHO_N "(cached) $ECHO_C" >&6
11492 else
11493   ac_check_lib_save_LIBS=$LIBS
11494 LIBS="-lgpm  $LIBS"
11495 cat >"conftest.$ac_ext" <<_ACEOF
11496 #line 11496 "configure"
11497 #include "confdefs.h"
11498
11499 /* Override any gcc2 internal prototype to avoid an error.  */
11500 #ifdef __cplusplus
11501 extern "C"
11502 #endif
11503 /* We use char because int might match the return type of a gcc2
11504    builtin and then its argument prototype would still apply.  */
11505 char initscr ();
11506 int
11507 main (void)
11508 {
11509 initscr ();
11510   ;
11511   return 0;
11512 }
11513 _ACEOF
11514 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11515 if { (eval echo "$as_me:11515: \"$ac_link\"") >&5
11516   (eval $ac_link) 2>&5
11517   ac_status=$?
11518   echo "$as_me:11518: \$? = $ac_status" >&5
11519   (exit "$ac_status"); } &&
11520          { ac_try='test -s "conftest$ac_exeext"'
11521   { (eval echo "$as_me:11521: \"$ac_try\"") >&5
11522   (eval $ac_try) 2>&5
11523   ac_status=$?
11524   echo "$as_me:11524: \$? = $ac_status" >&5
11525   (exit "$ac_status"); }; }; then
11526   ac_cv_lib_gpm_initscr=yes
11527 else
11528   echo "$as_me: failed program was:" >&5
11529 cat "conftest.$ac_ext" >&5
11530 ac_cv_lib_gpm_initscr=no
11531 fi
11532 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11533 LIBS=$ac_check_lib_save_LIBS
11534 fi
11535 echo "$as_me:11535: result: $ac_cv_lib_gpm_initscr" >&5
11536 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11537 if test "$ac_cv_lib_gpm_initscr" = yes; then
11538   LIBS="$cf_ncurses_SAVE"
11539 else
11540   cf_ncurses_LIBS="-lgpm"
11541 fi
11542
11543 fi
11544
11545 case "$host_os" in
11546 (freebsd*)
11547         # This is only necessary if you are linking against an obsolete
11548         # version of ncurses (but it should do no harm, since it's static).
11549         if test "$cf_nculib_root" = ncurses ; then
11550                 echo "$as_me:11550: checking for tgoto in -lmytinfo" >&5
11551 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11552 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11553   echo $ECHO_N "(cached) $ECHO_C" >&6
11554 else
11555   ac_check_lib_save_LIBS=$LIBS
11556 LIBS="-lmytinfo  $LIBS"
11557 cat >"conftest.$ac_ext" <<_ACEOF
11558 #line 11558 "configure"
11559 #include "confdefs.h"
11560
11561 /* Override any gcc2 internal prototype to avoid an error.  */
11562 #ifdef __cplusplus
11563 extern "C"
11564 #endif
11565 /* We use char because int might match the return type of a gcc2
11566    builtin and then its argument prototype would still apply.  */
11567 char tgoto ();
11568 int
11569 main (void)
11570 {
11571 tgoto ();
11572   ;
11573   return 0;
11574 }
11575 _ACEOF
11576 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11577 if { (eval echo "$as_me:11577: \"$ac_link\"") >&5
11578   (eval $ac_link) 2>&5
11579   ac_status=$?
11580   echo "$as_me:11580: \$? = $ac_status" >&5
11581   (exit "$ac_status"); } &&
11582          { ac_try='test -s "conftest$ac_exeext"'
11583   { (eval echo "$as_me:11583: \"$ac_try\"") >&5
11584   (eval $ac_try) 2>&5
11585   ac_status=$?
11586   echo "$as_me:11586: \$? = $ac_status" >&5
11587   (exit "$ac_status"); }; }; then
11588   ac_cv_lib_mytinfo_tgoto=yes
11589 else
11590   echo "$as_me: failed program was:" >&5
11591 cat "conftest.$ac_ext" >&5
11592 ac_cv_lib_mytinfo_tgoto=no
11593 fi
11594 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11595 LIBS=$ac_check_lib_save_LIBS
11596 fi
11597 echo "$as_me:11597: result: $ac_cv_lib_mytinfo_tgoto" >&5
11598 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11599 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11600   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11601 fi
11602
11603         fi
11604         ;;
11605 esac
11606
11607 cf_add_libs="$LIBS"
11608 # reverse order
11609 cf_add_0lib=
11610 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11611 # filter duplicates
11612 for cf_add_1lib in $cf_add_0lib; do
11613         for cf_add_2lib in $cf_add_libs; do
11614                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11615                         cf_add_1lib=
11616                         break
11617                 fi
11618         done
11619         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11620 done
11621 LIBS="$cf_add_libs"
11622
11623 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11624 then
11625
11626 cf_add_libs="$LIBS"
11627 # reverse order
11628 cf_add_0lib=
11629 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11630 # filter duplicates
11631 for cf_add_1lib in $cf_add_0lib; do
11632         for cf_add_2lib in $cf_add_libs; do
11633                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11634                         cf_add_1lib=
11635                         break
11636                 fi
11637         done
11638         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11639 done
11640 LIBS="$cf_add_libs"
11641
11642 else
11643
11644         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11645         cf_libdir=""
11646         echo "$as_me:11646: checking for initscr" >&5
11647 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11648 if test "${ac_cv_func_initscr+set}" = set; then
11649   echo $ECHO_N "(cached) $ECHO_C" >&6
11650 else
11651   cat >"conftest.$ac_ext" <<_ACEOF
11652 #line 11652 "configure"
11653 #include "confdefs.h"
11654 #define initscr autoconf_temporary
11655 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11656 #undef initscr
11657
11658 #ifdef __cplusplus
11659 extern "C"
11660 #endif
11661
11662 /* We use char because int might match the return type of a gcc2
11663    builtin and then its argument prototype would still apply.  */
11664 char initscr (void);
11665
11666 int
11667 main (void)
11668 {
11669
11670 /* The GNU C library defines stubs for functions which it implements
11671     to always fail with ENOSYS.  Some functions are actually named
11672     something starting with __ and the normal name is an alias.  */
11673 #if defined (__stub_initscr) || defined (__stub___initscr)
11674 #error found stub for initscr
11675 #endif
11676
11677         return initscr ();
11678   ;
11679   return 0;
11680 }
11681 _ACEOF
11682 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11683 if { (eval echo "$as_me:11683: \"$ac_link\"") >&5
11684   (eval $ac_link) 2>&5
11685   ac_status=$?
11686   echo "$as_me:11686: \$? = $ac_status" >&5
11687   (exit "$ac_status"); } &&
11688          { ac_try='test -s "conftest$ac_exeext"'
11689   { (eval echo "$as_me:11689: \"$ac_try\"") >&5
11690   (eval $ac_try) 2>&5
11691   ac_status=$?
11692   echo "$as_me:11692: \$? = $ac_status" >&5
11693   (exit "$ac_status"); }; }; then
11694   ac_cv_func_initscr=yes
11695 else
11696   echo "$as_me: failed program was:" >&5
11697 cat "conftest.$ac_ext" >&5
11698 ac_cv_func_initscr=no
11699 fi
11700 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11701 fi
11702 echo "$as_me:11702: result: $ac_cv_func_initscr" >&5
11703 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11704 if test "$ac_cv_func_initscr" = yes; then
11705   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11706 else
11707
11708                 cf_save_LIBS="$LIBS"
11709                 echo "$as_me:11709: checking for initscr in -l$cf_nculib_root" >&5
11710 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11711                 LIBS="-l$cf_nculib_root $LIBS"
11712                 cat >"conftest.$ac_ext" <<_ACEOF
11713 #line 11713 "configure"
11714 #include "confdefs.h"
11715 #include <${cf_cv_ncurses_header:-curses.h}>
11716 int
11717 main (void)
11718 {
11719 initscr()
11720   ;
11721   return 0;
11722 }
11723 _ACEOF
11724 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11725 if { (eval echo "$as_me:11725: \"$ac_link\"") >&5
11726   (eval $ac_link) 2>&5
11727   ac_status=$?
11728   echo "$as_me:11728: \$? = $ac_status" >&5
11729   (exit "$ac_status"); } &&
11730          { ac_try='test -s "conftest$ac_exeext"'
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   echo "$as_me:11736: result: yes" >&5
11737 echo "${ECHO_T}yes" >&6
11738                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11739
11740 else
11741   echo "$as_me: failed program was:" >&5
11742 cat "conftest.$ac_ext" >&5
11743 echo "$as_me:11743: result: no" >&5
11744 echo "${ECHO_T}no" >&6
11745
11746 cf_search=
11747 cf_library_path_list=""
11748 if test -n "${LDFLAGS}${LIBS}" ; then
11749         for cf_library_path in $LDFLAGS $LIBS
11750         do
11751                 case "$cf_library_path" in
11752                 (-L*)
11753                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11754
11755 test "x$cf_library_path" != "xNONE" && \
11756 test -d "$cf_library_path" && \
11757  {
11758         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11759         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11760         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11761         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11762         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11763         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"
11764 }
11765
11766                         cf_library_path_list="$cf_library_path_list $cf_search"
11767                         ;;
11768                 esac
11769         done
11770 fi
11771
11772 cf_search=
11773
11774 test "x$prefix" != "xNONE" && \
11775 test -d "$prefix" && \
11776  {
11777         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11778         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11779         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11780         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11781         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11782         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11783 }
11784
11785 for cf_subdir_prefix in \
11786         /usr \
11787         /usr/local \
11788         /usr/pkg \
11789         /opt \
11790         /opt/local \
11791         $HOME
11792 do
11793
11794 test "x$cf_subdir_prefix" != "x$prefix" && \
11795 test -d "$cf_subdir_prefix" && \
11796 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11797         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11798         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11799         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11800         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11801         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11802         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"
11803 }
11804
11805 done
11806
11807 cf_search="$cf_library_path_list $cf_search"
11808
11809                         for cf_libdir in $cf_search
11810                         do
11811                                 echo "$as_me:11811: checking for -l$cf_nculib_root in $cf_libdir" >&5
11812 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11813                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11814                                 cat >"conftest.$ac_ext" <<_ACEOF
11815 #line 11815 "configure"
11816 #include "confdefs.h"
11817 #include <${cf_cv_ncurses_header:-curses.h}>
11818 int
11819 main (void)
11820 {
11821 initscr()
11822   ;
11823   return 0;
11824 }
11825 _ACEOF
11826 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11827 if { (eval echo "$as_me:11827: \"$ac_link\"") >&5
11828   (eval $ac_link) 2>&5
11829   ac_status=$?
11830   echo "$as_me:11830: \$? = $ac_status" >&5
11831   (exit "$ac_status"); } &&
11832          { ac_try='test -s "conftest$ac_exeext"'
11833   { (eval echo "$as_me:11833: \"$ac_try\"") >&5
11834   (eval $ac_try) 2>&5
11835   ac_status=$?
11836   echo "$as_me:11836: \$? = $ac_status" >&5
11837   (exit "$ac_status"); }; }; then
11838   echo "$as_me:11838: result: yes" >&5
11839 echo "${ECHO_T}yes" >&6
11840                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11841                                          break
11842 else
11843   echo "$as_me: failed program was:" >&5
11844 cat "conftest.$ac_ext" >&5
11845 echo "$as_me:11845: result: no" >&5
11846 echo "${ECHO_T}no" >&6
11847                                          LIBS="$cf_save_LIBS"
11848 fi
11849 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11850                         done
11851
11852 fi
11853 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11854
11855 fi
11856
11857 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11858
11859 if test "$cf_found_library" = no ; then
11860         { { echo "$as_me:11860: error: Cannot link $cf_nculib_root library" >&5
11861 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11862    { (exit 1); exit 1; }; }
11863 fi
11864
11865 fi
11866
11867 if test -n "$cf_ncurses_LIBS" ; then
11868         echo "$as_me:11868: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11869 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11870         cf_ncurses_SAVE="$LIBS"
11871         for p in $cf_ncurses_LIBS ; do
11872                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11873                 if test "$q" != "$LIBS" ; then
11874                         LIBS="$q"
11875                 fi
11876         done
11877         cat >"conftest.$ac_ext" <<_ACEOF
11878 #line 11878 "configure"
11879 #include "confdefs.h"
11880 #include <${cf_cv_ncurses_header:-curses.h}>
11881 int
11882 main (void)
11883 {
11884 initscr(); mousemask(0,0); tigetstr((char *)0);
11885   ;
11886   return 0;
11887 }
11888 _ACEOF
11889 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11890 if { (eval echo "$as_me:11890: \"$ac_link\"") >&5
11891   (eval $ac_link) 2>&5
11892   ac_status=$?
11893   echo "$as_me:11893: \$? = $ac_status" >&5
11894   (exit "$ac_status"); } &&
11895          { ac_try='test -s "conftest$ac_exeext"'
11896   { (eval echo "$as_me:11896: \"$ac_try\"") >&5
11897   (eval $ac_try) 2>&5
11898   ac_status=$?
11899   echo "$as_me:11899: \$? = $ac_status" >&5
11900   (exit "$ac_status"); }; }; then
11901   echo "$as_me:11901: result: yes" >&5
11902 echo "${ECHO_T}yes" >&6
11903 else
11904   echo "$as_me: failed program was:" >&5
11905 cat "conftest.$ac_ext" >&5
11906 echo "$as_me:11906: result: no" >&5
11907 echo "${ECHO_T}no" >&6
11908                  LIBS="$cf_ncurses_SAVE"
11909 fi
11910 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11911 fi
11912
11913 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11914
11915 cat >>confdefs.h <<EOF
11916 #define $cf_nculib_ROOT 1
11917 EOF
11918
11919         fi
11920 else
11921         NCURSES_CONFIG=none
11922 fi
11923
11924         ;;
11925 (pdcurses)
11926         echo "$as_me:11926: checking for X" >&5
11927 echo $ECHO_N "checking for X... $ECHO_C" >&6
11928
11929 # Check whether --with-x or --without-x was given.
11930 if test "${with_x+set}" = set; then
11931   withval="$with_x"
11932
11933 fi;
11934 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11935 if test "x$with_x" = xno; then
11936   # The user explicitly disabled X.
11937   have_x=disabled
11938 else
11939   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11940     # Both variables are already set.
11941     have_x=yes
11942   else
11943     if test "${ac_cv_have_x+set}" = set; then
11944   echo $ECHO_N "(cached) $ECHO_C" >&6
11945 else
11946   # One or both of the vars are not set, and there is no cached value.
11947 ac_x_includes=no ac_x_libraries=no
11948 rm -fr conftest.dir
11949 if mkdir conftest.dir; then
11950   cd conftest.dir
11951   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11952   cat >Imakefile <<'EOF'
11953 acfindx:
11954         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11955 EOF
11956   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11957     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11958     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
11959     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11960     for ac_extension in a so sl dylib dll; do
11961       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
11962          test -f "$ac_im_libdir/libX11.$ac_extension"; then
11963         ac_im_usrlibdir=$ac_im_libdir; break
11964       fi
11965     done
11966     # Screen out bogus values from the imake configuration.  They are
11967     # bogus both because they are the default anyway, and because
11968     # using them would break gcc on systems where it needs fixed includes.
11969     case $ac_im_incroot in
11970         /usr/include) ;;
11971         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11972     esac
11973     case $ac_im_usrlibdir in
11974         /usr/lib | /lib) ;;
11975         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11976     esac
11977   fi
11978   cd ..
11979   rm -fr conftest.dir
11980 fi
11981
11982 # Standard set of common directories for X headers.
11983 # Check X11 before X11Rn because it is often a symlink to the current release.
11984 ac_x_header_dirs='
11985 /usr/X11/include
11986 /usr/X11R7/include
11987 /usr/X11R6/include
11988 /usr/X11R5/include
11989 /usr/X11R4/include
11990
11991 /opt/local/include
11992 /opt/X11/include
11993
11994 /usr/include/X11
11995 /usr/include/X11R7
11996 /usr/include/X11R6
11997 /usr/include/X11R5
11998 /usr/include/X11R4
11999
12000 /usr/local/X11/include
12001 /usr/local/X11R7/include
12002 /usr/local/X11R6/include
12003 /usr/local/X11R5/include
12004 /usr/local/X11R4/include
12005
12006 /usr/local/include/X11
12007 /usr/local/include/X11R7
12008 /usr/local/include/X11R6
12009 /usr/local/include/X11R5
12010 /usr/local/include/X11R4
12011
12012 /usr/X386/include
12013 /usr/x386/include
12014 /usr/XFree86/include/X11
12015
12016 /usr/include
12017 /usr/local/include
12018 /usr/unsupported/include
12019 /usr/athena/include
12020 /usr/local/x11r5/include
12021 /usr/lpp/Xamples/include
12022
12023 /usr/openwin/include
12024 /usr/openwin/share/include'
12025
12026 if test "$ac_x_includes" = no; then
12027   # Guess where to find include files, by looking for Intrinsic.h.
12028   # First, try using that file with no special directory specified.
12029   cat >"conftest.$ac_ext" <<_ACEOF
12030 #line 12030 "configure"
12031 #include "confdefs.h"
12032 #include <X11/Intrinsic.h>
12033 _ACEOF
12034 if { (eval echo "$as_me:12034: \"$ac_cpp "conftest.$ac_ext"\"") >&5
12035   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
12036   ac_status=$?
12037   $EGREP -v '^ *\+' conftest.er1 >conftest.err
12038   rm -f conftest.er1
12039   cat conftest.err >&5
12040   echo "$as_me:12040: \$? = $ac_status" >&5
12041   (exit "$ac_status"); } >/dev/null; then
12042   if test -s conftest.err; then
12043     ac_cpp_err=$ac_c_preproc_warn_flag
12044   else
12045     ac_cpp_err=
12046   fi
12047 else
12048   ac_cpp_err=yes
12049 fi
12050 if test -z "$ac_cpp_err"; then
12051   # We can compile using X headers with no special include directory.
12052 ac_x_includes=
12053 else
12054   echo "$as_me: failed program was:" >&5
12055   cat "conftest.$ac_ext" >&5
12056   for ac_dir in $ac_x_header_dirs; do
12057   if test -r "$ac_dir/X11/Intrinsic.h"; then
12058     ac_x_includes=$ac_dir
12059     break
12060   fi
12061 done
12062 fi
12063 rm -f conftest.err "conftest.$ac_ext"
12064 fi # $ac_x_includes = no
12065
12066 if test "$ac_x_libraries" = no; then
12067   # Check for the libraries.
12068   # See if we find them without any special options.
12069   # Don't add to $LIBS permanently.
12070   ac_save_LIBS=$LIBS
12071   LIBS="-lXt $LIBS"
12072   cat >"conftest.$ac_ext" <<_ACEOF
12073 #line 12073 "configure"
12074 #include "confdefs.h"
12075 #include <X11/Intrinsic.h>
12076 int
12077 main (void)
12078 {
12079 XtMalloc (0)
12080   ;
12081   return 0;
12082 }
12083 _ACEOF
12084 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12085 if { (eval echo "$as_me:12085: \"$ac_link\"") >&5
12086   (eval $ac_link) 2>&5
12087   ac_status=$?
12088   echo "$as_me:12088: \$? = $ac_status" >&5
12089   (exit "$ac_status"); } &&
12090          { ac_try='test -s "conftest$ac_exeext"'
12091   { (eval echo "$as_me:12091: \"$ac_try\"") >&5
12092   (eval $ac_try) 2>&5
12093   ac_status=$?
12094   echo "$as_me:12094: \$? = $ac_status" >&5
12095   (exit "$ac_status"); }; }; then
12096   LIBS=$ac_save_LIBS
12097 # We can link X programs with no special library path.
12098 ac_x_libraries=
12099 else
12100   echo "$as_me: failed program was:" >&5
12101 cat "conftest.$ac_ext" >&5
12102 LIBS=$ac_save_LIBS
12103 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
12104 do
12105   # Don't even attempt the hair of trying to link an X program!
12106   for ac_extension in a so sl dylib dll; do
12107     if test -r "$ac_dir/libXt.$ac_extension"; then
12108       ac_x_libraries=$ac_dir
12109       break 2
12110     fi
12111   done
12112 done
12113 fi
12114 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12115 fi # $ac_x_libraries = no
12116
12117 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
12118   # Didn't find X anywhere.  Cache the known absence of X.
12119   ac_cv_have_x="have_x=no"
12120 else
12121   # Record where we found X for the cache.
12122   ac_cv_have_x="have_x=yes \
12123                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
12124 fi
12125 fi
12126
12127   fi
12128   eval "$ac_cv_have_x"
12129 fi # $with_x != no
12130
12131 if test "$have_x" != yes; then
12132   echo "$as_me:12132: result: $have_x" >&5
12133 echo "${ECHO_T}$have_x" >&6
12134   no_x=yes
12135 else
12136   # If each of the values was on the command line, it overrides each guess.
12137   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
12138   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
12139   # Update the cache value to reflect the command line values.
12140   ac_cv_have_x="have_x=yes \
12141                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
12142   echo "$as_me:12142: result: libraries $x_libraries, headers $x_includes" >&5
12143 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
12144 fi
12145
12146 if test "$no_x" = yes; then
12147   # Not all programs may use this symbol, but it does not hurt to define it.
12148
12149 cat >>confdefs.h <<\EOF
12150 #define X_DISPLAY_MISSING 1
12151 EOF
12152
12153   X_CFLAGS=
12154   X_PRE_LIBS=
12155   X_LIBS=
12156   X_EXTRA_LIBS=
12157 else
12158   if test -n "$x_includes"; then
12159     X_CFLAGS="$X_CFLAGS -I$x_includes"
12160   fi
12161
12162   # It would also be nice to do this for all -L options, not just this one.
12163   if test -n "$x_libraries"; then
12164     X_LIBS="$X_LIBS -L$x_libraries"
12165     # For Solaris; some versions of Sun CC require a space after -R and
12166     # others require no space.  Words are not sufficient . . . .
12167     case `(uname -sr) 2>/dev/null` in
12168     "SunOS 5"*)
12169       echo "$as_me:12169: checking whether -R must be followed by a space" >&5
12170 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
12171       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
12172       cat >"conftest.$ac_ext" <<_ACEOF
12173 #line 12173 "configure"
12174 #include "confdefs.h"
12175
12176 int
12177 main (void)
12178 {
12179
12180   ;
12181   return 0;
12182 }
12183 _ACEOF
12184 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12185 if { (eval echo "$as_me:12185: \"$ac_link\"") >&5
12186   (eval $ac_link) 2>&5
12187   ac_status=$?
12188   echo "$as_me:12188: \$? = $ac_status" >&5
12189   (exit "$ac_status"); } &&
12190          { ac_try='test -s "conftest$ac_exeext"'
12191   { (eval echo "$as_me:12191: \"$ac_try\"") >&5
12192   (eval $ac_try) 2>&5
12193   ac_status=$?
12194   echo "$as_me:12194: \$? = $ac_status" >&5
12195   (exit "$ac_status"); }; }; then
12196   ac_R_nospace=yes
12197 else
12198   echo "$as_me: failed program was:" >&5
12199 cat "conftest.$ac_ext" >&5
12200 ac_R_nospace=no
12201 fi
12202 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12203       if test $ac_R_nospace = yes; then
12204         echo "$as_me:12204: result: no" >&5
12205 echo "${ECHO_T}no" >&6
12206         X_LIBS="$X_LIBS -R$x_libraries"
12207       else
12208         LIBS="$ac_xsave_LIBS -R $x_libraries"
12209         cat >"conftest.$ac_ext" <<_ACEOF
12210 #line 12210 "configure"
12211 #include "confdefs.h"
12212
12213 int
12214 main (void)
12215 {
12216
12217   ;
12218   return 0;
12219 }
12220 _ACEOF
12221 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12222 if { (eval echo "$as_me:12222: \"$ac_link\"") >&5
12223   (eval $ac_link) 2>&5
12224   ac_status=$?
12225   echo "$as_me:12225: \$? = $ac_status" >&5
12226   (exit "$ac_status"); } &&
12227          { ac_try='test -s "conftest$ac_exeext"'
12228   { (eval echo "$as_me:12228: \"$ac_try\"") >&5
12229   (eval $ac_try) 2>&5
12230   ac_status=$?
12231   echo "$as_me:12231: \$? = $ac_status" >&5
12232   (exit "$ac_status"); }; }; then
12233   ac_R_space=yes
12234 else
12235   echo "$as_me: failed program was:" >&5
12236 cat "conftest.$ac_ext" >&5
12237 ac_R_space=no
12238 fi
12239 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12240         if test $ac_R_space = yes; then
12241           echo "$as_me:12241: result: yes" >&5
12242 echo "${ECHO_T}yes" >&6
12243           X_LIBS="$X_LIBS -R $x_libraries"
12244         else
12245           echo "$as_me:12245: result: neither works" >&5
12246 echo "${ECHO_T}neither works" >&6
12247         fi
12248       fi
12249       LIBS=$ac_xsave_LIBS
12250     esac
12251   fi
12252
12253   # Check for system-dependent libraries X programs must link with.
12254   # Do this before checking for the system-independent R6 libraries
12255   # (-lICE), since we may need -lsocket or whatever for X linking.
12256
12257   if test "$ISC" = yes; then
12258     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
12259   else
12260     # Martyn Johnson says this is needed for Ultrix, if the X
12261     # libraries were built with DECnet support.  And Karl Berry says
12262     # the Alpha needs dnet_stub (dnet does not exist).
12263     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
12264     cat >"conftest.$ac_ext" <<_ACEOF
12265 #line 12265 "configure"
12266 #include "confdefs.h"
12267
12268 /* Override any gcc2 internal prototype to avoid an error.  */
12269 #ifdef __cplusplus
12270 extern "C"
12271 #endif
12272 /* We use char because int might match the return type of a gcc2
12273    builtin and then its argument prototype would still apply.  */
12274 char XOpenDisplay ();
12275 int
12276 main (void)
12277 {
12278 XOpenDisplay ();
12279   ;
12280   return 0;
12281 }
12282 _ACEOF
12283 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12284 if { (eval echo "$as_me:12284: \"$ac_link\"") >&5
12285   (eval $ac_link) 2>&5
12286   ac_status=$?
12287   echo "$as_me:12287: \$? = $ac_status" >&5
12288   (exit "$ac_status"); } &&
12289          { ac_try='test -s "conftest$ac_exeext"'
12290   { (eval echo "$as_me:12290: \"$ac_try\"") >&5
12291   (eval $ac_try) 2>&5
12292   ac_status=$?
12293   echo "$as_me:12293: \$? = $ac_status" >&5
12294   (exit "$ac_status"); }; }; then
12295   :
12296 else
12297   echo "$as_me: failed program was:" >&5
12298 cat "conftest.$ac_ext" >&5
12299 echo "$as_me:12299: checking for dnet_ntoa in -ldnet" >&5
12300 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12301 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12302   echo $ECHO_N "(cached) $ECHO_C" >&6
12303 else
12304   ac_check_lib_save_LIBS=$LIBS
12305 LIBS="-ldnet  $LIBS"
12306 cat >"conftest.$ac_ext" <<_ACEOF
12307 #line 12307 "configure"
12308 #include "confdefs.h"
12309
12310 /* Override any gcc2 internal prototype to avoid an error.  */
12311 #ifdef __cplusplus
12312 extern "C"
12313 #endif
12314 /* We use char because int might match the return type of a gcc2
12315    builtin and then its argument prototype would still apply.  */
12316 char dnet_ntoa ();
12317 int
12318 main (void)
12319 {
12320 dnet_ntoa ();
12321   ;
12322   return 0;
12323 }
12324 _ACEOF
12325 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12326 if { (eval echo "$as_me:12326: \"$ac_link\"") >&5
12327   (eval $ac_link) 2>&5
12328   ac_status=$?
12329   echo "$as_me:12329: \$? = $ac_status" >&5
12330   (exit "$ac_status"); } &&
12331          { ac_try='test -s "conftest$ac_exeext"'
12332   { (eval echo "$as_me:12332: \"$ac_try\"") >&5
12333   (eval $ac_try) 2>&5
12334   ac_status=$?
12335   echo "$as_me:12335: \$? = $ac_status" >&5
12336   (exit "$ac_status"); }; }; then
12337   ac_cv_lib_dnet_dnet_ntoa=yes
12338 else
12339   echo "$as_me: failed program was:" >&5
12340 cat "conftest.$ac_ext" >&5
12341 ac_cv_lib_dnet_dnet_ntoa=no
12342 fi
12343 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12344 LIBS=$ac_check_lib_save_LIBS
12345 fi
12346 echo "$as_me:12346: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12347 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12348 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
12349   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12350 fi
12351
12352     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12353       echo "$as_me:12353: checking for dnet_ntoa in -ldnet_stub" >&5
12354 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12355 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12356   echo $ECHO_N "(cached) $ECHO_C" >&6
12357 else
12358   ac_check_lib_save_LIBS=$LIBS
12359 LIBS="-ldnet_stub  $LIBS"
12360 cat >"conftest.$ac_ext" <<_ACEOF
12361 #line 12361 "configure"
12362 #include "confdefs.h"
12363
12364 /* Override any gcc2 internal prototype to avoid an error.  */
12365 #ifdef __cplusplus
12366 extern "C"
12367 #endif
12368 /* We use char because int might match the return type of a gcc2
12369    builtin and then its argument prototype would still apply.  */
12370 char dnet_ntoa ();
12371 int
12372 main (void)
12373 {
12374 dnet_ntoa ();
12375   ;
12376   return 0;
12377 }
12378 _ACEOF
12379 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12380 if { (eval echo "$as_me:12380: \"$ac_link\"") >&5
12381   (eval $ac_link) 2>&5
12382   ac_status=$?
12383   echo "$as_me:12383: \$? = $ac_status" >&5
12384   (exit "$ac_status"); } &&
12385          { ac_try='test -s "conftest$ac_exeext"'
12386   { (eval echo "$as_me:12386: \"$ac_try\"") >&5
12387   (eval $ac_try) 2>&5
12388   ac_status=$?
12389   echo "$as_me:12389: \$? = $ac_status" >&5
12390   (exit "$ac_status"); }; }; then
12391   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12392 else
12393   echo "$as_me: failed program was:" >&5
12394 cat "conftest.$ac_ext" >&5
12395 ac_cv_lib_dnet_stub_dnet_ntoa=no
12396 fi
12397 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12398 LIBS=$ac_check_lib_save_LIBS
12399 fi
12400 echo "$as_me:12400: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12401 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12402 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
12403   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12404 fi
12405
12406     fi
12407 fi
12408 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12409     LIBS="$ac_xsave_LIBS"
12410
12411     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12412     # to get the SysV transport functions.
12413     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12414     # needs -lnsl.
12415     # The nsl library prevents programs from opening the X display
12416     # on Irix 5.2, according to T.E. Dickey.
12417     # The functions gethostbyname, getservbyname, and inet_addr are
12418     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12419     echo "$as_me:12419: checking for gethostbyname" >&5
12420 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12421 if test "${ac_cv_func_gethostbyname+set}" = set; then
12422   echo $ECHO_N "(cached) $ECHO_C" >&6
12423 else
12424   cat >"conftest.$ac_ext" <<_ACEOF
12425 #line 12425 "configure"
12426 #include "confdefs.h"
12427 #define gethostbyname autoconf_temporary
12428 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12429 #undef gethostbyname
12430
12431 #ifdef __cplusplus
12432 extern "C"
12433 #endif
12434
12435 /* We use char because int might match the return type of a gcc2
12436    builtin and then its argument prototype would still apply.  */
12437 char gethostbyname (void);
12438
12439 int
12440 main (void)
12441 {
12442
12443 /* The GNU C library defines stubs for functions which it implements
12444     to always fail with ENOSYS.  Some functions are actually named
12445     something starting with __ and the normal name is an alias.  */
12446 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12447 #error found stub for gethostbyname
12448 #endif
12449
12450         return gethostbyname ();
12451   ;
12452   return 0;
12453 }
12454 _ACEOF
12455 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12456 if { (eval echo "$as_me:12456: \"$ac_link\"") >&5
12457   (eval $ac_link) 2>&5
12458   ac_status=$?
12459   echo "$as_me:12459: \$? = $ac_status" >&5
12460   (exit "$ac_status"); } &&
12461          { ac_try='test -s "conftest$ac_exeext"'
12462   { (eval echo "$as_me:12462: \"$ac_try\"") >&5
12463   (eval $ac_try) 2>&5
12464   ac_status=$?
12465   echo "$as_me:12465: \$? = $ac_status" >&5
12466   (exit "$ac_status"); }; }; then
12467   ac_cv_func_gethostbyname=yes
12468 else
12469   echo "$as_me: failed program was:" >&5
12470 cat "conftest.$ac_ext" >&5
12471 ac_cv_func_gethostbyname=no
12472 fi
12473 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12474 fi
12475 echo "$as_me:12475: result: $ac_cv_func_gethostbyname" >&5
12476 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12477
12478     if test $ac_cv_func_gethostbyname = no; then
12479       echo "$as_me:12479: checking for gethostbyname in -lnsl" >&5
12480 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12481 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12482   echo $ECHO_N "(cached) $ECHO_C" >&6
12483 else
12484   ac_check_lib_save_LIBS=$LIBS
12485 LIBS="-lnsl  $LIBS"
12486 cat >"conftest.$ac_ext" <<_ACEOF
12487 #line 12487 "configure"
12488 #include "confdefs.h"
12489
12490 /* Override any gcc2 internal prototype to avoid an error.  */
12491 #ifdef __cplusplus
12492 extern "C"
12493 #endif
12494 /* We use char because int might match the return type of a gcc2
12495    builtin and then its argument prototype would still apply.  */
12496 char gethostbyname ();
12497 int
12498 main (void)
12499 {
12500 gethostbyname ();
12501   ;
12502   return 0;
12503 }
12504 _ACEOF
12505 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12506 if { (eval echo "$as_me:12506: \"$ac_link\"") >&5
12507   (eval $ac_link) 2>&5
12508   ac_status=$?
12509   echo "$as_me:12509: \$? = $ac_status" >&5
12510   (exit "$ac_status"); } &&
12511          { ac_try='test -s "conftest$ac_exeext"'
12512   { (eval echo "$as_me:12512: \"$ac_try\"") >&5
12513   (eval $ac_try) 2>&5
12514   ac_status=$?
12515   echo "$as_me:12515: \$? = $ac_status" >&5
12516   (exit "$ac_status"); }; }; then
12517   ac_cv_lib_nsl_gethostbyname=yes
12518 else
12519   echo "$as_me: failed program was:" >&5
12520 cat "conftest.$ac_ext" >&5
12521 ac_cv_lib_nsl_gethostbyname=no
12522 fi
12523 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12524 LIBS=$ac_check_lib_save_LIBS
12525 fi
12526 echo "$as_me:12526: result: $ac_cv_lib_nsl_gethostbyname" >&5
12527 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12528 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
12529   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12530 fi
12531
12532       if test $ac_cv_lib_nsl_gethostbyname = no; then
12533         echo "$as_me:12533: checking for gethostbyname in -lbsd" >&5
12534 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12535 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12536   echo $ECHO_N "(cached) $ECHO_C" >&6
12537 else
12538   ac_check_lib_save_LIBS=$LIBS
12539 LIBS="-lbsd  $LIBS"
12540 cat >"conftest.$ac_ext" <<_ACEOF
12541 #line 12541 "configure"
12542 #include "confdefs.h"
12543
12544 /* Override any gcc2 internal prototype to avoid an error.  */
12545 #ifdef __cplusplus
12546 extern "C"
12547 #endif
12548 /* We use char because int might match the return type of a gcc2
12549    builtin and then its argument prototype would still apply.  */
12550 char gethostbyname ();
12551 int
12552 main (void)
12553 {
12554 gethostbyname ();
12555   ;
12556   return 0;
12557 }
12558 _ACEOF
12559 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12560 if { (eval echo "$as_me:12560: \"$ac_link\"") >&5
12561   (eval $ac_link) 2>&5
12562   ac_status=$?
12563   echo "$as_me:12563: \$? = $ac_status" >&5
12564   (exit "$ac_status"); } &&
12565          { ac_try='test -s "conftest$ac_exeext"'
12566   { (eval echo "$as_me:12566: \"$ac_try\"") >&5
12567   (eval $ac_try) 2>&5
12568   ac_status=$?
12569   echo "$as_me:12569: \$? = $ac_status" >&5
12570   (exit "$ac_status"); }; }; then
12571   ac_cv_lib_bsd_gethostbyname=yes
12572 else
12573   echo "$as_me: failed program was:" >&5
12574 cat "conftest.$ac_ext" >&5
12575 ac_cv_lib_bsd_gethostbyname=no
12576 fi
12577 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12578 LIBS=$ac_check_lib_save_LIBS
12579 fi
12580 echo "$as_me:12580: result: $ac_cv_lib_bsd_gethostbyname" >&5
12581 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12582 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
12583   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12584 fi
12585
12586       fi
12587     fi
12588
12589     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12590     # socket/setsockopt and other routines are undefined under SCO ODT
12591     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12592     # on later versions), says Simon Leinen: it contains gethostby*
12593     # variants that don't use the nameserver (or something).  -lsocket
12594     # must be given before -lnsl if both are needed.  We assume that
12595     # if connect needs -lnsl, so does gethostbyname.
12596     echo "$as_me:12596: checking for connect" >&5
12597 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12598 if test "${ac_cv_func_connect+set}" = set; then
12599   echo $ECHO_N "(cached) $ECHO_C" >&6
12600 else
12601   cat >"conftest.$ac_ext" <<_ACEOF
12602 #line 12602 "configure"
12603 #include "confdefs.h"
12604 #define connect autoconf_temporary
12605 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12606 #undef connect
12607
12608 #ifdef __cplusplus
12609 extern "C"
12610 #endif
12611
12612 /* We use char because int might match the return type of a gcc2
12613    builtin and then its argument prototype would still apply.  */
12614 char connect (void);
12615
12616 int
12617 main (void)
12618 {
12619
12620 /* The GNU C library defines stubs for functions which it implements
12621     to always fail with ENOSYS.  Some functions are actually named
12622     something starting with __ and the normal name is an alias.  */
12623 #if defined (__stub_connect) || defined (__stub___connect)
12624 #error found stub for connect
12625 #endif
12626
12627         return connect ();
12628   ;
12629   return 0;
12630 }
12631 _ACEOF
12632 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12633 if { (eval echo "$as_me:12633: \"$ac_link\"") >&5
12634   (eval $ac_link) 2>&5
12635   ac_status=$?
12636   echo "$as_me:12636: \$? = $ac_status" >&5
12637   (exit "$ac_status"); } &&
12638          { ac_try='test -s "conftest$ac_exeext"'
12639   { (eval echo "$as_me:12639: \"$ac_try\"") >&5
12640   (eval $ac_try) 2>&5
12641   ac_status=$?
12642   echo "$as_me:12642: \$? = $ac_status" >&5
12643   (exit "$ac_status"); }; }; then
12644   ac_cv_func_connect=yes
12645 else
12646   echo "$as_me: failed program was:" >&5
12647 cat "conftest.$ac_ext" >&5
12648 ac_cv_func_connect=no
12649 fi
12650 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12651 fi
12652 echo "$as_me:12652: result: $ac_cv_func_connect" >&5
12653 echo "${ECHO_T}$ac_cv_func_connect" >&6
12654
12655     if test $ac_cv_func_connect = no; then
12656       echo "$as_me:12656: checking for connect in -lsocket" >&5
12657 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12658 if test "${ac_cv_lib_socket_connect+set}" = set; then
12659   echo $ECHO_N "(cached) $ECHO_C" >&6
12660 else
12661   ac_check_lib_save_LIBS=$LIBS
12662 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12663 cat >"conftest.$ac_ext" <<_ACEOF
12664 #line 12664 "configure"
12665 #include "confdefs.h"
12666
12667 /* Override any gcc2 internal prototype to avoid an error.  */
12668 #ifdef __cplusplus
12669 extern "C"
12670 #endif
12671 /* We use char because int might match the return type of a gcc2
12672    builtin and then its argument prototype would still apply.  */
12673 char connect ();
12674 int
12675 main (void)
12676 {
12677 connect ();
12678   ;
12679   return 0;
12680 }
12681 _ACEOF
12682 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12683 if { (eval echo "$as_me:12683: \"$ac_link\"") >&5
12684   (eval $ac_link) 2>&5
12685   ac_status=$?
12686   echo "$as_me:12686: \$? = $ac_status" >&5
12687   (exit "$ac_status"); } &&
12688          { ac_try='test -s "conftest$ac_exeext"'
12689   { (eval echo "$as_me:12689: \"$ac_try\"") >&5
12690   (eval $ac_try) 2>&5
12691   ac_status=$?
12692   echo "$as_me:12692: \$? = $ac_status" >&5
12693   (exit "$ac_status"); }; }; then
12694   ac_cv_lib_socket_connect=yes
12695 else
12696   echo "$as_me: failed program was:" >&5
12697 cat "conftest.$ac_ext" >&5
12698 ac_cv_lib_socket_connect=no
12699 fi
12700 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12701 LIBS=$ac_check_lib_save_LIBS
12702 fi
12703 echo "$as_me:12703: result: $ac_cv_lib_socket_connect" >&5
12704 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12705 if test "$ac_cv_lib_socket_connect" = yes; then
12706   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12707 fi
12708
12709     fi
12710
12711     # Guillermo Gomez says -lposix is necessary on A/UX.
12712     echo "$as_me:12712: checking for remove" >&5
12713 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12714 if test "${ac_cv_func_remove+set}" = set; then
12715   echo $ECHO_N "(cached) $ECHO_C" >&6
12716 else
12717   cat >"conftest.$ac_ext" <<_ACEOF
12718 #line 12718 "configure"
12719 #include "confdefs.h"
12720 #define remove autoconf_temporary
12721 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12722 #undef remove
12723
12724 #ifdef __cplusplus
12725 extern "C"
12726 #endif
12727
12728 /* We use char because int might match the return type of a gcc2
12729    builtin and then its argument prototype would still apply.  */
12730 char remove (void);
12731
12732 int
12733 main (void)
12734 {
12735
12736 /* The GNU C library defines stubs for functions which it implements
12737     to always fail with ENOSYS.  Some functions are actually named
12738     something starting with __ and the normal name is an alias.  */
12739 #if defined (__stub_remove) || defined (__stub___remove)
12740 #error found stub for remove
12741 #endif
12742
12743         return remove ();
12744   ;
12745   return 0;
12746 }
12747 _ACEOF
12748 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12749 if { (eval echo "$as_me:12749: \"$ac_link\"") >&5
12750   (eval $ac_link) 2>&5
12751   ac_status=$?
12752   echo "$as_me:12752: \$? = $ac_status" >&5
12753   (exit "$ac_status"); } &&
12754          { ac_try='test -s "conftest$ac_exeext"'
12755   { (eval echo "$as_me:12755: \"$ac_try\"") >&5
12756   (eval $ac_try) 2>&5
12757   ac_status=$?
12758   echo "$as_me:12758: \$? = $ac_status" >&5
12759   (exit "$ac_status"); }; }; then
12760   ac_cv_func_remove=yes
12761 else
12762   echo "$as_me: failed program was:" >&5
12763 cat "conftest.$ac_ext" >&5
12764 ac_cv_func_remove=no
12765 fi
12766 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12767 fi
12768 echo "$as_me:12768: result: $ac_cv_func_remove" >&5
12769 echo "${ECHO_T}$ac_cv_func_remove" >&6
12770
12771     if test $ac_cv_func_remove = no; then
12772       echo "$as_me:12772: checking for remove in -lposix" >&5
12773 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12774 if test "${ac_cv_lib_posix_remove+set}" = set; then
12775   echo $ECHO_N "(cached) $ECHO_C" >&6
12776 else
12777   ac_check_lib_save_LIBS=$LIBS
12778 LIBS="-lposix  $LIBS"
12779 cat >"conftest.$ac_ext" <<_ACEOF
12780 #line 12780 "configure"
12781 #include "confdefs.h"
12782
12783 /* Override any gcc2 internal prototype to avoid an error.  */
12784 #ifdef __cplusplus
12785 extern "C"
12786 #endif
12787 /* We use char because int might match the return type of a gcc2
12788    builtin and then its argument prototype would still apply.  */
12789 char remove ();
12790 int
12791 main (void)
12792 {
12793 remove ();
12794   ;
12795   return 0;
12796 }
12797 _ACEOF
12798 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12799 if { (eval echo "$as_me:12799: \"$ac_link\"") >&5
12800   (eval $ac_link) 2>&5
12801   ac_status=$?
12802   echo "$as_me:12802: \$? = $ac_status" >&5
12803   (exit "$ac_status"); } &&
12804          { ac_try='test -s "conftest$ac_exeext"'
12805   { (eval echo "$as_me:12805: \"$ac_try\"") >&5
12806   (eval $ac_try) 2>&5
12807   ac_status=$?
12808   echo "$as_me:12808: \$? = $ac_status" >&5
12809   (exit "$ac_status"); }; }; then
12810   ac_cv_lib_posix_remove=yes
12811 else
12812   echo "$as_me: failed program was:" >&5
12813 cat "conftest.$ac_ext" >&5
12814 ac_cv_lib_posix_remove=no
12815 fi
12816 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12817 LIBS=$ac_check_lib_save_LIBS
12818 fi
12819 echo "$as_me:12819: result: $ac_cv_lib_posix_remove" >&5
12820 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12821 if test "$ac_cv_lib_posix_remove" = yes; then
12822   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12823 fi
12824
12825     fi
12826
12827     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12828     echo "$as_me:12828: checking for shmat" >&5
12829 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12830 if test "${ac_cv_func_shmat+set}" = set; then
12831   echo $ECHO_N "(cached) $ECHO_C" >&6
12832 else
12833   cat >"conftest.$ac_ext" <<_ACEOF
12834 #line 12834 "configure"
12835 #include "confdefs.h"
12836 #define shmat autoconf_temporary
12837 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12838 #undef shmat
12839
12840 #ifdef __cplusplus
12841 extern "C"
12842 #endif
12843
12844 /* We use char because int might match the return type of a gcc2
12845    builtin and then its argument prototype would still apply.  */
12846 char shmat (void);
12847
12848 int
12849 main (void)
12850 {
12851
12852 /* The GNU C library defines stubs for functions which it implements
12853     to always fail with ENOSYS.  Some functions are actually named
12854     something starting with __ and the normal name is an alias.  */
12855 #if defined (__stub_shmat) || defined (__stub___shmat)
12856 #error found stub for shmat
12857 #endif
12858
12859         return shmat ();
12860   ;
12861   return 0;
12862 }
12863 _ACEOF
12864 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12865 if { (eval echo "$as_me:12865: \"$ac_link\"") >&5
12866   (eval $ac_link) 2>&5
12867   ac_status=$?
12868   echo "$as_me:12868: \$? = $ac_status" >&5
12869   (exit "$ac_status"); } &&
12870          { ac_try='test -s "conftest$ac_exeext"'
12871   { (eval echo "$as_me:12871: \"$ac_try\"") >&5
12872   (eval $ac_try) 2>&5
12873   ac_status=$?
12874   echo "$as_me:12874: \$? = $ac_status" >&5
12875   (exit "$ac_status"); }; }; then
12876   ac_cv_func_shmat=yes
12877 else
12878   echo "$as_me: failed program was:" >&5
12879 cat "conftest.$ac_ext" >&5
12880 ac_cv_func_shmat=no
12881 fi
12882 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12883 fi
12884 echo "$as_me:12884: result: $ac_cv_func_shmat" >&5
12885 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12886
12887     if test $ac_cv_func_shmat = no; then
12888       echo "$as_me:12888: checking for shmat in -lipc" >&5
12889 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12890 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12891   echo $ECHO_N "(cached) $ECHO_C" >&6
12892 else
12893   ac_check_lib_save_LIBS=$LIBS
12894 LIBS="-lipc  $LIBS"
12895 cat >"conftest.$ac_ext" <<_ACEOF
12896 #line 12896 "configure"
12897 #include "confdefs.h"
12898
12899 /* Override any gcc2 internal prototype to avoid an error.  */
12900 #ifdef __cplusplus
12901 extern "C"
12902 #endif
12903 /* We use char because int might match the return type of a gcc2
12904    builtin and then its argument prototype would still apply.  */
12905 char shmat ();
12906 int
12907 main (void)
12908 {
12909 shmat ();
12910   ;
12911   return 0;
12912 }
12913 _ACEOF
12914 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12915 if { (eval echo "$as_me:12915: \"$ac_link\"") >&5
12916   (eval $ac_link) 2>&5
12917   ac_status=$?
12918   echo "$as_me:12918: \$? = $ac_status" >&5
12919   (exit "$ac_status"); } &&
12920          { ac_try='test -s "conftest$ac_exeext"'
12921   { (eval echo "$as_me:12921: \"$ac_try\"") >&5
12922   (eval $ac_try) 2>&5
12923   ac_status=$?
12924   echo "$as_me:12924: \$? = $ac_status" >&5
12925   (exit "$ac_status"); }; }; then
12926   ac_cv_lib_ipc_shmat=yes
12927 else
12928   echo "$as_me: failed program was:" >&5
12929 cat "conftest.$ac_ext" >&5
12930 ac_cv_lib_ipc_shmat=no
12931 fi
12932 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12933 LIBS=$ac_check_lib_save_LIBS
12934 fi
12935 echo "$as_me:12935: result: $ac_cv_lib_ipc_shmat" >&5
12936 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12937 if test "$ac_cv_lib_ipc_shmat" = yes; then
12938   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12939 fi
12940
12941     fi
12942   fi
12943
12944   # Check for libraries that X11R6 Xt/Xaw programs need.
12945   ac_save_LDFLAGS=$LDFLAGS
12946   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12947   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12948   # check for ICE first), but we must link in the order -lSM -lICE or
12949   # we get undefined symbols.  So assume we have SM if we have ICE.
12950   # These have to be linked with before -lX11, unlike the other
12951   # libraries we check for below, so use a different variable.
12952   # John Interrante, Karl Berry
12953   echo "$as_me:12953: checking for IceConnectionNumber in -lICE" >&5
12954 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12955 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12956   echo $ECHO_N "(cached) $ECHO_C" >&6
12957 else
12958   ac_check_lib_save_LIBS=$LIBS
12959 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12960 cat >"conftest.$ac_ext" <<_ACEOF
12961 #line 12961 "configure"
12962 #include "confdefs.h"
12963
12964 /* Override any gcc2 internal prototype to avoid an error.  */
12965 #ifdef __cplusplus
12966 extern "C"
12967 #endif
12968 /* We use char because int might match the return type of a gcc2
12969    builtin and then its argument prototype would still apply.  */
12970 char IceConnectionNumber ();
12971 int
12972 main (void)
12973 {
12974 IceConnectionNumber ();
12975   ;
12976   return 0;
12977 }
12978 _ACEOF
12979 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12980 if { (eval echo "$as_me:12980: \"$ac_link\"") >&5
12981   (eval $ac_link) 2>&5
12982   ac_status=$?
12983   echo "$as_me:12983: \$? = $ac_status" >&5
12984   (exit "$ac_status"); } &&
12985          { ac_try='test -s "conftest$ac_exeext"'
12986   { (eval echo "$as_me:12986: \"$ac_try\"") >&5
12987   (eval $ac_try) 2>&5
12988   ac_status=$?
12989   echo "$as_me:12989: \$? = $ac_status" >&5
12990   (exit "$ac_status"); }; }; then
12991   ac_cv_lib_ICE_IceConnectionNumber=yes
12992 else
12993   echo "$as_me: failed program was:" >&5
12994 cat "conftest.$ac_ext" >&5
12995 ac_cv_lib_ICE_IceConnectionNumber=no
12996 fi
12997 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12998 LIBS=$ac_check_lib_save_LIBS
12999 fi
13000 echo "$as_me:13000: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
13001 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
13002 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
13003   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
13004 fi
13005
13006   LDFLAGS=$ac_save_LDFLAGS
13007
13008 fi
13009
13010 cf_x_athena=${cf_x_athena:-Xaw}
13011
13012 echo "$as_me:13012: checking if you want to link with Xaw 3d library" >&5
13013 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
13014 withval=
13015
13016 # Check whether --with-Xaw3d or --without-Xaw3d was given.
13017 if test "${with_Xaw3d+set}" = set; then
13018   withval="$with_Xaw3d"
13019
13020 fi;
13021 if test "$withval" = yes ; then
13022         cf_x_athena=Xaw3d
13023         echo "$as_me:13023: result: yes" >&5
13024 echo "${ECHO_T}yes" >&6
13025 else
13026         echo "$as_me:13026: result: no" >&5
13027 echo "${ECHO_T}no" >&6
13028 fi
13029
13030 echo "$as_me:13030: checking if you want to link with Xaw 3d xft library" >&5
13031 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
13032 withval=
13033
13034 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
13035 if test "${with_Xaw3dxft+set}" = set; then
13036   withval="$with_Xaw3dxft"
13037
13038 fi;
13039 if test "$withval" = yes ; then
13040         cf_x_athena=Xaw3dxft
13041         echo "$as_me:13041: result: yes" >&5
13042 echo "${ECHO_T}yes" >&6
13043 else
13044         echo "$as_me:13044: result: no" >&5
13045 echo "${ECHO_T}no" >&6
13046 fi
13047
13048 echo "$as_me:13048: checking if you want to link with neXT Athena library" >&5
13049 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
13050 withval=
13051
13052 # Check whether --with-neXtaw or --without-neXtaw was given.
13053 if test "${with_neXtaw+set}" = set; then
13054   withval="$with_neXtaw"
13055
13056 fi;
13057 if test "$withval" = yes ; then
13058         cf_x_athena=neXtaw
13059         echo "$as_me:13059: result: yes" >&5
13060 echo "${ECHO_T}yes" >&6
13061 else
13062         echo "$as_me:13062: result: no" >&5
13063 echo "${ECHO_T}no" >&6
13064 fi
13065
13066 echo "$as_me:13066: checking if you want to link with Athena-Plus library" >&5
13067 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
13068 withval=
13069
13070 # Check whether --with-XawPlus or --without-XawPlus was given.
13071 if test "${with_XawPlus+set}" = set; then
13072   withval="$with_XawPlus"
13073
13074 fi;
13075 if test "$withval" = yes ; then
13076         cf_x_athena=XawPlus
13077         echo "$as_me:13077: result: yes" >&5
13078 echo "${ECHO_T}yes" >&6
13079 else
13080         echo "$as_me:13080: result: no" >&5
13081 echo "${ECHO_T}no" >&6
13082 fi
13083
13084 cf_x_athena_lib=""
13085
13086 if test "$PKG_CONFIG" != none ; then
13087         cf_athena_list=
13088         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
13089         for cf_athena_pkg in \
13090                 $cf_athena_list \
13091                 ${cf_x_athena} \
13092                 ${cf_x_athena}-devel \
13093                 lib${cf_x_athena} \
13094                 lib${cf_x_athena}-devel
13095         do
13096
13097 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_athena_pkg"; then
13098         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
13099
13100 echo "${as_me:-configure}:13100: testing found package $cf_athena_pkg ..." 1>&5
13101
13102         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$cf_athena_pkg" 2>/dev/null`"
13103         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$cf_athena_pkg" 2>/dev/null`"
13104         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
13105
13106 echo "${as_me:-configure}:13106: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13107
13108         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
13109
13110 echo "${as_me:-configure}:13110: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
13111
13112 cf_fix_cppflags=no
13113 cf_new_cflags=
13114 cf_new_cppflags=
13115 cf_new_extra_cppflags=
13116
13117 for cf_add_cflags in $cf_pkgconfig_incs
13118 do
13119 case "$cf_fix_cppflags" in
13120 (no)
13121         case "$cf_add_cflags" in
13122         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13123                 case "$cf_add_cflags" in
13124                 (-D*)
13125                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13126
13127                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13128                                 && test -z "${cf_tst_cflags}" \
13129                                 && cf_fix_cppflags=yes
13130
13131                         if test "$cf_fix_cppflags" = yes ; then
13132
13133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13135
13136                                 continue
13137                         elif test "${cf_tst_cflags}" = "\"'" ; then
13138
13139         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13140         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13141
13142                                 continue
13143                         fi
13144                         ;;
13145                 esac
13146                 case "$CPPFLAGS" in
13147                 (*$cf_add_cflags)
13148                         ;;
13149                 (*)
13150                         case "$cf_add_cflags" in
13151                         (-D*)
13152                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13153
13154 CPPFLAGS=`echo "$CPPFLAGS" | \
13155         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13156                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13157
13158                                 ;;
13159                         esac
13160
13161         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13162         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13163
13164                         ;;
13165                 esac
13166                 ;;
13167         (*)
13168
13169         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13170         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13171
13172                 ;;
13173         esac
13174         ;;
13175 (yes)
13176
13177         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13178         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13179
13180         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13181
13182         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13183                 && test -z "${cf_tst_cflags}" \
13184                 && cf_fix_cppflags=no
13185         ;;
13186 esac
13187 done
13188
13189 if test -n "$cf_new_cflags" ; then
13190
13191         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13192         CFLAGS="${CFLAGS}$cf_new_cflags"
13193
13194 fi
13195
13196 if test -n "$cf_new_cppflags" ; then
13197
13198         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13199         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13200
13201 fi
13202
13203 if test -n "$cf_new_extra_cppflags" ; then
13204
13205         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13206         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13207
13208 fi
13209
13210 cf_add_libs="$LIBS"
13211 # reverse order
13212 cf_add_0lib=
13213 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13214 # filter duplicates
13215 for cf_add_1lib in $cf_add_0lib; do
13216         for cf_add_2lib in $cf_add_libs; do
13217                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13218                         cf_add_1lib=
13219                         break
13220                 fi
13221         done
13222         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13223 done
13224 LIBS="$cf_add_libs"
13225
13226                         cf_x_athena_lib="$cf_pkgconfig_libs"
13227
13228 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13229
13230                         cat >>confdefs.h <<EOF
13231 #define $cf_x_athena_LIBS 1
13232 EOF
13233
13234         for cf_trim_lib in Xmu Xt X11
13235         do
13236                 case "$LIBS" in
13237                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13238                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13239                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13240
13241 echo "${as_me:-configure}:13241: testing ..trimmed $LIBS ..." 1>&5
13242
13243                         ;;
13244                 esac
13245         done
13246
13247 echo "$as_me:13247: checking for usable $cf_x_athena/Xmu package" >&5
13248 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
13249 if test "${cf_cv_xaw_compat+set}" = set; then
13250   echo $ECHO_N "(cached) $ECHO_C" >&6
13251 else
13252
13253 cat >"conftest.$ac_ext" <<_ACEOF
13254 #line 13254 "configure"
13255 #include "confdefs.h"
13256
13257 #include <X11/Xmu/CharSet.h>
13258
13259 int
13260 main (void)
13261 {
13262
13263 int check = XmuCompareISOLatin1("big", "small");
13264 (void)check;
13265
13266   ;
13267   return 0;
13268 }
13269 _ACEOF
13270 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13271 if { (eval echo "$as_me:13271: \"$ac_link\"") >&5
13272   (eval $ac_link) 2>&5
13273   ac_status=$?
13274   echo "$as_me:13274: \$? = $ac_status" >&5
13275   (exit "$ac_status"); } &&
13276          { ac_try='test -s "conftest$ac_exeext"'
13277   { (eval echo "$as_me:13277: \"$ac_try\"") >&5
13278   (eval $ac_try) 2>&5
13279   ac_status=$?
13280   echo "$as_me:13280: \$? = $ac_status" >&5
13281   (exit "$ac_status"); }; }; then
13282   cf_cv_xaw_compat=yes
13283 else
13284   echo "$as_me: failed program was:" >&5
13285 cat "conftest.$ac_ext" >&5
13286 cf_cv_xaw_compat=no
13287 fi
13288 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13289 fi
13290 echo "$as_me:13290: result: $cf_cv_xaw_compat" >&5
13291 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13292
13293                         if test "$cf_cv_xaw_compat" = no
13294                         then
13295                                 # workaround for broken ".pc" files...
13296                                 case "$cf_x_athena_lib" in
13297                                 (*-lXmu*)
13298                                         ;;
13299                                 (*)
13300                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13301
13302 echo "${as_me:-configure}:13302: testing work around broken package ..." 1>&5
13303
13304                                         cf_save_xmu="$LIBS"
13305                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13306
13307 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xmu"; then
13308         test -n "$verbose" && echo "    found package xmu" 1>&6
13309
13310 echo "${as_me:-configure}:13310: testing found package xmu ..." 1>&5
13311
13312         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xmu" 2>/dev/null`"
13313         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xmu" 2>/dev/null`"
13314         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13315
13316 echo "${as_me:-configure}:13316: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13317
13318         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13319
13320 echo "${as_me:-configure}:13320: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13321
13322 cf_fix_cppflags=no
13323 cf_new_cflags=
13324 cf_new_cppflags=
13325 cf_new_extra_cppflags=
13326
13327 for cf_add_cflags in $cf_pkgconfig_incs
13328 do
13329 case "$cf_fix_cppflags" in
13330 (no)
13331         case "$cf_add_cflags" in
13332         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13333                 case "$cf_add_cflags" in
13334                 (-D*)
13335                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13336
13337                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13338                                 && test -z "${cf_tst_cflags}" \
13339                                 && cf_fix_cppflags=yes
13340
13341                         if test "$cf_fix_cppflags" = yes ; then
13342
13343         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13344         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13345
13346                                 continue
13347                         elif test "${cf_tst_cflags}" = "\"'" ; then
13348
13349         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13350         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13351
13352                                 continue
13353                         fi
13354                         ;;
13355                 esac
13356                 case "$CPPFLAGS" in
13357                 (*$cf_add_cflags)
13358                         ;;
13359                 (*)
13360                         case "$cf_add_cflags" in
13361                         (-D*)
13362                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13363
13364 CPPFLAGS=`echo "$CPPFLAGS" | \
13365         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13366                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13367
13368                                 ;;
13369                         esac
13370
13371         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13372         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13373
13374                         ;;
13375                 esac
13376                 ;;
13377         (*)
13378
13379         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13380         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13381
13382                 ;;
13383         esac
13384         ;;
13385 (yes)
13386
13387         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13388         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13389
13390         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13391
13392         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13393                 && test -z "${cf_tst_cflags}" \
13394                 && cf_fix_cppflags=no
13395         ;;
13396 esac
13397 done
13398
13399 if test -n "$cf_new_cflags" ; then
13400
13401         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13402         CFLAGS="${CFLAGS}$cf_new_cflags"
13403
13404 fi
13405
13406 if test -n "$cf_new_cppflags" ; then
13407
13408         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13409         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13410
13411 fi
13412
13413 if test -n "$cf_new_extra_cppflags" ; then
13414
13415         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13416         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13417
13418 fi
13419
13420 cf_add_libs="$LIBS"
13421 # reverse order
13422 cf_add_0lib=
13423 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13424 # filter duplicates
13425 for cf_add_1lib in $cf_add_0lib; do
13426         for cf_add_2lib in $cf_add_libs; do
13427                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13428                         cf_add_1lib=
13429                         break
13430                 fi
13431         done
13432         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13433 done
13434 LIBS="$cf_add_libs"
13435
13436                                                         LIBS="$cf_save_xmu"
13437
13438 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13439
13440 echo "${as_me:-configure}:13440: testing ...before $LIBS ..." 1>&5
13441
13442 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13443 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13444
13445 echo "${as_me:-configure}:13445: testing ...after  $LIBS ..." 1>&5
13446
13447 else
13448         cf_pkgconfig_incs=
13449         cf_pkgconfig_libs=
13450
13451 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13452
13453 echo "${as_me:-configure}:13453: testing ...before $LIBS ..." 1>&5
13454
13455 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13456 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13457
13458 echo "${as_me:-configure}:13458: testing ...after  $LIBS ..." 1>&5
13459
13460 fi
13461
13462         for cf_trim_lib in Xmu Xt X11
13463         do
13464                 case "$LIBS" in
13465                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13466                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13467                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13468
13469 echo "${as_me:-configure}:13469: testing ..trimmed $LIBS ..." 1>&5
13470
13471                         ;;
13472                 esac
13473         done
13474
13475                                         ;;
13476                                 esac
13477                         fi
13478
13479                         break
13480 else
13481         cf_pkgconfig_incs=
13482         cf_pkgconfig_libs=
13483         :
13484 fi
13485
13486         done
13487 fi
13488
13489 if test -z "$cf_x_athena_lib" ; then
13490
13491 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "Xext"; then
13492         test -n "$verbose" && echo "    found package Xext" 1>&6
13493
13494 echo "${as_me:-configure}:13494: testing found package Xext ..." 1>&5
13495
13496         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "Xext" 2>/dev/null`"
13497         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "Xext" 2>/dev/null`"
13498         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13499
13500 echo "${as_me:-configure}:13500: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13501
13502         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13503
13504 echo "${as_me:-configure}:13504: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13505
13506 cf_fix_cppflags=no
13507 cf_new_cflags=
13508 cf_new_cppflags=
13509 cf_new_extra_cppflags=
13510
13511 for cf_add_cflags in $cf_pkgconfig_incs
13512 do
13513 case "$cf_fix_cppflags" in
13514 (no)
13515         case "$cf_add_cflags" in
13516         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13517                 case "$cf_add_cflags" in
13518                 (-D*)
13519                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13520
13521                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13522                                 && test -z "${cf_tst_cflags}" \
13523                                 && cf_fix_cppflags=yes
13524
13525                         if test "$cf_fix_cppflags" = yes ; then
13526
13527         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13528         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13529
13530                                 continue
13531                         elif test "${cf_tst_cflags}" = "\"'" ; then
13532
13533         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13534         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13535
13536                                 continue
13537                         fi
13538                         ;;
13539                 esac
13540                 case "$CPPFLAGS" in
13541                 (*$cf_add_cflags)
13542                         ;;
13543                 (*)
13544                         case "$cf_add_cflags" in
13545                         (-D*)
13546                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13547
13548 CPPFLAGS=`echo "$CPPFLAGS" | \
13549         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13550                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13551
13552                                 ;;
13553                         esac
13554
13555         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13556         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13557
13558                         ;;
13559                 esac
13560                 ;;
13561         (*)
13562
13563         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13564         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13565
13566                 ;;
13567         esac
13568         ;;
13569 (yes)
13570
13571         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13572         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13573
13574         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13575
13576         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13577                 && test -z "${cf_tst_cflags}" \
13578                 && cf_fix_cppflags=no
13579         ;;
13580 esac
13581 done
13582
13583 if test -n "$cf_new_cflags" ; then
13584
13585         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13586         CFLAGS="${CFLAGS}$cf_new_cflags"
13587
13588 fi
13589
13590 if test -n "$cf_new_cppflags" ; then
13591
13592         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13593         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13594
13595 fi
13596
13597 if test -n "$cf_new_extra_cppflags" ; then
13598
13599         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13600         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13601
13602 fi
13603
13604 cf_add_libs="$LIBS"
13605 # reverse order
13606 cf_add_0lib=
13607 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13608 # filter duplicates
13609 for cf_add_1lib in $cf_add_0lib; do
13610         for cf_add_2lib in $cf_add_libs; do
13611                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13612                         cf_add_1lib=
13613                         break
13614                 fi
13615         done
13616         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13617 done
13618 LIBS="$cf_add_libs"
13619
13620         :
13621 else
13622         cf_pkgconfig_incs=
13623         cf_pkgconfig_libs=
13624
13625         echo "$as_me:13625: checking for XextCreateExtension in -lXext" >&5
13626 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13627 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13628   echo $ECHO_N "(cached) $ECHO_C" >&6
13629 else
13630   ac_check_lib_save_LIBS=$LIBS
13631 LIBS="-lXext  $LIBS"
13632 cat >"conftest.$ac_ext" <<_ACEOF
13633 #line 13633 "configure"
13634 #include "confdefs.h"
13635
13636 /* Override any gcc2 internal prototype to avoid an error.  */
13637 #ifdef __cplusplus
13638 extern "C"
13639 #endif
13640 /* We use char because int might match the return type of a gcc2
13641    builtin and then its argument prototype would still apply.  */
13642 char XextCreateExtension ();
13643 int
13644 main (void)
13645 {
13646 XextCreateExtension ();
13647   ;
13648   return 0;
13649 }
13650 _ACEOF
13651 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
13652 if { (eval echo "$as_me:13652: \"$ac_link\"") >&5
13653   (eval $ac_link) 2>&5
13654   ac_status=$?
13655   echo "$as_me:13655: \$? = $ac_status" >&5
13656   (exit "$ac_status"); } &&
13657          { ac_try='test -s "conftest$ac_exeext"'
13658   { (eval echo "$as_me:13658: \"$ac_try\"") >&5
13659   (eval $ac_try) 2>&5
13660   ac_status=$?
13661   echo "$as_me:13661: \$? = $ac_status" >&5
13662   (exit "$ac_status"); }; }; then
13663   ac_cv_lib_Xext_XextCreateExtension=yes
13664 else
13665   echo "$as_me: failed program was:" >&5
13666 cat "conftest.$ac_ext" >&5
13667 ac_cv_lib_Xext_XextCreateExtension=no
13668 fi
13669 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
13670 LIBS=$ac_check_lib_save_LIBS
13671 fi
13672 echo "$as_me:13672: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13673 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13674 if test "$ac_cv_lib_Xext_XextCreateExtension" = yes; then
13675
13676 cf_add_libs="$LIBS"
13677 # reverse order
13678 cf_add_0lib=
13679 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13680 # filter duplicates
13681 for cf_add_1lib in $cf_add_0lib; do
13682         for cf_add_2lib in $cf_add_libs; do
13683                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13684                         cf_add_1lib=
13685                         break
13686                 fi
13687         done
13688         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13689 done
13690 LIBS="$cf_add_libs"
13691
13692 fi
13693
13694 fi
13695
13696 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13697 # in some cases has installed dummy files in the former, other cases replaced
13698 # it with a link to the new location).  This complicates the configure script.
13699 # Check for that pitfall, and recover using pkg-config
13700 #
13701 # If none of these are set, the configuration is almost certainly broken.
13702 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13703 then
13704
13705 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
13706         test -n "$verbose" && echo "    found package x11" 1>&6
13707
13708 echo "${as_me:-configure}:13708: testing found package x11 ..." 1>&5
13709
13710         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
13711         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
13712         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13713
13714 echo "${as_me:-configure}:13714: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13715
13716         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13717
13718 echo "${as_me:-configure}:13718: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13719
13720 cf_fix_cppflags=no
13721 cf_new_cflags=
13722 cf_new_cppflags=
13723 cf_new_extra_cppflags=
13724
13725 for cf_add_cflags in $cf_pkgconfig_incs
13726 do
13727 case "$cf_fix_cppflags" in
13728 (no)
13729         case "$cf_add_cflags" in
13730         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13731                 case "$cf_add_cflags" in
13732                 (-D*)
13733                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13734
13735                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13736                                 && test -z "${cf_tst_cflags}" \
13737                                 && cf_fix_cppflags=yes
13738
13739                         if test "$cf_fix_cppflags" = yes ; then
13740
13741         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13742         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13743
13744                                 continue
13745                         elif test "${cf_tst_cflags}" = "\"'" ; then
13746
13747         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13748         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13749
13750                                 continue
13751                         fi
13752                         ;;
13753                 esac
13754                 case "$CPPFLAGS" in
13755                 (*$cf_add_cflags)
13756                         ;;
13757                 (*)
13758                         case "$cf_add_cflags" in
13759                         (-D*)
13760                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13761
13762 CPPFLAGS=`echo "$CPPFLAGS" | \
13763         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13764                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13765
13766                                 ;;
13767                         esac
13768
13769         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13770         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13771
13772                         ;;
13773                 esac
13774                 ;;
13775         (*)
13776
13777         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13778         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13779
13780                 ;;
13781         esac
13782         ;;
13783 (yes)
13784
13785         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13786         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13787
13788         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13789
13790         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13791                 && test -z "${cf_tst_cflags}" \
13792                 && cf_fix_cppflags=no
13793         ;;
13794 esac
13795 done
13796
13797 if test -n "$cf_new_cflags" ; then
13798
13799         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13800         CFLAGS="${CFLAGS}$cf_new_cflags"
13801
13802 fi
13803
13804 if test -n "$cf_new_cppflags" ; then
13805
13806         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13807         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13808
13809 fi
13810
13811 if test -n "$cf_new_extra_cppflags" ; then
13812
13813         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13814         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13815
13816 fi
13817
13818 cf_add_libs="$LIBS"
13819 # reverse order
13820 cf_add_0lib=
13821 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13822 # filter duplicates
13823 for cf_add_1lib in $cf_add_0lib; do
13824         for cf_add_2lib in $cf_add_libs; do
13825                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13826                         cf_add_1lib=
13827                         break
13828                 fi
13829         done
13830         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13831 done
13832 LIBS="$cf_add_libs"
13833
13834         :
13835 else
13836         cf_pkgconfig_incs=
13837         cf_pkgconfig_libs=
13838         { echo "$as_me:13838: WARNING: unable to find X11 library" >&5
13839 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13840 fi
13841
13842 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
13843         test -n "$verbose" && echo "    found package ice" 1>&6
13844
13845 echo "${as_me:-configure}:13845: testing found package ice ..." 1>&5
13846
13847         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
13848         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
13849         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13850
13851 echo "${as_me:-configure}:13851: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13852
13853         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13854
13855 echo "${as_me:-configure}:13855: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13856
13857 cf_fix_cppflags=no
13858 cf_new_cflags=
13859 cf_new_cppflags=
13860 cf_new_extra_cppflags=
13861
13862 for cf_add_cflags in $cf_pkgconfig_incs
13863 do
13864 case "$cf_fix_cppflags" in
13865 (no)
13866         case "$cf_add_cflags" in
13867         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13868                 case "$cf_add_cflags" in
13869                 (-D*)
13870                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13871
13872                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13873                                 && test -z "${cf_tst_cflags}" \
13874                                 && cf_fix_cppflags=yes
13875
13876                         if test "$cf_fix_cppflags" = yes ; then
13877
13878         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13879         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13880
13881                                 continue
13882                         elif test "${cf_tst_cflags}" = "\"'" ; then
13883
13884         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13885         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13886
13887                                 continue
13888                         fi
13889                         ;;
13890                 esac
13891                 case "$CPPFLAGS" in
13892                 (*$cf_add_cflags)
13893                         ;;
13894                 (*)
13895                         case "$cf_add_cflags" in
13896                         (-D*)
13897                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13898
13899 CPPFLAGS=`echo "$CPPFLAGS" | \
13900         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13901                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13902
13903                                 ;;
13904                         esac
13905
13906         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13907         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13908
13909                         ;;
13910                 esac
13911                 ;;
13912         (*)
13913
13914         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13915         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13916
13917                 ;;
13918         esac
13919         ;;
13920 (yes)
13921
13922         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13923         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13924
13925         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13926
13927         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13928                 && test -z "${cf_tst_cflags}" \
13929                 && cf_fix_cppflags=no
13930         ;;
13931 esac
13932 done
13933
13934 if test -n "$cf_new_cflags" ; then
13935
13936         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13937         CFLAGS="${CFLAGS}$cf_new_cflags"
13938
13939 fi
13940
13941 if test -n "$cf_new_cppflags" ; then
13942
13943         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13944         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13945
13946 fi
13947
13948 if test -n "$cf_new_extra_cppflags" ; then
13949
13950         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13951         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13952
13953 fi
13954
13955 cf_add_libs="$LIBS"
13956 # reverse order
13957 cf_add_0lib=
13958 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13959 # filter duplicates
13960 for cf_add_1lib in $cf_add_0lib; do
13961         for cf_add_2lib in $cf_add_libs; do
13962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13963                         cf_add_1lib=
13964                         break
13965                 fi
13966         done
13967         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13968 done
13969 LIBS="$cf_add_libs"
13970
13971         :
13972 else
13973         cf_pkgconfig_incs=
13974         cf_pkgconfig_libs=
13975         { echo "$as_me:13975: WARNING: unable to find ICE library" >&5
13976 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13977 fi
13978
13979 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
13980         test -n "$verbose" && echo "    found package sm" 1>&6
13981
13982 echo "${as_me:-configure}:13982: testing found package sm ..." 1>&5
13983
13984         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
13985         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
13986         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13987
13988 echo "${as_me:-configure}:13988: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13989
13990         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13991
13992 echo "${as_me:-configure}:13992: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13993
13994 cf_fix_cppflags=no
13995 cf_new_cflags=
13996 cf_new_cppflags=
13997 cf_new_extra_cppflags=
13998
13999 for cf_add_cflags in $cf_pkgconfig_incs
14000 do
14001 case "$cf_fix_cppflags" in
14002 (no)
14003         case "$cf_add_cflags" in
14004         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14005                 case "$cf_add_cflags" in
14006                 (-D*)
14007                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14008
14009                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14010                                 && test -z "${cf_tst_cflags}" \
14011                                 && cf_fix_cppflags=yes
14012
14013                         if test "$cf_fix_cppflags" = yes ; then
14014
14015         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14016         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14017
14018                                 continue
14019                         elif test "${cf_tst_cflags}" = "\"'" ; then
14020
14021         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14022         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14023
14024                                 continue
14025                         fi
14026                         ;;
14027                 esac
14028                 case "$CPPFLAGS" in
14029                 (*$cf_add_cflags)
14030                         ;;
14031                 (*)
14032                         case "$cf_add_cflags" in
14033                         (-D*)
14034                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14035
14036 CPPFLAGS=`echo "$CPPFLAGS" | \
14037         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14038                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14039
14040                                 ;;
14041                         esac
14042
14043         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14044         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14045
14046                         ;;
14047                 esac
14048                 ;;
14049         (*)
14050
14051         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14052         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14053
14054                 ;;
14055         esac
14056         ;;
14057 (yes)
14058
14059         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14060         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14061
14062         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14063
14064         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14065                 && test -z "${cf_tst_cflags}" \
14066                 && cf_fix_cppflags=no
14067         ;;
14068 esac
14069 done
14070
14071 if test -n "$cf_new_cflags" ; then
14072
14073         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14074         CFLAGS="${CFLAGS}$cf_new_cflags"
14075
14076 fi
14077
14078 if test -n "$cf_new_cppflags" ; then
14079
14080         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14081         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14082
14083 fi
14084
14085 if test -n "$cf_new_extra_cppflags" ; then
14086
14087         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14088         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14089
14090 fi
14091
14092 cf_add_libs="$LIBS"
14093 # reverse order
14094 cf_add_0lib=
14095 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14096 # filter duplicates
14097 for cf_add_1lib in $cf_add_0lib; do
14098         for cf_add_2lib in $cf_add_libs; do
14099                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14100                         cf_add_1lib=
14101                         break
14102                 fi
14103         done
14104         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14105 done
14106 LIBS="$cf_add_libs"
14107
14108         :
14109 else
14110         cf_pkgconfig_incs=
14111         cf_pkgconfig_libs=
14112         { echo "$as_me:14112: WARNING: unable to find SM library" >&5
14113 echo "$as_me: WARNING: unable to find SM library" >&2;}
14114 fi
14115
14116 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14117         test -n "$verbose" && echo "    found package xt" 1>&6
14118
14119 echo "${as_me:-configure}:14119: testing found package xt ..." 1>&5
14120
14121         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14122         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14123         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14124
14125 echo "${as_me:-configure}:14125: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14126
14127         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14128
14129 echo "${as_me:-configure}:14129: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14130
14131 cf_fix_cppflags=no
14132 cf_new_cflags=
14133 cf_new_cppflags=
14134 cf_new_extra_cppflags=
14135
14136 for cf_add_cflags in $cf_pkgconfig_incs
14137 do
14138 case "$cf_fix_cppflags" in
14139 (no)
14140         case "$cf_add_cflags" in
14141         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14142                 case "$cf_add_cflags" in
14143                 (-D*)
14144                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14145
14146                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14147                                 && test -z "${cf_tst_cflags}" \
14148                                 && cf_fix_cppflags=yes
14149
14150                         if test "$cf_fix_cppflags" = yes ; then
14151
14152         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14153         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14154
14155                                 continue
14156                         elif test "${cf_tst_cflags}" = "\"'" ; then
14157
14158         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14159         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14160
14161                                 continue
14162                         fi
14163                         ;;
14164                 esac
14165                 case "$CPPFLAGS" in
14166                 (*$cf_add_cflags)
14167                         ;;
14168                 (*)
14169                         case "$cf_add_cflags" in
14170                         (-D*)
14171                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14172
14173 CPPFLAGS=`echo "$CPPFLAGS" | \
14174         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14175                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14176
14177                                 ;;
14178                         esac
14179
14180         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14181         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14182
14183                         ;;
14184                 esac
14185                 ;;
14186         (*)
14187
14188         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14189         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14190
14191                 ;;
14192         esac
14193         ;;
14194 (yes)
14195
14196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14198
14199         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14200
14201         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14202                 && test -z "${cf_tst_cflags}" \
14203                 && cf_fix_cppflags=no
14204         ;;
14205 esac
14206 done
14207
14208 if test -n "$cf_new_cflags" ; then
14209
14210         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14211         CFLAGS="${CFLAGS}$cf_new_cflags"
14212
14213 fi
14214
14215 if test -n "$cf_new_cppflags" ; then
14216
14217         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14218         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14219
14220 fi
14221
14222 if test -n "$cf_new_extra_cppflags" ; then
14223
14224         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14225         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14226
14227 fi
14228
14229 cf_add_libs="$LIBS"
14230 # reverse order
14231 cf_add_0lib=
14232 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14233 # filter duplicates
14234 for cf_add_1lib in $cf_add_0lib; do
14235         for cf_add_2lib in $cf_add_libs; do
14236                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14237                         cf_add_1lib=
14238                         break
14239                 fi
14240         done
14241         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14242 done
14243 LIBS="$cf_add_libs"
14244
14245         :
14246 else
14247         cf_pkgconfig_incs=
14248         cf_pkgconfig_libs=
14249         { echo "$as_me:14249: WARNING: unable to find Xt library" >&5
14250 echo "$as_me: WARNING: unable to find Xt library" >&2;}
14251 fi
14252
14253 else
14254         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14255 fi
14256
14257 cf_have_X_LIBS=no
14258
14259 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "xt"; then
14260         test -n "$verbose" && echo "    found package xt" 1>&6
14261
14262 echo "${as_me:-configure}:14262: testing found package xt ..." 1>&5
14263
14264         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "xt" 2>/dev/null`"
14265         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "xt" 2>/dev/null`"
14266         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
14267
14268 echo "${as_me:-configure}:14268: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14269
14270         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
14271
14272 echo "${as_me:-configure}:14272: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
14273
14274 cf_fix_cppflags=no
14275 cf_new_cflags=
14276 cf_new_cppflags=
14277 cf_new_extra_cppflags=
14278
14279 for cf_add_cflags in $cf_pkgconfig_incs
14280 do
14281 case "$cf_fix_cppflags" in
14282 (no)
14283         case "$cf_add_cflags" in
14284         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14285                 case "$cf_add_cflags" in
14286                 (-D*)
14287                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14288
14289                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14290                                 && test -z "${cf_tst_cflags}" \
14291                                 && cf_fix_cppflags=yes
14292
14293                         if test "$cf_fix_cppflags" = yes ; then
14294
14295         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14296         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14297
14298                                 continue
14299                         elif test "${cf_tst_cflags}" = "\"'" ; then
14300
14301         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14302         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14303
14304                                 continue
14305                         fi
14306                         ;;
14307                 esac
14308                 case "$CPPFLAGS" in
14309                 (*$cf_add_cflags)
14310                         ;;
14311                 (*)
14312                         case "$cf_add_cflags" in
14313                         (-D*)
14314                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14315
14316 CPPFLAGS=`echo "$CPPFLAGS" | \
14317         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14318                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14319
14320                                 ;;
14321                         esac
14322
14323         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14324         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14325
14326                         ;;
14327                 esac
14328                 ;;
14329         (*)
14330
14331         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14332         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14333
14334                 ;;
14335         esac
14336         ;;
14337 (yes)
14338
14339         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14340         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14341
14342         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14343
14344         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14345                 && test -z "${cf_tst_cflags}" \
14346                 && cf_fix_cppflags=no
14347         ;;
14348 esac
14349 done
14350
14351 if test -n "$cf_new_cflags" ; then
14352
14353         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14354         CFLAGS="${CFLAGS}$cf_new_cflags"
14355
14356 fi
14357
14358 if test -n "$cf_new_cppflags" ; then
14359
14360         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14361         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14362
14363 fi
14364
14365 if test -n "$cf_new_extra_cppflags" ; then
14366
14367         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14368         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14369
14370 fi
14371
14372 cf_add_libs="$LIBS"
14373 # reverse order
14374 cf_add_0lib=
14375 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14376 # filter duplicates
14377 for cf_add_1lib in $cf_add_0lib; do
14378         for cf_add_2lib in $cf_add_libs; do
14379                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14380                         cf_add_1lib=
14381                         break
14382                 fi
14383         done
14384         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14385 done
14386 LIBS="$cf_add_libs"
14387
14388         case "x$LIBS" in
14389         (*-lX11*)
14390                 ;;
14391         (*)
14392 # we have an "xt" package, but it may omit Xt's dependency on X11
14393 echo "$as_me:14393: checking for usable X dependency" >&5
14394 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14395 if test "${cf_cv_xt_x11_compat+set}" = set; then
14396   echo $ECHO_N "(cached) $ECHO_C" >&6
14397 else
14398
14399 cat >"conftest.$ac_ext" <<_ACEOF
14400 #line 14400 "configure"
14401 #include "confdefs.h"
14402
14403 #include <X11/Xlib.h>
14404
14405 int
14406 main (void)
14407 {
14408
14409         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14410         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14411         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14412         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14413
14414   ;
14415   return 0;
14416 }
14417 _ACEOF
14418 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14419 if { (eval echo "$as_me:14419: \"$ac_link\"") >&5
14420   (eval $ac_link) 2>&5
14421   ac_status=$?
14422   echo "$as_me:14422: \$? = $ac_status" >&5
14423   (exit "$ac_status"); } &&
14424          { ac_try='test -s "conftest$ac_exeext"'
14425   { (eval echo "$as_me:14425: \"$ac_try\"") >&5
14426   (eval $ac_try) 2>&5
14427   ac_status=$?
14428   echo "$as_me:14428: \$? = $ac_status" >&5
14429   (exit "$ac_status"); }; }; then
14430   cf_cv_xt_x11_compat=yes
14431 else
14432   echo "$as_me: failed program was:" >&5
14433 cat "conftest.$ac_ext" >&5
14434 cf_cv_xt_x11_compat=no
14435 fi
14436 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14437 fi
14438 echo "$as_me:14438: result: $cf_cv_xt_x11_compat" >&5
14439 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14440                 if test "$cf_cv_xt_x11_compat" = no
14441                 then
14442                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14443
14444 echo "${as_me:-configure}:14444: testing work around broken X11 dependency ..." 1>&5
14445
14446                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14447
14448 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "x11"; then
14449         test -n "$verbose" && echo "    found package x11" 1>&6
14450
14451 echo "${as_me:-configure}:14451: testing found package x11 ..." 1>&5
14452
14453         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "x11" 2>/dev/null`"
14454         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "x11" 2>/dev/null`"
14455         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14456
14457 echo "${as_me:-configure}:14457: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14458
14459         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14460
14461 echo "${as_me:-configure}:14461: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14462
14463 cf_fix_cppflags=no
14464 cf_new_cflags=
14465 cf_new_cppflags=
14466 cf_new_extra_cppflags=
14467
14468 for cf_add_cflags in $cf_pkgconfig_incs
14469 do
14470 case "$cf_fix_cppflags" in
14471 (no)
14472         case "$cf_add_cflags" in
14473         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14474                 case "$cf_add_cflags" in
14475                 (-D*)
14476                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14477
14478                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14479                                 && test -z "${cf_tst_cflags}" \
14480                                 && cf_fix_cppflags=yes
14481
14482                         if test "$cf_fix_cppflags" = yes ; then
14483
14484         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14485         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14486
14487                                 continue
14488                         elif test "${cf_tst_cflags}" = "\"'" ; then
14489
14490         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14491         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14492
14493                                 continue
14494                         fi
14495                         ;;
14496                 esac
14497                 case "$CPPFLAGS" in
14498                 (*$cf_add_cflags)
14499                         ;;
14500                 (*)
14501                         case "$cf_add_cflags" in
14502                         (-D*)
14503                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14504
14505 CPPFLAGS=`echo "$CPPFLAGS" | \
14506         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14507                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14508
14509                                 ;;
14510                         esac
14511
14512         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14513         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14514
14515                         ;;
14516                 esac
14517                 ;;
14518         (*)
14519
14520         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14521         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14522
14523                 ;;
14524         esac
14525         ;;
14526 (yes)
14527
14528         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14529         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14530
14531         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14532
14533         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14534                 && test -z "${cf_tst_cflags}" \
14535                 && cf_fix_cppflags=no
14536         ;;
14537 esac
14538 done
14539
14540 if test -n "$cf_new_cflags" ; then
14541
14542         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14543         CFLAGS="${CFLAGS}$cf_new_cflags"
14544
14545 fi
14546
14547 if test -n "$cf_new_cppflags" ; then
14548
14549         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14550         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14551
14552 fi
14553
14554 if test -n "$cf_new_extra_cppflags" ; then
14555
14556         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14557         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14558
14559 fi
14560
14561 cf_add_libs="$LIBS"
14562 # reverse order
14563 cf_add_0lib=
14564 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14565 # filter duplicates
14566 for cf_add_1lib in $cf_add_0lib; do
14567         for cf_add_2lib in $cf_add_libs; do
14568                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14569                         cf_add_1lib=
14570                         break
14571                 fi
14572         done
14573         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14574 done
14575 LIBS="$cf_add_libs"
14576
14577         :
14578 else
14579         cf_pkgconfig_incs=
14580         cf_pkgconfig_libs=
14581
14582 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14583
14584 echo "${as_me:-configure}:14584: testing ...before $LIBS ..." 1>&5
14585
14586 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14587 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14588
14589 echo "${as_me:-configure}:14589: testing ...after  $LIBS ..." 1>&5
14590
14591 fi
14592
14593                 fi
14594                 ;;
14595         esac
14596
14597 echo "$as_me:14597: checking for usable X Toolkit package" >&5
14598 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14599 if test "${cf_cv_xt_ice_compat+set}" = set; then
14600   echo $ECHO_N "(cached) $ECHO_C" >&6
14601 else
14602
14603 cat >"conftest.$ac_ext" <<_ACEOF
14604 #line 14604 "configure"
14605 #include "confdefs.h"
14606
14607 #include <X11/Shell.h>
14608
14609 int
14610 main (void)
14611 {
14612 int num = IceConnectionNumber(0); (void) num
14613
14614   ;
14615   return 0;
14616 }
14617 _ACEOF
14618 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14619 if { (eval echo "$as_me:14619: \"$ac_link\"") >&5
14620   (eval $ac_link) 2>&5
14621   ac_status=$?
14622   echo "$as_me:14622: \$? = $ac_status" >&5
14623   (exit "$ac_status"); } &&
14624          { ac_try='test -s "conftest$ac_exeext"'
14625   { (eval echo "$as_me:14625: \"$ac_try\"") >&5
14626   (eval $ac_try) 2>&5
14627   ac_status=$?
14628   echo "$as_me:14628: \$? = $ac_status" >&5
14629   (exit "$ac_status"); }; }; then
14630   cf_cv_xt_ice_compat=yes
14631 else
14632   echo "$as_me: failed program was:" >&5
14633 cat "conftest.$ac_ext" >&5
14634 cf_cv_xt_ice_compat=no
14635 fi
14636 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14637 fi
14638 echo "$as_me:14638: result: $cf_cv_xt_ice_compat" >&5
14639 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14640
14641         if test "$cf_cv_xt_ice_compat" = no
14642         then
14643                 # workaround for broken ".pc" files used for X Toolkit.
14644                 case "x$X_PRE_LIBS" in
14645                 (*-lICE*)
14646                         case "x$LIBS" in
14647                         (*-lICE*)
14648                                 ;;
14649                         (*)
14650                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14651
14652 echo "${as_me:-configure}:14652: testing work around broken ICE dependency ..." 1>&5
14653
14654 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "ice"; then
14655         test -n "$verbose" && echo "    found package ice" 1>&6
14656
14657 echo "${as_me:-configure}:14657: testing found package ice ..." 1>&5
14658
14659         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "ice" 2>/dev/null`"
14660         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "ice" 2>/dev/null`"
14661         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14662
14663 echo "${as_me:-configure}:14663: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14664
14665         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14666
14667 echo "${as_me:-configure}:14667: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14668
14669 cf_fix_cppflags=no
14670 cf_new_cflags=
14671 cf_new_cppflags=
14672 cf_new_extra_cppflags=
14673
14674 for cf_add_cflags in $cf_pkgconfig_incs
14675 do
14676 case "$cf_fix_cppflags" in
14677 (no)
14678         case "$cf_add_cflags" in
14679         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14680                 case "$cf_add_cflags" in
14681                 (-D*)
14682                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14683
14684                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14685                                 && test -z "${cf_tst_cflags}" \
14686                                 && cf_fix_cppflags=yes
14687
14688                         if test "$cf_fix_cppflags" = yes ; then
14689
14690         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14691         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14692
14693                                 continue
14694                         elif test "${cf_tst_cflags}" = "\"'" ; then
14695
14696         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14697         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14698
14699                                 continue
14700                         fi
14701                         ;;
14702                 esac
14703                 case "$CPPFLAGS" in
14704                 (*$cf_add_cflags)
14705                         ;;
14706                 (*)
14707                         case "$cf_add_cflags" in
14708                         (-D*)
14709                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14710
14711 CPPFLAGS=`echo "$CPPFLAGS" | \
14712         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14713                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14714
14715                                 ;;
14716                         esac
14717
14718         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14719         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14720
14721                         ;;
14722                 esac
14723                 ;;
14724         (*)
14725
14726         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14727         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14728
14729                 ;;
14730         esac
14731         ;;
14732 (yes)
14733
14734         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14735         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14736
14737         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14738
14739         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14740                 && test -z "${cf_tst_cflags}" \
14741                 && cf_fix_cppflags=no
14742         ;;
14743 esac
14744 done
14745
14746 if test -n "$cf_new_cflags" ; then
14747
14748         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14749         CFLAGS="${CFLAGS}$cf_new_cflags"
14750
14751 fi
14752
14753 if test -n "$cf_new_cppflags" ; then
14754
14755         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14756         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14757
14758 fi
14759
14760 if test -n "$cf_new_extra_cppflags" ; then
14761
14762         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14763         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14764
14765 fi
14766
14767 cf_add_libs="$LIBS"
14768 # reverse order
14769 cf_add_0lib=
14770 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14771 # filter duplicates
14772 for cf_add_1lib in $cf_add_0lib; do
14773         for cf_add_2lib in $cf_add_libs; do
14774                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14775                         cf_add_1lib=
14776                         break
14777                 fi
14778         done
14779         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14780 done
14781 LIBS="$cf_add_libs"
14782
14783 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "sm"; then
14784         test -n "$verbose" && echo "    found package sm" 1>&6
14785
14786 echo "${as_me:-configure}:14786: testing found package sm ..." 1>&5
14787
14788         cf_pkgconfig_incs="`$PKG_CONFIG --cflags "sm" 2>/dev/null`"
14789         cf_pkgconfig_libs="`$PKG_CONFIG --libs   "sm" 2>/dev/null`"
14790         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14791
14792 echo "${as_me:-configure}:14792: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14793
14794         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14795
14796 echo "${as_me:-configure}:14796: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14797
14798 cf_fix_cppflags=no
14799 cf_new_cflags=
14800 cf_new_cppflags=
14801 cf_new_extra_cppflags=
14802
14803 for cf_add_cflags in $cf_pkgconfig_incs
14804 do
14805 case "$cf_fix_cppflags" in
14806 (no)
14807         case "$cf_add_cflags" in
14808         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14809                 case "$cf_add_cflags" in
14810                 (-D*)
14811                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14812
14813                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14814                                 && test -z "${cf_tst_cflags}" \
14815                                 && cf_fix_cppflags=yes
14816
14817                         if test "$cf_fix_cppflags" = yes ; then
14818
14819         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14820         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14821
14822                                 continue
14823                         elif test "${cf_tst_cflags}" = "\"'" ; then
14824
14825         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14826         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14827
14828                                 continue
14829                         fi
14830                         ;;
14831                 esac
14832                 case "$CPPFLAGS" in
14833                 (*$cf_add_cflags)
14834                         ;;
14835                 (*)
14836                         case "$cf_add_cflags" in
14837                         (-D*)
14838                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14839
14840 CPPFLAGS=`echo "$CPPFLAGS" | \
14841         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14842                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14843
14844                                 ;;
14845                         esac
14846
14847         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14848         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14849
14850                         ;;
14851                 esac
14852                 ;;
14853         (*)
14854
14855         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14856         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14857
14858                 ;;
14859         esac
14860         ;;
14861 (yes)
14862
14863         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14864         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14865
14866         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14867
14868         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14869                 && test -z "${cf_tst_cflags}" \
14870                 && cf_fix_cppflags=no
14871         ;;
14872 esac
14873 done
14874
14875 if test -n "$cf_new_cflags" ; then
14876
14877         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14878         CFLAGS="${CFLAGS}$cf_new_cflags"
14879
14880 fi
14881
14882 if test -n "$cf_new_cppflags" ; then
14883
14884         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14885         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14886
14887 fi
14888
14889 if test -n "$cf_new_extra_cppflags" ; then
14890
14891         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14892         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14893
14894 fi
14895
14896 cf_add_libs="$LIBS"
14897 # reverse order
14898 cf_add_0lib=
14899 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14900 # filter duplicates
14901 for cf_add_1lib in $cf_add_0lib; do
14902         for cf_add_2lib in $cf_add_libs; do
14903                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14904                         cf_add_1lib=
14905                         break
14906                 fi
14907         done
14908         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14909 done
14910 LIBS="$cf_add_libs"
14911
14912         :
14913 else
14914         cf_pkgconfig_incs=
14915         cf_pkgconfig_libs=
14916         :
14917 fi
14918
14919 else
14920         cf_pkgconfig_incs=
14921         cf_pkgconfig_libs=
14922
14923 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14924
14925 echo "${as_me:-configure}:14925: testing ...before $LIBS ..." 1>&5
14926
14927 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14928 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14929
14930 echo "${as_me:-configure}:14930: testing ...after  $LIBS ..." 1>&5
14931
14932 fi
14933
14934                                 ;;
14935                         esac
14936                         ;;
14937                 esac
14938         fi
14939
14940         cf_have_X_LIBS=yes
14941
14942 else
14943         cf_pkgconfig_incs=
14944         cf_pkgconfig_libs=
14945
14946         LDFLAGS="$X_LIBS $LDFLAGS"
14947
14948 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14949
14950 echo "${as_me:-configure}:14950: testing checking additions to CFLAGS ..." 1>&5
14951
14952 cf_check_cflags="$CFLAGS"
14953 cf_check_cppflags="$CPPFLAGS"
14954
14955 cf_fix_cppflags=no
14956 cf_new_cflags=
14957 cf_new_cppflags=
14958 cf_new_extra_cppflags=
14959
14960 for cf_add_cflags in $X_CFLAGS
14961 do
14962 case "$cf_fix_cppflags" in
14963 (no)
14964         case "$cf_add_cflags" in
14965         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14966                 case "$cf_add_cflags" in
14967                 (-D*)
14968                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14969
14970                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14971                                 && test -z "${cf_tst_cflags}" \
14972                                 && cf_fix_cppflags=yes
14973
14974                         if test "$cf_fix_cppflags" = yes ; then
14975
14976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14978
14979                                 continue
14980                         elif test "${cf_tst_cflags}" = "\"'" ; then
14981
14982         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14983         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14984
14985                                 continue
14986                         fi
14987                         ;;
14988                 esac
14989                 case "$CPPFLAGS" in
14990                 (*$cf_add_cflags)
14991                         ;;
14992                 (*)
14993                         case "$cf_add_cflags" in
14994                         (-D*)
14995                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14996
14997 CPPFLAGS=`echo "$CPPFLAGS" | \
14998         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14999                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15000
15001                                 ;;
15002                         esac
15003
15004         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15005         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15006
15007                         ;;
15008                 esac
15009                 ;;
15010         (*)
15011
15012         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15013         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15014
15015                 ;;
15016         esac
15017         ;;
15018 (yes)
15019
15020         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15021         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15022
15023         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15024
15025         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15026                 && test -z "${cf_tst_cflags}" \
15027                 && cf_fix_cppflags=no
15028         ;;
15029 esac
15030 done
15031
15032 if test -n "$cf_new_cflags" ; then
15033         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15034
15035 echo "${as_me:-configure}:15035: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15036
15037         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15038         CFLAGS="${CFLAGS}$cf_new_cflags"
15039
15040 fi
15041
15042 if test -n "$cf_new_cppflags" ; then
15043         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15044
15045 echo "${as_me:-configure}:15045: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15046
15047         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15048         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15049
15050 fi
15051
15052 if test -n "$cf_new_extra_cppflags" ; then
15053         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15054
15055 echo "${as_me:-configure}:15055: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15056
15057         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15058         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15059
15060 fi
15061
15062 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15063 cat >"conftest.$ac_ext" <<_ACEOF
15064 #line 15064 "configure"
15065 #include "confdefs.h"
15066 #include <stdio.h>
15067 int
15068 main (void)
15069 {
15070 printf("Hello world");
15071   ;
15072   return 0;
15073 }
15074 _ACEOF
15075 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15076 if { (eval echo "$as_me:15076: \"$ac_link\"") >&5
15077   (eval $ac_link) 2>&5
15078   ac_status=$?
15079   echo "$as_me:15079: \$? = $ac_status" >&5
15080   (exit "$ac_status"); } &&
15081          { ac_try='test -s "conftest$ac_exeext"'
15082   { (eval echo "$as_me:15082: \"$ac_try\"") >&5
15083   (eval $ac_try) 2>&5
15084   ac_status=$?
15085   echo "$as_me:15085: \$? = $ac_status" >&5
15086   (exit "$ac_status"); }; }; then
15087   :
15088 else
15089   echo "$as_me: failed program was:" >&5
15090 cat "conftest.$ac_ext" >&5
15091 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15092
15093 echo "${as_me:-configure}:15093: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15094
15095          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15096                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15097
15098 echo "${as_me:-configure}:15098: testing but keeping change to \$CPPFLAGS ..." 1>&5
15099
15100          fi
15101          CFLAGS="$cf_check_cflags"
15102 fi
15103 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15104 fi
15105
15106         echo "$as_me:15106: checking for XOpenDisplay" >&5
15107 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
15108 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
15109   echo $ECHO_N "(cached) $ECHO_C" >&6
15110 else
15111   cat >"conftest.$ac_ext" <<_ACEOF
15112 #line 15112 "configure"
15113 #include "confdefs.h"
15114 #define XOpenDisplay autoconf_temporary
15115 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15116 #undef XOpenDisplay
15117
15118 #ifdef __cplusplus
15119 extern "C"
15120 #endif
15121
15122 /* We use char because int might match the return type of a gcc2
15123    builtin and then its argument prototype would still apply.  */
15124 char XOpenDisplay (void);
15125
15126 int
15127 main (void)
15128 {
15129
15130 /* The GNU C library defines stubs for functions which it implements
15131     to always fail with ENOSYS.  Some functions are actually named
15132     something starting with __ and the normal name is an alias.  */
15133 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
15134 #error found stub for XOpenDisplay
15135 #endif
15136
15137         return XOpenDisplay ();
15138   ;
15139   return 0;
15140 }
15141 _ACEOF
15142 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15143 if { (eval echo "$as_me:15143: \"$ac_link\"") >&5
15144   (eval $ac_link) 2>&5
15145   ac_status=$?
15146   echo "$as_me:15146: \$? = $ac_status" >&5
15147   (exit "$ac_status"); } &&
15148          { ac_try='test -s "conftest$ac_exeext"'
15149   { (eval echo "$as_me:15149: \"$ac_try\"") >&5
15150   (eval $ac_try) 2>&5
15151   ac_status=$?
15152   echo "$as_me:15152: \$? = $ac_status" >&5
15153   (exit "$ac_status"); }; }; then
15154   ac_cv_func_XOpenDisplay=yes
15155 else
15156   echo "$as_me: failed program was:" >&5
15157 cat "conftest.$ac_ext" >&5
15158 ac_cv_func_XOpenDisplay=no
15159 fi
15160 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15161 fi
15162 echo "$as_me:15162: result: $ac_cv_func_XOpenDisplay" >&5
15163 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
15164 if test "$ac_cv_func_XOpenDisplay" = yes; then
15165   :
15166 else
15167
15168         echo "$as_me:15168: checking for XOpenDisplay in -lX11" >&5
15169 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15170 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15171   echo $ECHO_N "(cached) $ECHO_C" >&6
15172 else
15173   ac_check_lib_save_LIBS=$LIBS
15174 LIBS="-lX11  $LIBS"
15175 cat >"conftest.$ac_ext" <<_ACEOF
15176 #line 15176 "configure"
15177 #include "confdefs.h"
15178
15179 /* Override any gcc2 internal prototype to avoid an error.  */
15180 #ifdef __cplusplus
15181 extern "C"
15182 #endif
15183 /* We use char because int might match the return type of a gcc2
15184    builtin and then its argument prototype would still apply.  */
15185 char XOpenDisplay ();
15186 int
15187 main (void)
15188 {
15189 XOpenDisplay ();
15190   ;
15191   return 0;
15192 }
15193 _ACEOF
15194 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15195 if { (eval echo "$as_me:15195: \"$ac_link\"") >&5
15196   (eval $ac_link) 2>&5
15197   ac_status=$?
15198   echo "$as_me:15198: \$? = $ac_status" >&5
15199   (exit "$ac_status"); } &&
15200          { ac_try='test -s "conftest$ac_exeext"'
15201   { (eval echo "$as_me:15201: \"$ac_try\"") >&5
15202   (eval $ac_try) 2>&5
15203   ac_status=$?
15204   echo "$as_me:15204: \$? = $ac_status" >&5
15205   (exit "$ac_status"); }; }; then
15206   ac_cv_lib_X11_XOpenDisplay=yes
15207 else
15208   echo "$as_me: failed program was:" >&5
15209 cat "conftest.$ac_ext" >&5
15210 ac_cv_lib_X11_XOpenDisplay=no
15211 fi
15212 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15213 LIBS=$ac_check_lib_save_LIBS
15214 fi
15215 echo "$as_me:15215: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15216 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15217 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
15218
15219 cf_add_libs="$LIBS"
15220 # reverse order
15221 cf_add_0lib=
15222 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15223 # filter duplicates
15224 for cf_add_1lib in $cf_add_0lib; do
15225         for cf_add_2lib in $cf_add_libs; do
15226                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15227                         cf_add_1lib=
15228                         break
15229                 fi
15230         done
15231         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15232 done
15233 LIBS="$cf_add_libs"
15234
15235 fi
15236
15237 fi
15238
15239         echo "$as_me:15239: checking for XtAppInitialize" >&5
15240 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
15241 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
15242   echo $ECHO_N "(cached) $ECHO_C" >&6
15243 else
15244   cat >"conftest.$ac_ext" <<_ACEOF
15245 #line 15245 "configure"
15246 #include "confdefs.h"
15247 #define XtAppInitialize autoconf_temporary
15248 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15249 #undef XtAppInitialize
15250
15251 #ifdef __cplusplus
15252 extern "C"
15253 #endif
15254
15255 /* We use char because int might match the return type of a gcc2
15256    builtin and then its argument prototype would still apply.  */
15257 char XtAppInitialize (void);
15258
15259 int
15260 main (void)
15261 {
15262
15263 /* The GNU C library defines stubs for functions which it implements
15264     to always fail with ENOSYS.  Some functions are actually named
15265     something starting with __ and the normal name is an alias.  */
15266 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
15267 #error found stub for XtAppInitialize
15268 #endif
15269
15270         return XtAppInitialize ();
15271   ;
15272   return 0;
15273 }
15274 _ACEOF
15275 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15276 if { (eval echo "$as_me:15276: \"$ac_link\"") >&5
15277   (eval $ac_link) 2>&5
15278   ac_status=$?
15279   echo "$as_me:15279: \$? = $ac_status" >&5
15280   (exit "$ac_status"); } &&
15281          { ac_try='test -s "conftest$ac_exeext"'
15282   { (eval echo "$as_me:15282: \"$ac_try\"") >&5
15283   (eval $ac_try) 2>&5
15284   ac_status=$?
15285   echo "$as_me:15285: \$? = $ac_status" >&5
15286   (exit "$ac_status"); }; }; then
15287   ac_cv_func_XtAppInitialize=yes
15288 else
15289   echo "$as_me: failed program was:" >&5
15290 cat "conftest.$ac_ext" >&5
15291 ac_cv_func_XtAppInitialize=no
15292 fi
15293 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15294 fi
15295 echo "$as_me:15295: result: $ac_cv_func_XtAppInitialize" >&5
15296 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15297 if test "$ac_cv_func_XtAppInitialize" = yes; then
15298   :
15299 else
15300
15301         echo "$as_me:15301: checking for XtAppInitialize in -lXt" >&5
15302 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15303 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15304   echo $ECHO_N "(cached) $ECHO_C" >&6
15305 else
15306   ac_check_lib_save_LIBS=$LIBS
15307 LIBS="-lXt  $LIBS"
15308 cat >"conftest.$ac_ext" <<_ACEOF
15309 #line 15309 "configure"
15310 #include "confdefs.h"
15311
15312 /* Override any gcc2 internal prototype to avoid an error.  */
15313 #ifdef __cplusplus
15314 extern "C"
15315 #endif
15316 /* We use char because int might match the return type of a gcc2
15317    builtin and then its argument prototype would still apply.  */
15318 char XtAppInitialize ();
15319 int
15320 main (void)
15321 {
15322 XtAppInitialize ();
15323   ;
15324   return 0;
15325 }
15326 _ACEOF
15327 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15328 if { (eval echo "$as_me:15328: \"$ac_link\"") >&5
15329   (eval $ac_link) 2>&5
15330   ac_status=$?
15331   echo "$as_me:15331: \$? = $ac_status" >&5
15332   (exit "$ac_status"); } &&
15333          { ac_try='test -s "conftest$ac_exeext"'
15334   { (eval echo "$as_me:15334: \"$ac_try\"") >&5
15335   (eval $ac_try) 2>&5
15336   ac_status=$?
15337   echo "$as_me:15337: \$? = $ac_status" >&5
15338   (exit "$ac_status"); }; }; then
15339   ac_cv_lib_Xt_XtAppInitialize=yes
15340 else
15341   echo "$as_me: failed program was:" >&5
15342 cat "conftest.$ac_ext" >&5
15343 ac_cv_lib_Xt_XtAppInitialize=no
15344 fi
15345 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15346 LIBS=$ac_check_lib_save_LIBS
15347 fi
15348 echo "$as_me:15348: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15349 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15350 if test "$ac_cv_lib_Xt_XtAppInitialize" = yes; then
15351
15352 cat >>confdefs.h <<\EOF
15353 #define HAVE_LIBXT 1
15354 EOF
15355
15356                  cf_have_X_LIBS=Xt
15357                  LIBS="-lXt $LIBS"
15358 fi
15359
15360 fi
15361
15362 fi
15363
15364 if test "$cf_have_X_LIBS" = no ; then
15365         { echo "$as_me:15365: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15366 test program.  You will have to check and add the proper libraries by hand
15367 to makefile." >&5
15368 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15369 test program.  You will have to check and add the proper libraries by hand
15370 to makefile." >&2;}
15371 fi
15372
15373 cf_x_athena_root=$cf_x_athena
15374 cf_x_athena_inc=""
15375
15376 for cf_path in default \
15377         /usr/contrib/X11R6 \
15378         /usr/contrib/X11R5 \
15379         /usr/lib/X11R5 \
15380         /usr/local
15381 do
15382         if test -z "$cf_x_athena_inc" ; then
15383
15384 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15385 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15386 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15387 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15388 for cf_X_CFLAGS in $X_CFLAGS
15389 do
15390         case "x$cf_X_CFLAGS" in
15391         x-[IUD]*)
15392                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15393                 ;;
15394         *)
15395                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15396                 ;;
15397         esac
15398 done
15399
15400                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15401                 if test "$cf_path" != default ; then
15402
15403         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15404         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15405
15406                         echo "$as_me:15406: checking for $cf_test in $cf_path" >&5
15407 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15408                 else
15409                         echo "$as_me:15409: checking for $cf_test" >&5
15410 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15411                 fi
15412                 cat >"conftest.$ac_ext" <<_ACEOF
15413 #line 15413 "configure"
15414 #include "confdefs.h"
15415
15416 #include <X11/Intrinsic.h>
15417 #include <$cf_test>
15418 int
15419 main (void)
15420 {
15421
15422   ;
15423   return 0;
15424 }
15425 _ACEOF
15426 rm -f "conftest.$ac_objext"
15427 if { (eval echo "$as_me:15427: \"$ac_compile\"") >&5
15428   (eval $ac_compile) 2>&5
15429   ac_status=$?
15430   echo "$as_me:15430: \$? = $ac_status" >&5
15431   (exit "$ac_status"); } &&
15432          { ac_try='test -s "conftest.$ac_objext"'
15433   { (eval echo "$as_me:15433: \"$ac_try\"") >&5
15434   (eval $ac_try) 2>&5
15435   ac_status=$?
15436   echo "$as_me:15436: \$? = $ac_status" >&5
15437   (exit "$ac_status"); }; }; then
15438   cf_result=yes
15439 else
15440   echo "$as_me: failed program was:" >&5
15441 cat "conftest.$ac_ext" >&5
15442 cf_result=no
15443 fi
15444 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15445                 echo "$as_me:15445: result: $cf_result" >&5
15446 echo "${ECHO_T}$cf_result" >&6
15447
15448 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15449 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15450 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15451
15452                 if test "$cf_result" = yes ; then
15453                         test "$cf_path"  = default && cf_x_athena_inc=default
15454                         test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
15455                         break
15456                 fi
15457         fi
15458 done
15459
15460 if test -z "$cf_x_athena_inc" ; then
15461         { echo "$as_me:15461: WARNING: Unable to find Athena header files" >&5
15462 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15463 elif test "$cf_x_athena_inc" != default ; then
15464
15465         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15466         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15467
15468 fi
15469
15470 cf_x_athena_root=$cf_x_athena
15471 cf_x_athena_lib=""
15472
15473 for cf_path in default \
15474         /usr/contrib/X11R6 \
15475         /usr/contrib/X11R5 \
15476         /usr/lib/X11R5 \
15477         /usr/local
15478 do
15479         for cf_lib in \
15480                 ${cf_x_athena_root} \
15481                 ${cf_x_athena_root}7 \
15482                 ${cf_x_athena_root}6
15483         do
15484         for cf_libs in \
15485                 "-l$cf_lib -lXmu" \
15486                 "-l$cf_lib -lXpm -lXmu" \
15487                 "-l${cf_lib}_s -lXmu_s"
15488         do
15489                 test -n "$cf_x_athena_lib" && break
15490
15491 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15492 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15493 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15494 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15495 for cf_X_CFLAGS in $X_CFLAGS
15496 do
15497         case "x$cf_X_CFLAGS" in
15498         x-[IUD]*)
15499                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15500                 ;;
15501         *)
15502                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15503                 ;;
15504         esac
15505 done
15506
15507                 cf_test=XawSimpleMenuAddGlobalActions
15508                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15509
15510 cf_add_libs="$LIBS"
15511 # reverse order
15512 cf_add_0lib=
15513 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15514 # filter duplicates
15515 for cf_add_1lib in $cf_add_0lib; do
15516         for cf_add_2lib in $cf_add_libs; do
15517                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15518                         cf_add_1lib=
15519                         break
15520                 fi
15521         done
15522         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15523 done
15524 LIBS="$cf_add_libs"
15525
15526                 echo "$as_me:15526: checking for $cf_test in $cf_libs" >&5
15527 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15528                 cat >"conftest.$ac_ext" <<_ACEOF
15529 #line 15529 "configure"
15530 #include "confdefs.h"
15531
15532 #include <X11/Intrinsic.h>
15533 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15534
15535 int
15536 main (void)
15537 {
15538
15539 $cf_test((XtAppContext) 0)
15540   ;
15541   return 0;
15542 }
15543 _ACEOF
15544 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15545 if { (eval echo "$as_me:15545: \"$ac_link\"") >&5
15546   (eval $ac_link) 2>&5
15547   ac_status=$?
15548   echo "$as_me:15548: \$? = $ac_status" >&5
15549   (exit "$ac_status"); } &&
15550          { ac_try='test -s "conftest$ac_exeext"'
15551   { (eval echo "$as_me:15551: \"$ac_try\"") >&5
15552   (eval $ac_try) 2>&5
15553   ac_status=$?
15554   echo "$as_me:15554: \$? = $ac_status" >&5
15555   (exit "$ac_status"); }; }; then
15556   cf_result=yes
15557 else
15558   echo "$as_me: failed program was:" >&5
15559 cat "conftest.$ac_ext" >&5
15560 cf_result=no
15561 fi
15562 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15563                 echo "$as_me:15563: result: $cf_result" >&5
15564 echo "${ECHO_T}$cf_result" >&6
15565
15566 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15567 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15568 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15569
15570                 if test "$cf_result" = yes ; then
15571                         cf_x_athena_lib="$cf_libs"
15572                         break
15573                 fi
15574         done # cf_libs
15575                 test -n "$cf_x_athena_lib" && break
15576         done # cf_lib
15577 done
15578
15579 if test -z "$cf_x_athena_lib" ; then
15580         { { echo "$as_me:15580: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15581 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15582    { (exit 1); exit 1; }; }
15583 fi
15584
15585 cf_add_libs="$LIBS"
15586 # reverse order
15587 cf_add_0lib=
15588 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15589 # filter duplicates
15590 for cf_add_1lib in $cf_add_0lib; do
15591         for cf_add_2lib in $cf_add_libs; do
15592                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15593                         cf_add_1lib=
15594                         break
15595                 fi
15596         done
15597         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15598 done
15599 LIBS="$cf_add_libs"
15600
15601 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15602
15603 cat >>confdefs.h <<EOF
15604 #define $cf_x_athena_LIBS 1
15605 EOF
15606
15607 fi
15608
15609 if test -n "$ac_tool_prefix"; then
15610   for ac_prog in xcurses-config
15611   do
15612     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15613 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15614 echo "$as_me:15614: checking for $ac_word" >&5
15615 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15616 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15617   echo $ECHO_N "(cached) $ECHO_C" >&6
15618 else
15619   if test -n "$XCURSES_CONFIG"; then
15620   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15621 else
15622   ac_save_IFS=$IFS; IFS=$ac_path_separator
15623 ac_dummy="$PATH"
15624 for ac_dir in $ac_dummy; do
15625   IFS=$ac_save_IFS
15626   test -z "$ac_dir" && ac_dir=.
15627   $as_executable_p "$ac_dir/$ac_word" || continue
15628 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15629 echo "$as_me:15629: found $ac_dir/$ac_word" >&5
15630 break
15631 done
15632
15633 fi
15634 fi
15635 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15636 if test -n "$XCURSES_CONFIG"; then
15637   echo "$as_me:15637: result: $XCURSES_CONFIG" >&5
15638 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15639 else
15640   echo "$as_me:15640: result: no" >&5
15641 echo "${ECHO_T}no" >&6
15642 fi
15643
15644     test -n "$XCURSES_CONFIG" && break
15645   done
15646 fi
15647 if test -z "$XCURSES_CONFIG"; then
15648   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15649   for ac_prog in xcurses-config
15650 do
15651   # Extract the first word of "$ac_prog", so it can be a program name with args.
15652 set dummy $ac_prog; ac_word=$2
15653 echo "$as_me:15653: checking for $ac_word" >&5
15654 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15655 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15656   echo $ECHO_N "(cached) $ECHO_C" >&6
15657 else
15658   if test -n "$ac_ct_XCURSES_CONFIG"; then
15659   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15660 else
15661   ac_save_IFS=$IFS; IFS=$ac_path_separator
15662 ac_dummy="$PATH"
15663 for ac_dir in $ac_dummy; do
15664   IFS=$ac_save_IFS
15665   test -z "$ac_dir" && ac_dir=.
15666   $as_executable_p "$ac_dir/$ac_word" || continue
15667 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15668 echo "$as_me:15668: found $ac_dir/$ac_word" >&5
15669 break
15670 done
15671
15672 fi
15673 fi
15674 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15675 if test -n "$ac_ct_XCURSES_CONFIG"; then
15676   echo "$as_me:15676: result: $ac_ct_XCURSES_CONFIG" >&5
15677 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15678 else
15679   echo "$as_me:15679: result: no" >&5
15680 echo "${ECHO_T}no" >&6
15681 fi
15682
15683   test -n "$ac_ct_XCURSES_CONFIG" && break
15684 done
15685 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15686
15687   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15688 fi
15689
15690 if test "$XCURSES_CONFIG" != none ; then
15691
15692 cf_fix_cppflags=no
15693 cf_new_cflags=
15694 cf_new_cppflags=
15695 cf_new_extra_cppflags=
15696
15697 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15698 do
15699 case "$cf_fix_cppflags" in
15700 (no)
15701         case "$cf_add_cflags" in
15702         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15703                 case "$cf_add_cflags" in
15704                 (-D*)
15705                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15706
15707                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15708                                 && test -z "${cf_tst_cflags}" \
15709                                 && cf_fix_cppflags=yes
15710
15711                         if test "$cf_fix_cppflags" = yes ; then
15712
15713         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15714         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15715
15716                                 continue
15717                         elif test "${cf_tst_cflags}" = "\"'" ; then
15718
15719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15721
15722                                 continue
15723                         fi
15724                         ;;
15725                 esac
15726                 case "$CPPFLAGS" in
15727                 (*$cf_add_cflags)
15728                         ;;
15729                 (*)
15730                         case "$cf_add_cflags" in
15731                         (-D*)
15732                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15733
15734 CPPFLAGS=`echo "$CPPFLAGS" | \
15735         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15736                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15737
15738                                 ;;
15739                         esac
15740
15741         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15742         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15743
15744                         ;;
15745                 esac
15746                 ;;
15747         (*)
15748
15749         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15750         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15751
15752                 ;;
15753         esac
15754         ;;
15755 (yes)
15756
15757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15759
15760         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15761
15762         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15763                 && test -z "${cf_tst_cflags}" \
15764                 && cf_fix_cppflags=no
15765         ;;
15766 esac
15767 done
15768
15769 if test -n "$cf_new_cflags" ; then
15770
15771         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15772         CFLAGS="${CFLAGS}$cf_new_cflags"
15773
15774 fi
15775
15776 if test -n "$cf_new_cppflags" ; then
15777
15778         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15779         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15780
15781 fi
15782
15783 if test -n "$cf_new_extra_cppflags" ; then
15784
15785         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15786         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15787
15788 fi
15789
15790 cf_add_libs="$LIBS"
15791 # reverse order
15792 cf_add_0lib=
15793 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15794 # filter duplicates
15795 for cf_add_1lib in $cf_add_0lib; do
15796         for cf_add_2lib in $cf_add_libs; do
15797                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15798                         cf_add_1lib=
15799                         break
15800                 fi
15801         done
15802         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15803 done
15804 LIBS="$cf_add_libs"
15805
15806 cf_cv_lib_XCurses=yes
15807
15808 else
15809
15810 LDFLAGS="$LDFLAGS $X_LIBS"
15811
15812 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15813
15814 echo "${as_me:-configure}:15814: testing checking additions to CFLAGS ..." 1>&5
15815
15816 cf_check_cflags="$CFLAGS"
15817 cf_check_cppflags="$CPPFLAGS"
15818
15819 cf_fix_cppflags=no
15820 cf_new_cflags=
15821 cf_new_cppflags=
15822 cf_new_extra_cppflags=
15823
15824 for cf_add_cflags in $X_CFLAGS
15825 do
15826 case "$cf_fix_cppflags" in
15827 (no)
15828         case "$cf_add_cflags" in
15829         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15830                 case "$cf_add_cflags" in
15831                 (-D*)
15832                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15833
15834                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15835                                 && test -z "${cf_tst_cflags}" \
15836                                 && cf_fix_cppflags=yes
15837
15838                         if test "$cf_fix_cppflags" = yes ; then
15839
15840         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15841         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15842
15843                                 continue
15844                         elif test "${cf_tst_cflags}" = "\"'" ; then
15845
15846         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15847         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15848
15849                                 continue
15850                         fi
15851                         ;;
15852                 esac
15853                 case "$CPPFLAGS" in
15854                 (*$cf_add_cflags)
15855                         ;;
15856                 (*)
15857                         case "$cf_add_cflags" in
15858                         (-D*)
15859                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15860
15861 CPPFLAGS=`echo "$CPPFLAGS" | \
15862         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15863                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15864
15865                                 ;;
15866                         esac
15867
15868         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15869         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15870
15871                         ;;
15872                 esac
15873                 ;;
15874         (*)
15875
15876         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15877         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15878
15879                 ;;
15880         esac
15881         ;;
15882 (yes)
15883
15884         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15885         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15886
15887         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15888
15889         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15890                 && test -z "${cf_tst_cflags}" \
15891                 && cf_fix_cppflags=no
15892         ;;
15893 esac
15894 done
15895
15896 if test -n "$cf_new_cflags" ; then
15897         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15898
15899 echo "${as_me:-configure}:15899: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15900
15901         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15902         CFLAGS="${CFLAGS}$cf_new_cflags"
15903
15904 fi
15905
15906 if test -n "$cf_new_cppflags" ; then
15907         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15908
15909 echo "${as_me:-configure}:15909: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15910
15911         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15912         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15913
15914 fi
15915
15916 if test -n "$cf_new_extra_cppflags" ; then
15917         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15918
15919 echo "${as_me:-configure}:15919: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15920
15921         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15922         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15923
15924 fi
15925
15926 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15927 cat >"conftest.$ac_ext" <<_ACEOF
15928 #line 15928 "configure"
15929 #include "confdefs.h"
15930 #include <stdio.h>
15931 int
15932 main (void)
15933 {
15934 printf("Hello world");
15935   ;
15936   return 0;
15937 }
15938 _ACEOF
15939 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15940 if { (eval echo "$as_me:15940: \"$ac_link\"") >&5
15941   (eval $ac_link) 2>&5
15942   ac_status=$?
15943   echo "$as_me:15943: \$? = $ac_status" >&5
15944   (exit "$ac_status"); } &&
15945          { ac_try='test -s "conftest$ac_exeext"'
15946   { (eval echo "$as_me:15946: \"$ac_try\"") >&5
15947   (eval $ac_try) 2>&5
15948   ac_status=$?
15949   echo "$as_me:15949: \$? = $ac_status" >&5
15950   (exit "$ac_status"); }; }; then
15951   :
15952 else
15953   echo "$as_me: failed program was:" >&5
15954 cat "conftest.$ac_ext" >&5
15955 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15956
15957 echo "${as_me:-configure}:15957: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15958
15959          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15960                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15961
15962 echo "${as_me:-configure}:15962: testing but keeping change to \$CPPFLAGS ..." 1>&5
15963
15964          fi
15965          CFLAGS="$cf_check_cflags"
15966 fi
15967 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15968 fi
15969
15970 echo "$as_me:15970: checking for XOpenDisplay in -lX11" >&5
15971 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15972 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15973   echo $ECHO_N "(cached) $ECHO_C" >&6
15974 else
15975   ac_check_lib_save_LIBS=$LIBS
15976 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15977 cat >"conftest.$ac_ext" <<_ACEOF
15978 #line 15978 "configure"
15979 #include "confdefs.h"
15980
15981 /* Override any gcc2 internal prototype to avoid an error.  */
15982 #ifdef __cplusplus
15983 extern "C"
15984 #endif
15985 /* We use char because int might match the return type of a gcc2
15986    builtin and then its argument prototype would still apply.  */
15987 char XOpenDisplay ();
15988 int
15989 main (void)
15990 {
15991 XOpenDisplay ();
15992   ;
15993   return 0;
15994 }
15995 _ACEOF
15996 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15997 if { (eval echo "$as_me:15997: \"$ac_link\"") >&5
15998   (eval $ac_link) 2>&5
15999   ac_status=$?
16000   echo "$as_me:16000: \$? = $ac_status" >&5
16001   (exit "$ac_status"); } &&
16002          { ac_try='test -s "conftest$ac_exeext"'
16003   { (eval echo "$as_me:16003: \"$ac_try\"") >&5
16004   (eval $ac_try) 2>&5
16005   ac_status=$?
16006   echo "$as_me:16006: \$? = $ac_status" >&5
16007   (exit "$ac_status"); }; }; then
16008   ac_cv_lib_X11_XOpenDisplay=yes
16009 else
16010   echo "$as_me: failed program was:" >&5
16011 cat "conftest.$ac_ext" >&5
16012 ac_cv_lib_X11_XOpenDisplay=no
16013 fi
16014 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16015 LIBS=$ac_check_lib_save_LIBS
16016 fi
16017 echo "$as_me:16017: result: $ac_cv_lib_X11_XOpenDisplay" >&5
16018 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
16019 if test "$ac_cv_lib_X11_XOpenDisplay" = yes; then
16020
16021 cf_add_libs="$LIBS"
16022 # reverse order
16023 cf_add_0lib=
16024 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16025 # filter duplicates
16026 for cf_add_1lib in $cf_add_0lib; do
16027         for cf_add_2lib in $cf_add_libs; do
16028                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16029                         cf_add_1lib=
16030                         break
16031                 fi
16032         done
16033         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16034 done
16035 LIBS="$cf_add_libs"
16036
16037 fi
16038
16039 echo "$as_me:16039: checking for XCurses library" >&5
16040 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
16041 if test "${cf_cv_lib_XCurses+set}" = set; then
16042   echo $ECHO_N "(cached) $ECHO_C" >&6
16043 else
16044
16045 cf_add_libs="$LIBS"
16046 # reverse order
16047 cf_add_0lib=
16048 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16049 # filter duplicates
16050 for cf_add_1lib in $cf_add_0lib; do
16051         for cf_add_2lib in $cf_add_libs; do
16052                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16053                         cf_add_1lib=
16054                         break
16055                 fi
16056         done
16057         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16058 done
16059 LIBS="$cf_add_libs"
16060
16061 cat >"conftest.$ac_ext" <<_ACEOF
16062 #line 16062 "configure"
16063 #include "confdefs.h"
16064
16065 #include <xcurses.h>
16066 char *XCursesProgramName = "test";
16067
16068 int
16069 main (void)
16070 {
16071 XCursesExit();
16072   ;
16073   return 0;
16074 }
16075 _ACEOF
16076 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16077 if { (eval echo "$as_me:16077: \"$ac_link\"") >&5
16078   (eval $ac_link) 2>&5
16079   ac_status=$?
16080   echo "$as_me:16080: \$? = $ac_status" >&5
16081   (exit "$ac_status"); } &&
16082          { ac_try='test -s "conftest$ac_exeext"'
16083   { (eval echo "$as_me:16083: \"$ac_try\"") >&5
16084   (eval $ac_try) 2>&5
16085   ac_status=$?
16086   echo "$as_me:16086: \$? = $ac_status" >&5
16087   (exit "$ac_status"); }; }; then
16088   cf_cv_lib_XCurses=yes
16089 else
16090   echo "$as_me: failed program was:" >&5
16091 cat "conftest.$ac_ext" >&5
16092 cf_cv_lib_XCurses=no
16093 fi
16094 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16095
16096 fi
16097 echo "$as_me:16097: result: $cf_cv_lib_XCurses" >&5
16098 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
16099
16100 fi
16101
16102 if test "$cf_cv_lib_XCurses" = yes ; then
16103
16104 cat >>confdefs.h <<\EOF
16105 #define UNIX 1
16106 EOF
16107
16108 cat >>confdefs.h <<\EOF
16109 #define XCURSES 1
16110 EOF
16111
16112         echo "$as_me:16112: checking for xcurses.h" >&5
16113 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
16114 if test "${ac_cv_header_xcurses_h+set}" = set; then
16115   echo $ECHO_N "(cached) $ECHO_C" >&6
16116 else
16117   cat >"conftest.$ac_ext" <<_ACEOF
16118 #line 16118 "configure"
16119 #include "confdefs.h"
16120 #include <xcurses.h>
16121 _ACEOF
16122 if { (eval echo "$as_me:16122: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16123   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16124   ac_status=$?
16125   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16126   rm -f conftest.er1
16127   cat conftest.err >&5
16128   echo "$as_me:16128: \$? = $ac_status" >&5
16129   (exit "$ac_status"); } >/dev/null; then
16130   if test -s conftest.err; then
16131     ac_cpp_err=$ac_c_preproc_warn_flag
16132   else
16133     ac_cpp_err=
16134   fi
16135 else
16136   ac_cpp_err=yes
16137 fi
16138 if test -z "$ac_cpp_err"; then
16139   ac_cv_header_xcurses_h=yes
16140 else
16141   echo "$as_me: failed program was:" >&5
16142   cat "conftest.$ac_ext" >&5
16143   ac_cv_header_xcurses_h=no
16144 fi
16145 rm -f conftest.err "conftest.$ac_ext"
16146 fi
16147 echo "$as_me:16147: result: $ac_cv_header_xcurses_h" >&5
16148 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
16149 if test "$ac_cv_header_xcurses_h" = yes; then
16150
16151 cat >>confdefs.h <<\EOF
16152 #define HAVE_XCURSES 1
16153 EOF
16154
16155 fi
16156
16157 else
16158         { { echo "$as_me:16158: error: Cannot link with XCurses" >&5
16159 echo "$as_me: error: Cannot link with XCurses" >&2;}
16160    { (exit 1); exit 1; }; }
16161 fi
16162
16163         ;;
16164 (*)
16165         { { echo "$as_me:16165: error: unexpected screen-value: $cf_cv_screen" >&5
16166 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
16167    { (exit 1); exit 1; }; }
16168         ;;
16169 esac
16170
16171 : ${cf_nculib_root:=$cf_cv_screen}
16172 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
16173 echo "$as_me:16173: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
16174 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
16175 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16176   echo $ECHO_N "(cached) $ECHO_C" >&6
16177 else
16178   ac_check_lib_save_LIBS=$LIBS
16179 LIBS="-l$cf_nculib_root  $LIBS"
16180 cat >"conftest.$ac_ext" <<_ACEOF
16181 #line 16181 "configure"
16182 #include "confdefs.h"
16183
16184 /* Override any gcc2 internal prototype to avoid an error.  */
16185 #ifdef __cplusplus
16186 extern "C"
16187 #endif
16188 /* We use char because int might match the return type of a gcc2
16189    builtin and then its argument prototype would still apply.  */
16190 char _nc_init_pthreads ();
16191 int
16192 main (void)
16193 {
16194 _nc_init_pthreads ();
16195   ;
16196   return 0;
16197 }
16198 _ACEOF
16199 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16200 if { (eval echo "$as_me:16200: \"$ac_link\"") >&5
16201   (eval $ac_link) 2>&5
16202   ac_status=$?
16203   echo "$as_me:16203: \$? = $ac_status" >&5
16204   (exit "$ac_status"); } &&
16205          { ac_try='test -s "conftest$ac_exeext"'
16206   { (eval echo "$as_me:16206: \"$ac_try\"") >&5
16207   (eval $ac_try) 2>&5
16208   ac_status=$?
16209   echo "$as_me:16209: \$? = $ac_status" >&5
16210   (exit "$ac_status"); }; }; then
16211   eval "$as_ac_Lib=yes"
16212 else
16213   echo "$as_me: failed program was:" >&5
16214 cat "conftest.$ac_ext" >&5
16215 eval "$as_ac_Lib=no"
16216 fi
16217 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16218 LIBS=$ac_check_lib_save_LIBS
16219 fi
16220 echo "$as_me:16220: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16221 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16222 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16223   cf_cv_ncurses_pthreads=yes
16224 else
16225   cf_cv_ncurses_pthreads=no
16226 fi
16227
16228 if test "$cf_cv_ncurses_pthreads" = yes
16229 then
16230
16231 cf_add_libs="$LIBS"
16232 # reverse order
16233 cf_add_0lib=
16234 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16235 # filter duplicates
16236 for cf_add_1lib in $cf_add_0lib; do
16237         for cf_add_2lib in $cf_add_libs; do
16238                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16239                         cf_add_1lib=
16240                         break
16241                 fi
16242         done
16243         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16244 done
16245 LIBS="$cf_add_libs"
16246
16247 fi
16248
16249 case $cf_cv_screen in
16250 (ncurses*)
16251         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
16252         ;;
16253 esac
16254
16255 echo "$as_me:16255: checking for X11 rgb file" >&5
16256 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
16257
16258 # Check whether --with-x11-rgb or --without-x11-rgb was given.
16259 if test "${with_x11_rgb+set}" = set; then
16260   withval="$with_x11_rgb"
16261   RGB_PATH=$withval
16262 else
16263   RGB_PATH=auto
16264 fi;
16265
16266 if test "x$RGB_PATH" = xauto
16267 then
16268         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
16269         for cf_path in \
16270                 /opt/local/share/X11/rgb.txt \
16271                 /opt/X11/share/X11/rgb.txt \
16272                 /usr/share/X11/rgb.txt \
16273                 /usr/X11/share/X11/rgb.txt \
16274                 /usr/X11/lib/X11/rgb.txt \
16275                 /usr/lib/X11/rgb.txt \
16276                 /etc/X11/rgb.txt \
16277                 /usr/pkg/lib/X11/rgb.txt \
16278                 /usr/X11R7/lib/X11/rgb.txt \
16279                 /usr/X11R6/lib/X11/rgb.txt \
16280                 /usr/X11R5/lib/X11/rgb.txt \
16281                 /usr/X11R4/lib/X11/rgb.txt \
16282                 /usr/local/lib/X11/rgb.txt \
16283                 /usr/local/share/X11/rgb.txt \
16284                 /usr/lib64/X11/rgb.txt
16285         do
16286                 if test -f "$cf_path" ; then
16287                         RGB_PATH="$cf_path"
16288                         break
16289                 fi
16290         done
16291 else
16292         cf_path=$RGB_PATH
16293
16294 if test "x$prefix" != xNONE; then
16295         cf_path_syntax="$prefix"
16296 else
16297         cf_path_syntax="$ac_default_prefix"
16298 fi
16299
16300 case ".$cf_path" in
16301 (.\$\(*\)*|.\'*\'*)
16302         ;;
16303 (..|./*|.\\*)
16304         ;;
16305 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16306         ;;
16307 (.\$\{*prefix\}*|.\$\{*dir\}*)
16308         eval cf_path="$cf_path"
16309         case ".$cf_path" in
16310         (.NONE/*)
16311                 cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16312                 ;;
16313         esac
16314         ;;
16315 (.no|.NONE/*)
16316         cf_path=`echo "$cf_path" | sed -e s%NONE%$cf_path_syntax%`
16317         ;;
16318 (*)
16319         { { echo "$as_me:16319: error: expected a pathname, not \"$cf_path\"" >&5
16320 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16321    { (exit 1); exit 1; }; }
16322         ;;
16323 esac
16324
16325 fi
16326
16327 echo "$as_me:16327: result: $RGB_PATH" >&5
16328 echo "${ECHO_T}$RGB_PATH" >&6
16329
16330 cat >>confdefs.h <<EOF
16331 #define RGB_PATH "$cf_path"
16332 EOF
16333
16334 no_x11_rgb=
16335 if test "$RGB_PATH" = no
16336 then
16337         no_x11_rgb="#"
16338 fi
16339
16340 cf_curses_headers=
16341
16342 case $cf_cv_screen in
16343 (pdcurses)
16344         cf_default_panel=no
16345         cf_default_form=no
16346         cf_default_menu=no
16347         cf_default_tinfo=no
16348         ;;
16349 (xcurses|bsdcurses)
16350         cf_default_panel=no
16351         cf_default_form=no
16352         cf_default_menu=no
16353         cf_default_tinfo=yes
16354         ;;
16355 (*)
16356         cf_default_panel=yes
16357         cf_default_form=yes
16358         cf_default_menu=yes
16359         cf_default_tinfo=yes
16360         case $cf_cv_screen in
16361         (ncurses*)
16362                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16363                 ;;
16364         esac
16365         ;;
16366 esac
16367
16368 echo "$as_me:16368: checking for desired basename for form library" >&5
16369 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16370
16371 # Check whether --with-form-libname or --without-form-libname was given.
16372 if test "${with_form_libname+set}" = set; then
16373   withval="$with_form_libname"
16374   with_lib_basename=$withval
16375 else
16376   with_lib_basename=form
16377 fi;
16378 FORM_NAME="$with_lib_basename"
16379
16380 case "x$FORM_NAME" in
16381 (x|xno|xnone|xyes)
16382         FORM_NAME=form
16383         ;;
16384 (*)
16385         ;;
16386 esac
16387
16388 echo "$as_me:16388: result: $FORM_NAME" >&5
16389 echo "${ECHO_T}$FORM_NAME" >&6
16390
16391 echo "$as_me:16391: checking for desired basename for menu library" >&5
16392 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16393
16394 # Check whether --with-menu-libname or --without-menu-libname was given.
16395 if test "${with_menu_libname+set}" = set; then
16396   withval="$with_menu_libname"
16397   with_lib_basename=$withval
16398 else
16399   with_lib_basename=menu
16400 fi;
16401 MENU_NAME="$with_lib_basename"
16402
16403 case "x$MENU_NAME" in
16404 (x|xno|xnone|xyes)
16405         MENU_NAME=menu
16406         ;;
16407 (*)
16408         ;;
16409 esac
16410
16411 echo "$as_me:16411: result: $MENU_NAME" >&5
16412 echo "${ECHO_T}$MENU_NAME" >&6
16413
16414 echo "$as_me:16414: checking for desired basename for panel library" >&5
16415 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16416
16417 # Check whether --with-panel-libname or --without-panel-libname was given.
16418 if test "${with_panel_libname+set}" = set; then
16419   withval="$with_panel_libname"
16420   with_lib_basename=$withval
16421 else
16422   with_lib_basename=panel
16423 fi;
16424 PANEL_NAME="$with_lib_basename"
16425
16426 case "x$PANEL_NAME" in
16427 (x|xno|xnone|xyes)
16428         PANEL_NAME=panel
16429         ;;
16430 (*)
16431         ;;
16432 esac
16433
16434 echo "$as_me:16434: result: $PANEL_NAME" >&5
16435 echo "${ECHO_T}$PANEL_NAME" >&6
16436
16437 echo "$as_me:16437: checking if you want to check for panel functions" >&5
16438 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16439
16440 # Check whether --enable-panel or --disable-panel was given.
16441 if test "${enable_panel+set}" = set; then
16442   enableval="$enable_panel"
16443   test "$enableval" != no && enableval=yes
16444         if test "$enableval" != "yes" ; then
16445     cf_enable_panel=no
16446         else
16447                 cf_enable_panel=$cf_default_panel
16448         fi
16449 else
16450   enableval=yes
16451         cf_enable_panel=$cf_default_panel
16452
16453 fi;
16454 echo "$as_me:16454: result: $cf_enable_panel" >&5
16455 echo "${ECHO_T}$cf_enable_panel" >&6
16456 if test $cf_enable_panel = yes
16457 then
16458
16459 cf_have_curses_lib=no
16460
16461 : ${NCURSES_CONFIG_PKG:=none}
16462 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16463         :
16464 elif test "x${PKG_CONFIG:=none}" != xnone; then
16465         echo "$as_me:16465: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16466 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16467         if "$PKG_CONFIG" --exists "$PANEL_NAME$cf_cv_libtype" ; then
16468                 echo "$as_me:16468: result: yes" >&5
16469 echo "${ECHO_T}yes" >&6
16470
16471                 echo "$as_me:16471: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16472 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16473
16474                 cf_save_CPPFLAGS="$CPPFLAGS"
16475                 cf_save_LIBS="$LIBS"
16476
16477 cf_fix_cppflags=no
16478 cf_new_cflags=
16479 cf_new_cppflags=
16480 cf_new_extra_cppflags=
16481
16482 for cf_add_cflags in `$PKG_CONFIG --cflags "$PANEL_NAME$cf_cv_libtype"`
16483 do
16484 case "$cf_fix_cppflags" in
16485 (no)
16486         case "$cf_add_cflags" in
16487         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16488                 case "$cf_add_cflags" in
16489                 (-D*)
16490                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16491
16492                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16493                                 && test -z "${cf_tst_cflags}" \
16494                                 && cf_fix_cppflags=yes
16495
16496                         if test "$cf_fix_cppflags" = yes ; then
16497
16498         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16499         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16500
16501                                 continue
16502                         elif test "${cf_tst_cflags}" = "\"'" ; then
16503
16504         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16505         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16506
16507                                 continue
16508                         fi
16509                         ;;
16510                 esac
16511                 case "$CPPFLAGS" in
16512                 (*$cf_add_cflags)
16513                         ;;
16514                 (*)
16515                         case "$cf_add_cflags" in
16516                         (-D*)
16517                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16518
16519 CPPFLAGS=`echo "$CPPFLAGS" | \
16520         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16521                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16522
16523                                 ;;
16524                         esac
16525
16526         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16527         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16528
16529                         ;;
16530                 esac
16531                 ;;
16532         (*)
16533
16534         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16535         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16536
16537                 ;;
16538         esac
16539         ;;
16540 (yes)
16541
16542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16544
16545         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16546
16547         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16548                 && test -z "${cf_tst_cflags}" \
16549                 && cf_fix_cppflags=no
16550         ;;
16551 esac
16552 done
16553
16554 if test -n "$cf_new_cflags" ; then
16555
16556         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16557         CFLAGS="${CFLAGS}$cf_new_cflags"
16558
16559 fi
16560
16561 if test -n "$cf_new_cppflags" ; then
16562
16563         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16564         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16565
16566 fi
16567
16568 if test -n "$cf_new_extra_cppflags" ; then
16569
16570         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16571         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16572
16573 fi
16574
16575 cf_add_libs="$LIBS"
16576 # reverse order
16577 cf_add_0lib=
16578 for cf_add_1lib in `$PKG_CONFIG --libs "$PANEL_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16579 # filter duplicates
16580 for cf_add_1lib in $cf_add_0lib; do
16581         for cf_add_2lib in $cf_add_libs; do
16582                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16583                         cf_add_1lib=
16584                         break
16585                 fi
16586         done
16587         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16588 done
16589 LIBS="$cf_add_libs"
16590
16591                 cat >"conftest.$ac_ext" <<_ACEOF
16592 #line 16592 "configure"
16593 #include "confdefs.h"
16594 #include <$PANEL_NAME.h>
16595 int
16596 main (void)
16597 {
16598 (void) new_panel ( 0 );
16599   ;
16600   return 0;
16601 }
16602 _ACEOF
16603 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16604 if { (eval echo "$as_me:16604: \"$ac_link\"") >&5
16605   (eval $ac_link) 2>&5
16606   ac_status=$?
16607   echo "$as_me:16607: \$? = $ac_status" >&5
16608   (exit "$ac_status"); } &&
16609          { ac_try='test -s "conftest$ac_exeext"'
16610   { (eval echo "$as_me:16610: \"$ac_try\"") >&5
16611   (eval $ac_try) 2>&5
16612   ac_status=$?
16613   echo "$as_me:16613: \$? = $ac_status" >&5
16614   (exit "$ac_status"); }; }; then
16615   if test "$cross_compiling" = yes; then
16616   cf_have_curses_lib=maybe
16617 else
16618   cat >"conftest.$ac_ext" <<_ACEOF
16619 #line 16619 "configure"
16620 #include "confdefs.h"
16621 #include <$PANEL_NAME.h>
16622                                 int main(void)
16623                                 { (void) new_panel ( 0 ); return 0; }
16624 _ACEOF
16625 rm -f "conftest$ac_exeext"
16626 if { (eval echo "$as_me:16626: \"$ac_link\"") >&5
16627   (eval $ac_link) 2>&5
16628   ac_status=$?
16629   echo "$as_me:16629: \$? = $ac_status" >&5
16630   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16631   { (eval echo "$as_me:16631: \"$ac_try\"") >&5
16632   (eval $ac_try) 2>&5
16633   ac_status=$?
16634   echo "$as_me:16634: \$? = $ac_status" >&5
16635   (exit "$ac_status"); }; }; then
16636   cf_have_curses_lib=yes
16637 else
16638   echo "$as_me: program exited with status $ac_status" >&5
16639 echo "$as_me: failed program was:" >&5
16640 cat "conftest.$ac_ext" >&5
16641 cf_have_curses_lib=no
16642 fi
16643 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16644 fi
16645 else
16646   echo "$as_me: failed program was:" >&5
16647 cat "conftest.$ac_ext" >&5
16648 cf_have_curses_lib=no
16649 fi
16650 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16651                 echo "$as_me:16651: result: $cf_have_curses_lib" >&5
16652 echo "${ECHO_T}$cf_have_curses_lib" >&6
16653                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16654                 if test "$cf_have_curses_lib" != "yes"
16655                 then
16656                         CPPFLAGS="$cf_save_CPPFLAGS"
16657                         LIBS="$cf_save_LIBS"
16658                 else
16659
16660 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16661
16662                         cat >>confdefs.h <<EOF
16663 #define $cf_upper 1
16664 EOF
16665
16666                 fi
16667         fi
16668 fi
16669 if test "$cf_have_curses_lib" = no; then
16670         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16671 echo "$as_me:16671: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16672 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16673 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16674   echo $ECHO_N "(cached) $ECHO_C" >&6
16675 else
16676   ac_check_lib_save_LIBS=$LIBS
16677 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16678 cat >"conftest.$ac_ext" <<_ACEOF
16679 #line 16679 "configure"
16680 #include "confdefs.h"
16681
16682 /* Override any gcc2 internal prototype to avoid an error.  */
16683 #ifdef __cplusplus
16684 extern "C"
16685 #endif
16686 /* We use char because int might match the return type of a gcc2
16687    builtin and then its argument prototype would still apply.  */
16688 char new_panel ();
16689 int
16690 main (void)
16691 {
16692 new_panel ();
16693   ;
16694   return 0;
16695 }
16696 _ACEOF
16697 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16698 if { (eval echo "$as_me:16698: \"$ac_link\"") >&5
16699   (eval $ac_link) 2>&5
16700   ac_status=$?
16701   echo "$as_me:16701: \$? = $ac_status" >&5
16702   (exit "$ac_status"); } &&
16703          { ac_try='test -s "conftest$ac_exeext"'
16704   { (eval echo "$as_me:16704: \"$ac_try\"") >&5
16705   (eval $ac_try) 2>&5
16706   ac_status=$?
16707   echo "$as_me:16707: \$? = $ac_status" >&5
16708   (exit "$ac_status"); }; }; then
16709   eval "$as_ac_Lib=yes"
16710 else
16711   echo "$as_me: failed program was:" >&5
16712 cat "conftest.$ac_ext" >&5
16713 eval "$as_ac_Lib=no"
16714 fi
16715 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16716 LIBS=$ac_check_lib_save_LIBS
16717 fi
16718 echo "$as_me:16718: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
16719 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
16720 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
16721
16722 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16723
16724 cf_add_libs="$LIBS"
16725 # reverse order
16726 cf_add_0lib=
16727 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16728 # filter duplicates
16729 for cf_add_1lib in $cf_add_0lib; do
16730         for cf_add_2lib in $cf_add_libs; do
16731                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16732                         cf_add_1lib=
16733                         break
16734                 fi
16735         done
16736         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16737 done
16738 LIBS="$cf_add_libs"
16739
16740                 cat >>confdefs.h <<EOF
16741 #define $cf_upper 1
16742 EOF
16743
16744 fi
16745
16746 fi
16747
16748         cf_curses_headers="$cf_curses_headers panel.h"
16749 fi
16750
16751 echo "$as_me:16751: checking if you want to check for menu functions" >&5
16752 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16753
16754 # Check whether --enable-menu or --disable-menu was given.
16755 if test "${enable_menu+set}" = set; then
16756   enableval="$enable_menu"
16757   test "$enableval" != no && enableval=yes
16758         if test "$enableval" != "yes" ; then
16759     cf_enable_menu=no
16760         else
16761                 cf_enable_menu=$cf_default_menu
16762         fi
16763 else
16764   enableval=yes
16765         cf_enable_menu=$cf_default_menu
16766
16767 fi;
16768 echo "$as_me:16768: result: $cf_enable_menu" >&5
16769 echo "${ECHO_T}$cf_enable_menu" >&6
16770 if test $cf_enable_menu = yes
16771 then
16772         case $cf_cv_screen in
16773         (ncurses*)
16774                 ;;
16775         (curses*)
16776
16777 echo "$as_me:16777: checking for NetBSD menu.h" >&5
16778 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16779 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16780   echo $ECHO_N "(cached) $ECHO_C" >&6
16781 else
16782
16783 cat >"conftest.$ac_ext" <<_ACEOF
16784 #line 16784 "configure"
16785 #include "confdefs.h"
16786
16787 #include <${cf_cv_ncurses_header:-curses.h}>
16788 #include <menu.h>
16789
16790 int
16791 main (void)
16792 {
16793
16794         MENU *menu;
16795         int y = menu->max_item_width;
16796
16797   ;
16798   return 0;
16799 }
16800 _ACEOF
16801 rm -f "conftest.$ac_objext"
16802 if { (eval echo "$as_me:16802: \"$ac_compile\"") >&5
16803   (eval $ac_compile) 2>&5
16804   ac_status=$?
16805   echo "$as_me:16805: \$? = $ac_status" >&5
16806   (exit "$ac_status"); } &&
16807          { ac_try='test -s "conftest.$ac_objext"'
16808   { (eval echo "$as_me:16808: \"$ac_try\"") >&5
16809   (eval $ac_try) 2>&5
16810   ac_status=$?
16811   echo "$as_me:16811: \$? = $ac_status" >&5
16812   (exit "$ac_status"); }; }; then
16813   cf_cv_netbsd_menu_h=yes
16814
16815 else
16816   echo "$as_me: failed program was:" >&5
16817 cat "conftest.$ac_ext" >&5
16818 cf_cv_netbsd_menu_h=no
16819 fi
16820 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16821
16822 fi
16823 echo "$as_me:16823: result: $cf_cv_netbsd_menu_h" >&5
16824 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16825
16826 test "$cf_cv_netbsd_menu_h" = yes &&
16827 cat >>confdefs.h <<\EOF
16828 #define HAVE_NETBSD_MENU_H 1
16829 EOF
16830
16831                 ;;
16832         esac
16833
16834 cf_have_curses_lib=no
16835
16836 : ${NCURSES_CONFIG_PKG:=none}
16837 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16838         :
16839 elif test "x${PKG_CONFIG:=none}" != xnone; then
16840         echo "$as_me:16840: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16841 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16842         if "$PKG_CONFIG" --exists "$MENU_NAME$cf_cv_libtype" ; then
16843                 echo "$as_me:16843: result: yes" >&5
16844 echo "${ECHO_T}yes" >&6
16845
16846                 echo "$as_me:16846: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16847 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16848
16849                 cf_save_CPPFLAGS="$CPPFLAGS"
16850                 cf_save_LIBS="$LIBS"
16851
16852 cf_fix_cppflags=no
16853 cf_new_cflags=
16854 cf_new_cppflags=
16855 cf_new_extra_cppflags=
16856
16857 for cf_add_cflags in `$PKG_CONFIG --cflags "$MENU_NAME$cf_cv_libtype"`
16858 do
16859 case "$cf_fix_cppflags" in
16860 (no)
16861         case "$cf_add_cflags" in
16862         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16863                 case "$cf_add_cflags" in
16864                 (-D*)
16865                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16866
16867                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16868                                 && test -z "${cf_tst_cflags}" \
16869                                 && cf_fix_cppflags=yes
16870
16871                         if test "$cf_fix_cppflags" = yes ; then
16872
16873         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16874         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16875
16876                                 continue
16877                         elif test "${cf_tst_cflags}" = "\"'" ; then
16878
16879         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16880         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16881
16882                                 continue
16883                         fi
16884                         ;;
16885                 esac
16886                 case "$CPPFLAGS" in
16887                 (*$cf_add_cflags)
16888                         ;;
16889                 (*)
16890                         case "$cf_add_cflags" in
16891                         (-D*)
16892                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16893
16894 CPPFLAGS=`echo "$CPPFLAGS" | \
16895         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16896                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16897
16898                                 ;;
16899                         esac
16900
16901         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16902         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16903
16904                         ;;
16905                 esac
16906                 ;;
16907         (*)
16908
16909         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16910         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16911
16912                 ;;
16913         esac
16914         ;;
16915 (yes)
16916
16917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16919
16920         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
16921
16922         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16923                 && test -z "${cf_tst_cflags}" \
16924                 && cf_fix_cppflags=no
16925         ;;
16926 esac
16927 done
16928
16929 if test -n "$cf_new_cflags" ; then
16930
16931         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16932         CFLAGS="${CFLAGS}$cf_new_cflags"
16933
16934 fi
16935
16936 if test -n "$cf_new_cppflags" ; then
16937
16938         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16939         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16940
16941 fi
16942
16943 if test -n "$cf_new_extra_cppflags" ; then
16944
16945         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16946         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16947
16948 fi
16949
16950 cf_add_libs="$LIBS"
16951 # reverse order
16952 cf_add_0lib=
16953 for cf_add_1lib in `$PKG_CONFIG --libs "$MENU_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16954 # filter duplicates
16955 for cf_add_1lib in $cf_add_0lib; do
16956         for cf_add_2lib in $cf_add_libs; do
16957                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16958                         cf_add_1lib=
16959                         break
16960                 fi
16961         done
16962         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16963 done
16964 LIBS="$cf_add_libs"
16965
16966                 cat >"conftest.$ac_ext" <<_ACEOF
16967 #line 16967 "configure"
16968 #include "confdefs.h"
16969 #include <$MENU_NAME.h>
16970 int
16971 main (void)
16972 {
16973 (void) menu_driver ( 0,0 );
16974   ;
16975   return 0;
16976 }
16977 _ACEOF
16978 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16979 if { (eval echo "$as_me:16979: \"$ac_link\"") >&5
16980   (eval $ac_link) 2>&5
16981   ac_status=$?
16982   echo "$as_me:16982: \$? = $ac_status" >&5
16983   (exit "$ac_status"); } &&
16984          { ac_try='test -s "conftest$ac_exeext"'
16985   { (eval echo "$as_me:16985: \"$ac_try\"") >&5
16986   (eval $ac_try) 2>&5
16987   ac_status=$?
16988   echo "$as_me:16988: \$? = $ac_status" >&5
16989   (exit "$ac_status"); }; }; then
16990   if test "$cross_compiling" = yes; then
16991   cf_have_curses_lib=maybe
16992 else
16993   cat >"conftest.$ac_ext" <<_ACEOF
16994 #line 16994 "configure"
16995 #include "confdefs.h"
16996 #include <$MENU_NAME.h>
16997                                 int main(void)
16998                                 { (void) menu_driver ( 0,0 ); return 0; }
16999 _ACEOF
17000 rm -f "conftest$ac_exeext"
17001 if { (eval echo "$as_me:17001: \"$ac_link\"") >&5
17002   (eval $ac_link) 2>&5
17003   ac_status=$?
17004   echo "$as_me:17004: \$? = $ac_status" >&5
17005   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17006   { (eval echo "$as_me:17006: \"$ac_try\"") >&5
17007   (eval $ac_try) 2>&5
17008   ac_status=$?
17009   echo "$as_me:17009: \$? = $ac_status" >&5
17010   (exit "$ac_status"); }; }; then
17011   cf_have_curses_lib=yes
17012 else
17013   echo "$as_me: program exited with status $ac_status" >&5
17014 echo "$as_me: failed program was:" >&5
17015 cat "conftest.$ac_ext" >&5
17016 cf_have_curses_lib=no
17017 fi
17018 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17019 fi
17020 else
17021   echo "$as_me: failed program was:" >&5
17022 cat "conftest.$ac_ext" >&5
17023 cf_have_curses_lib=no
17024 fi
17025 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17026                 echo "$as_me:17026: result: $cf_have_curses_lib" >&5
17027 echo "${ECHO_T}$cf_have_curses_lib" >&6
17028                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17029                 if test "$cf_have_curses_lib" != "yes"
17030                 then
17031                         CPPFLAGS="$cf_save_CPPFLAGS"
17032                         LIBS="$cf_save_LIBS"
17033                 else
17034
17035 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17036
17037                         cat >>confdefs.h <<EOF
17038 #define $cf_upper 1
17039 EOF
17040
17041                 fi
17042         fi
17043 fi
17044 if test "$cf_have_curses_lib" = no; then
17045         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
17046 echo "$as_me:17046: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
17047 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
17048 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17049   echo $ECHO_N "(cached) $ECHO_C" >&6
17050 else
17051   ac_check_lib_save_LIBS=$LIBS
17052 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
17053 cat >"conftest.$ac_ext" <<_ACEOF
17054 #line 17054 "configure"
17055 #include "confdefs.h"
17056
17057 /* Override any gcc2 internal prototype to avoid an error.  */
17058 #ifdef __cplusplus
17059 extern "C"
17060 #endif
17061 /* We use char because int might match the return type of a gcc2
17062    builtin and then its argument prototype would still apply.  */
17063 char menu_driver ();
17064 int
17065 main (void)
17066 {
17067 menu_driver ();
17068   ;
17069   return 0;
17070 }
17071 _ACEOF
17072 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17073 if { (eval echo "$as_me:17073: \"$ac_link\"") >&5
17074   (eval $ac_link) 2>&5
17075   ac_status=$?
17076   echo "$as_me:17076: \$? = $ac_status" >&5
17077   (exit "$ac_status"); } &&
17078          { ac_try='test -s "conftest$ac_exeext"'
17079   { (eval echo "$as_me:17079: \"$ac_try\"") >&5
17080   (eval $ac_try) 2>&5
17081   ac_status=$?
17082   echo "$as_me:17082: \$? = $ac_status" >&5
17083   (exit "$ac_status"); }; }; then
17084   eval "$as_ac_Lib=yes"
17085 else
17086   echo "$as_me: failed program was:" >&5
17087 cat "conftest.$ac_ext" >&5
17088 eval "$as_ac_Lib=no"
17089 fi
17090 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17091 LIBS=$ac_check_lib_save_LIBS
17092 fi
17093 echo "$as_me:17093: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17094 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17095 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17096
17097 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17098
17099 cf_add_libs="$LIBS"
17100 # reverse order
17101 cf_add_0lib=
17102 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17103 # filter duplicates
17104 for cf_add_1lib in $cf_add_0lib; do
17105         for cf_add_2lib in $cf_add_libs; do
17106                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17107                         cf_add_1lib=
17108                         break
17109                 fi
17110         done
17111         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17112 done
17113 LIBS="$cf_add_libs"
17114
17115                 cat >>confdefs.h <<EOF
17116 #define $cf_upper 1
17117 EOF
17118
17119 fi
17120
17121 fi
17122
17123         cf_curses_headers="$cf_curses_headers menu.h"
17124 fi
17125
17126 echo "$as_me:17126: checking if you want to check for form functions" >&5
17127 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
17128
17129 # Check whether --enable-form or --disable-form was given.
17130 if test "${enable_form+set}" = set; then
17131   enableval="$enable_form"
17132   test "$enableval" != no && enableval=yes
17133         if test "$enableval" != "yes" ; then
17134     cf_enable_form=no
17135         else
17136                 cf_enable_form=$cf_default_form
17137         fi
17138 else
17139   enableval=yes
17140         cf_enable_form=$cf_default_form
17141
17142 fi;
17143 echo "$as_me:17143: result: $cf_enable_form" >&5
17144 echo "${ECHO_T}$cf_enable_form" >&6
17145 if test $cf_enable_form = yes
17146 then
17147         case $cf_cv_screen in
17148         (ncurses*)
17149                 ;;
17150         (curses*)
17151
17152 echo "$as_me:17152: checking for NetBSD form.h" >&5
17153 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
17154 if test "${cf_cv_netbsd_form_h+set}" = set; then
17155   echo $ECHO_N "(cached) $ECHO_C" >&6
17156 else
17157
17158 cat >"conftest.$ac_ext" <<_ACEOF
17159 #line 17159 "configure"
17160 #include "confdefs.h"
17161
17162 #include <${cf_cv_ncurses_header:-curses.h}>
17163 #include <form.h>
17164
17165 int
17166 main (void)
17167 {
17168
17169         FORM *form;
17170         int y = current_field(form)->cursor_ypos;
17171         int x = current_field(form)->cursor_xpos;
17172
17173   ;
17174   return 0;
17175 }
17176 _ACEOF
17177 rm -f "conftest.$ac_objext"
17178 if { (eval echo "$as_me:17178: \"$ac_compile\"") >&5
17179   (eval $ac_compile) 2>&5
17180   ac_status=$?
17181   echo "$as_me:17181: \$? = $ac_status" >&5
17182   (exit "$ac_status"); } &&
17183          { ac_try='test -s "conftest.$ac_objext"'
17184   { (eval echo "$as_me:17184: \"$ac_try\"") >&5
17185   (eval $ac_try) 2>&5
17186   ac_status=$?
17187   echo "$as_me:17187: \$? = $ac_status" >&5
17188   (exit "$ac_status"); }; }; then
17189   cf_cv_netbsd_form_h=yes
17190
17191 else
17192   echo "$as_me: failed program was:" >&5
17193 cat "conftest.$ac_ext" >&5
17194 cf_cv_netbsd_form_h=no
17195 fi
17196 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17197
17198 fi
17199 echo "$as_me:17199: result: $cf_cv_netbsd_form_h" >&5
17200 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
17201
17202 test "$cf_cv_netbsd_form_h" = yes &&
17203 cat >>confdefs.h <<\EOF
17204 #define HAVE_NETBSD_FORM_H 1
17205 EOF
17206
17207                 ;;
17208         esac
17209
17210 cf_have_curses_lib=no
17211
17212 : ${NCURSES_CONFIG_PKG:=none}
17213 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
17214         :
17215 elif test "x${PKG_CONFIG:=none}" != xnone; then
17216         echo "$as_me:17216: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
17217 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17218         if "$PKG_CONFIG" --exists "$FORM_NAME$cf_cv_libtype" ; then
17219                 echo "$as_me:17219: result: yes" >&5
17220 echo "${ECHO_T}yes" >&6
17221
17222                 echo "$as_me:17222: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
17223 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
17224
17225                 cf_save_CPPFLAGS="$CPPFLAGS"
17226                 cf_save_LIBS="$LIBS"
17227
17228 cf_fix_cppflags=no
17229 cf_new_cflags=
17230 cf_new_cppflags=
17231 cf_new_extra_cppflags=
17232
17233 for cf_add_cflags in `$PKG_CONFIG --cflags "$FORM_NAME$cf_cv_libtype"`
17234 do
17235 case "$cf_fix_cppflags" in
17236 (no)
17237         case "$cf_add_cflags" in
17238         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17239                 case "$cf_add_cflags" in
17240                 (-D*)
17241                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17242
17243                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17244                                 && test -z "${cf_tst_cflags}" \
17245                                 && cf_fix_cppflags=yes
17246
17247                         if test "$cf_fix_cppflags" = yes ; then
17248
17249         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17250         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17251
17252                                 continue
17253                         elif test "${cf_tst_cflags}" = "\"'" ; then
17254
17255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17257
17258                                 continue
17259                         fi
17260                         ;;
17261                 esac
17262                 case "$CPPFLAGS" in
17263                 (*$cf_add_cflags)
17264                         ;;
17265                 (*)
17266                         case "$cf_add_cflags" in
17267                         (-D*)
17268                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17269
17270 CPPFLAGS=`echo "$CPPFLAGS" | \
17271         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17272                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17273
17274                                 ;;
17275                         esac
17276
17277         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17278         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17279
17280                         ;;
17281                 esac
17282                 ;;
17283         (*)
17284
17285         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17286         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17287
17288                 ;;
17289         esac
17290         ;;
17291 (yes)
17292
17293         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17294         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17295
17296         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
17297
17298         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17299                 && test -z "${cf_tst_cflags}" \
17300                 && cf_fix_cppflags=no
17301         ;;
17302 esac
17303 done
17304
17305 if test -n "$cf_new_cflags" ; then
17306
17307         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17308         CFLAGS="${CFLAGS}$cf_new_cflags"
17309
17310 fi
17311
17312 if test -n "$cf_new_cppflags" ; then
17313
17314         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17315         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17316
17317 fi
17318
17319 if test -n "$cf_new_extra_cppflags" ; then
17320
17321         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17322         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17323
17324 fi
17325
17326 cf_add_libs="$LIBS"
17327 # reverse order
17328 cf_add_0lib=
17329 for cf_add_1lib in `$PKG_CONFIG --libs "$FORM_NAME$cf_cv_libtype"`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17330 # filter duplicates
17331 for cf_add_1lib in $cf_add_0lib; do
17332         for cf_add_2lib in $cf_add_libs; do
17333                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17334                         cf_add_1lib=
17335                         break
17336                 fi
17337         done
17338         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17339 done
17340 LIBS="$cf_add_libs"
17341
17342                 cat >"conftest.$ac_ext" <<_ACEOF
17343 #line 17343 "configure"
17344 #include "confdefs.h"
17345 #include <$FORM_NAME.h>
17346 int
17347 main (void)
17348 {
17349 (void) form_driver ( 0,0 );
17350   ;
17351   return 0;
17352 }
17353 _ACEOF
17354 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17355 if { (eval echo "$as_me:17355: \"$ac_link\"") >&5
17356   (eval $ac_link) 2>&5
17357   ac_status=$?
17358   echo "$as_me:17358: \$? = $ac_status" >&5
17359   (exit "$ac_status"); } &&
17360          { ac_try='test -s "conftest$ac_exeext"'
17361   { (eval echo "$as_me:17361: \"$ac_try\"") >&5
17362   (eval $ac_try) 2>&5
17363   ac_status=$?
17364   echo "$as_me:17364: \$? = $ac_status" >&5
17365   (exit "$ac_status"); }; }; then
17366   if test "$cross_compiling" = yes; then
17367   cf_have_curses_lib=maybe
17368 else
17369   cat >"conftest.$ac_ext" <<_ACEOF
17370 #line 17370 "configure"
17371 #include "confdefs.h"
17372 #include <$FORM_NAME.h>
17373                                 int main(void)
17374                                 { (void) form_driver ( 0,0 ); return 0; }
17375 _ACEOF
17376 rm -f "conftest$ac_exeext"
17377 if { (eval echo "$as_me:17377: \"$ac_link\"") >&5
17378   (eval $ac_link) 2>&5
17379   ac_status=$?
17380   echo "$as_me:17380: \$? = $ac_status" >&5
17381   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17382   { (eval echo "$as_me:17382: \"$ac_try\"") >&5
17383   (eval $ac_try) 2>&5
17384   ac_status=$?
17385   echo "$as_me:17385: \$? = $ac_status" >&5
17386   (exit "$ac_status"); }; }; then
17387   cf_have_curses_lib=yes
17388 else
17389   echo "$as_me: program exited with status $ac_status" >&5
17390 echo "$as_me: failed program was:" >&5
17391 cat "conftest.$ac_ext" >&5
17392 cf_have_curses_lib=no
17393 fi
17394 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17395 fi
17396 else
17397   echo "$as_me: failed program was:" >&5
17398 cat "conftest.$ac_ext" >&5
17399 cf_have_curses_lib=no
17400 fi
17401 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17402                 echo "$as_me:17402: result: $cf_have_curses_lib" >&5
17403 echo "${ECHO_T}$cf_have_curses_lib" >&6
17404                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17405                 if test "$cf_have_curses_lib" != "yes"
17406                 then
17407                         CPPFLAGS="$cf_save_CPPFLAGS"
17408                         LIBS="$cf_save_LIBS"
17409                 else
17410
17411 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17412
17413                         cat >>confdefs.h <<EOF
17414 #define $cf_upper 1
17415 EOF
17416
17417                 fi
17418         fi
17419 fi
17420 if test "$cf_have_curses_lib" = no; then
17421         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17422 echo "$as_me:17422: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17423 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17424 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17425   echo $ECHO_N "(cached) $ECHO_C" >&6
17426 else
17427   ac_check_lib_save_LIBS=$LIBS
17428 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17429 cat >"conftest.$ac_ext" <<_ACEOF
17430 #line 17430 "configure"
17431 #include "confdefs.h"
17432
17433 /* Override any gcc2 internal prototype to avoid an error.  */
17434 #ifdef __cplusplus
17435 extern "C"
17436 #endif
17437 /* We use char because int might match the return type of a gcc2
17438    builtin and then its argument prototype would still apply.  */
17439 char form_driver ();
17440 int
17441 main (void)
17442 {
17443 form_driver ();
17444   ;
17445   return 0;
17446 }
17447 _ACEOF
17448 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17449 if { (eval echo "$as_me:17449: \"$ac_link\"") >&5
17450   (eval $ac_link) 2>&5
17451   ac_status=$?
17452   echo "$as_me:17452: \$? = $ac_status" >&5
17453   (exit "$ac_status"); } &&
17454          { ac_try='test -s "conftest$ac_exeext"'
17455   { (eval echo "$as_me:17455: \"$ac_try\"") >&5
17456   (eval $ac_try) 2>&5
17457   ac_status=$?
17458   echo "$as_me:17458: \$? = $ac_status" >&5
17459   (exit "$ac_status"); }; }; then
17460   eval "$as_ac_Lib=yes"
17461 else
17462   echo "$as_me: failed program was:" >&5
17463 cat "conftest.$ac_ext" >&5
17464 eval "$as_ac_Lib=no"
17465 fi
17466 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17467 LIBS=$ac_check_lib_save_LIBS
17468 fi
17469 echo "$as_me:17469: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5
17470 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6
17471 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then
17472
17473 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17474
17475 cf_add_libs="$LIBS"
17476 # reverse order
17477 cf_add_0lib=
17478 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17479 # filter duplicates
17480 for cf_add_1lib in $cf_add_0lib; do
17481         for cf_add_2lib in $cf_add_libs; do
17482                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17483                         cf_add_1lib=
17484                         break
17485                 fi
17486         done
17487         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17488 done
17489 LIBS="$cf_add_libs"
17490
17491                 cat >>confdefs.h <<EOF
17492 #define $cf_upper 1
17493 EOF
17494
17495 fi
17496
17497 fi
17498
17499         cf_curses_headers="$cf_curses_headers form.h"
17500 fi
17501
17502 # look for curses-related headers
17503
17504 for ac_header in $cf_curses_headers
17505 do
17506 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17507 echo "$as_me:17507: checking for $ac_header" >&5
17508 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17509 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17510   echo $ECHO_N "(cached) $ECHO_C" >&6
17511 else
17512   cat >"conftest.$ac_ext" <<_ACEOF
17513 #line 17513 "configure"
17514 #include "confdefs.h"
17515 #include <$ac_header>
17516 _ACEOF
17517 if { (eval echo "$as_me:17517: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17518   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17519   ac_status=$?
17520   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17521   rm -f conftest.er1
17522   cat conftest.err >&5
17523   echo "$as_me:17523: \$? = $ac_status" >&5
17524   (exit "$ac_status"); } >/dev/null; then
17525   if test -s conftest.err; then
17526     ac_cpp_err=$ac_c_preproc_warn_flag
17527   else
17528     ac_cpp_err=
17529   fi
17530 else
17531   ac_cpp_err=yes
17532 fi
17533 if test -z "$ac_cpp_err"; then
17534   eval "$as_ac_Header=yes"
17535 else
17536   echo "$as_me: failed program was:" >&5
17537   cat "conftest.$ac_ext" >&5
17538   eval "$as_ac_Header=no"
17539 fi
17540 rm -f conftest.err "conftest.$ac_ext"
17541 fi
17542 echo "$as_me:17542: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17543 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17544 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17545   cat >>confdefs.h <<EOF
17546 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17547 EOF
17548
17549 fi
17550 done
17551
17552 echo "$as_me:17552: checking for ANSI C header files" >&5
17553 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17554 if test "${ac_cv_header_stdc+set}" = set; then
17555   echo $ECHO_N "(cached) $ECHO_C" >&6
17556 else
17557   cat >"conftest.$ac_ext" <<_ACEOF
17558 #line 17558 "configure"
17559 #include "confdefs.h"
17560 #include <stdlib.h>
17561 #include <stdarg.h>
17562 #include <string.h>
17563 #include <float.h>
17564
17565 _ACEOF
17566 if { (eval echo "$as_me:17566: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17567   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17568   ac_status=$?
17569   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17570   rm -f conftest.er1
17571   cat conftest.err >&5
17572   echo "$as_me:17572: \$? = $ac_status" >&5
17573   (exit "$ac_status"); } >/dev/null; then
17574   if test -s conftest.err; then
17575     ac_cpp_err=$ac_c_preproc_warn_flag
17576   else
17577     ac_cpp_err=
17578   fi
17579 else
17580   ac_cpp_err=yes
17581 fi
17582 if test -z "$ac_cpp_err"; then
17583   ac_cv_header_stdc=yes
17584 else
17585   echo "$as_me: failed program was:" >&5
17586   cat "conftest.$ac_ext" >&5
17587   ac_cv_header_stdc=no
17588 fi
17589 rm -f conftest.err "conftest.$ac_ext"
17590
17591 if test $ac_cv_header_stdc = yes; then
17592   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17593   cat >"conftest.$ac_ext" <<_ACEOF
17594 #line 17594 "configure"
17595 #include "confdefs.h"
17596 #include <string.h>
17597
17598 _ACEOF
17599 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17600   $EGREP "memchr" >/dev/null 2>&1; then
17601   :
17602 else
17603   ac_cv_header_stdc=no
17604 fi
17605 rm -rf conftest*
17606
17607 fi
17608
17609 if test $ac_cv_header_stdc = yes; then
17610   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17611   cat >"conftest.$ac_ext" <<_ACEOF
17612 #line 17612 "configure"
17613 #include "confdefs.h"
17614 #include <stdlib.h>
17615
17616 _ACEOF
17617 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17618   $EGREP "free" >/dev/null 2>&1; then
17619   :
17620 else
17621   ac_cv_header_stdc=no
17622 fi
17623 rm -rf conftest*
17624
17625 fi
17626
17627 if test $ac_cv_header_stdc = yes; then
17628   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17629   if test "$cross_compiling" = yes; then
17630   :
17631 else
17632   cat >"conftest.$ac_ext" <<_ACEOF
17633 #line 17633 "configure"
17634 #include "confdefs.h"
17635 #include <ctype.h>
17636 #if ((' ' & 0x0FF) == 0x020)
17637 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17638 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17639 #else
17640 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17641                      || ('j' <= (c) && (c) <= 'r') \
17642                      || ('s' <= (c) && (c) <= 'z'))
17643 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17644 #endif
17645
17646 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17647 int
17648 main (void)
17649 {
17650   int i;
17651   for (i = 0; i < 256; i++)
17652     if (XOR (islower (i), ISLOWER (i))
17653         || toupper (i) != TOUPPER (i))
17654       $ac_main_return(2);
17655   $ac_main_return (0);
17656 }
17657 _ACEOF
17658 rm -f "conftest$ac_exeext"
17659 if { (eval echo "$as_me:17659: \"$ac_link\"") >&5
17660   (eval $ac_link) 2>&5
17661   ac_status=$?
17662   echo "$as_me:17662: \$? = $ac_status" >&5
17663   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17664   { (eval echo "$as_me:17664: \"$ac_try\"") >&5
17665   (eval $ac_try) 2>&5
17666   ac_status=$?
17667   echo "$as_me:17667: \$? = $ac_status" >&5
17668   (exit "$ac_status"); }; }; then
17669   :
17670 else
17671   echo "$as_me: program exited with status $ac_status" >&5
17672 echo "$as_me: failed program was:" >&5
17673 cat "conftest.$ac_ext" >&5
17674 ac_cv_header_stdc=no
17675 fi
17676 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17677 fi
17678 fi
17679 fi
17680 echo "$as_me:17680: result: $ac_cv_header_stdc" >&5
17681 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17682 if test $ac_cv_header_stdc = yes; then
17683
17684 cat >>confdefs.h <<\EOF
17685 #define STDC_HEADERS 1
17686 EOF
17687
17688 fi
17689
17690 echo "$as_me:17690: checking whether time.h and sys/time.h may both be included" >&5
17691 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17692 if test "${ac_cv_header_time+set}" = set; then
17693   echo $ECHO_N "(cached) $ECHO_C" >&6
17694 else
17695   cat >"conftest.$ac_ext" <<_ACEOF
17696 #line 17696 "configure"
17697 #include "confdefs.h"
17698 #include <sys/types.h>
17699 #include <sys/time.h>
17700 #include <time.h>
17701
17702 int
17703 main (void)
17704 {
17705 if ((struct tm *) 0)
17706 return 0;
17707   ;
17708   return 0;
17709 }
17710 _ACEOF
17711 rm -f "conftest.$ac_objext"
17712 if { (eval echo "$as_me:17712: \"$ac_compile\"") >&5
17713   (eval $ac_compile) 2>&5
17714   ac_status=$?
17715   echo "$as_me:17715: \$? = $ac_status" >&5
17716   (exit "$ac_status"); } &&
17717          { ac_try='test -s "conftest.$ac_objext"'
17718   { (eval echo "$as_me:17718: \"$ac_try\"") >&5
17719   (eval $ac_try) 2>&5
17720   ac_status=$?
17721   echo "$as_me:17721: \$? = $ac_status" >&5
17722   (exit "$ac_status"); }; }; then
17723   ac_cv_header_time=yes
17724 else
17725   echo "$as_me: failed program was:" >&5
17726 cat "conftest.$ac_ext" >&5
17727 ac_cv_header_time=no
17728 fi
17729 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17730 fi
17731 echo "$as_me:17731: result: $ac_cv_header_time" >&5
17732 echo "${ECHO_T}$ac_cv_header_time" >&6
17733 if test $ac_cv_header_time = yes; then
17734
17735 cat >>confdefs.h <<\EOF
17736 #define TIME_WITH_SYS_TIME 1
17737 EOF
17738
17739 fi
17740
17741 for ac_header in \
17742 getopt.h \
17743 locale.h \
17744 math.h \
17745 stdarg.h \
17746 stdint.h \
17747 sys/ioctl.h \
17748 sys/select.h \
17749 sys/time.h \
17750 termios.h \
17751 unistd.h \
17752
17753 do
17754 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17755 echo "$as_me:17755: checking for $ac_header" >&5
17756 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17757 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17758   echo $ECHO_N "(cached) $ECHO_C" >&6
17759 else
17760   cat >"conftest.$ac_ext" <<_ACEOF
17761 #line 17761 "configure"
17762 #include "confdefs.h"
17763 #include <$ac_header>
17764 _ACEOF
17765 if { (eval echo "$as_me:17765: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17766   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17767   ac_status=$?
17768   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17769   rm -f conftest.er1
17770   cat conftest.err >&5
17771   echo "$as_me:17771: \$? = $ac_status" >&5
17772   (exit "$ac_status"); } >/dev/null; then
17773   if test -s conftest.err; then
17774     ac_cpp_err=$ac_c_preproc_warn_flag
17775   else
17776     ac_cpp_err=
17777   fi
17778 else
17779   ac_cpp_err=yes
17780 fi
17781 if test -z "$ac_cpp_err"; then
17782   eval "$as_ac_Header=yes"
17783 else
17784   echo "$as_me: failed program was:" >&5
17785   cat "conftest.$ac_ext" >&5
17786   eval "$as_ac_Header=no"
17787 fi
17788 rm -f conftest.err "conftest.$ac_ext"
17789 fi
17790 echo "$as_me:17790: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17791 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17792 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17793   cat >>confdefs.h <<EOF
17794 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17795 EOF
17796
17797 fi
17798 done
17799
17800 for ac_header in unistd.h getopt.h
17801 do
17802 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17803 echo "$as_me:17803: checking for $ac_header" >&5
17804 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17805 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17806   echo $ECHO_N "(cached) $ECHO_C" >&6
17807 else
17808   cat >"conftest.$ac_ext" <<_ACEOF
17809 #line 17809 "configure"
17810 #include "confdefs.h"
17811 #include <$ac_header>
17812 _ACEOF
17813 if { (eval echo "$as_me:17813: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17814   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17815   ac_status=$?
17816   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17817   rm -f conftest.er1
17818   cat conftest.err >&5
17819   echo "$as_me:17819: \$? = $ac_status" >&5
17820   (exit "$ac_status"); } >/dev/null; then
17821   if test -s conftest.err; then
17822     ac_cpp_err=$ac_c_preproc_warn_flag
17823   else
17824     ac_cpp_err=
17825   fi
17826 else
17827   ac_cpp_err=yes
17828 fi
17829 if test -z "$ac_cpp_err"; then
17830   eval "$as_ac_Header=yes"
17831 else
17832   echo "$as_me: failed program was:" >&5
17833   cat "conftest.$ac_ext" >&5
17834   eval "$as_ac_Header=no"
17835 fi
17836 rm -f conftest.err "conftest.$ac_ext"
17837 fi
17838 echo "$as_me:17838: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17839 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17840 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17841   cat >>confdefs.h <<EOF
17842 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17843 EOF
17844
17845 fi
17846 done
17847
17848 echo "$as_me:17848: checking for header declaring getopt variables" >&5
17849 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17850 if test "${cf_cv_getopt_header+set}" = set; then
17851   echo $ECHO_N "(cached) $ECHO_C" >&6
17852 else
17853
17854 cf_cv_getopt_header=none
17855 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17856 do
17857 cat >"conftest.$ac_ext" <<_ACEOF
17858 #line 17858 "configure"
17859 #include "confdefs.h"
17860
17861 #include <$cf_header>
17862 int
17863 main (void)
17864 {
17865 int x = optind; char *y = optarg
17866   ;
17867   return 0;
17868 }
17869 _ACEOF
17870 rm -f "conftest.$ac_objext"
17871 if { (eval echo "$as_me:17871: \"$ac_compile\"") >&5
17872   (eval $ac_compile) 2>&5
17873   ac_status=$?
17874   echo "$as_me:17874: \$? = $ac_status" >&5
17875   (exit "$ac_status"); } &&
17876          { ac_try='test -s "conftest.$ac_objext"'
17877   { (eval echo "$as_me:17877: \"$ac_try\"") >&5
17878   (eval $ac_try) 2>&5
17879   ac_status=$?
17880   echo "$as_me:17880: \$? = $ac_status" >&5
17881   (exit "$ac_status"); }; }; then
17882   cf_cv_getopt_header=$cf_header
17883  break
17884 else
17885   echo "$as_me: failed program was:" >&5
17886 cat "conftest.$ac_ext" >&5
17887 fi
17888 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17889 done
17890
17891 fi
17892 echo "$as_me:17892: result: $cf_cv_getopt_header" >&5
17893 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17894 if test "$cf_cv_getopt_header" != none ; then
17895
17896 cat >>confdefs.h <<\EOF
17897 #define HAVE_GETOPT_HEADER 1
17898 EOF
17899
17900 fi
17901 if test "$cf_cv_getopt_header" = getopt.h ; then
17902
17903 cat >>confdefs.h <<\EOF
17904 #define NEED_GETOPT_H 1
17905 EOF
17906
17907 fi
17908
17909 for ac_func in \
17910 getopt \
17911 gettimeofday \
17912 snprintf \
17913 strdup \
17914 strstr \
17915 tsearch \
17916
17917 do
17918 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17919 echo "$as_me:17919: checking for $ac_func" >&5
17920 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17921 if eval "test \"\${$as_ac_var+set}\" = set"; then
17922   echo $ECHO_N "(cached) $ECHO_C" >&6
17923 else
17924   cat >"conftest.$ac_ext" <<_ACEOF
17925 #line 17925 "configure"
17926 #include "confdefs.h"
17927 #define $ac_func autoconf_temporary
17928 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17929 #undef $ac_func
17930
17931 #ifdef __cplusplus
17932 extern "C"
17933 #endif
17934
17935 /* We use char because int might match the return type of a gcc2
17936    builtin and then its argument prototype would still apply.  */
17937 char $ac_func (void);
17938
17939 int
17940 main (void)
17941 {
17942
17943 /* The GNU C library defines stubs for functions which it implements
17944     to always fail with ENOSYS.  Some functions are actually named
17945     something starting with __ and the normal name is an alias.  */
17946 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17947 #error found stub for $ac_func
17948 #endif
17949
17950         return $ac_func ();
17951   ;
17952   return 0;
17953 }
17954 _ACEOF
17955 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17956 if { (eval echo "$as_me:17956: \"$ac_link\"") >&5
17957   (eval $ac_link) 2>&5
17958   ac_status=$?
17959   echo "$as_me:17959: \$? = $ac_status" >&5
17960   (exit "$ac_status"); } &&
17961          { ac_try='test -s "conftest$ac_exeext"'
17962   { (eval echo "$as_me:17962: \"$ac_try\"") >&5
17963   (eval $ac_try) 2>&5
17964   ac_status=$?
17965   echo "$as_me:17965: \$? = $ac_status" >&5
17966   (exit "$ac_status"); }; }; then
17967   eval "$as_ac_var=yes"
17968 else
17969   echo "$as_me: failed program was:" >&5
17970 cat "conftest.$ac_ext" >&5
17971 eval "$as_ac_var=no"
17972 fi
17973 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17974 fi
17975 echo "$as_me:17975: result: `eval echo '${'"$as_ac_var"'}'`" >&5
17976 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
17977 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
17978   cat >>confdefs.h <<EOF
17979 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17980 EOF
17981
17982 fi
17983 done
17984
17985 # use a compile-check to work with ncurses*-config and subdirectory includes
17986 echo "$as_me:17986: checking if we can use termcap.h" >&5
17987 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17988 if test "${cf_cv_have_termcap_h+set}" = set; then
17989   echo $ECHO_N "(cached) $ECHO_C" >&6
17990 else
17991
17992         cat >"conftest.$ac_ext" <<_ACEOF
17993 #line 17993 "configure"
17994 #include "confdefs.h"
17995
17996 #include <curses.h>
17997 #ifdef NCURSES_VERSION
17998 #undef NCURSES_VERSION
17999 #endif
18000 #include <termcap.h>
18001 #ifndef NCURSES_VERSION
18002 #error wrong header
18003 #endif
18004
18005 int
18006 main (void)
18007 {
18008 return 0;
18009   ;
18010   return 0;
18011 }
18012 _ACEOF
18013 rm -f "conftest.$ac_objext"
18014 if { (eval echo "$as_me:18014: \"$ac_compile\"") >&5
18015   (eval $ac_compile) 2>&5
18016   ac_status=$?
18017   echo "$as_me:18017: \$? = $ac_status" >&5
18018   (exit "$ac_status"); } &&
18019          { ac_try='test -s "conftest.$ac_objext"'
18020   { (eval echo "$as_me:18020: \"$ac_try\"") >&5
18021   (eval $ac_try) 2>&5
18022   ac_status=$?
18023   echo "$as_me:18023: \$? = $ac_status" >&5
18024   (exit "$ac_status"); }; }; then
18025   cf_cv_have_termcap_h=yes
18026 else
18027   echo "$as_me: failed program was:" >&5
18028 cat "conftest.$ac_ext" >&5
18029 cf_cv_have_termcap_h=no
18030 fi
18031 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18032 fi
18033 echo "$as_me:18033: result: $cf_cv_have_termcap_h" >&5
18034 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
18035 if test "x$cf_cv_have_termcap_h" = xyes
18036 then
18037
18038 cat >>confdefs.h <<\EOF
18039 #define HAVE_TERMCAP_H 1
18040 EOF
18041
18042 else
18043 echo "$as_me:18043: checking if we can use ncurses/termcap.h" >&5
18044 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
18045 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
18046   echo $ECHO_N "(cached) $ECHO_C" >&6
18047 else
18048
18049         cat >"conftest.$ac_ext" <<_ACEOF
18050 #line 18050 "configure"
18051 #include "confdefs.h"
18052
18053 #include <ncurses/curses.h>
18054 #ifdef NCURSES_VERSION
18055 #undef NCURSES_VERSION
18056 #endif
18057 #include <ncurses/termcap.h>
18058 #ifndef NCURSES_VERSION
18059 #error wrong header
18060 #endif
18061
18062 int
18063 main (void)
18064 {
18065 return 0;
18066   ;
18067   return 0;
18068 }
18069 _ACEOF
18070 rm -f "conftest.$ac_objext"
18071 if { (eval echo "$as_me:18071: \"$ac_compile\"") >&5
18072   (eval $ac_compile) 2>&5
18073   ac_status=$?
18074   echo "$as_me:18074: \$? = $ac_status" >&5
18075   (exit "$ac_status"); } &&
18076          { ac_try='test -s "conftest.$ac_objext"'
18077   { (eval echo "$as_me:18077: \"$ac_try\"") >&5
18078   (eval $ac_try) 2>&5
18079   ac_status=$?
18080   echo "$as_me:18080: \$? = $ac_status" >&5
18081   (exit "$ac_status"); }; }; then
18082   cf_cv_have_ncurses_termcap_h=yes
18083 else
18084   echo "$as_me: failed program was:" >&5
18085 cat "conftest.$ac_ext" >&5
18086 cf_cv_have_ncurses_termcap_h=no
18087 fi
18088 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18089 fi
18090 echo "$as_me:18090: result: $cf_cv_have_ncurses_termcap_h" >&5
18091 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
18092 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
18093 cat >>confdefs.h <<\EOF
18094 #define HAVE_NCURSES_TERMCAP_H 1
18095 EOF
18096
18097 fi
18098
18099 if test "x$ac_cv_func_getopt" = xno; then
18100         { { echo "$as_me:18100: error: getopt is required for building programs" >&5
18101 echo "$as_me: error: getopt is required for building programs" >&2;}
18102    { (exit 1); exit 1; }; }
18103 fi
18104
18105 if test "$cf_enable_widec" = yes; then
18106
18107 for ac_func in \
18108 mblen \
18109 mbrlen \
18110 mbrtowc \
18111 mbsrtowcs \
18112 mbstowcs \
18113 mbtowc \
18114 wcsrtombs \
18115 wcstombs \
18116
18117 do
18118 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18119 echo "$as_me:18119: checking for $ac_func" >&5
18120 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
18121 if eval "test \"\${$as_ac_var+set}\" = set"; then
18122   echo $ECHO_N "(cached) $ECHO_C" >&6
18123 else
18124   cat >"conftest.$ac_ext" <<_ACEOF
18125 #line 18125 "configure"
18126 #include "confdefs.h"
18127 #define $ac_func autoconf_temporary
18128 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
18129 #undef $ac_func
18130
18131 #ifdef __cplusplus
18132 extern "C"
18133 #endif
18134
18135 /* We use char because int might match the return type of a gcc2
18136    builtin and then its argument prototype would still apply.  */
18137 char $ac_func (void);
18138
18139 int
18140 main (void)
18141 {
18142
18143 /* The GNU C library defines stubs for functions which it implements
18144     to always fail with ENOSYS.  Some functions are actually named
18145     something starting with __ and the normal name is an alias.  */
18146 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
18147 #error found stub for $ac_func
18148 #endif
18149
18150         return $ac_func ();
18151   ;
18152   return 0;
18153 }
18154 _ACEOF
18155 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18156 if { (eval echo "$as_me:18156: \"$ac_link\"") >&5
18157   (eval $ac_link) 2>&5
18158   ac_status=$?
18159   echo "$as_me:18159: \$? = $ac_status" >&5
18160   (exit "$ac_status"); } &&
18161          { ac_try='test -s "conftest$ac_exeext"'
18162   { (eval echo "$as_me:18162: \"$ac_try\"") >&5
18163   (eval $ac_try) 2>&5
18164   ac_status=$?
18165   echo "$as_me:18165: \$? = $ac_status" >&5
18166   (exit "$ac_status"); }; }; then
18167   eval "$as_ac_var=yes"
18168 else
18169   echo "$as_me: failed program was:" >&5
18170 cat "conftest.$ac_ext" >&5
18171 eval "$as_ac_var=no"
18172 fi
18173 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18174 fi
18175 echo "$as_me:18175: result: `eval echo '${'"$as_ac_var"'}'`" >&5
18176 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6
18177 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then
18178   cat >>confdefs.h <<EOF
18179 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18180 EOF
18181
18182 fi
18183 done
18184
18185 fi
18186
18187 echo "$as_me:18187: checking definition to turn on extended curses functions" >&5
18188 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
18189 if test "${cf_cv_need_xopen_extension+set}" = set; then
18190   echo $ECHO_N "(cached) $ECHO_C" >&6
18191 else
18192
18193 cf_cv_need_xopen_extension=unknown
18194 cat >"conftest.$ac_ext" <<_ACEOF
18195 #line 18195 "configure"
18196 #include "confdefs.h"
18197
18198 #include <stdlib.h>
18199 #include <${cf_cv_ncurses_header:-curses.h}>
18200 int
18201 main (void)
18202 {
18203
18204 #if defined(NCURSES_VERSION_PATCH)
18205 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
18206         make an error
18207 #endif
18208 #endif
18209 #ifdef NCURSES_VERSION
18210         cchar_t check;
18211         int check2 = curs_set((int)sizeof(check));
18212 #endif
18213         long x = winnstr(stdscr, "", 0);
18214         int x1, y1;
18215 #ifdef NCURSES_VERSION
18216         (void)check2;
18217 #endif
18218         getbegyx(stdscr, y1, x1);
18219         (void)x;
18220         (void)y1;
18221         (void)x1;
18222
18223   ;
18224   return 0;
18225 }
18226 _ACEOF
18227 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18228 if { (eval echo "$as_me:18228: \"$ac_link\"") >&5
18229   (eval $ac_link) 2>&5
18230   ac_status=$?
18231   echo "$as_me:18231: \$? = $ac_status" >&5
18232   (exit "$ac_status"); } &&
18233          { ac_try='test -s "conftest$ac_exeext"'
18234   { (eval echo "$as_me:18234: \"$ac_try\"") >&5
18235   (eval $ac_try) 2>&5
18236   ac_status=$?
18237   echo "$as_me:18237: \$? = $ac_status" >&5
18238   (exit "$ac_status"); }; }; then
18239   cf_cv_need_xopen_extension=none
18240 else
18241   echo "$as_me: failed program was:" >&5
18242 cat "conftest.$ac_ext" >&5
18243
18244         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
18245         do
18246                 cat >"conftest.$ac_ext" <<_ACEOF
18247 #line 18247 "configure"
18248 #include "confdefs.h"
18249
18250 #define $cf_try_xopen_extension 1
18251 #include <stdlib.h>
18252 #include <${cf_cv_ncurses_header:-curses.h}>
18253 int
18254 main (void)
18255 {
18256
18257 #ifdef NCURSES_VERSION
18258                 cchar_t check;
18259                 int check2 = curs_set((int)sizeof(check));
18260 #endif
18261                 long x = winnstr(stdscr, "", 0);
18262                 int x1, y1;
18263                 getbegyx(stdscr, y1, x1);
18264 #ifdef NCURSES_VERSION
18265                 (void)check2;
18266 #endif
18267                 (void)x;
18268                 (void)y1;
18269                 (void)x1;
18270
18271   ;
18272   return 0;
18273 }
18274 _ACEOF
18275 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18276 if { (eval echo "$as_me:18276: \"$ac_link\"") >&5
18277   (eval $ac_link) 2>&5
18278   ac_status=$?
18279   echo "$as_me:18279: \$? = $ac_status" >&5
18280   (exit "$ac_status"); } &&
18281          { ac_try='test -s "conftest$ac_exeext"'
18282   { (eval echo "$as_me:18282: \"$ac_try\"") >&5
18283   (eval $ac_try) 2>&5
18284   ac_status=$?
18285   echo "$as_me:18285: \$? = $ac_status" >&5
18286   (exit "$ac_status"); }; }; then
18287   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18288 else
18289   echo "$as_me: failed program was:" >&5
18290 cat "conftest.$ac_ext" >&5
18291 fi
18292 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18293         done
18294
18295 fi
18296 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18297
18298 fi
18299 echo "$as_me:18299: result: $cf_cv_need_xopen_extension" >&5
18300 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18301
18302 case "$cf_cv_need_xopen_extension" in
18303 (*_*)
18304
18305         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18306         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18307
18308         ;;
18309 esac
18310
18311 echo "$as_me:18311: checking for term.h" >&5
18312 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18313 if test "${cf_cv_term_header+set}" = set; then
18314   echo $ECHO_N "(cached) $ECHO_C" >&6
18315 else
18316
18317 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18318 # for <term.h> if we do not find the variant.
18319
18320 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18321
18322 case "${cf_cv_ncurses_header:-curses.h}" in
18323 (*/*)
18324         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18325         cf_header_list="$cf_header_item $cf_header_list"
18326         ;;
18327 esac
18328
18329 for cf_header in $cf_header_list
18330 do
18331         cat >"conftest.$ac_ext" <<_ACEOF
18332 #line 18332 "configure"
18333 #include "confdefs.h"
18334
18335 #include <${cf_cv_ncurses_header:-curses.h}>
18336 #include <${cf_header}>
18337 int
18338 main (void)
18339 {
18340 WINDOW *x; (void)x
18341   ;
18342   return 0;
18343 }
18344 _ACEOF
18345 rm -f "conftest.$ac_objext"
18346 if { (eval echo "$as_me:18346: \"$ac_compile\"") >&5
18347   (eval $ac_compile) 2>&5
18348   ac_status=$?
18349   echo "$as_me:18349: \$? = $ac_status" >&5
18350   (exit "$ac_status"); } &&
18351          { ac_try='test -s "conftest.$ac_objext"'
18352   { (eval echo "$as_me:18352: \"$ac_try\"") >&5
18353   (eval $ac_try) 2>&5
18354   ac_status=$?
18355   echo "$as_me:18355: \$? = $ac_status" >&5
18356   (exit "$ac_status"); }; }; then
18357   cf_cv_term_header=$cf_header
18358          break
18359 else
18360   echo "$as_me: failed program was:" >&5
18361 cat "conftest.$ac_ext" >&5
18362 cf_cv_term_header=no
18363 fi
18364 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18365 done
18366
18367 case "$cf_cv_term_header" in
18368 (no)
18369         # If curses is ncurses, some packagers still mess it up by trying to make
18370         # us use GNU termcap.  This handles the most common case.
18371         for cf_header in ncurses/term.h ncursesw/term.h
18372         do
18373                 cat >"conftest.$ac_ext" <<_ACEOF
18374 #line 18374 "configure"
18375 #include "confdefs.h"
18376
18377 #include <${cf_cv_ncurses_header:-curses.h}>
18378 #ifdef NCURSES_VERSION
18379 #include <${cf_header}>
18380 #else
18381 make an error
18382 #endif
18383 int
18384 main (void)
18385 {
18386 WINDOW *x; (void)x
18387   ;
18388   return 0;
18389 }
18390 _ACEOF
18391 rm -f "conftest.$ac_objext"
18392 if { (eval echo "$as_me:18392: \"$ac_compile\"") >&5
18393   (eval $ac_compile) 2>&5
18394   ac_status=$?
18395   echo "$as_me:18395: \$? = $ac_status" >&5
18396   (exit "$ac_status"); } &&
18397          { ac_try='test -s "conftest.$ac_objext"'
18398   { (eval echo "$as_me:18398: \"$ac_try\"") >&5
18399   (eval $ac_try) 2>&5
18400   ac_status=$?
18401   echo "$as_me:18401: \$? = $ac_status" >&5
18402   (exit "$ac_status"); }; }; then
18403   cf_cv_term_header=$cf_header
18404                          break
18405 else
18406   echo "$as_me: failed program was:" >&5
18407 cat "conftest.$ac_ext" >&5
18408 cf_cv_term_header=no
18409 fi
18410 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18411         done
18412         ;;
18413 esac
18414
18415 fi
18416 echo "$as_me:18416: result: $cf_cv_term_header" >&5
18417 echo "${ECHO_T}$cf_cv_term_header" >&6
18418
18419 case "$cf_cv_term_header" in
18420 (term.h)
18421
18422 cat >>confdefs.h <<\EOF
18423 #define HAVE_TERM_H 1
18424 EOF
18425
18426         ;;
18427 (ncurses/term.h)
18428
18429 cat >>confdefs.h <<\EOF
18430 #define HAVE_NCURSES_TERM_H 1
18431 EOF
18432
18433         ;;
18434 (ncursesw/term.h)
18435
18436 cat >>confdefs.h <<\EOF
18437 #define HAVE_NCURSESW_TERM_H 1
18438 EOF
18439
18440         ;;
18441 esac
18442
18443 echo "$as_me:18443: checking for unctrl.h" >&5
18444 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18445 if test "${cf_cv_unctrl_header+set}" = set; then
18446   echo $ECHO_N "(cached) $ECHO_C" >&6
18447 else
18448
18449 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18450 # for <unctrl.h> if we do not find the variant.
18451
18452 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18453
18454 case "${cf_cv_ncurses_header:-curses.h}" in
18455 (*/*)
18456         cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18457         cf_header_list="$cf_header_item $cf_header_list"
18458         ;;
18459 esac
18460
18461 for cf_header in $cf_header_list
18462 do
18463         cat >"conftest.$ac_ext" <<_ACEOF
18464 #line 18464 "configure"
18465 #include "confdefs.h"
18466
18467 #include <${cf_cv_ncurses_header:-curses.h}>
18468 #include <${cf_header}>
18469 int
18470 main (void)
18471 {
18472 WINDOW *x; (void)x
18473   ;
18474   return 0;
18475 }
18476 _ACEOF
18477 rm -f "conftest.$ac_objext"
18478 if { (eval echo "$as_me:18478: \"$ac_compile\"") >&5
18479   (eval $ac_compile) 2>&5
18480   ac_status=$?
18481   echo "$as_me:18481: \$? = $ac_status" >&5
18482   (exit "$ac_status"); } &&
18483          { ac_try='test -s "conftest.$ac_objext"'
18484   { (eval echo "$as_me:18484: \"$ac_try\"") >&5
18485   (eval $ac_try) 2>&5
18486   ac_status=$?
18487   echo "$as_me:18487: \$? = $ac_status" >&5
18488   (exit "$ac_status"); }; }; then
18489   cf_cv_unctrl_header=$cf_header
18490          break
18491 else
18492   echo "$as_me: failed program was:" >&5
18493 cat "conftest.$ac_ext" >&5
18494 cf_cv_unctrl_header=no
18495 fi
18496 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18497 done
18498
18499 fi
18500 echo "$as_me:18500: result: $cf_cv_unctrl_header" >&5
18501 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18502
18503 case "$cf_cv_unctrl_header" in
18504 (no)
18505         { echo "$as_me:18505: WARNING: unctrl.h header not found" >&5
18506 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18507         ;;
18508 esac
18509
18510 case "$cf_cv_unctrl_header" in
18511 (unctrl.h)
18512
18513 cat >>confdefs.h <<\EOF
18514 #define HAVE_UNCTRL_H 1
18515 EOF
18516
18517         ;;
18518 (ncurses/unctrl.h)
18519
18520 cat >>confdefs.h <<\EOF
18521 #define HAVE_NCURSES_UNCTRL_H 1
18522 EOF
18523
18524         ;;
18525 (ncursesw/unctrl.h)
18526
18527 cat >>confdefs.h <<\EOF
18528 #define HAVE_NCURSESW_UNCTRL_H 1
18529 EOF
18530
18531         ;;
18532 esac
18533
18534 for cf_func in \
18535 alloc_pair \
18536 assume_default_colors \
18537 chgat \
18538 color_content \
18539 color_set \
18540 copywin \
18541 delscreen \
18542 dupwin \
18543 exit_curses \
18544 exit_terminfo \
18545 filter \
18546 getbegx \
18547 getcurx \
18548 getmaxx \
18549 getnstr \
18550 getparx \
18551 getwin \
18552 halfdelay \
18553 init_extended_color \
18554 mvderwin \
18555 mvvline \
18556 mvwin \
18557 mvwvline \
18558 napms \
18559 newpad \
18560 putwin \
18561 reset_color_pairs \
18562 resize_term \
18563 resizeterm \
18564 restartterm \
18565 ripoffline \
18566 scr_dump \
18567 setupterm \
18568 slk_color \
18569 slk_init \
18570 termattrs \
18571 termname \
18572 tgetent \
18573 tigetnum \
18574 tigetstr \
18575 tputs_sp \
18576 typeahead \
18577 use_default_colors \
18578 use_env \
18579 use_extended_names \
18580 use_screen \
18581 use_window \
18582 vid_puts \
18583 vidputs \
18584 vsscanf \
18585 vw_printw \
18586 wchgat \
18587 winsdelln \
18588 winsstr \
18589 wresize \
18590 wsyncdown \
18591 _tracef \
18592
18593 do
18594
18595 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18596
18597         echo "$as_me:18597: checking for ${cf_func}" >&5
18598 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18599
18600 echo "${as_me:-configure}:18600: testing ${cf_func} ..." 1>&5
18601
18602         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18603   echo $ECHO_N "(cached) $ECHO_C" >&6
18604 else
18605
18606                 eval cf_result='$ac_cv_func_'$cf_func
18607                 if test ".$cf_result" != ".no"; then
18608                         cat >"conftest.$ac_ext" <<_ACEOF
18609 #line 18609 "configure"
18610 #include "confdefs.h"
18611
18612 #ifdef HAVE_XCURSES
18613 #include <xcurses.h>
18614 char * XCursesProgramName = "test";
18615 #else
18616 #include <${cf_cv_ncurses_header:-curses.h}>
18617 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18618 #include <ncursesw/term.h>
18619 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18620 #include <ncurses/term.h>
18621 #elif defined(HAVE_TERM_H)
18622 #include <term.h>
18623 #endif
18624 #endif
18625
18626 int
18627 main (void)
18628 {
18629
18630 #ifndef ${cf_func}
18631 long foo = (long)(&${cf_func});
18632 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18633 if (foo + 1234L > 5678L)
18634         ${cf_cv_main_return:-return}(foo != 0);
18635 #endif
18636
18637   ;
18638   return 0;
18639 }
18640 _ACEOF
18641 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18642 if { (eval echo "$as_me:18642: \"$ac_link\"") >&5
18643   (eval $ac_link) 2>&5
18644   ac_status=$?
18645   echo "$as_me:18645: \$? = $ac_status" >&5
18646   (exit "$ac_status"); } &&
18647          { ac_try='test -s "conftest$ac_exeext"'
18648   { (eval echo "$as_me:18648: \"$ac_try\"") >&5
18649   (eval $ac_try) 2>&5
18650   ac_status=$?
18651   echo "$as_me:18651: \$? = $ac_status" >&5
18652   (exit "$ac_status"); }; }; then
18653   cf_result=yes
18654 else
18655   echo "$as_me: failed program was:" >&5
18656 cat "conftest.$ac_ext" >&5
18657 cf_result=no
18658 fi
18659 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18660                 fi
18661                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18662
18663 fi
18664
18665         # use the computed/retrieved cache-value:
18666         eval 'cf_result=$cf_cv_func_'$cf_func
18667         echo "$as_me:18667: result: $cf_result" >&5
18668 echo "${ECHO_T}$cf_result" >&6
18669         if test "$cf_result" != no; then
18670                 cat >>confdefs.h <<EOF
18671 #define HAVE_${cf_tr_func} 1
18672 EOF
18673
18674         fi
18675 done
18676
18677 for cf_func in tputs
18678 do
18679
18680 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18681
18682         echo "$as_me:18682: checking for ${cf_func}" >&5
18683 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18684
18685 echo "${as_me:-configure}:18685: testing ${cf_func} ..." 1>&5
18686
18687         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18688   echo $ECHO_N "(cached) $ECHO_C" >&6
18689 else
18690
18691                 eval cf_result='$ac_cv_func_'$cf_func
18692                 if test ".$cf_result" != ".no"; then
18693                         cat >"conftest.$ac_ext" <<_ACEOF
18694 #line 18694 "configure"
18695 #include "confdefs.h"
18696
18697 #ifdef HAVE_XCURSES
18698 #include <xcurses.h>
18699 char * XCursesProgramName = "test";
18700 #else
18701 #include <${cf_cv_ncurses_header:-curses.h}>
18702 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18703 #include <ncursesw/term.h>
18704 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18705 #include <ncurses/term.h>
18706 #elif defined(HAVE_TERM_H)
18707 #include <term.h>
18708 #endif
18709 #endif
18710
18711 int
18712 main (void)
18713 {
18714
18715 #ifndef ${cf_func}
18716 long foo = (long)(&${cf_func});
18717 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
18718 if (foo + 1234L > 5678L)
18719         ${cf_cv_main_return:-return}(foo != 0);
18720 #endif
18721
18722   ;
18723   return 0;
18724 }
18725 _ACEOF
18726 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18727 if { (eval echo "$as_me:18727: \"$ac_link\"") >&5
18728   (eval $ac_link) 2>&5
18729   ac_status=$?
18730   echo "$as_me:18730: \$? = $ac_status" >&5
18731   (exit "$ac_status"); } &&
18732          { ac_try='test -s "conftest$ac_exeext"'
18733   { (eval echo "$as_me:18733: \"$ac_try\"") >&5
18734   (eval $ac_try) 2>&5
18735   ac_status=$?
18736   echo "$as_me:18736: \$? = $ac_status" >&5
18737   (exit "$ac_status"); }; }; then
18738   cf_result=yes
18739 else
18740   echo "$as_me: failed program was:" >&5
18741 cat "conftest.$ac_ext" >&5
18742 cf_result=no
18743 fi
18744 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18745                 fi
18746                 eval 'cf_cv_func_'$cf_func'="$cf_result"'
18747
18748 fi
18749
18750         # use the computed/retrieved cache-value:
18751         eval 'cf_result=$cf_cv_func_'$cf_func
18752         echo "$as_me:18752: result: $cf_result" >&5
18753 echo "${ECHO_T}$cf_result" >&6
18754         if test "$cf_result" != no; then
18755                 cat >>confdefs.h <<EOF
18756 #define HAVE_${cf_tr_func} 1
18757 EOF
18758
18759         fi
18760 done
18761
18762 if test "x$cf_cv_func_tputs" = xyes
18763 then
18764         cf_done=no
18765         for cf_arg in int char
18766         do
18767                 for cf_ret in int void
18768                 do
18769                         if test "$cf_ret" = void
18770                         then
18771                                 cf_return="/* nothing */"
18772                         else
18773                                 cf_return="return value"
18774                         fi
18775                         cat >"conftest.$ac_ext" <<_ACEOF
18776 #line 18776 "configure"
18777 #include "confdefs.h"
18778
18779 #include <${cf_cv_ncurses_header:-curses.h}>
18780 #include <$cf_cv_term_header>
18781
18782 static $cf_ret outc($cf_arg value) { $cf_return; }
18783
18784 int
18785 main (void)
18786 {
18787
18788         tputs("hello", 0, outc);
18789         ${cf_cv_main_return:-return}(0);
18790
18791   ;
18792   return 0;
18793 }
18794 _ACEOF
18795 rm -f "conftest.$ac_objext"
18796 if { (eval echo "$as_me:18796: \"$ac_compile\"") >&5
18797   (eval $ac_compile) 2>&5
18798   ac_status=$?
18799   echo "$as_me:18799: \$? = $ac_status" >&5
18800   (exit "$ac_status"); } &&
18801          { ac_try='test -s "conftest.$ac_objext"'
18802   { (eval echo "$as_me:18802: \"$ac_try\"") >&5
18803   (eval $ac_try) 2>&5
18804   ac_status=$?
18805   echo "$as_me:18805: \$? = $ac_status" >&5
18806   (exit "$ac_status"); }; }; then
18807
18808                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18809
18810 echo "${as_me:-configure}:18810: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18811
18812                 cat >>confdefs.h <<EOF
18813 #define TPUTS_ARG               $cf_arg
18814 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18815 #define TPUTS_RETURN(value)     $cf_return
18816 EOF
18817                 cf_done=yes
18818                 break
18819
18820 else
18821   echo "$as_me: failed program was:" >&5
18822 cat "conftest.$ac_ext" >&5
18823 fi
18824 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18825                 done
18826                 test "$cf_done" = yes && break
18827         done
18828 fi
18829
18830 echo "$as_me:18830: checking for ncurses extended functions" >&5
18831 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18832 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18833   echo $ECHO_N "(cached) $ECHO_C" >&6
18834 else
18835
18836 cat >"conftest.$ac_ext" <<_ACEOF
18837 #line 18837 "configure"
18838 #include "confdefs.h"
18839
18840 #include <${cf_cv_ncurses_header:-curses.h}>
18841 int
18842 main (void)
18843 {
18844
18845 int x = NCURSES_EXT_FUNCS
18846
18847   ;
18848   return 0;
18849 }
18850 _ACEOF
18851 rm -f "conftest.$ac_objext"
18852 if { (eval echo "$as_me:18852: \"$ac_compile\"") >&5
18853   (eval $ac_compile) 2>&5
18854   ac_status=$?
18855   echo "$as_me:18855: \$? = $ac_status" >&5
18856   (exit "$ac_status"); } &&
18857          { ac_try='test -s "conftest.$ac_objext"'
18858   { (eval echo "$as_me:18858: \"$ac_try\"") >&5
18859   (eval $ac_try) 2>&5
18860   ac_status=$?
18861   echo "$as_me:18861: \$? = $ac_status" >&5
18862   (exit "$ac_status"); }; }; then
18863   cf_cv_ncurses_ext_funcs=defined
18864 else
18865   echo "$as_me: failed program was:" >&5
18866 cat "conftest.$ac_ext" >&5
18867
18868 cat >"conftest.$ac_ext" <<_ACEOF
18869 #line 18869 "configure"
18870 #include "confdefs.h"
18871
18872 #include <${cf_cv_ncurses_header:-curses.h}>
18873 int
18874 main (void)
18875 {
18876
18877         (void) assume_default_colors (0, 0);
18878         (void) curses_version ();
18879         (void) define_key (0, 0);
18880         (void) is_term_resized (0, 0);
18881         (void) key_defined (0);
18882         (void) keybound (0, 0);
18883         (void) keyok (0, 0);
18884         (void) resize_term (0, 0);
18885         (void) resizeterm (0, 0);
18886         (void) use_default_colors ();
18887         (void) use_extended_names (0);
18888         (void) wresize (0, 0, 0);
18889   ;
18890   return 0;
18891 }
18892 _ACEOF
18893 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
18894 if { (eval echo "$as_me:18894: \"$ac_link\"") >&5
18895   (eval $ac_link) 2>&5
18896   ac_status=$?
18897   echo "$as_me:18897: \$? = $ac_status" >&5
18898   (exit "$ac_status"); } &&
18899          { ac_try='test -s "conftest$ac_exeext"'
18900   { (eval echo "$as_me:18900: \"$ac_try\"") >&5
18901   (eval $ac_try) 2>&5
18902   ac_status=$?
18903   echo "$as_me:18903: \$? = $ac_status" >&5
18904   (exit "$ac_status"); }; }; then
18905   cf_cv_ncurses_ext_funcs=yes
18906 else
18907   echo "$as_me: failed program was:" >&5
18908 cat "conftest.$ac_ext" >&5
18909 cf_cv_ncurses_ext_funcs=no
18910 fi
18911 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
18912
18913 fi
18914 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18915
18916 fi
18917 echo "$as_me:18917: result: $cf_cv_ncurses_ext_funcs" >&5
18918 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18919 test "$cf_cv_ncurses_ext_funcs" = yes &&
18920 cat >>confdefs.h <<\EOF
18921 #define NCURSES_EXT_FUNCS 1
18922 EOF
18923
18924 if test "$cf_enable_widec" = yes
18925 then
18926         # workaround for systems with ncurses before 20111029, due to change of
18927         # feature test macro from _XPG5 to _XOPEN_SOURCE
18928         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18929         then
18930                 cf_define_xpg5=no
18931                 echo "$as_me:18931: checking if _XPG5 should be defined to enable wide-characters" >&5
18932 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18933
18934                 cat >"conftest.$ac_ext" <<_ACEOF
18935 #line 18935 "configure"
18936 #include "confdefs.h"
18937
18938 #include <${cf_cv_ncurses_header:-curses.h}>
18939 int
18940 main (void)
18941 {
18942 int x = _XPG5
18943   ;
18944   return 0;
18945 }
18946 _ACEOF
18947 rm -f "conftest.$ac_objext"
18948 if { (eval echo "$as_me:18948: \"$ac_compile\"") >&5
18949   (eval $ac_compile) 2>&5
18950   ac_status=$?
18951   echo "$as_me:18951: \$? = $ac_status" >&5
18952   (exit "$ac_status"); } &&
18953          { ac_try='test -s "conftest.$ac_objext"'
18954   { (eval echo "$as_me:18954: \"$ac_try\"") >&5
18955   (eval $ac_try) 2>&5
18956   ac_status=$?
18957   echo "$as_me:18957: \$? = $ac_status" >&5
18958   (exit "$ac_status"); }; }; then
18959   :
18960 else
18961   echo "$as_me: failed program was:" >&5
18962 cat "conftest.$ac_ext" >&5
18963 cf_save_cppflags="$CPPFLAGS"
18964                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18965                          cat >"conftest.$ac_ext" <<_ACEOF
18966 #line 18966 "configure"
18967 #include "confdefs.h"
18968
18969 #include <${cf_cv_ncurses_header:-curses.h}>
18970 int
18971 main (void)
18972 {
18973 int x = _XPG5
18974   ;
18975   return 0;
18976 }
18977 _ACEOF
18978 rm -f "conftest.$ac_objext"
18979 if { (eval echo "$as_me:18979: \"$ac_compile\"") >&5
18980   (eval $ac_compile) 2>&5
18981   ac_status=$?
18982   echo "$as_me:18982: \$? = $ac_status" >&5
18983   (exit "$ac_status"); } &&
18984          { ac_try='test -s "conftest.$ac_objext"'
18985   { (eval echo "$as_me:18985: \"$ac_try\"") >&5
18986   (eval $ac_try) 2>&5
18987   ac_status=$?
18988   echo "$as_me:18988: \$? = $ac_status" >&5
18989   (exit "$ac_status"); }; }; then
18990   cf_define_xpg5=yes
18991 else
18992   echo "$as_me: failed program was:" >&5
18993 cat "conftest.$ac_ext" >&5
18994 fi
18995 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18996                          CPPFLAGS="$cf_save_cppflags"
18997 fi
18998 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
18999                 echo "$as_me:18999: result: $cf_define_xpg5" >&5
19000 echo "${ECHO_T}$cf_define_xpg5" >&6
19001
19002                 if test "$cf_define_xpg5" = yes
19003                 then
19004                         CPPFLAGS="$CPPFLAGS -D_XPG5"
19005                 fi
19006         fi
19007
19008         echo "$as_me:19008: checking for wide-character functions" >&5
19009 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
19010 if test "${cf_cv_widechar_funcs+set}" = set; then
19011   echo $ECHO_N "(cached) $ECHO_C" >&6
19012 else
19013
19014         cat >"conftest.$ac_ext" <<_ACEOF
19015 #line 19015 "configure"
19016 #include "confdefs.h"
19017
19018 #include <${cf_cv_ncurses_header:-curses.h}>
19019 int
19020 main (void)
19021 {
19022
19023                 static wchar_t src_wchar[2];
19024                 static cchar_t dst_cchar;
19025                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
19026
19027   ;
19028   return 0;
19029 }
19030 _ACEOF
19031 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19032 if { (eval echo "$as_me:19032: \"$ac_link\"") >&5
19033   (eval $ac_link) 2>&5
19034   ac_status=$?
19035   echo "$as_me:19035: \$? = $ac_status" >&5
19036   (exit "$ac_status"); } &&
19037          { ac_try='test -s "conftest$ac_exeext"'
19038   { (eval echo "$as_me:19038: \"$ac_try\"") >&5
19039   (eval $ac_try) 2>&5
19040   ac_status=$?
19041   echo "$as_me:19041: \$? = $ac_status" >&5
19042   (exit "$ac_status"); }; }; then
19043   cf_cv_widechar_funcs=yes
19044 else
19045   echo "$as_me: failed program was:" >&5
19046 cat "conftest.$ac_ext" >&5
19047 cf_cv_widechar_funcs=no
19048 fi
19049 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19050
19051 fi
19052 echo "$as_me:19052: result: $cf_cv_widechar_funcs" >&5
19053 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
19054         if test "$cf_cv_widechar_funcs" != no ; then
19055
19056 cat >>confdefs.h <<\EOF
19057 #define USE_WIDEC_SUPPORT 1
19058 EOF
19059
19060         else
19061                 cat >>confdefs.h <<\EOF
19062 #define USE_WIDEC_SUPPORT 0
19063 EOF
19064
19065         fi
19066 else
19067         cat >>confdefs.h <<\EOF
19068 #define USE_WIDEC_SUPPORT 0
19069 EOF
19070
19071 fi
19072
19073 echo "$as_me:19073: checking if $cf_cv_screen library uses pthreads" >&5
19074 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
19075 if test "${cf_cv_use_pthreads+set}" = set; then
19076   echo $ECHO_N "(cached) $ECHO_C" >&6
19077 else
19078
19079 cat >"conftest.$ac_ext" <<_ACEOF
19080 #line 19080 "configure"
19081 #include "confdefs.h"
19082
19083 #include <${cf_cv_ncurses_header:-curses.h}>
19084 extern void _nc_init_pthreads(void);
19085
19086 int
19087 main (void)
19088 {
19089
19090         initscr();
19091         _nc_init_pthreads();
19092
19093   ;
19094   return 0;
19095 }
19096 _ACEOF
19097 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19098 if { (eval echo "$as_me:19098: \"$ac_link\"") >&5
19099   (eval $ac_link) 2>&5
19100   ac_status=$?
19101   echo "$as_me:19101: \$? = $ac_status" >&5
19102   (exit "$ac_status"); } &&
19103          { ac_try='test -s "conftest$ac_exeext"'
19104   { (eval echo "$as_me:19104: \"$ac_try\"") >&5
19105   (eval $ac_try) 2>&5
19106   ac_status=$?
19107   echo "$as_me:19107: \$? = $ac_status" >&5
19108   (exit "$ac_status"); }; }; then
19109   cf_cv_use_pthreads=yes
19110 else
19111   echo "$as_me: failed program was:" >&5
19112 cat "conftest.$ac_ext" >&5
19113 cf_cv_use_pthreads=no
19114 fi
19115 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19116
19117 fi
19118 echo "$as_me:19118: result: $cf_cv_use_pthreads" >&5
19119 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
19120 test $cf_cv_use_pthreads = yes &&
19121 cat >>confdefs.h <<\EOF
19122 #define USE_PTHREADS 1
19123 EOF
19124
19125 echo "$as_me:19125: checking if sys/time.h works with sys/select.h" >&5
19126 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
19127 if test "${cf_cv_sys_time_select+set}" = set; then
19128   echo $ECHO_N "(cached) $ECHO_C" >&6
19129 else
19130
19131 cat >"conftest.$ac_ext" <<_ACEOF
19132 #line 19132 "configure"
19133 #include "confdefs.h"
19134
19135 #include <sys/types.h>
19136 #ifdef HAVE_SYS_TIME_H
19137 #include <sys/time.h>
19138 #endif
19139 #ifdef HAVE_SYS_SELECT_H
19140 #include <sys/select.h>
19141 #endif
19142
19143 int
19144 main (void)
19145 {
19146
19147   ;
19148   return 0;
19149 }
19150 _ACEOF
19151 rm -f "conftest.$ac_objext"
19152 if { (eval echo "$as_me:19152: \"$ac_compile\"") >&5
19153   (eval $ac_compile) 2>&5
19154   ac_status=$?
19155   echo "$as_me:19155: \$? = $ac_status" >&5
19156   (exit "$ac_status"); } &&
19157          { ac_try='test -s "conftest.$ac_objext"'
19158   { (eval echo "$as_me:19158: \"$ac_try\"") >&5
19159   (eval $ac_try) 2>&5
19160   ac_status=$?
19161   echo "$as_me:19161: \$? = $ac_status" >&5
19162   (exit "$ac_status"); }; }; then
19163   cf_cv_sys_time_select=yes
19164 else
19165   echo "$as_me: failed program was:" >&5
19166 cat "conftest.$ac_ext" >&5
19167 cf_cv_sys_time_select=no
19168 fi
19169 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19170
19171 fi
19172
19173 echo "$as_me:19173: result: $cf_cv_sys_time_select" >&5
19174 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
19175 test "$cf_cv_sys_time_select" = yes &&
19176 cat >>confdefs.h <<\EOF
19177 #define HAVE_SYS_TIME_SELECT 1
19178 EOF
19179
19180 # special check for test/ditto.c
19181
19182 echo "$as_me:19182: checking for openpty in -lutil" >&5
19183 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
19184 if test "${ac_cv_lib_util_openpty+set}" = set; then
19185   echo $ECHO_N "(cached) $ECHO_C" >&6
19186 else
19187   ac_check_lib_save_LIBS=$LIBS
19188 LIBS="-lutil  $LIBS"
19189 cat >"conftest.$ac_ext" <<_ACEOF
19190 #line 19190 "configure"
19191 #include "confdefs.h"
19192
19193 /* Override any gcc2 internal prototype to avoid an error.  */
19194 #ifdef __cplusplus
19195 extern "C"
19196 #endif
19197 /* We use char because int might match the return type of a gcc2
19198    builtin and then its argument prototype would still apply.  */
19199 char openpty ();
19200 int
19201 main (void)
19202 {
19203 openpty ();
19204   ;
19205   return 0;
19206 }
19207 _ACEOF
19208 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19209 if { (eval echo "$as_me:19209: \"$ac_link\"") >&5
19210   (eval $ac_link) 2>&5
19211   ac_status=$?
19212   echo "$as_me:19212: \$? = $ac_status" >&5
19213   (exit "$ac_status"); } &&
19214          { ac_try='test -s "conftest$ac_exeext"'
19215   { (eval echo "$as_me:19215: \"$ac_try\"") >&5
19216   (eval $ac_try) 2>&5
19217   ac_status=$?
19218   echo "$as_me:19218: \$? = $ac_status" >&5
19219   (exit "$ac_status"); }; }; then
19220   ac_cv_lib_util_openpty=yes
19221 else
19222   echo "$as_me: failed program was:" >&5
19223 cat "conftest.$ac_ext" >&5
19224 ac_cv_lib_util_openpty=no
19225 fi
19226 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19227 LIBS=$ac_check_lib_save_LIBS
19228 fi
19229 echo "$as_me:19229: result: $ac_cv_lib_util_openpty" >&5
19230 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
19231 if test "$ac_cv_lib_util_openpty" = yes; then
19232   cf_cv_lib_util=yes
19233 else
19234   cf_cv_lib_util=no
19235 fi
19236
19237 echo "$as_me:19237: checking for openpty header" >&5
19238 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
19239 if test "${cf_cv_func_openpty+set}" = set; then
19240   echo $ECHO_N "(cached) $ECHO_C" >&6
19241 else
19242
19243         cf_save_LIBS="$LIBS"
19244         test "$cf_cv_lib_util" = yes && {
19245 cf_add_libs="$LIBS"
19246 # reverse order
19247 cf_add_0lib=
19248 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19249 # filter duplicates
19250 for cf_add_1lib in $cf_add_0lib; do
19251         for cf_add_2lib in $cf_add_libs; do
19252                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19253                         cf_add_1lib=
19254                         break
19255                 fi
19256         done
19257         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19258 done
19259 LIBS="$cf_add_libs"
19260  }
19261         for cf_header in pty.h libutil.h util.h
19262         do
19263         cat >"conftest.$ac_ext" <<_ACEOF
19264 #line 19264 "configure"
19265 #include "confdefs.h"
19266
19267 #include <$cf_header>
19268
19269 int
19270 main (void)
19271 {
19272
19273         int x = openpty((int *)0, (int *)0, (char *)0,
19274                                    (struct termios *)0, (struct winsize *)0);
19275
19276   ;
19277   return 0;
19278 }
19279 _ACEOF
19280 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19281 if { (eval echo "$as_me:19281: \"$ac_link\"") >&5
19282   (eval $ac_link) 2>&5
19283   ac_status=$?
19284   echo "$as_me:19284: \$? = $ac_status" >&5
19285   (exit "$ac_status"); } &&
19286          { ac_try='test -s "conftest$ac_exeext"'
19287   { (eval echo "$as_me:19287: \"$ac_try\"") >&5
19288   (eval $ac_try) 2>&5
19289   ac_status=$?
19290   echo "$as_me:19290: \$? = $ac_status" >&5
19291   (exit "$ac_status"); }; }; then
19292
19293                 cf_cv_func_openpty=$cf_header
19294                 break
19295
19296 else
19297   echo "$as_me: failed program was:" >&5
19298 cat "conftest.$ac_ext" >&5
19299
19300                 cf_cv_func_openpty=no
19301
19302 fi
19303 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19304         done
19305         LIBS="$cf_save_LIBS"
19306
19307 fi
19308 echo "$as_me:19308: result: $cf_cv_func_openpty" >&5
19309 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19310
19311 if test "$cf_cv_func_openpty" != no ; then
19312
19313 cat >>confdefs.h <<EOF
19314 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19315 EOF
19316
19317 cat >>confdefs.h <<\EOF
19318 #define USE_XTERM_PTY 1
19319 EOF
19320
19321         if test "x$cf_cv_lib_util" = xyes ; then
19322
19323 cf_add_libs="$TEST_LIBS"
19324 # reverse order
19325 cf_add_0lib=
19326 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19327 # filter duplicates
19328 for cf_add_1lib in $cf_add_0lib; do
19329         for cf_add_2lib in $cf_add_libs; do
19330                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19331                         cf_add_1lib=
19332                         break
19333                 fi
19334         done
19335         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19336 done
19337 TEST_LIBS="$cf_add_libs"
19338
19339         fi
19340 fi
19341
19342 echo "$as_me:19342: checking for function curses_version" >&5
19343 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19344 if test "${cf_cv_func_curses_version+set}" = set; then
19345   echo $ECHO_N "(cached) $ECHO_C" >&6
19346 else
19347
19348 if test "$cross_compiling" = yes; then
19349   cf_cv_func_curses_version=unknown
19350 else
19351   cat >"conftest.$ac_ext" <<_ACEOF
19352 #line 19352 "configure"
19353 #include "confdefs.h"
19354
19355 #include <${cf_cv_ncurses_header:-curses.h}>
19356 int main(void)
19357 {
19358         char temp[1024];
19359         sprintf(temp, "%s\\n", curses_version());
19360         ${cf_cv_main_return:-return}(0);
19361 }
19362
19363 _ACEOF
19364 rm -f "conftest$ac_exeext"
19365 if { (eval echo "$as_me:19365: \"$ac_link\"") >&5
19366   (eval $ac_link) 2>&5
19367   ac_status=$?
19368   echo "$as_me:19368: \$? = $ac_status" >&5
19369   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
19370   { (eval echo "$as_me:19370: \"$ac_try\"") >&5
19371   (eval $ac_try) 2>&5
19372   ac_status=$?
19373   echo "$as_me:19373: \$? = $ac_status" >&5
19374   (exit "$ac_status"); }; }; then
19375   cf_cv_func_curses_version=yes
19376
19377 else
19378   echo "$as_me: program exited with status $ac_status" >&5
19379 echo "$as_me: failed program was:" >&5
19380 cat "conftest.$ac_ext" >&5
19381 cf_cv_func_curses_version=no
19382
19383 fi
19384 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
19385 fi
19386 rm -f core
19387 fi
19388 echo "$as_me:19388: result: $cf_cv_func_curses_version" >&5
19389 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19390 test "$cf_cv_func_curses_version" = yes &&
19391 cat >>confdefs.h <<\EOF
19392 #define HAVE_CURSES_VERSION 1
19393 EOF
19394
19395 echo "$as_me:19395: checking for alternate character set array" >&5
19396 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19397 if test "${cf_cv_curses_acs_map+set}" = set; then
19398   echo $ECHO_N "(cached) $ECHO_C" >&6
19399 else
19400
19401 cf_cv_curses_acs_map=unknown
19402 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19403 do
19404 cat >"conftest.$ac_ext" <<_ACEOF
19405 #line 19405 "configure"
19406 #include "confdefs.h"
19407
19408 #include <${cf_cv_ncurses_header:-curses.h}>
19409
19410 int
19411 main (void)
19412 {
19413
19414 ${name}['k'] = ACS_PLUS
19415
19416   ;
19417   return 0;
19418 }
19419 _ACEOF
19420 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19421 if { (eval echo "$as_me:19421: \"$ac_link\"") >&5
19422   (eval $ac_link) 2>&5
19423   ac_status=$?
19424   echo "$as_me:19424: \$? = $ac_status" >&5
19425   (exit "$ac_status"); } &&
19426          { ac_try='test -s "conftest$ac_exeext"'
19427   { (eval echo "$as_me:19427: \"$ac_try\"") >&5
19428   (eval $ac_try) 2>&5
19429   ac_status=$?
19430   echo "$as_me:19430: \$? = $ac_status" >&5
19431   (exit "$ac_status"); }; }; then
19432   cf_cv_curses_acs_map=$name; break
19433 else
19434   echo "$as_me: failed program was:" >&5
19435 cat "conftest.$ac_ext" >&5
19436 fi
19437 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19438 done
19439
19440 fi
19441 echo "$as_me:19441: result: $cf_cv_curses_acs_map" >&5
19442 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19443
19444 test "$cf_cv_curses_acs_map" != unknown &&
19445 cat >>confdefs.h <<EOF
19446 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19447 EOF
19448
19449 if test "$cf_enable_widec" = yes; then
19450
19451 echo "$as_me:19451: checking for wide alternate character set array" >&5
19452 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19453 if test "${cf_cv_curses_wacs_map+set}" = set; then
19454   echo $ECHO_N "(cached) $ECHO_C" >&6
19455 else
19456
19457         cf_cv_curses_wacs_map=unknown
19458         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19459         do
19460         cat >"conftest.$ac_ext" <<_ACEOF
19461 #line 19461 "configure"
19462 #include "confdefs.h"
19463
19464 #ifndef _XOPEN_SOURCE_EXTENDED
19465 #define _XOPEN_SOURCE_EXTENDED
19466 #endif
19467 #include <${cf_cv_ncurses_header:-curses.h}>
19468 int
19469 main (void)
19470 {
19471 void *foo = &(${name}['k']); (void)foo
19472   ;
19473   return 0;
19474 }
19475 _ACEOF
19476 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19477 if { (eval echo "$as_me:19477: \"$ac_link\"") >&5
19478   (eval $ac_link) 2>&5
19479   ac_status=$?
19480   echo "$as_me:19480: \$? = $ac_status" >&5
19481   (exit "$ac_status"); } &&
19482          { ac_try='test -s "conftest$ac_exeext"'
19483   { (eval echo "$as_me:19483: \"$ac_try\"") >&5
19484   (eval $ac_try) 2>&5
19485   ac_status=$?
19486   echo "$as_me:19486: \$? = $ac_status" >&5
19487   (exit "$ac_status"); }; }; then
19488   cf_cv_curses_wacs_map=$name
19489          break
19490 else
19491   echo "$as_me: failed program was:" >&5
19492 cat "conftest.$ac_ext" >&5
19493 fi
19494 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19495         done
19496 fi
19497 echo "$as_me:19497: result: $cf_cv_curses_wacs_map" >&5
19498 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19499
19500 test "$cf_cv_curses_wacs_map" != unknown &&
19501 cat >>confdefs.h <<EOF
19502 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19503 EOF
19504
19505 echo "$as_me:19505: checking for wide alternate character constants" >&5
19506 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19507 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19508   echo $ECHO_N "(cached) $ECHO_C" >&6
19509 else
19510
19511 cf_cv_curses_wacs_symbols=no
19512 if test "$cf_cv_curses_wacs_map" != unknown
19513 then
19514         cat >"conftest.$ac_ext" <<_ACEOF
19515 #line 19515 "configure"
19516 #include "confdefs.h"
19517
19518 #ifndef _XOPEN_SOURCE_EXTENDED
19519 #define _XOPEN_SOURCE_EXTENDED
19520 #endif
19521 #include <${cf_cv_ncurses_header:-curses.h}>
19522 int
19523 main (void)
19524 {
19525 cchar_t *foo = WACS_PLUS;
19526          ${cf_cv_curses_wacs_map}['k'] = *WACS_PLUS; (void)foo
19527   ;
19528   return 0;
19529 }
19530 _ACEOF
19531 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19532 if { (eval echo "$as_me:19532: \"$ac_link\"") >&5
19533   (eval $ac_link) 2>&5
19534   ac_status=$?
19535   echo "$as_me:19535: \$? = $ac_status" >&5
19536   (exit "$ac_status"); } &&
19537          { ac_try='test -s "conftest$ac_exeext"'
19538   { (eval echo "$as_me:19538: \"$ac_try\"") >&5
19539   (eval $ac_try) 2>&5
19540   ac_status=$?
19541   echo "$as_me:19541: \$? = $ac_status" >&5
19542   (exit "$ac_status"); }; }; then
19543   cf_cv_curses_wacs_symbols=yes
19544 else
19545   echo "$as_me: failed program was:" >&5
19546 cat "conftest.$ac_ext" >&5
19547 fi
19548 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19549 else
19550         cat >"conftest.$ac_ext" <<_ACEOF
19551 #line 19551 "configure"
19552 #include "confdefs.h"
19553
19554 #ifndef _XOPEN_SOURCE_EXTENDED
19555 #define _XOPEN_SOURCE_EXTENDED
19556 #endif
19557 #include <${cf_cv_ncurses_header:-curses.h}>
19558 int
19559 main (void)
19560 {
19561 cchar_t *foo = WACS_PLUS; (void)foo
19562   ;
19563   return 0;
19564 }
19565 _ACEOF
19566 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
19567 if { (eval echo "$as_me:19567: \"$ac_link\"") >&5
19568   (eval $ac_link) 2>&5
19569   ac_status=$?
19570   echo "$as_me:19570: \$? = $ac_status" >&5
19571   (exit "$ac_status"); } &&
19572          { ac_try='test -s "conftest$ac_exeext"'
19573   { (eval echo "$as_me:19573: \"$ac_try\"") >&5
19574   (eval $ac_try) 2>&5
19575   ac_status=$?
19576   echo "$as_me:19576: \$? = $ac_status" >&5
19577   (exit "$ac_status"); }; }; then
19578   cf_cv_curses_wacs_symbols=yes
19579 else
19580   echo "$as_me: failed program was:" >&5
19581 cat "conftest.$ac_ext" >&5
19582 fi
19583 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
19584 fi
19585
19586 fi
19587 echo "$as_me:19587: result: $cf_cv_curses_wacs_symbols" >&5
19588 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19589
19590 test "$cf_cv_curses_wacs_symbols" != no &&
19591 cat >>confdefs.h <<\EOF
19592 #define CURSES_WACS_SYMBOLS 1
19593 EOF
19594
19595 fi
19596
19597 echo "$as_me:19597: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19598 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19599 cat >"conftest.$ac_ext" <<_ACEOF
19600 #line 19600 "configure"
19601 #include "confdefs.h"
19602
19603 #ifndef _XOPEN_SOURCE_EXTENDED
19604 #define _XOPEN_SOURCE_EXTENDED
19605 #endif
19606 #include <${cf_cv_ncurses_header:-curses.h}>
19607 int
19608 main (void)
19609 {
19610
19611 attr_t foo
19612
19613   ;
19614   return 0;
19615 }
19616 _ACEOF
19617 rm -f "conftest.$ac_objext"
19618 if { (eval echo "$as_me:19618: \"$ac_compile\"") >&5
19619   (eval $ac_compile) 2>&5
19620   ac_status=$?
19621   echo "$as_me:19621: \$? = $ac_status" >&5
19622   (exit "$ac_status"); } &&
19623          { ac_try='test -s "conftest.$ac_objext"'
19624   { (eval echo "$as_me:19624: \"$ac_try\"") >&5
19625   (eval $ac_try) 2>&5
19626   ac_status=$?
19627   echo "$as_me:19627: \$? = $ac_status" >&5
19628   (exit "$ac_status"); }; }; then
19629   cf_result=yes
19630 else
19631   echo "$as_me: failed program was:" >&5
19632 cat "conftest.$ac_ext" >&5
19633 cf_result=no
19634 fi
19635 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19636 echo "$as_me:19636: result: $cf_result" >&5
19637 echo "${ECHO_T}$cf_result" >&6
19638 if test "$cf_result" = yes ; then
19639
19640 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19641
19642 cat >>confdefs.h <<EOF
19643 #define $cf_result 1
19644 EOF
19645
19646 else
19647
19648 cat >>confdefs.h <<EOF
19649 #define attr_t long
19650 EOF
19651
19652 fi
19653
19654 if test "$cf_enable_widec" = yes; then
19655
19656 # This is needed on Tru64 5.0 to declare mbstate_t
19657 echo "$as_me:19657: checking if we must include wchar.h to declare mbstate_t" >&5
19658 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19659 if test "${cf_cv_mbstate_t+set}" = set; then
19660   echo $ECHO_N "(cached) $ECHO_C" >&6
19661 else
19662
19663 cat >"conftest.$ac_ext" <<_ACEOF
19664 #line 19664 "configure"
19665 #include "confdefs.h"
19666
19667 #include <stdlib.h>
19668 #include <stdarg.h>
19669 #include <stdio.h>
19670 #ifdef HAVE_LIBUTF8_H
19671 #include <libutf8.h>
19672 #endif
19673 int
19674 main (void)
19675 {
19676 mbstate_t state
19677   ;
19678   return 0;
19679 }
19680 _ACEOF
19681 rm -f "conftest.$ac_objext"
19682 if { (eval echo "$as_me:19682: \"$ac_compile\"") >&5
19683   (eval $ac_compile) 2>&5
19684   ac_status=$?
19685   echo "$as_me:19685: \$? = $ac_status" >&5
19686   (exit "$ac_status"); } &&
19687          { ac_try='test -s "conftest.$ac_objext"'
19688   { (eval echo "$as_me:19688: \"$ac_try\"") >&5
19689   (eval $ac_try) 2>&5
19690   ac_status=$?
19691   echo "$as_me:19691: \$? = $ac_status" >&5
19692   (exit "$ac_status"); }; }; then
19693   cf_cv_mbstate_t=no
19694 else
19695   echo "$as_me: failed program was:" >&5
19696 cat "conftest.$ac_ext" >&5
19697 cat >"conftest.$ac_ext" <<_ACEOF
19698 #line 19698 "configure"
19699 #include "confdefs.h"
19700
19701 #include <stdlib.h>
19702 #include <stdarg.h>
19703 #include <stdio.h>
19704 #include <wchar.h>
19705 #ifdef HAVE_LIBUTF8_H
19706 #include <libutf8.h>
19707 #endif
19708 int
19709 main (void)
19710 {
19711 mbstate_t value
19712   ;
19713   return 0;
19714 }
19715 _ACEOF
19716 rm -f "conftest.$ac_objext"
19717 if { (eval echo "$as_me:19717: \"$ac_compile\"") >&5
19718   (eval $ac_compile) 2>&5
19719   ac_status=$?
19720   echo "$as_me:19720: \$? = $ac_status" >&5
19721   (exit "$ac_status"); } &&
19722          { ac_try='test -s "conftest.$ac_objext"'
19723   { (eval echo "$as_me:19723: \"$ac_try\"") >&5
19724   (eval $ac_try) 2>&5
19725   ac_status=$?
19726   echo "$as_me:19726: \$? = $ac_status" >&5
19727   (exit "$ac_status"); }; }; then
19728   cf_cv_mbstate_t=yes
19729 else
19730   echo "$as_me: failed program was:" >&5
19731 cat "conftest.$ac_ext" >&5
19732 cf_cv_mbstate_t=unknown
19733 fi
19734 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19735 fi
19736 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19737 fi
19738 echo "$as_me:19738: result: $cf_cv_mbstate_t" >&5
19739 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19740
19741 if test "$cf_cv_mbstate_t" = yes ; then
19742
19743 cat >>confdefs.h <<\EOF
19744 #define NEED_WCHAR_H 1
19745 EOF
19746
19747         NEED_WCHAR_H=1
19748 fi
19749
19750 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19751 if test "$cf_cv_mbstate_t" = unknown ; then
19752         NCURSES_MBSTATE_T=1
19753 fi
19754
19755 # if we find mbstate_t in either place, use substitution to provide a fallback.
19756 if test "$cf_cv_mbstate_t" != unknown ; then
19757         NCURSES_OK_MBSTATE_T=1
19758 fi
19759
19760 # This is needed on Tru64 5.0 to declare wchar_t
19761 echo "$as_me:19761: checking if we must include wchar.h to declare wchar_t" >&5
19762 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19763 if test "${cf_cv_wchar_t+set}" = set; then
19764   echo $ECHO_N "(cached) $ECHO_C" >&6
19765 else
19766
19767 cat >"conftest.$ac_ext" <<_ACEOF
19768 #line 19768 "configure"
19769 #include "confdefs.h"
19770
19771 #include <stdlib.h>
19772 #include <stdarg.h>
19773 #include <stdio.h>
19774 #ifdef HAVE_LIBUTF8_H
19775 #include <libutf8.h>
19776 #endif
19777 int
19778 main (void)
19779 {
19780 wchar_t state
19781   ;
19782   return 0;
19783 }
19784 _ACEOF
19785 rm -f "conftest.$ac_objext"
19786 if { (eval echo "$as_me:19786: \"$ac_compile\"") >&5
19787   (eval $ac_compile) 2>&5
19788   ac_status=$?
19789   echo "$as_me:19789: \$? = $ac_status" >&5
19790   (exit "$ac_status"); } &&
19791          { ac_try='test -s "conftest.$ac_objext"'
19792   { (eval echo "$as_me:19792: \"$ac_try\"") >&5
19793   (eval $ac_try) 2>&5
19794   ac_status=$?
19795   echo "$as_me:19795: \$? = $ac_status" >&5
19796   (exit "$ac_status"); }; }; then
19797   cf_cv_wchar_t=no
19798 else
19799   echo "$as_me: failed program was:" >&5
19800 cat "conftest.$ac_ext" >&5
19801 cat >"conftest.$ac_ext" <<_ACEOF
19802 #line 19802 "configure"
19803 #include "confdefs.h"
19804
19805 #include <stdlib.h>
19806 #include <stdarg.h>
19807 #include <stdio.h>
19808 #include <wchar.h>
19809 #ifdef HAVE_LIBUTF8_H
19810 #include <libutf8.h>
19811 #endif
19812 int
19813 main (void)
19814 {
19815 wchar_t value
19816   ;
19817   return 0;
19818 }
19819 _ACEOF
19820 rm -f "conftest.$ac_objext"
19821 if { (eval echo "$as_me:19821: \"$ac_compile\"") >&5
19822   (eval $ac_compile) 2>&5
19823   ac_status=$?
19824   echo "$as_me:19824: \$? = $ac_status" >&5
19825   (exit "$ac_status"); } &&
19826          { ac_try='test -s "conftest.$ac_objext"'
19827   { (eval echo "$as_me:19827: \"$ac_try\"") >&5
19828   (eval $ac_try) 2>&5
19829   ac_status=$?
19830   echo "$as_me:19830: \$? = $ac_status" >&5
19831   (exit "$ac_status"); }; }; then
19832   cf_cv_wchar_t=yes
19833 else
19834   echo "$as_me: failed program was:" >&5
19835 cat "conftest.$ac_ext" >&5
19836 cf_cv_wchar_t=unknown
19837 fi
19838 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19839 fi
19840 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19841 fi
19842 echo "$as_me:19842: result: $cf_cv_wchar_t" >&5
19843 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19844
19845 if test "$cf_cv_wchar_t" = yes ; then
19846
19847 cat >>confdefs.h <<\EOF
19848 #define NEED_WCHAR_H 1
19849 EOF
19850
19851         NEED_WCHAR_H=1
19852 fi
19853
19854 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19855 if test "$cf_cv_wchar_t" = unknown ; then
19856         NCURSES_WCHAR_T=1
19857 fi
19858
19859 # if we find wchar_t in either place, use substitution to provide a fallback.
19860 if test "$cf_cv_wchar_t" != unknown ; then
19861         NCURSES_OK_WCHAR_T=1
19862 fi
19863
19864 # This is needed on Tru64 5.0 to declare wint_t
19865 echo "$as_me:19865: checking if we must include wchar.h to declare wint_t" >&5
19866 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19867 if test "${cf_cv_wint_t+set}" = set; then
19868   echo $ECHO_N "(cached) $ECHO_C" >&6
19869 else
19870
19871 cat >"conftest.$ac_ext" <<_ACEOF
19872 #line 19872 "configure"
19873 #include "confdefs.h"
19874
19875 #include <stdlib.h>
19876 #include <stdarg.h>
19877 #include <stdio.h>
19878 #ifdef HAVE_LIBUTF8_H
19879 #include <libutf8.h>
19880 #endif
19881 int
19882 main (void)
19883 {
19884 wint_t state
19885   ;
19886   return 0;
19887 }
19888 _ACEOF
19889 rm -f "conftest.$ac_objext"
19890 if { (eval echo "$as_me:19890: \"$ac_compile\"") >&5
19891   (eval $ac_compile) 2>&5
19892   ac_status=$?
19893   echo "$as_me:19893: \$? = $ac_status" >&5
19894   (exit "$ac_status"); } &&
19895          { ac_try='test -s "conftest.$ac_objext"'
19896   { (eval echo "$as_me:19896: \"$ac_try\"") >&5
19897   (eval $ac_try) 2>&5
19898   ac_status=$?
19899   echo "$as_me:19899: \$? = $ac_status" >&5
19900   (exit "$ac_status"); }; }; then
19901   cf_cv_wint_t=no
19902 else
19903   echo "$as_me: failed program was:" >&5
19904 cat "conftest.$ac_ext" >&5
19905 cat >"conftest.$ac_ext" <<_ACEOF
19906 #line 19906 "configure"
19907 #include "confdefs.h"
19908
19909 #include <stdlib.h>
19910 #include <stdarg.h>
19911 #include <stdio.h>
19912 #include <wchar.h>
19913 #ifdef HAVE_LIBUTF8_H
19914 #include <libutf8.h>
19915 #endif
19916 int
19917 main (void)
19918 {
19919 wint_t value
19920   ;
19921   return 0;
19922 }
19923 _ACEOF
19924 rm -f "conftest.$ac_objext"
19925 if { (eval echo "$as_me:19925: \"$ac_compile\"") >&5
19926   (eval $ac_compile) 2>&5
19927   ac_status=$?
19928   echo "$as_me:19928: \$? = $ac_status" >&5
19929   (exit "$ac_status"); } &&
19930          { ac_try='test -s "conftest.$ac_objext"'
19931   { (eval echo "$as_me:19931: \"$ac_try\"") >&5
19932   (eval $ac_try) 2>&5
19933   ac_status=$?
19934   echo "$as_me:19934: \$? = $ac_status" >&5
19935   (exit "$ac_status"); }; }; then
19936   cf_cv_wint_t=yes
19937 else
19938   echo "$as_me: failed program was:" >&5
19939 cat "conftest.$ac_ext" >&5
19940 cf_cv_wint_t=unknown
19941 fi
19942 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19943 fi
19944 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
19945 fi
19946 echo "$as_me:19946: result: $cf_cv_wint_t" >&5
19947 echo "${ECHO_T}$cf_cv_wint_t" >&6
19948
19949 if test "$cf_cv_wint_t" = yes ; then
19950
19951 cat >>confdefs.h <<\EOF
19952 #define NEED_WCHAR_H 1
19953 EOF
19954
19955         NEED_WCHAR_H=1
19956 fi
19957
19958 # if we do not find wint_t in either place, use substitution to provide a fallback.
19959 if test "$cf_cv_wint_t" = unknown ; then
19960         NCURSES_WINT_T=1
19961 fi
19962
19963 # if we find wint_t in either place, use substitution to provide a fallback.
19964 if test "$cf_cv_wint_t" != unknown ; then
19965         NCURSES_OK_WINT_T=1
19966 fi
19967
19968         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19969
19970 echo "$as_me:19970: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19971 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19972 cat >"conftest.$ac_ext" <<_ACEOF
19973 #line 19973 "configure"
19974 #include "confdefs.h"
19975
19976 #ifndef _XOPEN_SOURCE_EXTENDED
19977 #define _XOPEN_SOURCE_EXTENDED
19978 #endif
19979 #include <${cf_cv_ncurses_header:-curses.h}>
19980 int
19981 main (void)
19982 {
19983
19984 mbstate_t foo
19985
19986   ;
19987   return 0;
19988 }
19989 _ACEOF
19990 rm -f "conftest.$ac_objext"
19991 if { (eval echo "$as_me:19991: \"$ac_compile\"") >&5
19992   (eval $ac_compile) 2>&5
19993   ac_status=$?
19994   echo "$as_me:19994: \$? = $ac_status" >&5
19995   (exit "$ac_status"); } &&
19996          { ac_try='test -s "conftest.$ac_objext"'
19997   { (eval echo "$as_me:19997: \"$ac_try\"") >&5
19998   (eval $ac_try) 2>&5
19999   ac_status=$?
20000   echo "$as_me:20000: \$? = $ac_status" >&5
20001   (exit "$ac_status"); }; }; then
20002   cf_result=yes
20003 else
20004   echo "$as_me: failed program was:" >&5
20005 cat "conftest.$ac_ext" >&5
20006 cf_result=no
20007 fi
20008 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20009 echo "$as_me:20009: result: $cf_result" >&5
20010 echo "${ECHO_T}$cf_result" >&6
20011 if test "$cf_result" = yes ; then
20012
20013 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20014
20015 cat >>confdefs.h <<EOF
20016 #define $cf_result 1
20017 EOF
20018
20019 else
20020
20021 cat >>confdefs.h <<EOF
20022 #define mbstate_t long
20023 EOF
20024
20025 fi
20026
20027         fi
20028
20029         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
20030
20031 echo "$as_me:20031: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20032 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20033 cat >"conftest.$ac_ext" <<_ACEOF
20034 #line 20034 "configure"
20035 #include "confdefs.h"
20036
20037 #ifndef _XOPEN_SOURCE_EXTENDED
20038 #define _XOPEN_SOURCE_EXTENDED
20039 #endif
20040 #include <${cf_cv_ncurses_header:-curses.h}>
20041 int
20042 main (void)
20043 {
20044
20045 wchar_t foo
20046
20047   ;
20048   return 0;
20049 }
20050 _ACEOF
20051 rm -f "conftest.$ac_objext"
20052 if { (eval echo "$as_me:20052: \"$ac_compile\"") >&5
20053   (eval $ac_compile) 2>&5
20054   ac_status=$?
20055   echo "$as_me:20055: \$? = $ac_status" >&5
20056   (exit "$ac_status"); } &&
20057          { ac_try='test -s "conftest.$ac_objext"'
20058   { (eval echo "$as_me:20058: \"$ac_try\"") >&5
20059   (eval $ac_try) 2>&5
20060   ac_status=$?
20061   echo "$as_me:20061: \$? = $ac_status" >&5
20062   (exit "$ac_status"); }; }; then
20063   cf_result=yes
20064 else
20065   echo "$as_me: failed program was:" >&5
20066 cat "conftest.$ac_ext" >&5
20067 cf_result=no
20068 fi
20069 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20070 echo "$as_me:20070: result: $cf_result" >&5
20071 echo "${ECHO_T}$cf_result" >&6
20072 if test "$cf_result" = yes ; then
20073
20074 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20075
20076 cat >>confdefs.h <<EOF
20077 #define $cf_result 1
20078 EOF
20079
20080 else
20081
20082 cat >>confdefs.h <<EOF
20083 #define wchar_t long
20084 EOF
20085
20086 fi
20087
20088         fi
20089
20090         if test "$NCURSES_OK_WINT_T" = 0 ; then
20091
20092 echo "$as_me:20092: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
20093 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20094 cat >"conftest.$ac_ext" <<_ACEOF
20095 #line 20095 "configure"
20096 #include "confdefs.h"
20097
20098 #ifndef _XOPEN_SOURCE_EXTENDED
20099 #define _XOPEN_SOURCE_EXTENDED
20100 #endif
20101 #include <${cf_cv_ncurses_header:-curses.h}>
20102 int
20103 main (void)
20104 {
20105
20106 wint_t foo
20107
20108   ;
20109   return 0;
20110 }
20111 _ACEOF
20112 rm -f "conftest.$ac_objext"
20113 if { (eval echo "$as_me:20113: \"$ac_compile\"") >&5
20114   (eval $ac_compile) 2>&5
20115   ac_status=$?
20116   echo "$as_me:20116: \$? = $ac_status" >&5
20117   (exit "$ac_status"); } &&
20118          { ac_try='test -s "conftest.$ac_objext"'
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_result=yes
20125 else
20126   echo "$as_me: failed program was:" >&5
20127 cat "conftest.$ac_ext" >&5
20128 cf_result=no
20129 fi
20130 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20131 echo "$as_me:20131: result: $cf_result" >&5
20132 echo "${ECHO_T}$cf_result" >&6
20133 if test "$cf_result" = yes ; then
20134
20135 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20136
20137 cat >>confdefs.h <<EOF
20138 #define $cf_result 1
20139 EOF
20140
20141 else
20142
20143 cat >>confdefs.h <<EOF
20144 #define wint_t long
20145 EOF
20146
20147 fi
20148
20149         fi
20150 fi
20151
20152 for cf_data in \
20153 TABSIZE \
20154 curscr \
20155 ospeed \
20156 boolnames \
20157 boolfnames \
20158 ttytype
20159 do
20160 echo "$as_me:20160: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
20161 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
20162
20163 cat >"conftest.$ac_ext" <<_ACEOF
20164 #line 20164 "configure"
20165 #include "confdefs.h"
20166
20167 #ifdef HAVE_XCURSES
20168 #include <xcurses.h>
20169 char * XCursesProgramName = "test";
20170 #else
20171 #include <${cf_cv_ncurses_header:-curses.h}>
20172 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20173 #include <ncursesw/term.h>
20174 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20175 #include <ncurses/term.h>
20176 #elif defined(HAVE_TERM_H)
20177 #include <term.h>
20178 #endif
20179 #endif
20180
20181 int
20182 main (void)
20183 {
20184
20185 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20186         const void *foo = (const void *)($cf_data);
20187 #else
20188         const void *foo = &($cf_data);
20189 #endif
20190         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20191
20192   ;
20193   return 0;
20194 }
20195 _ACEOF
20196 rm -f "conftest.$ac_objext"
20197 if { (eval echo "$as_me:20197: \"$ac_compile\"") >&5
20198   (eval $ac_compile) 2>&5
20199   ac_status=$?
20200   echo "$as_me:20200: \$? = $ac_status" >&5
20201   (exit "$ac_status"); } &&
20202          { ac_try='test -s "conftest.$ac_objext"'
20203   { (eval echo "$as_me:20203: \"$ac_try\"") >&5
20204   (eval $ac_try) 2>&5
20205   ac_status=$?
20206   echo "$as_me:20206: \$? = $ac_status" >&5
20207   (exit "$ac_status"); }; }; then
20208   cf_result=yes
20209
20210 else
20211   echo "$as_me: failed program was:" >&5
20212 cat "conftest.$ac_ext" >&5
20213 cf_result=no
20214 fi
20215 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
20216 echo "$as_me:20216: result: $cf_result" >&5
20217 echo "${ECHO_T}$cf_result" >&6
20218
20219 if test "$cf_result" = yes ; then
20220
20221 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20222
20223         cat >>confdefs.h <<EOF
20224 #define $cf_result 1
20225 EOF
20226
20227 else
20228         echo "$as_me:20228: checking for data $cf_data in library" >&5
20229 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
20230         # BSD linkers insist on making weak linkage, but resolve at runtime.
20231         if test "$cross_compiling" = yes; then
20232
20233         # cross-compiling
20234         cat >"conftest.$ac_ext" <<_ACEOF
20235 #line 20235 "configure"
20236 #include "confdefs.h"
20237
20238 #ifdef HAVE_XCURSES
20239 #include <xcurses.h>
20240 char * XCursesProgramName = "test";
20241 #else
20242 #include <${cf_cv_ncurses_header:-curses.h}>
20243 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20244 #include <ncursesw/term.h>
20245 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20246 #include <ncurses/term.h>
20247 #elif defined(HAVE_TERM_H)
20248 #include <term.h>
20249 #endif
20250 #endif
20251
20252 extern char $cf_data;
20253 int
20254 main (void)
20255 {
20256
20257         do {
20258
20259 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20260         const void *foo = (const void *)($cf_data);
20261 #else
20262         const void *foo = &($cf_data);
20263 #endif
20264         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20265
20266                 ${cf_cv_main_return:-return}(foo == 0);
20267         } while (0)
20268
20269   ;
20270   return 0;
20271 }
20272 _ACEOF
20273 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20274 if { (eval echo "$as_me:20274: \"$ac_link\"") >&5
20275   (eval $ac_link) 2>&5
20276   ac_status=$?
20277   echo "$as_me:20277: \$? = $ac_status" >&5
20278   (exit "$ac_status"); } &&
20279          { ac_try='test -s "conftest$ac_exeext"'
20280   { (eval echo "$as_me:20280: \"$ac_try\"") >&5
20281   (eval $ac_try) 2>&5
20282   ac_status=$?
20283   echo "$as_me:20283: \$? = $ac_status" >&5
20284   (exit "$ac_status"); }; }; then
20285   cf_result=yes
20286 else
20287   echo "$as_me: failed program was:" >&5
20288 cat "conftest.$ac_ext" >&5
20289 cf_result=no
20290 fi
20291 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20292
20293 else
20294   cat >"conftest.$ac_ext" <<_ACEOF
20295 #line 20295 "configure"
20296 #include "confdefs.h"
20297
20298 #ifdef HAVE_XCURSES
20299 #include <xcurses.h>
20300 char * XCursesProgramName = "test";
20301 #else
20302 #include <${cf_cv_ncurses_header:-curses.h}>
20303 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20304 #include <ncursesw/term.h>
20305 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20306 #include <ncurses/term.h>
20307 #elif defined(HAVE_TERM_H)
20308 #include <term.h>
20309 #endif
20310 #endif
20311
20312 extern char $cf_data;
20313 int main(void)
20314 {
20315
20316 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20317         const void *foo = (const void *)($cf_data);
20318 #else
20319         const void *foo = &($cf_data);
20320 #endif
20321         fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo);
20322
20323         ${cf_cv_main_return:-return}(foo == 0);
20324 }
20325 _ACEOF
20326 rm -f "conftest$ac_exeext"
20327 if { (eval echo "$as_me:20327: \"$ac_link\"") >&5
20328   (eval $ac_link) 2>&5
20329   ac_status=$?
20330   echo "$as_me:20330: \$? = $ac_status" >&5
20331   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
20332   { (eval echo "$as_me:20332: \"$ac_try\"") >&5
20333   (eval $ac_try) 2>&5
20334   ac_status=$?
20335   echo "$as_me:20335: \$? = $ac_status" >&5
20336   (exit "$ac_status"); }; }; then
20337   cf_result=yes
20338
20339 else
20340   echo "$as_me: program exited with status $ac_status" >&5
20341 echo "$as_me: failed program was:" >&5
20342 cat "conftest.$ac_ext" >&5
20343 cf_result=no
20344 fi
20345 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
20346 fi
20347         echo "$as_me:20347: result: $cf_result" >&5
20348 echo "${ECHO_T}$cf_result" >&6
20349         if test "$cf_result" = yes ; then
20350
20351 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20352
20353                 cat >>confdefs.h <<EOF
20354 #define $cf_result 1
20355 EOF
20356
20357                 # do not exit loop here, since we prefer system's declarations
20358         fi
20359 fi
20360 done
20361
20362 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20363 then
20364         echo "$as_me:20364: checking for X" >&5
20365 echo $ECHO_N "checking for X... $ECHO_C" >&6
20366
20367 # Check whether --with-x or --without-x was given.
20368 if test "${with_x+set}" = set; then
20369   withval="$with_x"
20370
20371 fi;
20372 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20373 if test "x$with_x" = xno; then
20374   # The user explicitly disabled X.
20375   have_x=disabled
20376 else
20377   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20378     # Both variables are already set.
20379     have_x=yes
20380   else
20381     if test "${ac_cv_have_x+set}" = set; then
20382   echo $ECHO_N "(cached) $ECHO_C" >&6
20383 else
20384   # One or both of the vars are not set, and there is no cached value.
20385 ac_x_includes=no ac_x_libraries=no
20386 rm -fr conftest.dir
20387 if mkdir conftest.dir; then
20388   cd conftest.dir
20389   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20390   cat >Imakefile <<'EOF'
20391 acfindx:
20392         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20393 EOF
20394   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20395     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20396     eval "`${MAKE-make} acfindx 2>/dev/null | grep -v make`"
20397     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20398     for ac_extension in a so sl dylib dll; do
20399       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
20400          test -f "$ac_im_libdir/libX11.$ac_extension"; then
20401         ac_im_usrlibdir=$ac_im_libdir; break
20402       fi
20403     done
20404     # Screen out bogus values from the imake configuration.  They are
20405     # bogus both because they are the default anyway, and because
20406     # using them would break gcc on systems where it needs fixed includes.
20407     case $ac_im_incroot in
20408         /usr/include) ;;
20409         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20410     esac
20411     case $ac_im_usrlibdir in
20412         /usr/lib | /lib) ;;
20413         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20414     esac
20415   fi
20416   cd ..
20417   rm -fr conftest.dir
20418 fi
20419
20420 # Standard set of common directories for X headers.
20421 # Check X11 before X11Rn because it is often a symlink to the current release.
20422 ac_x_header_dirs='
20423 /usr/X11/include
20424 /usr/X11R7/include
20425 /usr/X11R6/include
20426 /usr/X11R5/include
20427 /usr/X11R4/include
20428
20429 /opt/local/include
20430 /opt/X11/include
20431
20432 /usr/include/X11
20433 /usr/include/X11R7
20434 /usr/include/X11R6
20435 /usr/include/X11R5
20436 /usr/include/X11R4
20437
20438 /usr/local/X11/include
20439 /usr/local/X11R7/include
20440 /usr/local/X11R6/include
20441 /usr/local/X11R5/include
20442 /usr/local/X11R4/include
20443
20444 /usr/local/include/X11
20445 /usr/local/include/X11R7
20446 /usr/local/include/X11R6
20447 /usr/local/include/X11R5
20448 /usr/local/include/X11R4
20449
20450 /usr/X386/include
20451 /usr/x386/include
20452 /usr/XFree86/include/X11
20453
20454 /usr/include
20455 /usr/local/include
20456 /usr/unsupported/include
20457 /usr/athena/include
20458 /usr/local/x11r5/include
20459 /usr/lpp/Xamples/include
20460
20461 /usr/openwin/include
20462 /usr/openwin/share/include'
20463
20464 if test "$ac_x_includes" = no; then
20465   # Guess where to find include files, by looking for Intrinsic.h.
20466   # First, try using that file with no special directory specified.
20467   cat >"conftest.$ac_ext" <<_ACEOF
20468 #line 20468 "configure"
20469 #include "confdefs.h"
20470 #include <X11/Intrinsic.h>
20471 _ACEOF
20472 if { (eval echo "$as_me:20472: \"$ac_cpp "conftest.$ac_ext"\"") >&5
20473   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
20474   ac_status=$?
20475   $EGREP -v '^ *\+' conftest.er1 >conftest.err
20476   rm -f conftest.er1
20477   cat conftest.err >&5
20478   echo "$as_me:20478: \$? = $ac_status" >&5
20479   (exit "$ac_status"); } >/dev/null; then
20480   if test -s conftest.err; then
20481     ac_cpp_err=$ac_c_preproc_warn_flag
20482   else
20483     ac_cpp_err=
20484   fi
20485 else
20486   ac_cpp_err=yes
20487 fi
20488 if test -z "$ac_cpp_err"; then
20489   # We can compile using X headers with no special include directory.
20490 ac_x_includes=
20491 else
20492   echo "$as_me: failed program was:" >&5
20493   cat "conftest.$ac_ext" >&5
20494   for ac_dir in $ac_x_header_dirs; do
20495   if test -r "$ac_dir/X11/Intrinsic.h"; then
20496     ac_x_includes=$ac_dir
20497     break
20498   fi
20499 done
20500 fi
20501 rm -f conftest.err "conftest.$ac_ext"
20502 fi # $ac_x_includes = no
20503
20504 if test "$ac_x_libraries" = no; then
20505   # Check for the libraries.
20506   # See if we find them without any special options.
20507   # Don't add to $LIBS permanently.
20508   ac_save_LIBS=$LIBS
20509   LIBS="-lXt $LIBS"
20510   cat >"conftest.$ac_ext" <<_ACEOF
20511 #line 20511 "configure"
20512 #include "confdefs.h"
20513 #include <X11/Intrinsic.h>
20514 int
20515 main (void)
20516 {
20517 XtMalloc (0)
20518   ;
20519   return 0;
20520 }
20521 _ACEOF
20522 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20523 if { (eval echo "$as_me:20523: \"$ac_link\"") >&5
20524   (eval $ac_link) 2>&5
20525   ac_status=$?
20526   echo "$as_me:20526: \$? = $ac_status" >&5
20527   (exit "$ac_status"); } &&
20528          { ac_try='test -s "conftest$ac_exeext"'
20529   { (eval echo "$as_me:20529: \"$ac_try\"") >&5
20530   (eval $ac_try) 2>&5
20531   ac_status=$?
20532   echo "$as_me:20532: \$? = $ac_status" >&5
20533   (exit "$ac_status"); }; }; then
20534   LIBS=$ac_save_LIBS
20535 # We can link X programs with no special library path.
20536 ac_x_libraries=
20537 else
20538   echo "$as_me: failed program was:" >&5
20539 cat "conftest.$ac_ext" >&5
20540 LIBS=$ac_save_LIBS
20541 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20542 do
20543   # Don't even attempt the hair of trying to link an X program!
20544   for ac_extension in a so sl dylib dll; do
20545     if test -r "$ac_dir/libXt.$ac_extension"; then
20546       ac_x_libraries=$ac_dir
20547       break 2
20548     fi
20549   done
20550 done
20551 fi
20552 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20553 fi # $ac_x_libraries = no
20554
20555 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20556   # Didn't find X anywhere.  Cache the known absence of X.
20557   ac_cv_have_x="have_x=no"
20558 else
20559   # Record where we found X for the cache.
20560   ac_cv_have_x="have_x=yes \
20561                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20562 fi
20563 fi
20564
20565   fi
20566   eval "$ac_cv_have_x"
20567 fi # $with_x != no
20568
20569 if test "$have_x" != yes; then
20570   echo "$as_me:20570: result: $have_x" >&5
20571 echo "${ECHO_T}$have_x" >&6
20572   no_x=yes
20573 else
20574   # If each of the values was on the command line, it overrides each guess.
20575   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20576   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20577   # Update the cache value to reflect the command line values.
20578   ac_cv_have_x="have_x=yes \
20579                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20580   echo "$as_me:20580: result: libraries $x_libraries, headers $x_includes" >&5
20581 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20582 fi
20583
20584         if test "$no_x" = yes; then
20585   # Not all programs may use this symbol, but it does not hurt to define it.
20586
20587 cat >>confdefs.h <<\EOF
20588 #define X_DISPLAY_MISSING 1
20589 EOF
20590
20591   X_CFLAGS=
20592   X_PRE_LIBS=
20593   X_LIBS=
20594   X_EXTRA_LIBS=
20595 else
20596   if test -n "$x_includes"; then
20597     X_CFLAGS="$X_CFLAGS -I$x_includes"
20598   fi
20599
20600   # It would also be nice to do this for all -L options, not just this one.
20601   if test -n "$x_libraries"; then
20602     X_LIBS="$X_LIBS -L$x_libraries"
20603     # For Solaris; some versions of Sun CC require a space after -R and
20604     # others require no space.  Words are not sufficient . . . .
20605     case `(uname -sr) 2>/dev/null` in
20606     "SunOS 5"*)
20607       echo "$as_me:20607: checking whether -R must be followed by a space" >&5
20608 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20609       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20610       cat >"conftest.$ac_ext" <<_ACEOF
20611 #line 20611 "configure"
20612 #include "confdefs.h"
20613
20614 int
20615 main (void)
20616 {
20617
20618   ;
20619   return 0;
20620 }
20621 _ACEOF
20622 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20623 if { (eval echo "$as_me:20623: \"$ac_link\"") >&5
20624   (eval $ac_link) 2>&5
20625   ac_status=$?
20626   echo "$as_me:20626: \$? = $ac_status" >&5
20627   (exit "$ac_status"); } &&
20628          { ac_try='test -s "conftest$ac_exeext"'
20629   { (eval echo "$as_me:20629: \"$ac_try\"") >&5
20630   (eval $ac_try) 2>&5
20631   ac_status=$?
20632   echo "$as_me:20632: \$? = $ac_status" >&5
20633   (exit "$ac_status"); }; }; then
20634   ac_R_nospace=yes
20635 else
20636   echo "$as_me: failed program was:" >&5
20637 cat "conftest.$ac_ext" >&5
20638 ac_R_nospace=no
20639 fi
20640 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20641       if test $ac_R_nospace = yes; then
20642         echo "$as_me:20642: result: no" >&5
20643 echo "${ECHO_T}no" >&6
20644         X_LIBS="$X_LIBS -R$x_libraries"
20645       else
20646         LIBS="$ac_xsave_LIBS -R $x_libraries"
20647         cat >"conftest.$ac_ext" <<_ACEOF
20648 #line 20648 "configure"
20649 #include "confdefs.h"
20650
20651 int
20652 main (void)
20653 {
20654
20655   ;
20656   return 0;
20657 }
20658 _ACEOF
20659 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20660 if { (eval echo "$as_me:20660: \"$ac_link\"") >&5
20661   (eval $ac_link) 2>&5
20662   ac_status=$?
20663   echo "$as_me:20663: \$? = $ac_status" >&5
20664   (exit "$ac_status"); } &&
20665          { ac_try='test -s "conftest$ac_exeext"'
20666   { (eval echo "$as_me:20666: \"$ac_try\"") >&5
20667   (eval $ac_try) 2>&5
20668   ac_status=$?
20669   echo "$as_me:20669: \$? = $ac_status" >&5
20670   (exit "$ac_status"); }; }; then
20671   ac_R_space=yes
20672 else
20673   echo "$as_me: failed program was:" >&5
20674 cat "conftest.$ac_ext" >&5
20675 ac_R_space=no
20676 fi
20677 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20678         if test $ac_R_space = yes; then
20679           echo "$as_me:20679: result: yes" >&5
20680 echo "${ECHO_T}yes" >&6
20681           X_LIBS="$X_LIBS -R $x_libraries"
20682         else
20683           echo "$as_me:20683: result: neither works" >&5
20684 echo "${ECHO_T}neither works" >&6
20685         fi
20686       fi
20687       LIBS=$ac_xsave_LIBS
20688     esac
20689   fi
20690
20691   # Check for system-dependent libraries X programs must link with.
20692   # Do this before checking for the system-independent R6 libraries
20693   # (-lICE), since we may need -lsocket or whatever for X linking.
20694
20695   if test "$ISC" = yes; then
20696     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20697   else
20698     # Martyn Johnson says this is needed for Ultrix, if the X
20699     # libraries were built with DECnet support.  And Karl Berry says
20700     # the Alpha needs dnet_stub (dnet does not exist).
20701     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20702     cat >"conftest.$ac_ext" <<_ACEOF
20703 #line 20703 "configure"
20704 #include "confdefs.h"
20705
20706 /* Override any gcc2 internal prototype to avoid an error.  */
20707 #ifdef __cplusplus
20708 extern "C"
20709 #endif
20710 /* We use char because int might match the return type of a gcc2
20711    builtin and then its argument prototype would still apply.  */
20712 char XOpenDisplay ();
20713 int
20714 main (void)
20715 {
20716 XOpenDisplay ();
20717   ;
20718   return 0;
20719 }
20720 _ACEOF
20721 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20722 if { (eval echo "$as_me:20722: \"$ac_link\"") >&5
20723   (eval $ac_link) 2>&5
20724   ac_status=$?
20725   echo "$as_me:20725: \$? = $ac_status" >&5
20726   (exit "$ac_status"); } &&
20727          { ac_try='test -s "conftest$ac_exeext"'
20728   { (eval echo "$as_me:20728: \"$ac_try\"") >&5
20729   (eval $ac_try) 2>&5
20730   ac_status=$?
20731   echo "$as_me:20731: \$? = $ac_status" >&5
20732   (exit "$ac_status"); }; }; then
20733   :
20734 else
20735   echo "$as_me: failed program was:" >&5
20736 cat "conftest.$ac_ext" >&5
20737 echo "$as_me:20737: checking for dnet_ntoa in -ldnet" >&5
20738 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20739 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20740   echo $ECHO_N "(cached) $ECHO_C" >&6
20741 else
20742   ac_check_lib_save_LIBS=$LIBS
20743 LIBS="-ldnet  $LIBS"
20744 cat >"conftest.$ac_ext" <<_ACEOF
20745 #line 20745 "configure"
20746 #include "confdefs.h"
20747
20748 /* Override any gcc2 internal prototype to avoid an error.  */
20749 #ifdef __cplusplus
20750 extern "C"
20751 #endif
20752 /* We use char because int might match the return type of a gcc2
20753    builtin and then its argument prototype would still apply.  */
20754 char dnet_ntoa ();
20755 int
20756 main (void)
20757 {
20758 dnet_ntoa ();
20759   ;
20760   return 0;
20761 }
20762 _ACEOF
20763 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20764 if { (eval echo "$as_me:20764: \"$ac_link\"") >&5
20765   (eval $ac_link) 2>&5
20766   ac_status=$?
20767   echo "$as_me:20767: \$? = $ac_status" >&5
20768   (exit "$ac_status"); } &&
20769          { ac_try='test -s "conftest$ac_exeext"'
20770   { (eval echo "$as_me:20770: \"$ac_try\"") >&5
20771   (eval $ac_try) 2>&5
20772   ac_status=$?
20773   echo "$as_me:20773: \$? = $ac_status" >&5
20774   (exit "$ac_status"); }; }; then
20775   ac_cv_lib_dnet_dnet_ntoa=yes
20776 else
20777   echo "$as_me: failed program was:" >&5
20778 cat "conftest.$ac_ext" >&5
20779 ac_cv_lib_dnet_dnet_ntoa=no
20780 fi
20781 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20782 LIBS=$ac_check_lib_save_LIBS
20783 fi
20784 echo "$as_me:20784: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20785 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20786 if test "$ac_cv_lib_dnet_dnet_ntoa" = yes; then
20787   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20788 fi
20789
20790     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20791       echo "$as_me:20791: checking for dnet_ntoa in -ldnet_stub" >&5
20792 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20793 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20794   echo $ECHO_N "(cached) $ECHO_C" >&6
20795 else
20796   ac_check_lib_save_LIBS=$LIBS
20797 LIBS="-ldnet_stub  $LIBS"
20798 cat >"conftest.$ac_ext" <<_ACEOF
20799 #line 20799 "configure"
20800 #include "confdefs.h"
20801
20802 /* Override any gcc2 internal prototype to avoid an error.  */
20803 #ifdef __cplusplus
20804 extern "C"
20805 #endif
20806 /* We use char because int might match the return type of a gcc2
20807    builtin and then its argument prototype would still apply.  */
20808 char dnet_ntoa ();
20809 int
20810 main (void)
20811 {
20812 dnet_ntoa ();
20813   ;
20814   return 0;
20815 }
20816 _ACEOF
20817 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20818 if { (eval echo "$as_me:20818: \"$ac_link\"") >&5
20819   (eval $ac_link) 2>&5
20820   ac_status=$?
20821   echo "$as_me:20821: \$? = $ac_status" >&5
20822   (exit "$ac_status"); } &&
20823          { ac_try='test -s "conftest$ac_exeext"'
20824   { (eval echo "$as_me:20824: \"$ac_try\"") >&5
20825   (eval $ac_try) 2>&5
20826   ac_status=$?
20827   echo "$as_me:20827: \$? = $ac_status" >&5
20828   (exit "$ac_status"); }; }; then
20829   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20830 else
20831   echo "$as_me: failed program was:" >&5
20832 cat "conftest.$ac_ext" >&5
20833 ac_cv_lib_dnet_stub_dnet_ntoa=no
20834 fi
20835 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20836 LIBS=$ac_check_lib_save_LIBS
20837 fi
20838 echo "$as_me:20838: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20839 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20840 if test "$ac_cv_lib_dnet_stub_dnet_ntoa" = yes; then
20841   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20842 fi
20843
20844     fi
20845 fi
20846 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20847     LIBS="$ac_xsave_LIBS"
20848
20849     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20850     # to get the SysV transport functions.
20851     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20852     # needs -lnsl.
20853     # The nsl library prevents programs from opening the X display
20854     # on Irix 5.2, according to T.E. Dickey.
20855     # The functions gethostbyname, getservbyname, and inet_addr are
20856     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20857     echo "$as_me:20857: checking for gethostbyname" >&5
20858 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20859 if test "${ac_cv_func_gethostbyname+set}" = set; then
20860   echo $ECHO_N "(cached) $ECHO_C" >&6
20861 else
20862   cat >"conftest.$ac_ext" <<_ACEOF
20863 #line 20863 "configure"
20864 #include "confdefs.h"
20865 #define gethostbyname autoconf_temporary
20866 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20867 #undef gethostbyname
20868
20869 #ifdef __cplusplus
20870 extern "C"
20871 #endif
20872
20873 /* We use char because int might match the return type of a gcc2
20874    builtin and then its argument prototype would still apply.  */
20875 char gethostbyname (void);
20876
20877 int
20878 main (void)
20879 {
20880
20881 /* The GNU C library defines stubs for functions which it implements
20882     to always fail with ENOSYS.  Some functions are actually named
20883     something starting with __ and the normal name is an alias.  */
20884 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20885 #error found stub for gethostbyname
20886 #endif
20887
20888         return gethostbyname ();
20889   ;
20890   return 0;
20891 }
20892 _ACEOF
20893 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20894 if { (eval echo "$as_me:20894: \"$ac_link\"") >&5
20895   (eval $ac_link) 2>&5
20896   ac_status=$?
20897   echo "$as_me:20897: \$? = $ac_status" >&5
20898   (exit "$ac_status"); } &&
20899          { ac_try='test -s "conftest$ac_exeext"'
20900   { (eval echo "$as_me:20900: \"$ac_try\"") >&5
20901   (eval $ac_try) 2>&5
20902   ac_status=$?
20903   echo "$as_me:20903: \$? = $ac_status" >&5
20904   (exit "$ac_status"); }; }; then
20905   ac_cv_func_gethostbyname=yes
20906 else
20907   echo "$as_me: failed program was:" >&5
20908 cat "conftest.$ac_ext" >&5
20909 ac_cv_func_gethostbyname=no
20910 fi
20911 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20912 fi
20913 echo "$as_me:20913: result: $ac_cv_func_gethostbyname" >&5
20914 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20915
20916     if test $ac_cv_func_gethostbyname = no; then
20917       echo "$as_me:20917: checking for gethostbyname in -lnsl" >&5
20918 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20919 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20920   echo $ECHO_N "(cached) $ECHO_C" >&6
20921 else
20922   ac_check_lib_save_LIBS=$LIBS
20923 LIBS="-lnsl  $LIBS"
20924 cat >"conftest.$ac_ext" <<_ACEOF
20925 #line 20925 "configure"
20926 #include "confdefs.h"
20927
20928 /* Override any gcc2 internal prototype to avoid an error.  */
20929 #ifdef __cplusplus
20930 extern "C"
20931 #endif
20932 /* We use char because int might match the return type of a gcc2
20933    builtin and then its argument prototype would still apply.  */
20934 char gethostbyname ();
20935 int
20936 main (void)
20937 {
20938 gethostbyname ();
20939   ;
20940   return 0;
20941 }
20942 _ACEOF
20943 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20944 if { (eval echo "$as_me:20944: \"$ac_link\"") >&5
20945   (eval $ac_link) 2>&5
20946   ac_status=$?
20947   echo "$as_me:20947: \$? = $ac_status" >&5
20948   (exit "$ac_status"); } &&
20949          { ac_try='test -s "conftest$ac_exeext"'
20950   { (eval echo "$as_me:20950: \"$ac_try\"") >&5
20951   (eval $ac_try) 2>&5
20952   ac_status=$?
20953   echo "$as_me:20953: \$? = $ac_status" >&5
20954   (exit "$ac_status"); }; }; then
20955   ac_cv_lib_nsl_gethostbyname=yes
20956 else
20957   echo "$as_me: failed program was:" >&5
20958 cat "conftest.$ac_ext" >&5
20959 ac_cv_lib_nsl_gethostbyname=no
20960 fi
20961 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
20962 LIBS=$ac_check_lib_save_LIBS
20963 fi
20964 echo "$as_me:20964: result: $ac_cv_lib_nsl_gethostbyname" >&5
20965 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
20966 if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
20967   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
20968 fi
20969
20970       if test $ac_cv_lib_nsl_gethostbyname = no; then
20971         echo "$as_me:20971: checking for gethostbyname in -lbsd" >&5
20972 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
20973 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
20974   echo $ECHO_N "(cached) $ECHO_C" >&6
20975 else
20976   ac_check_lib_save_LIBS=$LIBS
20977 LIBS="-lbsd  $LIBS"
20978 cat >"conftest.$ac_ext" <<_ACEOF
20979 #line 20979 "configure"
20980 #include "confdefs.h"
20981
20982 /* Override any gcc2 internal prototype to avoid an error.  */
20983 #ifdef __cplusplus
20984 extern "C"
20985 #endif
20986 /* We use char because int might match the return type of a gcc2
20987    builtin and then its argument prototype would still apply.  */
20988 char gethostbyname ();
20989 int
20990 main (void)
20991 {
20992 gethostbyname ();
20993   ;
20994   return 0;
20995 }
20996 _ACEOF
20997 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
20998 if { (eval echo "$as_me:20998: \"$ac_link\"") >&5
20999   (eval $ac_link) 2>&5
21000   ac_status=$?
21001   echo "$as_me:21001: \$? = $ac_status" >&5
21002   (exit "$ac_status"); } &&
21003          { ac_try='test -s "conftest$ac_exeext"'
21004   { (eval echo "$as_me:21004: \"$ac_try\"") >&5
21005   (eval $ac_try) 2>&5
21006   ac_status=$?
21007   echo "$as_me:21007: \$? = $ac_status" >&5
21008   (exit "$ac_status"); }; }; then
21009   ac_cv_lib_bsd_gethostbyname=yes
21010 else
21011   echo "$as_me: failed program was:" >&5
21012 cat "conftest.$ac_ext" >&5
21013 ac_cv_lib_bsd_gethostbyname=no
21014 fi
21015 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21016 LIBS=$ac_check_lib_save_LIBS
21017 fi
21018 echo "$as_me:21018: result: $ac_cv_lib_bsd_gethostbyname" >&5
21019 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
21020 if test "$ac_cv_lib_bsd_gethostbyname" = yes; then
21021   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
21022 fi
21023
21024       fi
21025     fi
21026
21027     # lieder@skyler.mavd.honeywell.com says without -lsocket,
21028     # socket/setsockopt and other routines are undefined under SCO ODT
21029     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
21030     # on later versions), says Simon Leinen: it contains gethostby*
21031     # variants that don't use the nameserver (or something).  -lsocket
21032     # must be given before -lnsl if both are needed.  We assume that
21033     # if connect needs -lnsl, so does gethostbyname.
21034     echo "$as_me:21034: checking for connect" >&5
21035 echo $ECHO_N "checking for connect... $ECHO_C" >&6
21036 if test "${ac_cv_func_connect+set}" = set; then
21037   echo $ECHO_N "(cached) $ECHO_C" >&6
21038 else
21039   cat >"conftest.$ac_ext" <<_ACEOF
21040 #line 21040 "configure"
21041 #include "confdefs.h"
21042 #define connect autoconf_temporary
21043 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21044 #undef connect
21045
21046 #ifdef __cplusplus
21047 extern "C"
21048 #endif
21049
21050 /* We use char because int might match the return type of a gcc2
21051    builtin and then its argument prototype would still apply.  */
21052 char connect (void);
21053
21054 int
21055 main (void)
21056 {
21057
21058 /* The GNU C library defines stubs for functions which it implements
21059     to always fail with ENOSYS.  Some functions are actually named
21060     something starting with __ and the normal name is an alias.  */
21061 #if defined (__stub_connect) || defined (__stub___connect)
21062 #error found stub for connect
21063 #endif
21064
21065         return connect ();
21066   ;
21067   return 0;
21068 }
21069 _ACEOF
21070 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21071 if { (eval echo "$as_me:21071: \"$ac_link\"") >&5
21072   (eval $ac_link) 2>&5
21073   ac_status=$?
21074   echo "$as_me:21074: \$? = $ac_status" >&5
21075   (exit "$ac_status"); } &&
21076          { ac_try='test -s "conftest$ac_exeext"'
21077   { (eval echo "$as_me:21077: \"$ac_try\"") >&5
21078   (eval $ac_try) 2>&5
21079   ac_status=$?
21080   echo "$as_me:21080: \$? = $ac_status" >&5
21081   (exit "$ac_status"); }; }; then
21082   ac_cv_func_connect=yes
21083 else
21084   echo "$as_me: failed program was:" >&5
21085 cat "conftest.$ac_ext" >&5
21086 ac_cv_func_connect=no
21087 fi
21088 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21089 fi
21090 echo "$as_me:21090: result: $ac_cv_func_connect" >&5
21091 echo "${ECHO_T}$ac_cv_func_connect" >&6
21092
21093     if test $ac_cv_func_connect = no; then
21094       echo "$as_me:21094: checking for connect in -lsocket" >&5
21095 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
21096 if test "${ac_cv_lib_socket_connect+set}" = set; then
21097   echo $ECHO_N "(cached) $ECHO_C" >&6
21098 else
21099   ac_check_lib_save_LIBS=$LIBS
21100 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
21101 cat >"conftest.$ac_ext" <<_ACEOF
21102 #line 21102 "configure"
21103 #include "confdefs.h"
21104
21105 /* Override any gcc2 internal prototype to avoid an error.  */
21106 #ifdef __cplusplus
21107 extern "C"
21108 #endif
21109 /* We use char because int might match the return type of a gcc2
21110    builtin and then its argument prototype would still apply.  */
21111 char connect ();
21112 int
21113 main (void)
21114 {
21115 connect ();
21116   ;
21117   return 0;
21118 }
21119 _ACEOF
21120 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21121 if { (eval echo "$as_me:21121: \"$ac_link\"") >&5
21122   (eval $ac_link) 2>&5
21123   ac_status=$?
21124   echo "$as_me:21124: \$? = $ac_status" >&5
21125   (exit "$ac_status"); } &&
21126          { ac_try='test -s "conftest$ac_exeext"'
21127   { (eval echo "$as_me:21127: \"$ac_try\"") >&5
21128   (eval $ac_try) 2>&5
21129   ac_status=$?
21130   echo "$as_me:21130: \$? = $ac_status" >&5
21131   (exit "$ac_status"); }; }; then
21132   ac_cv_lib_socket_connect=yes
21133 else
21134   echo "$as_me: failed program was:" >&5
21135 cat "conftest.$ac_ext" >&5
21136 ac_cv_lib_socket_connect=no
21137 fi
21138 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21139 LIBS=$ac_check_lib_save_LIBS
21140 fi
21141 echo "$as_me:21141: result: $ac_cv_lib_socket_connect" >&5
21142 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
21143 if test "$ac_cv_lib_socket_connect" = yes; then
21144   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
21145 fi
21146
21147     fi
21148
21149     # Guillermo Gomez says -lposix is necessary on A/UX.
21150     echo "$as_me:21150: checking for remove" >&5
21151 echo $ECHO_N "checking for remove... $ECHO_C" >&6
21152 if test "${ac_cv_func_remove+set}" = set; then
21153   echo $ECHO_N "(cached) $ECHO_C" >&6
21154 else
21155   cat >"conftest.$ac_ext" <<_ACEOF
21156 #line 21156 "configure"
21157 #include "confdefs.h"
21158 #define remove autoconf_temporary
21159 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21160 #undef remove
21161
21162 #ifdef __cplusplus
21163 extern "C"
21164 #endif
21165
21166 /* We use char because int might match the return type of a gcc2
21167    builtin and then its argument prototype would still apply.  */
21168 char remove (void);
21169
21170 int
21171 main (void)
21172 {
21173
21174 /* The GNU C library defines stubs for functions which it implements
21175     to always fail with ENOSYS.  Some functions are actually named
21176     something starting with __ and the normal name is an alias.  */
21177 #if defined (__stub_remove) || defined (__stub___remove)
21178 #error found stub for remove
21179 #endif
21180
21181         return remove ();
21182   ;
21183   return 0;
21184 }
21185 _ACEOF
21186 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21187 if { (eval echo "$as_me:21187: \"$ac_link\"") >&5
21188   (eval $ac_link) 2>&5
21189   ac_status=$?
21190   echo "$as_me:21190: \$? = $ac_status" >&5
21191   (exit "$ac_status"); } &&
21192          { ac_try='test -s "conftest$ac_exeext"'
21193   { (eval echo "$as_me:21193: \"$ac_try\"") >&5
21194   (eval $ac_try) 2>&5
21195   ac_status=$?
21196   echo "$as_me:21196: \$? = $ac_status" >&5
21197   (exit "$ac_status"); }; }; then
21198   ac_cv_func_remove=yes
21199 else
21200   echo "$as_me: failed program was:" >&5
21201 cat "conftest.$ac_ext" >&5
21202 ac_cv_func_remove=no
21203 fi
21204 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21205 fi
21206 echo "$as_me:21206: result: $ac_cv_func_remove" >&5
21207 echo "${ECHO_T}$ac_cv_func_remove" >&6
21208
21209     if test $ac_cv_func_remove = no; then
21210       echo "$as_me:21210: checking for remove in -lposix" >&5
21211 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
21212 if test "${ac_cv_lib_posix_remove+set}" = set; then
21213   echo $ECHO_N "(cached) $ECHO_C" >&6
21214 else
21215   ac_check_lib_save_LIBS=$LIBS
21216 LIBS="-lposix  $LIBS"
21217 cat >"conftest.$ac_ext" <<_ACEOF
21218 #line 21218 "configure"
21219 #include "confdefs.h"
21220
21221 /* Override any gcc2 internal prototype to avoid an error.  */
21222 #ifdef __cplusplus
21223 extern "C"
21224 #endif
21225 /* We use char because int might match the return type of a gcc2
21226    builtin and then its argument prototype would still apply.  */
21227 char remove ();
21228 int
21229 main (void)
21230 {
21231 remove ();
21232   ;
21233   return 0;
21234 }
21235 _ACEOF
21236 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21237 if { (eval echo "$as_me:21237: \"$ac_link\"") >&5
21238   (eval $ac_link) 2>&5
21239   ac_status=$?
21240   echo "$as_me:21240: \$? = $ac_status" >&5
21241   (exit "$ac_status"); } &&
21242          { ac_try='test -s "conftest$ac_exeext"'
21243   { (eval echo "$as_me:21243: \"$ac_try\"") >&5
21244   (eval $ac_try) 2>&5
21245   ac_status=$?
21246   echo "$as_me:21246: \$? = $ac_status" >&5
21247   (exit "$ac_status"); }; }; then
21248   ac_cv_lib_posix_remove=yes
21249 else
21250   echo "$as_me: failed program was:" >&5
21251 cat "conftest.$ac_ext" >&5
21252 ac_cv_lib_posix_remove=no
21253 fi
21254 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21255 LIBS=$ac_check_lib_save_LIBS
21256 fi
21257 echo "$as_me:21257: result: $ac_cv_lib_posix_remove" >&5
21258 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
21259 if test "$ac_cv_lib_posix_remove" = yes; then
21260   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
21261 fi
21262
21263     fi
21264
21265     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
21266     echo "$as_me:21266: checking for shmat" >&5
21267 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
21268 if test "${ac_cv_func_shmat+set}" = set; then
21269   echo $ECHO_N "(cached) $ECHO_C" >&6
21270 else
21271   cat >"conftest.$ac_ext" <<_ACEOF
21272 #line 21272 "configure"
21273 #include "confdefs.h"
21274 #define shmat autoconf_temporary
21275 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
21276 #undef shmat
21277
21278 #ifdef __cplusplus
21279 extern "C"
21280 #endif
21281
21282 /* We use char because int might match the return type of a gcc2
21283    builtin and then its argument prototype would still apply.  */
21284 char shmat (void);
21285
21286 int
21287 main (void)
21288 {
21289
21290 /* The GNU C library defines stubs for functions which it implements
21291     to always fail with ENOSYS.  Some functions are actually named
21292     something starting with __ and the normal name is an alias.  */
21293 #if defined (__stub_shmat) || defined (__stub___shmat)
21294 #error found stub for shmat
21295 #endif
21296
21297         return shmat ();
21298   ;
21299   return 0;
21300 }
21301 _ACEOF
21302 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21303 if { (eval echo "$as_me:21303: \"$ac_link\"") >&5
21304   (eval $ac_link) 2>&5
21305   ac_status=$?
21306   echo "$as_me:21306: \$? = $ac_status" >&5
21307   (exit "$ac_status"); } &&
21308          { ac_try='test -s "conftest$ac_exeext"'
21309   { (eval echo "$as_me:21309: \"$ac_try\"") >&5
21310   (eval $ac_try) 2>&5
21311   ac_status=$?
21312   echo "$as_me:21312: \$? = $ac_status" >&5
21313   (exit "$ac_status"); }; }; then
21314   ac_cv_func_shmat=yes
21315 else
21316   echo "$as_me: failed program was:" >&5
21317 cat "conftest.$ac_ext" >&5
21318 ac_cv_func_shmat=no
21319 fi
21320 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21321 fi
21322 echo "$as_me:21322: result: $ac_cv_func_shmat" >&5
21323 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21324
21325     if test $ac_cv_func_shmat = no; then
21326       echo "$as_me:21326: checking for shmat in -lipc" >&5
21327 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21328 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21329   echo $ECHO_N "(cached) $ECHO_C" >&6
21330 else
21331   ac_check_lib_save_LIBS=$LIBS
21332 LIBS="-lipc  $LIBS"
21333 cat >"conftest.$ac_ext" <<_ACEOF
21334 #line 21334 "configure"
21335 #include "confdefs.h"
21336
21337 /* Override any gcc2 internal prototype to avoid an error.  */
21338 #ifdef __cplusplus
21339 extern "C"
21340 #endif
21341 /* We use char because int might match the return type of a gcc2
21342    builtin and then its argument prototype would still apply.  */
21343 char shmat ();
21344 int
21345 main (void)
21346 {
21347 shmat ();
21348   ;
21349   return 0;
21350 }
21351 _ACEOF
21352 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21353 if { (eval echo "$as_me:21353: \"$ac_link\"") >&5
21354   (eval $ac_link) 2>&5
21355   ac_status=$?
21356   echo "$as_me:21356: \$? = $ac_status" >&5
21357   (exit "$ac_status"); } &&
21358          { ac_try='test -s "conftest$ac_exeext"'
21359   { (eval echo "$as_me:21359: \"$ac_try\"") >&5
21360   (eval $ac_try) 2>&5
21361   ac_status=$?
21362   echo "$as_me:21362: \$? = $ac_status" >&5
21363   (exit "$ac_status"); }; }; then
21364   ac_cv_lib_ipc_shmat=yes
21365 else
21366   echo "$as_me: failed program was:" >&5
21367 cat "conftest.$ac_ext" >&5
21368 ac_cv_lib_ipc_shmat=no
21369 fi
21370 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21371 LIBS=$ac_check_lib_save_LIBS
21372 fi
21373 echo "$as_me:21373: result: $ac_cv_lib_ipc_shmat" >&5
21374 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21375 if test "$ac_cv_lib_ipc_shmat" = yes; then
21376   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21377 fi
21378
21379     fi
21380   fi
21381
21382   # Check for libraries that X11R6 Xt/Xaw programs need.
21383   ac_save_LDFLAGS=$LDFLAGS
21384   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21385   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21386   # check for ICE first), but we must link in the order -lSM -lICE or
21387   # we get undefined symbols.  So assume we have SM if we have ICE.
21388   # These have to be linked with before -lX11, unlike the other
21389   # libraries we check for below, so use a different variable.
21390   # John Interrante, Karl Berry
21391   echo "$as_me:21391: checking for IceConnectionNumber in -lICE" >&5
21392 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21393 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21394   echo $ECHO_N "(cached) $ECHO_C" >&6
21395 else
21396   ac_check_lib_save_LIBS=$LIBS
21397 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21398 cat >"conftest.$ac_ext" <<_ACEOF
21399 #line 21399 "configure"
21400 #include "confdefs.h"
21401
21402 /* Override any gcc2 internal prototype to avoid an error.  */
21403 #ifdef __cplusplus
21404 extern "C"
21405 #endif
21406 /* We use char because int might match the return type of a gcc2
21407    builtin and then its argument prototype would still apply.  */
21408 char IceConnectionNumber ();
21409 int
21410 main (void)
21411 {
21412 IceConnectionNumber ();
21413   ;
21414   return 0;
21415 }
21416 _ACEOF
21417 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
21418 if { (eval echo "$as_me:21418: \"$ac_link\"") >&5
21419   (eval $ac_link) 2>&5
21420   ac_status=$?
21421   echo "$as_me:21421: \$? = $ac_status" >&5
21422   (exit "$ac_status"); } &&
21423          { ac_try='test -s "conftest$ac_exeext"'
21424   { (eval echo "$as_me:21424: \"$ac_try\"") >&5
21425   (eval $ac_try) 2>&5
21426   ac_status=$?
21427   echo "$as_me:21427: \$? = $ac_status" >&5
21428   (exit "$ac_status"); }; }; then
21429   ac_cv_lib_ICE_IceConnectionNumber=yes
21430 else
21431   echo "$as_me: failed program was:" >&5
21432 cat "conftest.$ac_ext" >&5
21433 ac_cv_lib_ICE_IceConnectionNumber=no
21434 fi
21435 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
21436 LIBS=$ac_check_lib_save_LIBS
21437 fi
21438 echo "$as_me:21438: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21439 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21440 if test "$ac_cv_lib_ICE_IceConnectionNumber" = yes; then
21441   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21442 fi
21443
21444   LDFLAGS=$ac_save_LDFLAGS
21445
21446 fi
21447
21448 fi
21449
21450 if test "$GCC" = yes || test "$GXX" = yes
21451 then
21452
21453 if test "$GCC" = yes || test "$GXX" = yes
21454 then
21455         case $CFLAGS in
21456         (*-Werror=*)
21457                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21458
21459 echo "${as_me:-configure}:21459: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21460
21461                 cf_temp_flags=
21462                 for cf_temp_scan in $CFLAGS
21463                 do
21464                         case "x$cf_temp_scan" in
21465                         (x-Werror=*)
21466
21467         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21468         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21469
21470                                 ;;
21471                         (*)
21472
21473         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21474         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21475
21476                                 ;;
21477                         esac
21478                 done
21479                 CFLAGS="$cf_temp_flags"
21480                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21481
21482 echo "${as_me:-configure}:21482: testing ... fixed $CFLAGS ..." 1>&5
21483
21484                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21485
21486 echo "${as_me:-configure}:21486: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21487
21488                 ;;
21489         esac
21490 fi
21491
21492 if test "$GCC" = yes || test "$GXX" = yes
21493 then
21494         case $CPPFLAGS in
21495         (*-Werror=*)
21496                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21497
21498 echo "${as_me:-configure}:21498: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21499
21500                 cf_temp_flags=
21501                 for cf_temp_scan in $CPPFLAGS
21502                 do
21503                         case "x$cf_temp_scan" in
21504                         (x-Werror=*)
21505
21506         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21507         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21508
21509                                 ;;
21510                         (*)
21511
21512         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21513         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21514
21515                                 ;;
21516                         esac
21517                 done
21518                 CPPFLAGS="$cf_temp_flags"
21519                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21520
21521 echo "${as_me:-configure}:21521: testing ... fixed $CPPFLAGS ..." 1>&5
21522
21523                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21524
21525 echo "${as_me:-configure}:21525: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21526
21527                 ;;
21528         esac
21529 fi
21530
21531 if test "$GCC" = yes || test "$GXX" = yes
21532 then
21533         case $LDFLAGS in
21534         (*-Werror=*)
21535                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21536
21537 echo "${as_me:-configure}:21537: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21538
21539                 cf_temp_flags=
21540                 for cf_temp_scan in $LDFLAGS
21541                 do
21542                         case "x$cf_temp_scan" in
21543                         (x-Werror=*)
21544
21545         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21546         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
21547
21548                                 ;;
21549                         (*)
21550
21551         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21552         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
21553
21554                                 ;;
21555                         esac
21556                 done
21557                 LDFLAGS="$cf_temp_flags"
21558                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21559
21560 echo "${as_me:-configure}:21560: testing ... fixed $LDFLAGS ..." 1>&5
21561
21562                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21563
21564 echo "${as_me:-configure}:21564: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21565
21566                 ;;
21567         esac
21568 fi
21569
21570 echo "$as_me:21570: checking if you want to turn on gcc warnings" >&5
21571 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21572
21573 # Check whether --enable-warnings or --disable-warnings was given.
21574 if test "${enable_warnings+set}" = set; then
21575   enableval="$enable_warnings"
21576   test "$enableval" != yes && enableval=no
21577         if test "$enableval" != "no" ; then
21578     enable_warnings=yes
21579         else
21580                 enable_warnings=no
21581         fi
21582 else
21583   enableval=no
21584         enable_warnings=no
21585
21586 fi;
21587 echo "$as_me:21587: result: $enable_warnings" >&5
21588 echo "${ECHO_T}$enable_warnings" >&6
21589 if test "$enable_warnings" = "yes"
21590 then
21591
21592 if test "$GCC" = yes || test "$GXX" = yes
21593 then
21594 cat > conftest.i <<EOF
21595 #ifndef GCC_PRINTF
21596 #define GCC_PRINTF 0
21597 #endif
21598 #ifndef GCC_SCANF
21599 #define GCC_SCANF 0
21600 #endif
21601 #ifndef GCC_NORETURN
21602 #define GCC_NORETURN /* nothing */
21603 #endif
21604 #ifndef GCC_UNUSED
21605 #define GCC_UNUSED /* nothing */
21606 #endif
21607 EOF
21608 if test "$GCC" = yes
21609 then
21610         { echo "$as_me:21610: checking for $CC __attribute__ directives..." >&5
21611 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21612 cat > "conftest.$ac_ext" <<EOF
21613 #line 21613 "${as_me:-configure}"
21614 #include "confdefs.h"
21615 #include "conftest.h"
21616 #include "conftest.i"
21617 #if     GCC_PRINTF
21618 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21619 #else
21620 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21621 #endif
21622 #if     GCC_SCANF
21623 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21624 #else
21625 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21626 #endif
21627 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21628 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
21629 extern GCC_NORETURN void foo(void);
21630 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21631 EOF
21632         cf_printf_attribute=no
21633         cf_scanf_attribute=no
21634         for cf_attribute in scanf printf unused noreturn
21635         do
21636
21637 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21638
21639                 cf_directive="__attribute__(($cf_attribute))"
21640                 echo "checking for $CC $cf_directive" 1>&5
21641
21642                 case "$cf_attribute" in
21643                 (printf)
21644                         cf_printf_attribute=yes
21645                         cat >conftest.h <<EOF
21646 #define GCC_$cf_ATTRIBUTE 1
21647 EOF
21648                         ;;
21649                 (scanf)
21650                         cf_scanf_attribute=yes
21651                         cat >conftest.h <<EOF
21652 #define GCC_$cf_ATTRIBUTE 1
21653 EOF
21654                         ;;
21655                 (*)
21656                         cat >conftest.h <<EOF
21657 #define GCC_$cf_ATTRIBUTE $cf_directive
21658 EOF
21659                         ;;
21660                 esac
21661
21662                 if { (eval echo "$as_me:21662: \"$ac_compile\"") >&5
21663   (eval $ac_compile) 2>&5
21664   ac_status=$?
21665   echo "$as_me:21665: \$? = $ac_status" >&5
21666   (exit "$ac_status"); }; then
21667                         test -n "$verbose" && echo "$as_me:21667: result: ... $cf_attribute" >&5
21668 echo "${ECHO_T}... $cf_attribute" >&6
21669                         cat conftest.h >>confdefs.h
21670                         case "$cf_attribute" in
21671                         (noreturn)
21672
21673 cat >>confdefs.h <<EOF
21674 #define GCC_NORETURN $cf_directive
21675 EOF
21676
21677                                 ;;
21678                         (printf)
21679                                 cf_value='/* nothing */'
21680                                 if test "$cf_printf_attribute" != no ; then
21681                                         cf_value='__attribute__((format(printf,fmt,var)))'
21682
21683 cat >>confdefs.h <<\EOF
21684 #define GCC_PRINTF 1
21685 EOF
21686
21687                                 fi
21688
21689 cat >>confdefs.h <<EOF
21690 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21691 EOF
21692
21693                                 ;;
21694                         (scanf)
21695                                 cf_value='/* nothing */'
21696                                 if test "$cf_scanf_attribute" != no ; then
21697                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21698
21699 cat >>confdefs.h <<\EOF
21700 #define GCC_SCANF 1
21701 EOF
21702
21703                                 fi
21704
21705 cat >>confdefs.h <<EOF
21706 #define GCC_SCANFLIKE(fmt,var) $cf_value
21707 EOF
21708
21709                                 ;;
21710                         (unused)
21711
21712 cat >>confdefs.h <<EOF
21713 #define GCC_UNUSED $cf_directive
21714 EOF
21715
21716                                 ;;
21717                         esac
21718                 fi
21719         done
21720 else
21721         ${FGREP-fgrep} define conftest.i >>confdefs.h
21722 fi
21723 rm -rf ./conftest*
21724 fi
21725
21726 if test "x$have_x" = xyes; then
21727
21728 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21729 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21730 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21731 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21732 for cf_X_CFLAGS in $X_CFLAGS
21733 do
21734         case "x$cf_X_CFLAGS" in
21735         x-[IUD]*)
21736                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21737                 ;;
21738         *)
21739                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21740                 ;;
21741         esac
21742 done
21743
21744 cat >"conftest.$ac_ext" <<_ACEOF
21745 #line 21745 "configure"
21746 #include "confdefs.h"
21747
21748 #include <stdlib.h>
21749 #include <X11/Intrinsic.h>
21750
21751 int
21752 main (void)
21753 {
21754 String foo = malloc(1); (void)foo
21755   ;
21756   return 0;
21757 }
21758 _ACEOF
21759 rm -f "conftest.$ac_objext"
21760 if { (eval echo "$as_me:21760: \"$ac_compile\"") >&5
21761   (eval $ac_compile) 2>&5
21762   ac_status=$?
21763   echo "$as_me:21763: \$? = $ac_status" >&5
21764   (exit "$ac_status"); } &&
21765          { ac_try='test -s "conftest.$ac_objext"'
21766   { (eval echo "$as_me:21766: \"$ac_try\"") >&5
21767   (eval $ac_try) 2>&5
21768   ac_status=$?
21769   echo "$as_me:21769: \$? = $ac_status" >&5
21770   (exit "$ac_status"); }; }; then
21771
21772 echo "$as_me:21772: checking for X11/Xt const-feature" >&5
21773 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21774 if test "${cf_cv_const_x_string+set}" = set; then
21775   echo $ECHO_N "(cached) $ECHO_C" >&6
21776 else
21777
21778         cat >"conftest.$ac_ext" <<_ACEOF
21779 #line 21779 "configure"
21780 #include "confdefs.h"
21781
21782 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21783 #undef  XTSTRINGDEFINES /* X11R5 and later */
21784 #include <stdlib.h>
21785 #include <X11/Intrinsic.h>
21786
21787 int
21788 main (void)
21789 {
21790 String foo = malloc(1); *foo = 0
21791   ;
21792   return 0;
21793 }
21794 _ACEOF
21795 rm -f "conftest.$ac_objext"
21796 if { (eval echo "$as_me:21796: \"$ac_compile\"") >&5
21797   (eval $ac_compile) 2>&5
21798   ac_status=$?
21799   echo "$as_me:21799: \$? = $ac_status" >&5
21800   (exit "$ac_status"); } &&
21801          { ac_try='test -s "conftest.$ac_objext"'
21802   { (eval echo "$as_me:21802: \"$ac_try\"") >&5
21803   (eval $ac_try) 2>&5
21804   ac_status=$?
21805   echo "$as_me:21805: \$? = $ac_status" >&5
21806   (exit "$ac_status"); }; }; then
21807
21808                         cf_cv_const_x_string=no
21809
21810 else
21811   echo "$as_me: failed program was:" >&5
21812 cat "conftest.$ac_ext" >&5
21813
21814                         cf_cv_const_x_string=yes
21815
21816 fi
21817 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21818
21819 fi
21820 echo "$as_me:21820: result: $cf_cv_const_x_string" >&5
21821 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21822
21823 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21824 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21825 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21826
21827 case "$cf_cv_const_x_string" in
21828 (no)
21829
21830         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21831         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21832
21833         ;;
21834 (*)
21835
21836         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21837         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21838
21839         ;;
21840 esac
21841
21842 else
21843   echo "$as_me: failed program was:" >&5
21844 cat "conftest.$ac_ext" >&5
21845 fi
21846 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
21847  fi
21848 cat > "conftest.$ac_ext" <<EOF
21849 #line 21849 "${as_me:-configure}"
21850 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21851 EOF
21852 if test "$INTEL_COMPILER" = yes
21853 then
21854 # The "-wdXXX" options suppress warnings:
21855 # remark #1419: external declaration in primary source file
21856 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21857 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21858 # remark #193: zero used for undefined preprocessing identifier
21859 # remark #593: variable "curs_sb_left_arrow" was set but never used
21860 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21861 # remark #869: parameter "tw" was never referenced
21862 # remark #981: operands are evaluated in unspecified order
21863 # warning #279: controlling expression is constant
21864
21865         { echo "$as_me:21865: checking for $CC warning options..." >&5
21866 echo "$as_me: checking for $CC warning options..." >&6;}
21867         cf_save_CFLAGS="$CFLAGS"
21868         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21869         for cf_opt in \
21870                 wd1419 \
21871                 wd1683 \
21872                 wd1684 \
21873                 wd193 \
21874                 wd593 \
21875                 wd279 \
21876                 wd810 \
21877                 wd869 \
21878                 wd981
21879         do
21880                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21881                 if { (eval echo "$as_me:21881: \"$ac_compile\"") >&5
21882   (eval $ac_compile) 2>&5
21883   ac_status=$?
21884   echo "$as_me:21884: \$? = $ac_status" >&5
21885   (exit "$ac_status"); }; then
21886                         test -n "$verbose" && echo "$as_me:21886: result: ... -$cf_opt" >&5
21887 echo "${ECHO_T}... -$cf_opt" >&6
21888                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21889                 fi
21890         done
21891         CFLAGS="$cf_save_CFLAGS"
21892 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21893 then
21894         { echo "$as_me:21894: checking for $CC warning options..." >&5
21895 echo "$as_me: checking for $CC warning options..." >&6;}
21896         cf_save_CFLAGS="$CFLAGS"
21897         cf_warn_CONST=""
21898         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21899         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21900         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21901         for cf_opt in W Wall \
21902                 Wbad-function-cast \
21903                 Wcast-align \
21904                 Wcast-qual \
21905                 Wdeclaration-after-statement \
21906                 Wextra \
21907                 Winline \
21908                 Wmissing-declarations \
21909                 Wmissing-prototypes \
21910                 Wnested-externs \
21911                 Wpointer-arith \
21912                 Wshadow \
21913                 Wstrict-prototypes \
21914                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21915         do
21916                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21917                 if { (eval echo "$as_me:21917: \"$ac_compile\"") >&5
21918   (eval $ac_compile) 2>&5
21919   ac_status=$?
21920   echo "$as_me:21920: \$? = $ac_status" >&5
21921   (exit "$ac_status"); }; then
21922                         test -n "$verbose" && echo "$as_me:21922: result: ... -$cf_opt" >&5
21923 echo "${ECHO_T}... -$cf_opt" >&6
21924                         case "$cf_opt" in
21925                         (Winline)
21926                                 case "$GCC_VERSION" in
21927                                 ([34].*)
21928                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21929
21930 echo "${as_me:-configure}:21930: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21931
21932                                         continue;;
21933                                 esac
21934                                 ;;
21935                         (Wpointer-arith)
21936                                 case "$GCC_VERSION" in
21937                                 ([12].*)
21938                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21939
21940 echo "${as_me:-configure}:21940: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21941
21942                                         continue;;
21943                                 esac
21944                                 ;;
21945                         esac
21946                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21947                 fi
21948         done
21949         CFLAGS="$cf_save_CFLAGS"
21950 fi
21951 rm -rf ./conftest*
21952
21953 fi
21954
21955 fi
21956
21957 echo "$as_me:21957: checking if you want to use dmalloc for testing" >&5
21958 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
21959
21960 # Check whether --with-dmalloc or --without-dmalloc was given.
21961 if test "${with_dmalloc+set}" = set; then
21962   withval="$with_dmalloc"
21963
21964 cat >>confdefs.h <<EOF
21965 #define USE_DMALLOC 1
21966 EOF
21967
21968         : "${with_cflags:=-g}"
21969         : "${enable_leaks:=no}"
21970          with_dmalloc=yes
21971 else
21972   with_dmalloc=
21973 fi;
21974 echo "$as_me:21974: result: ${with_dmalloc:-no}" >&5
21975 echo "${ECHO_T}${with_dmalloc:-no}" >&6
21976
21977 case ".$with_cflags" in
21978 (.*-g*)
21979         case .$CFLAGS in
21980         (.*-g*)
21981                 ;;
21982         (*)
21983
21984 cf_fix_cppflags=no
21985 cf_new_cflags=
21986 cf_new_cppflags=
21987 cf_new_extra_cppflags=
21988
21989 for cf_add_cflags in -g
21990 do
21991 case "$cf_fix_cppflags" in
21992 (no)
21993         case "$cf_add_cflags" in
21994         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21995                 case "$cf_add_cflags" in
21996                 (-D*)
21997                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21998
21999                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22000                                 && test -z "${cf_tst_cflags}" \
22001                                 && cf_fix_cppflags=yes
22002
22003                         if test "$cf_fix_cppflags" = yes ; then
22004
22005         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22006         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22007
22008                                 continue
22009                         elif test "${cf_tst_cflags}" = "\"'" ; then
22010
22011         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22012         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22013
22014                                 continue
22015                         fi
22016                         ;;
22017                 esac
22018                 case "$CPPFLAGS" in
22019                 (*$cf_add_cflags)
22020                         ;;
22021                 (*)
22022                         case "$cf_add_cflags" in
22023                         (-D*)
22024                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22025
22026 CPPFLAGS=`echo "$CPPFLAGS" | \
22027         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22028                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22029
22030                                 ;;
22031                         esac
22032
22033         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22034         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22035
22036                         ;;
22037                 esac
22038                 ;;
22039         (*)
22040
22041         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22042         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22043
22044                 ;;
22045         esac
22046         ;;
22047 (yes)
22048
22049         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22050         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22051
22052         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22053
22054         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22055                 && test -z "${cf_tst_cflags}" \
22056                 && cf_fix_cppflags=no
22057         ;;
22058 esac
22059 done
22060
22061 if test -n "$cf_new_cflags" ; then
22062
22063         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22064         CFLAGS="${CFLAGS}$cf_new_cflags"
22065
22066 fi
22067
22068 if test -n "$cf_new_cppflags" ; then
22069
22070         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22071         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22072
22073 fi
22074
22075 if test -n "$cf_new_extra_cppflags" ; then
22076
22077         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22078         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22079
22080 fi
22081
22082                 ;;
22083         esac
22084         ;;
22085 esac
22086
22087 if test "$with_dmalloc" = yes ; then
22088         echo "$as_me:22088: checking for dmalloc.h" >&5
22089 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
22090 if test "${ac_cv_header_dmalloc_h+set}" = set; then
22091   echo $ECHO_N "(cached) $ECHO_C" >&6
22092 else
22093   cat >"conftest.$ac_ext" <<_ACEOF
22094 #line 22094 "configure"
22095 #include "confdefs.h"
22096 #include <dmalloc.h>
22097 _ACEOF
22098 if { (eval echo "$as_me:22098: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22099   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22100   ac_status=$?
22101   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22102   rm -f conftest.er1
22103   cat conftest.err >&5
22104   echo "$as_me:22104: \$? = $ac_status" >&5
22105   (exit "$ac_status"); } >/dev/null; then
22106   if test -s conftest.err; then
22107     ac_cpp_err=$ac_c_preproc_warn_flag
22108   else
22109     ac_cpp_err=
22110   fi
22111 else
22112   ac_cpp_err=yes
22113 fi
22114 if test -z "$ac_cpp_err"; then
22115   ac_cv_header_dmalloc_h=yes
22116 else
22117   echo "$as_me: failed program was:" >&5
22118   cat "conftest.$ac_ext" >&5
22119   ac_cv_header_dmalloc_h=no
22120 fi
22121 rm -f conftest.err "conftest.$ac_ext"
22122 fi
22123 echo "$as_me:22123: result: $ac_cv_header_dmalloc_h" >&5
22124 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
22125 if test "$ac_cv_header_dmalloc_h" = yes; then
22126
22127 echo "$as_me:22127: checking for dmalloc_debug in -ldmalloc" >&5
22128 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
22129 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
22130   echo $ECHO_N "(cached) $ECHO_C" >&6
22131 else
22132   ac_check_lib_save_LIBS=$LIBS
22133 LIBS="-ldmalloc  $LIBS"
22134 cat >"conftest.$ac_ext" <<_ACEOF
22135 #line 22135 "configure"
22136 #include "confdefs.h"
22137
22138 /* Override any gcc2 internal prototype to avoid an error.  */
22139 #ifdef __cplusplus
22140 extern "C"
22141 #endif
22142 /* We use char because int might match the return type of a gcc2
22143    builtin and then its argument prototype would still apply.  */
22144 char dmalloc_debug ();
22145 int
22146 main (void)
22147 {
22148 dmalloc_debug ();
22149   ;
22150   return 0;
22151 }
22152 _ACEOF
22153 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22154 if { (eval echo "$as_me:22154: \"$ac_link\"") >&5
22155   (eval $ac_link) 2>&5
22156   ac_status=$?
22157   echo "$as_me:22157: \$? = $ac_status" >&5
22158   (exit "$ac_status"); } &&
22159          { ac_try='test -s "conftest$ac_exeext"'
22160   { (eval echo "$as_me:22160: \"$ac_try\"") >&5
22161   (eval $ac_try) 2>&5
22162   ac_status=$?
22163   echo "$as_me:22163: \$? = $ac_status" >&5
22164   (exit "$ac_status"); }; }; then
22165   ac_cv_lib_dmalloc_dmalloc_debug=yes
22166 else
22167   echo "$as_me: failed program was:" >&5
22168 cat "conftest.$ac_ext" >&5
22169 ac_cv_lib_dmalloc_dmalloc_debug=no
22170 fi
22171 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22172 LIBS=$ac_check_lib_save_LIBS
22173 fi
22174 echo "$as_me:22174: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
22175 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
22176 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then
22177   cat >>confdefs.h <<EOF
22178 #define HAVE_LIBDMALLOC 1
22179 EOF
22180
22181   LIBS="-ldmalloc $LIBS"
22182
22183 fi
22184
22185 fi
22186
22187 fi
22188
22189 echo "$as_me:22189: checking if you want to use dbmalloc for testing" >&5
22190 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
22191
22192 # Check whether --with-dbmalloc or --without-dbmalloc was given.
22193 if test "${with_dbmalloc+set}" = set; then
22194   withval="$with_dbmalloc"
22195
22196 cat >>confdefs.h <<EOF
22197 #define USE_DBMALLOC 1
22198 EOF
22199
22200         : "${with_cflags:=-g}"
22201         : "${enable_leaks:=no}"
22202          with_dbmalloc=yes
22203 else
22204   with_dbmalloc=
22205 fi;
22206 echo "$as_me:22206: result: ${with_dbmalloc:-no}" >&5
22207 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
22208
22209 case ".$with_cflags" in
22210 (.*-g*)
22211         case .$CFLAGS in
22212         (.*-g*)
22213                 ;;
22214         (*)
22215
22216 cf_fix_cppflags=no
22217 cf_new_cflags=
22218 cf_new_cppflags=
22219 cf_new_extra_cppflags=
22220
22221 for cf_add_cflags in -g
22222 do
22223 case "$cf_fix_cppflags" in
22224 (no)
22225         case "$cf_add_cflags" in
22226         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22227                 case "$cf_add_cflags" in
22228                 (-D*)
22229                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22230
22231                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22232                                 && test -z "${cf_tst_cflags}" \
22233                                 && cf_fix_cppflags=yes
22234
22235                         if test "$cf_fix_cppflags" = yes ; then
22236
22237         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22238         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22239
22240                                 continue
22241                         elif test "${cf_tst_cflags}" = "\"'" ; then
22242
22243         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22244         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22245
22246                                 continue
22247                         fi
22248                         ;;
22249                 esac
22250                 case "$CPPFLAGS" in
22251                 (*$cf_add_cflags)
22252                         ;;
22253                 (*)
22254                         case "$cf_add_cflags" in
22255                         (-D*)
22256                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22257
22258 CPPFLAGS=`echo "$CPPFLAGS" | \
22259         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22260                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22261
22262                                 ;;
22263                         esac
22264
22265         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22266         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22267
22268                         ;;
22269                 esac
22270                 ;;
22271         (*)
22272
22273         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22274         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22275
22276                 ;;
22277         esac
22278         ;;
22279 (yes)
22280
22281         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22282         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22283
22284         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22285
22286         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22287                 && test -z "${cf_tst_cflags}" \
22288                 && cf_fix_cppflags=no
22289         ;;
22290 esac
22291 done
22292
22293 if test -n "$cf_new_cflags" ; then
22294
22295         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22296         CFLAGS="${CFLAGS}$cf_new_cflags"
22297
22298 fi
22299
22300 if test -n "$cf_new_cppflags" ; then
22301
22302         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22303         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22304
22305 fi
22306
22307 if test -n "$cf_new_extra_cppflags" ; then
22308
22309         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22310         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22311
22312 fi
22313
22314                 ;;
22315         esac
22316         ;;
22317 esac
22318
22319 if test "$with_dbmalloc" = yes ; then
22320         echo "$as_me:22320: checking for dbmalloc.h" >&5
22321 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22322 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22323   echo $ECHO_N "(cached) $ECHO_C" >&6
22324 else
22325   cat >"conftest.$ac_ext" <<_ACEOF
22326 #line 22326 "configure"
22327 #include "confdefs.h"
22328 #include <dbmalloc.h>
22329 _ACEOF
22330 if { (eval echo "$as_me:22330: \"$ac_cpp "conftest.$ac_ext"\"") >&5
22331   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
22332   ac_status=$?
22333   $EGREP -v '^ *\+' conftest.er1 >conftest.err
22334   rm -f conftest.er1
22335   cat conftest.err >&5
22336   echo "$as_me:22336: \$? = $ac_status" >&5
22337   (exit "$ac_status"); } >/dev/null; then
22338   if test -s conftest.err; then
22339     ac_cpp_err=$ac_c_preproc_warn_flag
22340   else
22341     ac_cpp_err=
22342   fi
22343 else
22344   ac_cpp_err=yes
22345 fi
22346 if test -z "$ac_cpp_err"; then
22347   ac_cv_header_dbmalloc_h=yes
22348 else
22349   echo "$as_me: failed program was:" >&5
22350   cat "conftest.$ac_ext" >&5
22351   ac_cv_header_dbmalloc_h=no
22352 fi
22353 rm -f conftest.err "conftest.$ac_ext"
22354 fi
22355 echo "$as_me:22355: result: $ac_cv_header_dbmalloc_h" >&5
22356 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22357 if test "$ac_cv_header_dbmalloc_h" = yes; then
22358
22359 echo "$as_me:22359: checking for debug_malloc in -ldbmalloc" >&5
22360 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22361 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22362   echo $ECHO_N "(cached) $ECHO_C" >&6
22363 else
22364   ac_check_lib_save_LIBS=$LIBS
22365 LIBS="-ldbmalloc  $LIBS"
22366 cat >"conftest.$ac_ext" <<_ACEOF
22367 #line 22367 "configure"
22368 #include "confdefs.h"
22369
22370 /* Override any gcc2 internal prototype to avoid an error.  */
22371 #ifdef __cplusplus
22372 extern "C"
22373 #endif
22374 /* We use char because int might match the return type of a gcc2
22375    builtin and then its argument prototype would still apply.  */
22376 char debug_malloc ();
22377 int
22378 main (void)
22379 {
22380 debug_malloc ();
22381   ;
22382   return 0;
22383 }
22384 _ACEOF
22385 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22386 if { (eval echo "$as_me:22386: \"$ac_link\"") >&5
22387   (eval $ac_link) 2>&5
22388   ac_status=$?
22389   echo "$as_me:22389: \$? = $ac_status" >&5
22390   (exit "$ac_status"); } &&
22391          { ac_try='test -s "conftest$ac_exeext"'
22392   { (eval echo "$as_me:22392: \"$ac_try\"") >&5
22393   (eval $ac_try) 2>&5
22394   ac_status=$?
22395   echo "$as_me:22395: \$? = $ac_status" >&5
22396   (exit "$ac_status"); }; }; then
22397   ac_cv_lib_dbmalloc_debug_malloc=yes
22398 else
22399   echo "$as_me: failed program was:" >&5
22400 cat "conftest.$ac_ext" >&5
22401 ac_cv_lib_dbmalloc_debug_malloc=no
22402 fi
22403 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22404 LIBS=$ac_check_lib_save_LIBS
22405 fi
22406 echo "$as_me:22406: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22407 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22408 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then
22409   cat >>confdefs.h <<EOF
22410 #define HAVE_LIBDBMALLOC 1
22411 EOF
22412
22413   LIBS="-ldbmalloc $LIBS"
22414
22415 fi
22416
22417 fi
22418
22419 fi
22420
22421 echo "$as_me:22421: checking if you want to use valgrind for testing" >&5
22422 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22423
22424 # Check whether --with-valgrind or --without-valgrind was given.
22425 if test "${with_valgrind+set}" = set; then
22426   withval="$with_valgrind"
22427
22428 cat >>confdefs.h <<EOF
22429 #define USE_VALGRIND 1
22430 EOF
22431
22432         : "${with_cflags:=-g}"
22433         : "${enable_leaks:=no}"
22434          with_valgrind=yes
22435 else
22436   with_valgrind=
22437 fi;
22438 echo "$as_me:22438: result: ${with_valgrind:-no}" >&5
22439 echo "${ECHO_T}${with_valgrind:-no}" >&6
22440
22441 case ".$with_cflags" in
22442 (.*-g*)
22443         case .$CFLAGS in
22444         (.*-g*)
22445                 ;;
22446         (*)
22447
22448 cf_fix_cppflags=no
22449 cf_new_cflags=
22450 cf_new_cppflags=
22451 cf_new_extra_cppflags=
22452
22453 for cf_add_cflags in -g
22454 do
22455 case "$cf_fix_cppflags" in
22456 (no)
22457         case "$cf_add_cflags" in
22458         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22459                 case "$cf_add_cflags" in
22460                 (-D*)
22461                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22462
22463                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22464                                 && test -z "${cf_tst_cflags}" \
22465                                 && cf_fix_cppflags=yes
22466
22467                         if test "$cf_fix_cppflags" = yes ; then
22468
22469         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22470         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22471
22472                                 continue
22473                         elif test "${cf_tst_cflags}" = "\"'" ; then
22474
22475         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22476         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22477
22478                                 continue
22479                         fi
22480                         ;;
22481                 esac
22482                 case "$CPPFLAGS" in
22483                 (*$cf_add_cflags)
22484                         ;;
22485                 (*)
22486                         case "$cf_add_cflags" in
22487                         (-D*)
22488                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22489
22490 CPPFLAGS=`echo "$CPPFLAGS" | \
22491         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22492                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22493
22494                                 ;;
22495                         esac
22496
22497         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22498         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22499
22500                         ;;
22501                 esac
22502                 ;;
22503         (*)
22504
22505         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22506         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22507
22508                 ;;
22509         esac
22510         ;;
22511 (yes)
22512
22513         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22514         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22515
22516         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
22517
22518         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22519                 && test -z "${cf_tst_cflags}" \
22520                 && cf_fix_cppflags=no
22521         ;;
22522 esac
22523 done
22524
22525 if test -n "$cf_new_cflags" ; then
22526
22527         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22528         CFLAGS="${CFLAGS}$cf_new_cflags"
22529
22530 fi
22531
22532 if test -n "$cf_new_cppflags" ; then
22533
22534         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22535         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22536
22537 fi
22538
22539 if test -n "$cf_new_extra_cppflags" ; then
22540
22541         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22542         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22543
22544 fi
22545
22546                 ;;
22547         esac
22548         ;;
22549 esac
22550
22551 echo "$as_me:22551: checking if you want to perform memory-leak testing" >&5
22552 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22553
22554 # Check whether --enable-leaks or --disable-leaks was given.
22555 if test "${enable_leaks+set}" = set; then
22556   enableval="$enable_leaks"
22557   enable_leaks=$enableval
22558 else
22559   enable_leaks=yes
22560 fi;
22561 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22562 echo "$as_me:22562: result: $with_no_leaks" >&5
22563 echo "${ECHO_T}$with_no_leaks" >&6
22564
22565 if test "$enable_leaks" = no ; then
22566
22567 cat >>confdefs.h <<\EOF
22568 #define NO_LEAKS 1
22569 EOF
22570
22571 cat >>confdefs.h <<\EOF
22572 #define YY_NO_LEAKS 1
22573 EOF
22574
22575 fi
22576
22577 LD_RPATH_OPT=
22578 if test "x$cf_cv_enable_rpath" != xno
22579 then
22580         echo "$as_me:22580: checking for an rpath option" >&5
22581 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22582         case "$cf_cv_system_name" in
22583         (irix*)
22584                 if test "$GCC" = yes; then
22585                         LD_RPATH_OPT="-Wl,-rpath,"
22586                 else
22587                         LD_RPATH_OPT="-rpath "
22588                 fi
22589                 ;;
22590         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22591                 LD_RPATH_OPT="-Wl,-rpath,"
22592                 ;;
22593         (openbsd[2-9].*|mirbsd*)
22594                 LD_RPATH_OPT="-Wl,-rpath,"
22595                 ;;
22596         (dragonfly*)
22597                 LD_RPATH_OPT="-rpath "
22598                 ;;
22599         (netbsd*)
22600                 LD_RPATH_OPT="-Wl,-rpath,"
22601                 ;;
22602         (osf*|mls+*)
22603                 LD_RPATH_OPT="-rpath "
22604                 ;;
22605         (solaris2*)
22606                 LD_RPATH_OPT="-R"
22607                 ;;
22608         (*)
22609                 ;;
22610         esac
22611         echo "$as_me:22611: result: $LD_RPATH_OPT" >&5
22612 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22613
22614         case "x$LD_RPATH_OPT" in
22615         (x-R*)
22616                 echo "$as_me:22616: checking if we need a space after rpath option" >&5
22617 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22618                 cf_save_LIBS="$LIBS"
22619
22620 cf_add_libs="$LIBS"
22621 # reverse order
22622 cf_add_0lib=
22623 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22624 # filter duplicates
22625 for cf_add_1lib in $cf_add_0lib; do
22626         for cf_add_2lib in $cf_add_libs; do
22627                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22628                         cf_add_1lib=
22629                         break
22630                 fi
22631         done
22632         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22633 done
22634 LIBS="$cf_add_libs"
22635
22636                 cat >"conftest.$ac_ext" <<_ACEOF
22637 #line 22637 "configure"
22638 #include "confdefs.h"
22639
22640 int
22641 main (void)
22642 {
22643
22644   ;
22645   return 0;
22646 }
22647 _ACEOF
22648 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22649 if { (eval echo "$as_me:22649: \"$ac_link\"") >&5
22650   (eval $ac_link) 2>&5
22651   ac_status=$?
22652   echo "$as_me:22652: \$? = $ac_status" >&5
22653   (exit "$ac_status"); } &&
22654          { ac_try='test -s "conftest$ac_exeext"'
22655   { (eval echo "$as_me:22655: \"$ac_try\"") >&5
22656   (eval $ac_try) 2>&5
22657   ac_status=$?
22658   echo "$as_me:22658: \$? = $ac_status" >&5
22659   (exit "$ac_status"); }; }; then
22660   cf_rpath_space=no
22661 else
22662   echo "$as_me: failed program was:" >&5
22663 cat "conftest.$ac_ext" >&5
22664 cf_rpath_space=yes
22665 fi
22666 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22667                 LIBS="$cf_save_LIBS"
22668                 echo "$as_me:22668: result: $cf_rpath_space" >&5
22669 echo "${ECHO_T}$cf_rpath_space" >&6
22670                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22671                 ;;
22672         esac
22673 fi
22674
22675 echo "$as_me:22675: checking if rpath-hack should be disabled" >&5
22676 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22677
22678 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22679 if test "${enable_rpath_hack+set}" = set; then
22680   enableval="$enable_rpath_hack"
22681   test "$enableval" != no && enableval=yes
22682         if test "$enableval" != "yes" ; then
22683     enable_rpath_hack=no
22684         else
22685                 enable_rpath_hack=yes
22686         fi
22687 else
22688   enableval=yes
22689         enable_rpath_hack=yes
22690
22691 fi;
22692 if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi
22693 echo "$as_me:22693: result: $cf_disable_rpath_hack" >&5
22694 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22695
22696 if test "$enable_rpath_hack" = yes ; then
22697
22698 echo "$as_me:22698: checking for updated LDFLAGS" >&5
22699 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22700 if test -n "$LD_RPATH_OPT" ; then
22701         echo "$as_me:22701: result: maybe" >&5
22702 echo "${ECHO_T}maybe" >&6
22703
22704         for ac_prog in ldd
22705 do
22706   # Extract the first word of "$ac_prog", so it can be a program name with args.
22707 set dummy $ac_prog; ac_word=$2
22708 echo "$as_me:22708: checking for $ac_word" >&5
22709 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22710 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22711   echo $ECHO_N "(cached) $ECHO_C" >&6
22712 else
22713   if test -n "$cf_ldd_prog"; then
22714   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22715 else
22716   ac_save_IFS=$IFS; IFS=$ac_path_separator
22717 ac_dummy="$PATH"
22718 for ac_dir in $ac_dummy; do
22719   IFS=$ac_save_IFS
22720   test -z "$ac_dir" && ac_dir=.
22721   $as_executable_p "$ac_dir/$ac_word" || continue
22722 ac_cv_prog_cf_ldd_prog="$ac_prog"
22723 echo "$as_me:22723: found $ac_dir/$ac_word" >&5
22724 break
22725 done
22726
22727 fi
22728 fi
22729 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22730 if test -n "$cf_ldd_prog"; then
22731   echo "$as_me:22731: result: $cf_ldd_prog" >&5
22732 echo "${ECHO_T}$cf_ldd_prog" >&6
22733 else
22734   echo "$as_me:22734: result: no" >&5
22735 echo "${ECHO_T}no" >&6
22736 fi
22737
22738   test -n "$cf_ldd_prog" && break
22739 done
22740 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22741
22742         cf_rpath_list="/usr/lib /lib"
22743         if test "$cf_ldd_prog" != no
22744         then
22745                 cf_rpath_oops=
22746
22747 cat >"conftest.$ac_ext" <<_ACEOF
22748 #line 22748 "configure"
22749 #include "confdefs.h"
22750 #include <stdio.h>
22751 int
22752 main (void)
22753 {
22754 printf("Hello");
22755   ;
22756   return 0;
22757 }
22758 _ACEOF
22759 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
22760 if { (eval echo "$as_me:22760: \"$ac_link\"") >&5
22761   (eval $ac_link) 2>&5
22762   ac_status=$?
22763   echo "$as_me:22763: \$? = $ac_status" >&5
22764   (exit "$ac_status"); } &&
22765          { ac_try='test -s "conftest$ac_exeext"'
22766   { (eval echo "$as_me:22766: \"$ac_try\"") >&5
22767   (eval $ac_try) 2>&5
22768   ac_status=$?
22769   echo "$as_me:22769: \$? = $ac_status" >&5
22770   (exit "$ac_status"); }; }; then
22771   cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22772                  cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[         ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22773 else
22774   echo "$as_me: failed program was:" >&5
22775 cat "conftest.$ac_ext" >&5
22776 fi
22777 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
22778
22779                 # If we passed the link-test, but get a "not found" on a given library,
22780                 # this could be due to inept reconfiguration of gcc to make it only
22781                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22782                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22783                 # /usr/local libraries.
22784                 if test -n "$cf_rpath_oops"
22785                 then
22786                         for cf_rpath_src in $cf_rpath_oops
22787                         do
22788                                 for cf_rpath_dir in \
22789                                         /usr/local \
22790                                         /usr/pkg \
22791                                         /opt/sfw
22792                                 do
22793                                         if test -f "$cf_rpath_dir/lib/$cf_rpath_src"
22794                                         then
22795                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22796
22797 echo "${as_me:-configure}:22797: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22798
22799                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22800                                                 break
22801                                         fi
22802                                 done
22803                         done
22804                 fi
22805         fi
22806
22807         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22808
22809 echo "${as_me:-configure}:22809: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22810
22811 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22812
22813 echo "${as_me:-configure}:22813: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22814
22815 cf_rpath_dst=
22816 for cf_rpath_src in $LDFLAGS
22817 do
22818         case "$cf_rpath_src" in
22819         (-L*)
22820
22821                 # check if this refers to a directory which we will ignore
22822                 cf_rpath_skip=no
22823                 if test -n "$cf_rpath_list"
22824                 then
22825                         for cf_rpath_item in $cf_rpath_list
22826                         do
22827                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22828                                 then
22829                                         cf_rpath_skip=yes
22830                                         break
22831                                 fi
22832                         done
22833                 fi
22834
22835                 if test "$cf_rpath_skip" = no
22836                 then
22837                         # transform the option
22838                         if test "$LD_RPATH_OPT" = "-R " ; then
22839                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22840                         else
22841                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22842                         fi
22843
22844                         # if we have not already added this, add it now
22845                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22846                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22847                         then
22848                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22849
22850 echo "${as_me:-configure}:22850: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22851
22852                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22853                         fi
22854                 fi
22855                 ;;
22856         esac
22857         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22858 done
22859 LDFLAGS=$cf_rpath_dst
22860
22861 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22862
22863 echo "${as_me:-configure}:22863: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22864
22865 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22866
22867 echo "${as_me:-configure}:22867: testing ...checking LIBS $LIBS ..." 1>&5
22868
22869 cf_rpath_dst=
22870 for cf_rpath_src in $LIBS
22871 do
22872         case "$cf_rpath_src" in
22873         (-L*)
22874
22875                 # check if this refers to a directory which we will ignore
22876                 cf_rpath_skip=no
22877                 if test -n "$cf_rpath_list"
22878                 then
22879                         for cf_rpath_item in $cf_rpath_list
22880                         do
22881                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22882                                 then
22883                                         cf_rpath_skip=yes
22884                                         break
22885                                 fi
22886                         done
22887                 fi
22888
22889                 if test "$cf_rpath_skip" = no
22890                 then
22891                         # transform the option
22892                         if test "$LD_RPATH_OPT" = "-R " ; then
22893                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22894                         else
22895                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22896                         fi
22897
22898                         # if we have not already added this, add it now
22899                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22900                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22901                         then
22902                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22903
22904 echo "${as_me:-configure}:22904: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22905
22906                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22907                         fi
22908                 fi
22909                 ;;
22910         esac
22911         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22912 done
22913 LIBS=$cf_rpath_dst
22914
22915 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22916
22917 echo "${as_me:-configure}:22917: testing ...checked LIBS $LIBS ..." 1>&5
22918
22919         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22920
22921 echo "${as_me:-configure}:22921: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22922
22923 else
22924         echo "$as_me:22924: result: no" >&5
22925 echo "${ECHO_T}no" >&6
22926 fi
22927
22928 fi
22929
22930 TEST_ARGS="$LIBS"
22931 LIBS=
22932
22933 ac_config_files="$ac_config_files Makefile"
22934 ac_config_commands="$ac_config_commands default"
22935 cat >confcache <<\_ACEOF
22936 # This file is a shell script that caches the results of configure
22937 # tests run on this system so they can be shared between configure
22938 # scripts and configure runs, see configure's option --config-cache.
22939 # It is not useful on other systems.  If it contains results you don't
22940 # want to keep, you may remove or edit it.
22941 #
22942 # config.status only pays attention to the cache file if you give it
22943 # the --recheck option to rerun configure.
22944 #
22945 # `ac_cv_env_foo' variables (set or unset) will be overriden when
22946 # loading this file, other *unset* `ac_cv_foo' will be assigned the
22947 # following values.
22948
22949 _ACEOF
22950
22951 # The following way of writing the cache mishandles newlines in values,
22952 # but we know of no workaround that is simple, portable, and efficient.
22953 # So, don't put newlines in cache variables' values.
22954 # Ultrix sh set writes to stderr and can't be redirected directly,
22955 # and sets the high bit in the cache file unless we assign to the vars.
22956 {
22957   (set) 2>&1 |
22958     case `(ac_space=' '; set | grep ac_space) 2>&1` in
22959     *ac_space=\ *)
22960       # `set' does not quote correctly, so add quotes (double-quote
22961       # substitution turns \\\\ into \\, and sed turns \\ into \).
22962       sed -n \
22963         "s/'/'\\\\''/g;
22964           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
22965       ;;
22966     *)
22967       # `set' quotes correctly as required by POSIX, so do not add quotes.
22968       sed -n \
22969         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
22970       ;;
22971     esac;
22972 } |
22973   sed '
22974      t clear
22975      : clear
22976      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
22977      t end
22978      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
22979      : end' >>confcache
22980 if cmp -s $cache_file confcache; then :; else
22981   if test -w $cache_file; then
22982     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
22983     cat confcache >$cache_file
22984   else
22985     echo "not updating unwritable cache $cache_file"
22986   fi
22987 fi
22988 rm -f confcache
22989
22990 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22991 # Let make expand exec_prefix.
22992 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22993
22994 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22995 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22996 # trailing colons and then remove the whole line if VPATH becomes empty
22997 # (actually we leave an empty line to preserve line numbers).
22998 if test "x$srcdir" = x.; then
22999   ac_vpsub='/^[         ]*VPATH[        ]*=/{
23000 s/:*\$(srcdir):*/:/;
23001 s/:*\${srcdir}:*/:/;
23002 s/:*@srcdir@:*/:/;
23003 s/^\([^=]*=[    ]*\):*/\1/;
23004 s/:*$//;
23005 s/^[^=]*=[      ]*$//;
23006 }'
23007 fi
23008
23009 DEFS=-DHAVE_CONFIG_H
23010
23011 : "${CONFIG_STATUS=./config.status}"
23012 ac_clean_files_save=$ac_clean_files
23013 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
23014 { echo "$as_me:23014: creating $CONFIG_STATUS" >&5
23015 echo "$as_me: creating $CONFIG_STATUS" >&6;}
23016 cat >"$CONFIG_STATUS" <<_ACEOF
23017 #! $SHELL
23018 # Generated automatically by configure.
23019 # Run this file to recreate the current configuration.
23020 # Compiler output produced by configure, useful for debugging
23021 # configure, is in config.log if it exists.
23022
23023 debug=false
23024 SHELL=\${CONFIG_SHELL-$SHELL}
23025 ac_cs_invocation="\$0 \$@"
23026
23027 CLICOLOR_FORCE= GREP_OPTIONS=
23028 unset CLICOLOR_FORCE GREP_OPTIONS
23029 _ACEOF
23030
23031 cat >>"$CONFIG_STATUS" <<\_ACEOF
23032 # Be Bourne compatible
23033 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
23034   emulate sh
23035   NULLCMD=:
23036 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
23037   set -o posix
23038 fi
23039
23040 # Name of the executable.
23041 as_me=`echo "$0" |sed 's,.*[\\/],,'`
23042
23043 if expr a : '\(a\)' >/dev/null 2>&1; then
23044   as_expr=expr
23045 else
23046   as_expr=false
23047 fi
23048
23049 rm -f conf$$ conf$$.exe conf$$.file
23050 echo >conf$$.file
23051 if ln -s conf$$.file conf$$ 2>/dev/null; then
23052   # We could just check for DJGPP; but this test a) works b) is more generic
23053   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
23054   if test -f conf$$.exe; then
23055     # Don't use ln at all; we don't have any links
23056     as_ln_s='cp -p'
23057   else
23058     as_ln_s='ln -s'
23059   fi
23060 elif ln conf$$.file conf$$ 2>/dev/null; then
23061   as_ln_s=ln
23062 else
23063   as_ln_s='cp -p'
23064 fi
23065 rm -f conf$$ conf$$.exe conf$$.file
23066
23067 as_executable_p="test -f"
23068
23069 # Support unset when possible.
23070 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
23071   as_unset="unset"
23072 else
23073   as_unset="false"
23074 fi
23075
23076 # NLS nuisances.
23077 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
23078 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
23079 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
23080 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
23081 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
23082 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
23083 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
23084 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
23085
23086 # IFS
23087 # We need space, tab and new line, in precisely that order.
23088 as_nl='
23089 '
23090 IFS="   $as_nl"
23091
23092 # CDPATH.
23093 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
23094
23095 exec 6>&1
23096
23097 _ACEOF
23098
23099 # Files that config.status was made for.
23100 if test -n "$ac_config_files"; then
23101   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
23102 fi
23103
23104 if test -n "$ac_config_headers"; then
23105   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
23106 fi
23107
23108 if test -n "$ac_config_links"; then
23109   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
23110 fi
23111
23112 if test -n "$ac_config_commands"; then
23113   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
23114 fi
23115
23116 cat >>"$CONFIG_STATUS" <<\EOF
23117
23118 ac_cs_usage="\
23119 \`$as_me' instantiates files from templates according to the
23120 current configuration.
23121
23122 Usage: $0 [OPTIONS] [FILE]...
23123
23124   -h, --help       print this help, then exit
23125   -V, --version    print version number, then exit
23126   -d, --debug      don't remove temporary files
23127       --recheck    update $as_me by reconfiguring in the same conditions
23128   --file=FILE[:TEMPLATE]
23129                    instantiate the configuration file FILE
23130   --header=FILE[:TEMPLATE]
23131                    instantiate the configuration header FILE
23132
23133 Configuration files:
23134 $config_files
23135
23136 Configuration headers:
23137 $config_headers
23138
23139 Configuration commands:
23140 $config_commands
23141
23142 Report bugs to <dickey@invisible-island.net>."
23143 EOF
23144
23145 cat >>"$CONFIG_STATUS" <<EOF
23146 ac_cs_version="\\
23147 config.status
23148 configured by $0, generated by GNU Autoconf 2.52.20210105,
23149   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
23150
23151 Copyright 2003-2020,2021        Thomas E. Dickey
23152 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
23153 Free Software Foundation, Inc.
23154 This config.status script is free software; the Free Software Foundation
23155 gives unlimited permission to copy, distribute and modify it."
23156 srcdir="$srcdir"
23157 INSTALL="$INSTALL"
23158 EOF
23159
23160 cat >>"$CONFIG_STATUS" <<\EOF
23161 # If no file are specified by the user, then we need to provide default
23162 # value.  By we need to know if files were specified by the user.
23163 ac_need_defaults=:
23164 while test $# != 0
23165 do
23166   case $1 in
23167   --*=*)
23168     ac_option=`expr "x$1" : 'x\([^=]*\)='`
23169     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
23170     shift
23171     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
23172     shift
23173     ;;
23174   -*);;
23175   *) # This is not an option, so the user has probably given explicit
23176      # arguments.
23177      ac_need_defaults=false;;
23178   esac
23179
23180   case $1 in
23181   # Handling of the options.
23182 EOF
23183 cat >>"$CONFIG_STATUS" <<EOF
23184   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
23185     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
23186     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
23187 EOF
23188 cat >>"$CONFIG_STATUS" <<\EOF
23189   --version | --vers* | -V )
23190     echo "$ac_cs_version"; exit 0 ;;
23191   --he | --h)
23192     # Conflict between --help and --header
23193     { { echo "$as_me:23193: error: ambiguous option: $1
23194 Try \`$0 --help' for more information." >&5
23195 echo "$as_me: error: ambiguous option: $1
23196 Try \`$0 --help' for more information." >&2;}
23197    { (exit 1); exit 1; }; };;
23198   --help | --hel | -h )
23199     echo "$ac_cs_usage"; exit 0 ;;
23200   --debug | --d* | -d )
23201     debug=: ;;
23202   --file | --fil | --fi | --f )
23203     shift
23204     CONFIG_FILES="$CONFIG_FILES $1"
23205     ac_need_defaults=false;;
23206   --header | --heade | --head | --hea )
23207     shift
23208     CONFIG_HEADERS="$CONFIG_HEADERS $1"
23209     ac_need_defaults=false;;
23210
23211   # This is an error.
23212   -*) { { echo "$as_me:23212: error: unrecognized option: $1
23213 Try \`$0 --help' for more information." >&5
23214 echo "$as_me: error: unrecognized option: $1
23215 Try \`$0 --help' for more information." >&2;}
23216    { (exit 1); exit 1; }; } ;;
23217
23218   *) ac_config_targets="$ac_config_targets $1" ;;
23219
23220   esac
23221   shift
23222 done
23223
23224 exec 5>>config.log
23225 cat >&5 << _ACEOF
23226
23227 ## ----------------------- ##
23228 ## Running config.status.  ##
23229 ## ----------------------- ##
23230
23231 This file was extended by $as_me 2.52.20210105, executed with
23232   CONFIG_FILES    = $CONFIG_FILES
23233   CONFIG_HEADERS  = $CONFIG_HEADERS
23234   CONFIG_LINKS    = $CONFIG_LINKS
23235   CONFIG_COMMANDS = $CONFIG_COMMANDS
23236   > "$ac_cs_invocation"
23237 on `(hostname || uname -n) 2>/dev/null | sed 1q`
23238
23239 _ACEOF
23240 EOF
23241
23242 cat >>"$CONFIG_STATUS" <<EOF
23243 #
23244 # INIT-COMMANDS section.
23245 #
23246
23247 AWK="$AWK"
23248 ECHO_CC="$ECHO_CC"
23249 ECHO_LD="$ECHO_LD"
23250 SHOW_CC="$SHOW_LD"
23251
23252 EOF
23253
23254 cat >>"$CONFIG_STATUS" <<\EOF
23255 for ac_config_target in $ac_config_targets
23256 do
23257   case "$ac_config_target" in
23258   # Handling of arguments.
23259   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
23260   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
23261   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
23262   *) { { echo "$as_me:23262: error: invalid argument: $ac_config_target" >&5
23263 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
23264    { (exit 1); exit 1; }; };;
23265   esac
23266 done
23267
23268 # If the user did not use the arguments to specify the items to instantiate,
23269 # then the envvar interface is used.  Set only those that are not.
23270 # We use the long form for the default assignment because of an extremely
23271 # bizarre bug on SunOS 4.1.3.
23272 if "$ac_need_defaults"; then
23273   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
23274   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
23275   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
23276 fi
23277
23278 # Create a temporary directory, and hook for its removal unless debugging.
23279 $debug ||
23280 {
23281   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
23282   trap '{ (exit 1); exit 1; }' 1 2 13 15
23283 }
23284
23285 # Create a (secure) tmp directory for tmp files.
23286 : ${TMPDIR=/tmp}
23287 {
23288   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23289   test -n "$tmp" && test -d "$tmp"
23290 }  ||
23291 {
23292   tmp=$TMPDIR/cs$$-$RANDOM
23293   (umask 077 && mkdir $tmp)
23294 } ||
23295 {
23296    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23297    { (exit 1); exit 1; }
23298 }
23299
23300 EOF
23301
23302 cat >>"$CONFIG_STATUS" <<EOF
23303
23304 #
23305 # CONFIG_FILES section.
23306 #
23307
23308 # No need to generate the scripts if there are no CONFIG_FILES.
23309 # This happens for instance when ./config.status config.h
23310 if test -n "\$CONFIG_FILES"; then
23311   # Protect against being on the right side of a sed subst in config.status.
23312   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23313    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23314 s,@SHELL@,$SHELL,;t t
23315 s,@exec_prefix@,$exec_prefix,;t t
23316 s,@prefix@,$prefix,;t t
23317 s,@program_transform_name@,$program_transform_name,;t t
23318 s,@bindir@,$bindir,;t t
23319 s,@sbindir@,$sbindir,;t t
23320 s,@libexecdir@,$libexecdir,;t t
23321 s,@datarootdir@,$datarootdir,;t t
23322 s,@datadir@,$datadir,;t t
23323 s,@sysconfdir@,$sysconfdir,;t t
23324 s,@sharedstatedir@,$sharedstatedir,;t t
23325 s,@localstatedir@,$localstatedir,;t t
23326 s,@runstatedir@,$runstatedir,;t t
23327 s,@libdir@,$libdir,;t t
23328 s,@includedir@,$includedir,;t t
23329 s,@oldincludedir@,$oldincludedir,;t t
23330 s,@infodir@,$infodir,;t t
23331 s,@mandir@,$mandir,;t t
23332 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23333 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23334 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23335 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23336 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23337 s,@build_alias@,$build_alias,;t t
23338 s,@host_alias@,$host_alias,;t t
23339 s,@target_alias@,$target_alias,;t t
23340 s,@ECHO_C@,$ECHO_C,;t t
23341 s,@ECHO_N@,$ECHO_N,;t t
23342 s,@ECHO_T@,$ECHO_T,;t t
23343 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23344 s,@DEFS@,$DEFS,;t t
23345 s,@LIBS@,$LIBS,;t t
23346 s,@build@,$build,;t t
23347 s,@build_cpu@,$build_cpu,;t t
23348 s,@build_vendor@,$build_vendor,;t t
23349 s,@build_os@,$build_os,;t t
23350 s,@host@,$host,;t t
23351 s,@host_cpu@,$host_cpu,;t t
23352 s,@host_vendor@,$host_vendor,;t t
23353 s,@host_os@,$host_os,;t t
23354 s,@SET_MAKE@,$SET_MAKE,;t t
23355 s,@CC@,$CC,;t t
23356 s,@CFLAGS@,$CFLAGS,;t t
23357 s,@LDFLAGS@,$LDFLAGS,;t t
23358 s,@CPPFLAGS@,$CPPFLAGS,;t t
23359 s,@ac_ct_CC@,$ac_ct_CC,;t t
23360 s,@EXEEXT@,$EXEEXT,;t t
23361 s,@OBJEXT@,$OBJEXT,;t t
23362 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23363 s,@CPP@,$CPP,;t t
23364 s,@GREP@,$GREP,;t t
23365 s,@EGREP@,$EGREP,;t t
23366 s,@AWK@,$AWK,;t t
23367 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23368 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23369 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23370 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23371 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23372 s,@LINT@,$LINT,;t t
23373 s,@LINT_OPTS@,$LINT_OPTS,;t t
23374 s,@CTAGS@,$CTAGS,;t t
23375 s,@ETAGS@,$ETAGS,;t t
23376 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23377 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23378 s,@MATH_LIB@,$MATH_LIB,;t t
23379 s,@top_builddir@,$top_builddir,;t t
23380 s,@CC_G_OPT@,$CC_G_OPT,;t t
23381 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23382 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23383 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23384 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23385 s,@LD@,$LD,;t t
23386 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23387 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23388 s,@LD_MODEL@,$LD_MODEL,;t t
23389 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23390 s,@LIBTOOL@,$LIBTOOL,;t t
23391 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23392 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23393 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23394 s,@LIB_LINK@,$LIB_LINK,;t t
23395 s,@LINK_TESTS@,$LINK_TESTS,;t t
23396 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23397 s,@PACKAGE@,$PACKAGE,;t t
23398 s,@PTHREAD@,$PTHREAD,;t t
23399 s,@TEST_ARGS@,$TEST_ARGS,;t t
23400 s,@TEST_DEPS@,$TEST_DEPS,;t t
23401 s,@TEST_LIBS@,$TEST_LIBS,;t t
23402 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23403 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23404 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23405 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23406 s,@includesubdir@,$includesubdir,;t t
23407 s,@FGREP@,$FGREP,;t t
23408 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
23409 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
23410 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23411 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23412 s,@ECHO_LT@,$ECHO_LT,;t t
23413 s,@ECHO_LD@,$ECHO_LD,;t t
23414 s,@RULE_CC@,$RULE_CC,;t t
23415 s,@SHOW_CC@,$SHOW_CC,;t t
23416 s,@ECHO_CC@,$ECHO_CC,;t t
23417 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23418 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23419 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23420 s,@X_CFLAGS@,$X_CFLAGS,;t t
23421 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23422 s,@X_LIBS@,$X_LIBS,;t t
23423 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23424 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23425 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23426 s,@RGB_PATH@,$RGB_PATH,;t t
23427 s,@no_x11_rgb@,$no_x11_rgb,;t t
23428 s,@FORM_NAME@,$FORM_NAME,;t t
23429 s,@MENU_NAME@,$MENU_NAME,;t t
23430 s,@PANEL_NAME@,$PANEL_NAME,;t t
23431 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23432 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23433 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23434 CEOF
23435
23436 EOF
23437
23438   cat >>"$CONFIG_STATUS" <<\EOF
23439   # Split the substitutions into bite-sized pieces for seds with
23440   # small command number limits, like on Digital OSF/1 and HP-UX.
23441   ac_max_sed_lines=48
23442   ac_sed_frag=1 # Number of current file.
23443   ac_beg=1 # First line for current file.
23444   ac_end=$ac_max_sed_lines # Line after last line for current file.
23445   ac_more_lines=:
23446   ac_sed_cmds=
23447   while "$ac_more_lines"; do
23448     if test "$ac_beg" -gt 1; then
23449       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23450     else
23451       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23452     fi
23453     if test ! -s $tmp/subs.frag; then
23454       ac_more_lines=false
23455     else
23456       # The purpose of the label and of the branching condition is to
23457       # speed up the sed processing (if there are no `@' at all, there
23458       # is no need to browse any of the substitutions).
23459       # These are the two extra sed commands mentioned above.
23460       (echo ':t
23461   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23462       # It is possible to make a multiline substitution using escaped newlines.
23463       # Ensure that we do not split the substitution between script fragments.
23464       ac_BEG=$ac_end
23465       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
23466       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23467       if test -s $tmp/subs.next; then
23468         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23469         if test ! -s $tmp/subs.edit; then
23470           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23471           if test ! -s $tmp/subs.edit; then
23472             if test "$ac_beg" -gt 1; then
23473               ac_end=`expr "$ac_end" - 1`
23474               continue
23475             fi
23476           fi
23477         fi
23478       fi
23479
23480       if test -z "$ac_sed_cmds"; then
23481         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23482       else
23483         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23484       fi
23485       ac_sed_frag=`expr "$ac_sed_frag" + 1`
23486       ac_beg=$ac_end
23487       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
23488     fi
23489   done
23490   if test -z "$ac_sed_cmds"; then
23491     ac_sed_cmds=cat
23492   fi
23493 fi # test -n "$CONFIG_FILES"
23494
23495 EOF
23496 cat >>"$CONFIG_STATUS" <<\EOF
23497 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23498   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23499   case "$ac_file" in
23500   - | *:- | *:-:* ) # input from stdin
23501         cat >$tmp/stdin
23502         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23503         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23504   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23505         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23506   * )   ac_file_in=$ac_file.in ;;
23507   esac
23508
23509   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23510   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23511          X"$ac_file" : 'X\(//\)[^/]' \| \
23512          X"$ac_file" : 'X\(//\)$' \| \
23513          X"$ac_file" : 'X\(/\)' \| \
23514          .     : '\(.\)' 2>/dev/null ||
23515 echo X"$ac_file" |
23516     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23517           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23518           /^X\(\/\/\)$/{ s//\1/; q; }
23519           /^X\(\/\).*/{ s//\1/; q; }
23520           s/.*/./; q'`
23521   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23522     { case "$ac_dir" in
23523   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23524   *)                      as_incr_dir=.;;
23525 esac
23526 as_dummy="$ac_dir"
23527 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23528   case $as_mkdir_dir in
23529     # Skip DOS drivespec
23530     ?:) as_incr_dir=$as_mkdir_dir ;;
23531     *)
23532       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23533       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23534     ;;
23535   esac
23536 done; }
23537
23538     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23539     # A "../" for each directory in $ac_dir_suffix.
23540     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23541   else
23542     ac_dir_suffix= ac_dots=
23543   fi
23544
23545   case "$srcdir" in
23546   .)  ac_srcdir=.
23547       if test -z "$ac_dots"; then
23548          ac_top_srcdir=.
23549       else
23550          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
23551       fi ;;
23552   [\\/]* | ?:[\\/]* )
23553       ac_srcdir="$srcdir$ac_dir_suffix";
23554       ac_top_srcdir="$srcdir" ;;
23555   *) # Relative path.
23556     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
23557     ac_top_srcdir="$ac_dots$srcdir" ;;
23558   esac
23559
23560   case $INSTALL in
23561   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23562   *) ac_INSTALL=$ac_dots$INSTALL ;;
23563   esac
23564
23565   if test x"$ac_file" != x-; then
23566     { echo "$as_me:23566: creating $ac_file" >&5
23567 echo "$as_me: creating $ac_file" >&6;}
23568     rm -f "$ac_file"
23569   fi
23570   # Let's still pretend it is `configure' which instantiates (i.e., don't
23571   # use $as_me), people would be surprised to read:
23572   #    /* config.h.  Generated automatically by config.status.  */
23573   configure_input="Generated automatically from `echo $ac_file_in |
23574                                                  sed 's,.*/,,'` by configure."
23575
23576   # First look for the input files in the build tree, otherwise in the
23577   # src tree.
23578   ac_file_inputs=`IFS=:
23579     for f in $ac_file_in; do
23580       case $f in
23581       -) echo $tmp/stdin ;;
23582       [\\/$]*)
23583          # Absolute (can't be DOS-style, as IFS=:)
23584          test -f "$f" || { { echo "$as_me:23584: error: cannot find input file: $f" >&5
23585 echo "$as_me: error: cannot find input file: $f" >&2;}
23586    { (exit 1); exit 1; }; }
23587          echo $f;;
23588       *) # Relative
23589          if test -f "$f"; then
23590            # Build tree
23591            echo $f
23592          elif test -f "$srcdir/$f"; then
23593            # Source tree
23594            echo "$srcdir/$f"
23595          else
23596            # /dev/null tree
23597            { { echo "$as_me:23597: error: cannot find input file: $f" >&5
23598 echo "$as_me: error: cannot find input file: $f" >&2;}
23599    { (exit 1); exit 1; }; }
23600          fi;;
23601       esac
23602     done` || { (exit 1); exit 1; }
23603 EOF
23604 cat >>"$CONFIG_STATUS" <<\EOF
23605   ac_warn_datarootdir=no
23606   if test x"$ac_file" != x-; then
23607     for ac_item in $ac_file_inputs
23608     do
23609       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
23610       if test -n "$ac_seen"; then
23611         ac_used=`grep '@datarootdir@' "$ac_item"`
23612         if test -z "$ac_used"; then
23613           { echo "$as_me:23613: WARNING: datarootdir was used implicitly but not set:
23614 $ac_seen" >&5
23615 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23616 $ac_seen" >&2;}
23617           ac_warn_datarootdir=yes
23618         fi
23619       fi
23620       ac_seen=`grep '${datarootdir}' "$ac_item"`
23621       if test -n "$ac_seen"; then
23622         { echo "$as_me:23622: WARNING: datarootdir was used explicitly but not set:
23623 $ac_seen" >&5
23624 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23625 $ac_seen" >&2;}
23626         ac_warn_datarootdir=yes
23627       fi
23628     done
23629   fi
23630
23631 if test "x$ac_warn_datarootdir" = xyes; then
23632   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23633 fi
23634
23635 EOF
23636 cat >>"$CONFIG_STATUS" <<EOF
23637   sed "$ac_vpsub
23638 $extrasub
23639 EOF
23640 cat >>"$CONFIG_STATUS" <<\EOF
23641 :t
23642 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23643 s,@configure_input@,$configure_input,;t t
23644 s,@srcdir@,$ac_srcdir,;t t
23645 s,@top_srcdir@,$ac_top_srcdir,;t t
23646 s,@INSTALL@,$ac_INSTALL,;t t
23647 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23648   rm -f $tmp/stdin
23649   if test x"$ac_file" != x-; then
23650     cp "$tmp/out" "$ac_file"
23651
23652     for ac_name in prefix exec_prefix datarootdir
23653     do
23654         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
23655         if test -n "$ac_seen"; then
23656             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
23657             if test -z "$ac_init"; then
23658               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23659               { echo "$as_me:23659: WARNING: Variable $ac_name is used but was not set:
23660 $ac_seen" >&5
23661 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23662 $ac_seen" >&2;}
23663             fi
23664         fi
23665     done
23666     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
23667     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
23668     if test -s $tmp/out; then
23669       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23670       { echo "$as_me:23670: WARNING: Some variables may not be substituted:
23671 $ac_seen" >&5
23672 echo "$as_me: WARNING: Some variables may not be substituted:
23673 $ac_seen" >&2;}
23674     fi
23675   else
23676     cat $tmp/out
23677   fi
23678   rm -f $tmp/out
23679
23680 done
23681 EOF
23682 cat >>"$CONFIG_STATUS" <<\EOF
23683
23684 #
23685 # CONFIG_HEADER section.
23686 #
23687
23688 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23689 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23690 #
23691 # ac_d sets the value in "#define NAME VALUE" lines.
23692 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23693 ac_dB='[        ].*$,\1#\2'
23694 ac_dC=' '
23695 ac_dD=',;t'
23696 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23697 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23698 ac_iB='\([      ]\),\1#\2define\3'
23699 ac_iC=' '
23700 ac_iD='\4,;t'
23701 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23702 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23703 ac_uB='$,\1#\2define\3'
23704 ac_uC=' '
23705 ac_uD=',;t'
23706
23707 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23708   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23709   case "$ac_file" in
23710   - | *:- | *:-:* ) # input from stdin
23711         cat >$tmp/stdin
23712         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23713         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23714   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23715         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23716   * )   ac_file_in=$ac_file.in ;;
23717   esac
23718
23719   test x"$ac_file" != x- && { echo "$as_me:23719: creating $ac_file" >&5
23720 echo "$as_me: creating $ac_file" >&6;}
23721
23722   # First look for the input files in the build tree, otherwise in the
23723   # src tree.
23724   ac_file_inputs=`IFS=:
23725     for f in $ac_file_in; do
23726       case $f in
23727       -) echo $tmp/stdin ;;
23728       [\\/$]*)
23729          # Absolute (can't be DOS-style, as IFS=:)
23730          test -f "$f" || { { echo "$as_me:23730: error: cannot find input file: $f" >&5
23731 echo "$as_me: error: cannot find input file: $f" >&2;}
23732    { (exit 1); exit 1; }; }
23733          echo $f;;
23734       *) # Relative
23735          if test -f "$f"; then
23736            # Build tree
23737            echo $f
23738          elif test -f "$srcdir/$f"; then
23739            # Source tree
23740            echo "$srcdir/$f"
23741          else
23742            # /dev/null tree
23743            { { echo "$as_me:23743: error: cannot find input file: $f" >&5
23744 echo "$as_me: error: cannot find input file: $f" >&2;}
23745    { (exit 1); exit 1; }; }
23746          fi;;
23747       esac
23748     done` || { (exit 1); exit 1; }
23749   # Remove the trailing spaces.
23750   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23751
23752 EOF
23753
23754 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23755 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23756 # be either 'cat' or 'sort'.
23757 cat confdefs.h | uniq >conftest.vals
23758
23759 # Break up conftest.vals because some shells have a limit on
23760 # the size of here documents, and old seds have small limits too.
23761
23762 rm -f conftest.tail
23763 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
23764 while grep . conftest.vals >/dev/null
23765 do
23766   # Write chunks of a limited-size here document to conftest.frag.
23767   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
23768   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
23769   echo 'CEOF' >> "$CONFIG_STATUS"
23770   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
23771   rm -f conftest.vals
23772   mv conftest.tail conftest.vals
23773 done
23774 rm -f conftest.vals
23775
23776 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23777 # marker @DEFS@.
23778 echo '  cat >> conftest.edit <<CEOF
23779 /@DEFS@/r conftest.frag
23780 /@DEFS@/d
23781 CEOF
23782 sed -f conftest.edit $tmp/in > $tmp/out
23783 rm -f $tmp/in
23784 mv $tmp/out $tmp/in
23785 rm -f conftest.edit conftest.frag
23786 ' >> "$CONFIG_STATUS"
23787
23788 cat >>"$CONFIG_STATUS" <<\EOF
23789   # Let's still pretend it is `configure' which instantiates (i.e., don't
23790   # use $as_me), people would be surprised to read:
23791   #    /* config.h.  Generated automatically by config.status.  */
23792   if test x"$ac_file" = x-; then
23793     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23794   else
23795     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23796   fi
23797   cat $tmp/in >>$tmp/config.h
23798   rm -f $tmp/in
23799   if test x"$ac_file" != x-; then
23800     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
23801       { echo "$as_me:23801: $ac_file is unchanged" >&5
23802 echo "$as_me: $ac_file is unchanged" >&6;}
23803     else
23804       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23805          X"$ac_file" : 'X\(//\)[^/]' \| \
23806          X"$ac_file" : 'X\(//\)$' \| \
23807          X"$ac_file" : 'X\(/\)' \| \
23808          .     : '\(.\)' 2>/dev/null ||
23809 echo X"$ac_file" |
23810     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23811           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23812           /^X\(\/\/\)$/{ s//\1/; q; }
23813           /^X\(\/\).*/{ s//\1/; q; }
23814           s/.*/./; q'`
23815       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23816         { case "$ac_dir" in
23817   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23818   *)                      as_incr_dir=.;;
23819 esac
23820 as_dummy="$ac_dir"
23821 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23822   case $as_mkdir_dir in
23823     # Skip DOS drivespec
23824     ?:) as_incr_dir=$as_mkdir_dir ;;
23825     *)
23826       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23827       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23828     ;;
23829   esac
23830 done; }
23831
23832       fi
23833       rm -f "$ac_file"
23834       mv "$tmp/config.h" "$ac_file"
23835     fi
23836   else
23837     cat $tmp/config.h
23838     rm -f $tmp/config.h
23839   fi
23840 done
23841 EOF
23842 cat >>"$CONFIG_STATUS" <<\EOF
23843 #
23844 # CONFIG_COMMANDS section.
23845 #
23846 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23847   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23848   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23849
23850   case "$ac_dest" in
23851     default )
23852
23853 for cf_dir in .
23854 do
23855         if test ! -d "$srcdir/$cf_dir" ; then
23856                 continue
23857         elif test -f "$srcdir/$cf_dir/programs" ; then
23858                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" "$srcdir/$cf_dir/programs" >>$cf_dir/Makefile
23859         fi
23860 done
23861
23862         cat >>Makefile <<TEST_EOF
23863
23864 # These rules are generated so we do not rely on suffix rules, which do not
23865 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23866 # some, and the '\$x' confuses others).
23867 TEST_EOF
23868
23869 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23870 for N in $LIST
23871 do
23872         cat >>Makefile <<TEST_EOF
23873
23874 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23875         \$(srcdir)/test.priv.h \\
23876         ncurses_cfg.h
23877         $SHOW_CC
23878         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23879 TEST_EOF
23880 done
23881
23882 if test -f ../config.guess && test -f ../config.sub
23883 then
23884         cat >>Makefile <<TEST_EOF
23885
23886 # if we used CF_INHERIT for getting these files, we can remove them
23887 distclean::
23888         rm -f config.guess config.sub
23889 TEST_EOF
23890 fi
23891  ;;
23892   esac
23893 done
23894 EOF
23895
23896 cat >>"$CONFIG_STATUS" <<\EOF
23897
23898 { (exit 0); exit 0; }
23899 EOF
23900 chmod +x "$CONFIG_STATUS"
23901 ac_clean_files=$ac_clean_files_save
23902
23903 # configure is writing to config.log, and then calls config.status.
23904 # config.status does its own redirection, appending to config.log.
23905 # Unfortunately, on DOS this fails, as config.log is still kept open
23906 # by configure, so config.status won't be able to write to it; its
23907 # output is simply discarded.  So we exec the FD to /dev/null,
23908 # effectively closing config.log, so it can be properly (re)opened and
23909 # appended to by config.status.  When coming back to configure, we
23910 # need to make the FD available again.
23911 if test "$no_create" != yes; then
23912   ac_cs_success=:
23913   exec 5>/dev/null
23914   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
23915   exec 5>>config.log
23916   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23917   # would make configure fail if this is the last instruction.
23918   "$ac_cs_success" || { (exit 1); exit 1; }
23919 fi
23920